﻿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 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");
		}
	}
}

/*******************
PAUSA CON SEMAFORO RETARDADO 4 SEGUNDOS
*******************/
/*
function activa_semaforo(){
	semaforo = "verde";
	console.log(semaforo);
}

function aparece(id_elemento){
	console.log(semaforo);
	if(semaforo=="verde"){
		semaforo = "rojo";
		setTimeout("activa_semaforo()", 1000);
		if(producto_Actual == ""){
			producto_Actual = id_elemento;
			$(producto_Actual).fadeIn("slow");
		}else{
			$(producto_Actual).fadeOut("fast", function(){ $(id_elemento).fadeIn('slow');} );
			producto_Actual = id_elemento;
			//$(producto_Actual).fadeIn("slow");
		}
	}
	semaforo="rojo";
}*/

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