function mover_avion(){
	$('#redes').animate({'right': '600px'}, 50000);
}

function visible(elemento){
	var elem = document.getElementById(elemento);
	if(elem.className=="corto"){
		elem.className = "largo";
	}
}
function invisible(elemento){
	var elem = document.getElementById(elemento);
	elem.className = "corto";
}

/*if( $("#"+elemento).css("height").is(27) ){
		alert("hola");
	}*/
	//$("#"+elemento).animate({height:327}, "slow");
	/*if ( $("#"+elemento).is (':hidden') ){
		$("#"+elemento).css("display","block");
	}else{
		$("#"+elemento).css("display","none");
	}*/
/*function invisible(elemento){
	//$("#"+elemento).animate({height:27}, "slow");
	$("#"+elemento).css("height","27");
}*/
var clearQueue = false;
var gotoEnd = false;
var foto_Actual = "";
var producto_Actual = "";
var lateral = "";
var semaforo = "verde";
/*
function aparece(id_elemento){
	if(semaforo=="verde"){
		if(producto_Actual == ""){
			producto_Actual = id_elemento;
			$(producto_Actual).fadeIn("slow");
		}else{
			semaforo="rojo";
			$(producto_Actual).fadeOut("fast", function(){ $(id_elemento).fadeIn('slow'); semaforo="verde";} );
			producto_Actual = id_elemento;
			$(producto_Actual).fadeIn("slow");
		}
	}
}*/

function aparece(id_elemento){
	//alert("aparece");
	//$(id_elemento).animate({'top': '0px'}, 'fast');
	if(semaforo=="verde"){
		if(producto_Actual == ""){
			producto_Actual = id_elemento;
			$(producto_Actual).animate({'top': '0px'}, 'fast');
		}else{
			//alert("entra");
			semaforo="rojo";
			$(producto_Actual).animate({'top': '450px'}, 'fast');//, function(){ $(id_elemento).fadeIn('slow'); semaforo="verde";} );
			producto_Actual = id_elemento;
			$(producto_Actual).animate({'top': '0px'}, 'fast');
			semaforo="verde";
		}
	}
}


function texto(x,y){
		$("#explicacion_helado").animate({top:x, left:y}, "slow");
}

function cambia_lateral(){
	total = (laterales.length-1);
	if ( laterales!='' ){
		aleat = Math.round(Math.random()*total);
		while ( lateral == laterales[aleat] ){
			aleat = Math.round(Math.random()*total);
		}
		//alert(aleat+"="+laterales[aleat]);
		$("#lateral").stop(true, true).fadeOut("slow");
		//$("#texto").stop(true, true).attr("style","height:0");
		
		$("#lateral").fadeOut("slow",function() { 
											$("#lateral").html("<img src='imagenes/"+laterales[aleat]+"'>");
											});
		$("#lateral").fadeIn("slow");
		lateral = laterales[aleat];
		timer = setTimeout("cambia_lateral()", 10000);
	}
}

function visible_elem(info, foto){
	if(foto_Actual!=foto){
		$("#foto").stop(true, true).fadeOut("fast");
		//$("#texto").stop(true, true).attr("style","height:0");
		
		$("#foto").fadeOut("slow",function() { 
											$("#foto").html("<img src='"+foto+"'>");
											$("#explicacion_helado").html(info);
											});
		$("#foto").fadeIn("slow");
		//$("#texto").fadeIn("slow");
		//$("#tabla").animate({height:300}, "slow");
		//$("#explicacion_helado").animate({top:x, left:y}, "slow");
		foto_Actual=foto;
		
	}
}