
/*	Overlay ver video	*/
try {
	q(document).ready(function(){
		var overlay_video = q("#overlayVerVideo").overlay({
			api:true,
			expose: {
				color: '#000', 
				opacity: 0.7,
				speed: 'fast',
				loadSpeed: 0
			},
			closeOnClick:false,
			onClose: function(){
				q("#overlayVerVideo").html('<a class="close" onclick="closeOverlayVerVideo();"></a><div id="objetoVideo"></div>');
			}
		});
		window.openOverlayVerVideo = function(idCapa,codigo,idE,ancho,alto) {
			cargarVideo(idCapa,codigo,idE,ancho,alto);
			overlay_video.load();              
		}
		window.closeOverlayVerVideo = function() {
			q("#overlayVerVideo").html('<a class="close" onclick="closeOverlayVerVideo();"></a><div id="objetoVideo"></div>');
			overlay_video.close();
		}
		var overlay_politica = q("#overlayPolitica").overlay({
			api:true,
			expose: {
				color: '#000', 
				opacity: 0.7,
				speed: 'fast',
				loadSpeed: 0
			},
			closeOnClick:false,
			onClose: function(){				
			}
		});
		var overlay_condCompra = q("#overlayCondCompra").overlay({
			api:true,
			expose: {
				color: '#000', 
				opacity: 0.7,
				speed: 'fast',
				loadSpeed: 0
			},
			closeOnClick:false,
			onClose: function(){				
			}
		});
		
		window.openOverlayPolitica = function() {
			overlay_politica.load();              				
		}
		window.closeOverlayPolitica = function() {
			overlay_politica.close();
		}
		window.openCondCompra= function() {
			overlay_condCompra.load();              				
		}
		window.closeCondCompra = function() {
			overlay_condCompra.close();
		}
		
		
		
	});
} catch (e) {
	// TODO: handle exception
}
/********************************************************************/
/*				NUEVOS METODOS					*/
function accordeonSimple(id){
	jQ("#" + id).slideToggle("slow");
}
function comprobarTexto(id,texto,foco){//Comprobaci�n para InputText
	var inputB=document.getElementById(id);
	var textoInput = inputB.value;
	if(foco){
		if(textoInput == texto)inputB.value='';
	}else {
		if(textoInput == '')inputB.value=texto;
	}
}
/**************	Funciones de la galeria multimedia	*************/
var idElemento = '';
function cargarVideo(id,capa,ancho,alto){
	var vidSrc = "http://www.youtube.com/v/" + id + "&hl=es&fs=1&autoplay=0&rel=0";
	var flashvars = {};
	var params = {};
	params.wmode = "transparent";
	params.allowFullScreen = "true";
	params.allowscriptaccess = "always";
	var attributes = {};
	swfobject.embedSWF(vidSrc, capa, ancho, alto, "9.0.0", false, flashvars, params, attributes);
}
function mostrarVideo(idCapa,codigo,idE,ancho,alto){
	var infoImagen = document.getElementById('info_imagen');
	infoImagen.style.display="none";
	if(idE != idElemento){
		idElemento = idE;
		cargarVideo(codigo,idCapa,ancho,alto);
	}
	tipoActualFoto = false;
}
function mostrarImagen(idCapa,src,idE,n,texto){
	if(idE != idElemento){
		var capaMarco = document.getElementById(idCapa);
		idElemento = idE;
		capaMarco.innerHTML =	"<div id='videoyoutubecontenido'>" +
									"<img id='imagenMarco' name='imagen_centrada' alt='" + texto + "' title='" + texto + "' src='" + src + "'/>" +
								"</div>" +
								"<div id='info_imagen' class='info_imagen'>" + texto + "</div>";
		/*jq('#imagenMarco').load(function(){
			 centerImage(this);
		});*/
		tipoActualFoto = true;
		numFoto=n;				//Variable que se emplea en actualidadDesarrollada.jsp, para controlar la foto del slide que se esta viendo
		numElem = n;
	}
}
var index = 0;
function nextElement(){
	//alert("index#"+index+"#");
	if((index+1)<size_array_galeria){
		index++;
	}else{
		index=0;
	}
	//alert("size_array_galeria#"+size_array_galeria+"#");
	//alert("indexDespues#"+index+"#");
	auxElement = array_galeria_multimedia[index].split("|");
	//alert("auxElement0#"+auxElement[0]+"#");
	//alert("auxElement1#"+auxElement[1]+"#");
	if(auxElement[0] == "i"){
		numFoto = index;
		tipoActualFoto = true;
		jQ("#contenedor_objeto").html('<img alt="" title="" src="' + auxElement[1] + '" />');
	}else if(auxElement[0] == "v"){
		tipoActualFoto = false;
		jQ("#contenedor_objeto").html('<iframe width="288" height="350" src="http://www.youtube.com/embed/' + auxElement[1] + '" frameborder="0" allowfullscreen></iframe>');
	}
}
function prevElement(){
	if((index-1)>-1){
		index--;
	}else{
		index=size_array_galeria-1;
	}
	auxElement = array_galeria_multimedia[index].split("|");
	if(auxElement[0] == "i"){
		numFoto = index;
		tipoActualFoto = true;
		jQ("#contenedor_objeto").html('<img alt="" title="" src="' + auxElement[1] + '" />');
	}else if(auxElement[0] == "v"){
		tipoActualFoto = false;
		jQ("#contenedor_objeto").html('<iframe width="300" height="349" src="http://www.youtube.com/embed/' + auxElement[1] + '" frameborder="0" allowfullscreen></iframe>');
	}
}
/**************	Fin funciones de la galeria multimedia	*************/
function marcarMenuCabecera(id){
	jQ(id).addClass("hover");
}
/*************** Cargando ******************/
function cargando(id){
	jQ("#"+id).css("display","block").html("<span class='cargando_buscando'><b>BUSCANDO</b> Espere por favor...</span>");
}
/***********	Funciones para mostrar elementos del menu	**********/
function verTiendaNav(){
	jQ("#btn_tienda").addClass('active');
	jQ("#btn_ofertas").removeClass('active');
	jQ("#lista_tienda").css("display","block");
	jQ("#lista_ofertas").css("display","none");
}
function verOfertasNav(){
	jQ("#btn_tienda").removeClass('active');
	jQ("#btn_ofertas").addClass('active');
	jQ("#lista_tienda").css("display","none");
	jQ("#lista_ofertas").css("display","block");
}
/*	Aumentar y disminuir tama�o de letra	*/
function zoomText(tipo){
	//alert("Zoomtext");
	//alert("tipo#"+tipo+"#");
	//inicializaciones
	obj=document.getElementById("Lectura");
	if (obj.style.fontSize==""){
		obj.style.fontSize="14px";
	}
	actual=parseInt(obj.style.fontSize);
	incremento=1;
	//operacion
	if(tipo=="normal"){
		obj.style.fontSize="14px";
	}
	if(tipo=="aumentar"){
		valor=actual+incremento;
		obj.style.fontSize=valor+"px";
	}
	if(tipo=="disminuir"){
		valor=actual-incremento;
		obj.style.fontSize=valor+"px";
	}
}
/*	Aumentar y disminuir tama�o de letra	*/
