/* init */
var ticker = 1;
function slide_news(elem) {
	$(elem).stop().animate({
		left: '0',
		opacity: 1
	},800).delay(3000).animate({
		opacity: '0'
	},1000).delay(200).animate({
		left: '550px'
	},0);
	
	
	window.setTimeout(function(){
		rotate();					   
	},6000);
}
function rotate() {
	$('ul.newsticker li[id="ticker_'+ticker+'"]').addClass('active')
	$('ul.newsticker li').each(function(index){
		if ($(this).hasClass('active')) {
			slide_news(this);
			$(this).removeClass('active');
			if ($(this).hasClass('last')) {
				ticker = 1;
			} else {
				ticker = $(this).attr('rel');
			}
		}
	});
}
$(function(){ 
	window.setTimeout(function(){
		rotate();					   
	},4000);
}); 
