/*
 * jQuery ctRotator Plugin briget
 * Convert an ul or ol list to a useable data source for ctRotator
 * 
 * Under MIT license http://www.opensource.org/licenses/mit-license.php
 *
 * @author: Cuong Tham
 * @version: 1.0
 * @requires jQuery v1.2.6 or later
 * @requires ctRotator
 *
 * @headsTip: Examples and documentation at: http://thecodecentral.com/2008/11/12/ctrotator-a-flexible-itemimage-rotator-script-for-jquery
 */

function ctRotatorBridgeLi(container){
  this.container = container;
}

ctRotatorBridgeLi.prototype = {
  getDataSource:function(){
    var dataSource = [];
    this.container.find('li').each(function(){
	  var e = $(this);
	  var p;
	  if(e.children('a').size() == 0){
	    dataSource.push({title:e.text()});
	  }else{
	    a = e.children('a');
	    p = e.children('p');
	    em=e.children('em');
	    dataSource.push({title:a.text(), url:a.attr('href'),des:p.text(),datepost:em.text()});
	  }
	});
	return dataSource;
  }
};

