$(document).ready(function() {
	
	var fuelIds = new Array("1","2","6");
	//fuelIds = {1,2,6};
	var current = 0;
 	// $("#pricecontainer").load('/fills/get_pricelist_ajax');
 	
	$.ajax({
		  url: "/fills/get_pricelist_ajax",
		  dataType: 'HTML',
		  cache: false,
		  data:{fuelTypeId:fuelIds[current]},
		  success: function(data, textStatus){
			  $("#pricecontainer").fadeOut('slow', function(){
				   $("#pricecontainer").html(data);
				   $("#pricecontainer").fadeIn('slow');
			   })
		  }
	});
	current++;
	
		$('.ticker').vTicker({
		   speed: 500,
		   pause: 3000,
		   showItems: 3,
		   animation: 'fade',
		   mousePause: false,
		   height: 0,
		   direction: 'down'
		});
		
   var refreshId = setInterval(function() {
//	  $("#pricecontainer").fadeOut('slow');
//	  $("#pricecontainer").load('/fills/get_pricelist_ajax');
//	  $("#pricecontainer").fadeIn('slow');
	   
	   $.ajax({
			  url: "/fills/get_pricelist_ajax",
			  dataType: 'HTML',
			  cache: false,
			  data:{fuelTypeId:fuelIds[current]},
			  success: function(data, textStatus){
				  $("#pricecontainer").fadeOut('slow', function(){
					   $("#pricecontainer").html(data);
					   $("#pricecontainer").fadeIn('slow');
				   })
			  }
		});
	   current++;
	   if(!(current<fuelIds.length)){
		   current = 0;
	   }
	/*   $.get('/fills/get_pricelist_ajax', function(data) {
		   $("#pricecontainer").fadeOut('slow', function(){
			   $("#pricecontainer").html(data);
			   $("#pricecontainer").fadeIn('slow');
		   })

		 });*/

	   
   }, 18000);
});
