jQuery(document).ready(function($){
    if($("#tickets").children().length){
	
	function headline_rotate() {
	    current_headline = (old_headline + 1) % headline_count;
	    $("#tickets .destination:eq(" + old_headline + ")").animate({top: -205}, 1000, function() {
		$(this).css('top','210px');
	    });
	    $("#tickets .destination:eq(" + current_headline + ")").show().animate({top: 16}, 1000);

	    $("#tickets .price1:eq(" + old_headline + ")").animate({top: -195}, 1000, function() {
			$(this).css('top','210px');
	    });
			
		$("#tickets .price2:eq(" + old_headline + ")").animate({top: -195}, 1000, function() {
			$(this).css('top','210px');
	    });

	    $("#tickets .price1:eq(" + current_headline + ")").show().animate({top: 8}, 1000);
				 
		$("#tickets .price2:eq(" + current_headline + ")").show().animate({top: 24}, 1000);
		
		
	    old_headline = current_headline;
	}

	var headline_count;
	var headline_interval;
	var old_headline = 0;
	var current_headline = 0;

	headline_count = $("#tickets .destination").size();
	$("#tickets .destination:eq("+current_headline+")").css('top','16px');
	$("#tickets .price1:eq("+current_headline+")").css('top','8px');
	$("#tickets .price2:eq("+current_headline+")").css('top','24px');


	headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
	/*
	$('#tickets').hover(function() {
	    clearInterval(headline_interval);
	}, function() {
	    headline_interval = setInterval(headline_rotate,5000); //time in milliseconds
	    headline_rotate();
	});
//	*/
    }
});

