   var pa=0;
   var t;
var timer_is_on=0;
var fotoA=0;
var fotoT;
$(document).ready(function(){
						  
						   fotoT = ($("#carrusel_feed").children().length)-1;
						   $("#carrusel_feed").width((fotoT+1)*225);
							doTimer();
						  $("#next_feed").click(avanza_feed);
						    $("#prev_feed").click(retrocede_feed);
							$(".feed_info").click(function(){window.location.href="motos/news/";});
						   })
function callExternalInterface() {
				thisMovie("motos-principalF").moto_on_the_run();
				   $('#super_moto_invisible').css("display","none");
				
			}
function thisMovie(movieName) {
				if (navigator.appName.indexOf("Microsoft") != -1) {
					return window[movieName]
				}
				else {
					return document[movieName]
				}
			}
  	function sayHello() {
 
	   $('#super_moto_invisible').css("display","block");
	   $('#super_moto_invisible').height($("#page-container").height());
    }


function timedCount()
{	//var x=Math.ceil(Math.random()*5);
	//$('#sticky').attr("src", "data/stickers/sticker"+fotoA+".png");
	if(pa < fotoT){
		avanza_feed();
		
	}else{
		$('#carrusel_feed').animate({"left": "0px"}, "slow");
		
		pa=0;
		}
	//fotoA == 6 ? fotoA=1 : fotoA++;
t=setTimeout("timedCount()",5000);
}

function doTimer()
{
	  // fotoT = ($("#carrusel_feed").children().length)-1;
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }}
			
function sayHello() {
	   $('#super_moto_invisible').css("display","block");
	   $('#super_moto_invisible').height($("#page-container").height());
    }
	
function avanza_feed(){
	//alert("avanza");
	if(pa < fotoT){
		$('#carrusel_feed').animate({"left": "-=225px"}, "slow");
		pa++;
	}
	}
function retrocede_feed(){
	//alert("avanza");
	if(pa>0){
	$('#carrusel_feed').animate({"left": "+=225px"}, "slow");
	pa--;
	}
	}
