/****************************************************************
/ Nombre: getHTTPObject
/ Implentacion: 
/ Revision: 301106
/ Descripcion: Manejo del AJAX
'***************************************************************/
function getHTTPObject() {
	var xmlhttp;      
  
  /*@cc_on
  @if (@_jscript_version >= 5)
	try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
		xmlhttp = false;
	  }
	}
  @else
  xmlhttp = false;
  @end @*/
  
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {  
		try {
		  xmlhttp = new XMLHttpRequest();
		} catch (e) {
		  xmlhttp = false;
		}
	}
	return xmlhttp;
}
    
//--
var http = getHTTPObject(); 


//************ SECCION PRODCUTOS **************************************************
//*********************************************************************************
function ampliaProducto(pagina,id,tipo,galeria){
	if (tipo == 1){
//		alert(tipo);
		var ref = document.getElementById("pk_info"+id).value;
		if (ref != ""){
			document.getElementById("formularioAmplia" + id).action = document.getElementById("formularioAmplia" + id).action + "&ref="+ref;
		}
	}
	document.getElementById("formularioAmplia" + id).numPagina.value=pagina
	document.getElementById("formularioAmplia" + id).numGaleria.value=galeria
	document.getElementById("formularioAmplia" + id).submit();
}


/****************************************************************
/ Nombre: Paginacion
/ Implentacion: 
/ Revision: 301106
/ Descripcion: funcion para realizar la paginacion de los productos
'***************************************************************/
function paginacion(pagina){
	document.getElementById("formularioPaginacion").numPagina.value=pagina
	document.getElementById("formularioPaginacion").submit();
}

function volverCatalogo(pagina){
	document.getElementById("formularioVolver").numPagina.value=pagina
	document.getElementById("formularioVolver").submit();
}

function paginacion2(totalPag,num,tema,galeria,producto,pagina){
	http.open("GET", "includes/paginacion.asp?totalPag=" + totalPag + "&num=" + num + "&tema=" + tema + "&galeria=" + galeria + "&producto=" + producto + "&pagina=" + pagina, true);
	http.onreadystatechange = handleHttpResponsePaginacion;
	http.send(null);
}

function handleHttpResponsePaginacion() {
	if (http.readyState == 4) {    	
		//Aqui va el nombre de la capa donde queramos cargar el contenido
		document.getElementById("capa-paginacion").innerHTML = http.responseText;	
	}    
}

/****************************************************************
/ Nombre: cambiaFondo
/ Implentacion: JBernalte
/ Revision: 301106
/ Descripcion: Cambia el fondo del obj como ID
'***************************************************************/
function cambiaFondo(pagina, obj){
	//	var fondo;
	//	fondo="";
	//	switch(pagina){
	//		
	//		case 1: 
	//			fondo= "url(images/top-background-grupo.jpg)";
	//			break;
	//		default:
	//			fondo= "url(images/top-background.jpg)";
	//	}
	//	document.getElementById(obj).style.backgroundImage =fondo;
	}


/****************************************************************
/ Nombre: cambiaClaseFamilia
/ Implentacion
/ Revision: 301106
/ Descripcion: Cambia ela clase del obj pasado como ID
'***************************************************************/
function cambiaClaseFamilia(obj){
	
	//switch(obj){
	//		
	//		case 1: 
	//			clase= "x";
	//			break;
	//		default:
	//			clase= "x";
	//	}
	
//	document.getElementById(obj).className=clase;
}


function quitaClaseFamilia(familia,marcado){
	
	//if (familia==1 && marcado==0){
//		clase="x";
//	}
	
//	document.getElementById("familia" + familia).className=clase;
}

//****************** SECCION CONTACTO ******************************************************************************************************************************/

/****************************************************************
/ Nombre: validarEmail
/ Implentacion
/ Revision: 301106
/ Descripcion: Valida el formato del email
'***************************************************************/
function validarEmail(valor){
//funcion para validar el formato del email
	return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor));
	
}

/****************************************************************
/ Nombre: validar
/ Implentacion
/ Revision: 301106
/ Descripcion: Valida los campos del formulario
'***************************************************************/
function validar(){
//Funcion para la validar los datos enviados desde el formulario de contacto
	var texto;
	texto = "";

	var cadenaEnvio;
	cadenaEnvio = "";
	
	//Aqui validamos que los campos obligatorios tengan valor y se añaden a la cadena de envio
	
	if ( document.getElementById("formularioContacto").nombre.value == "" ) {
		texto+=" * Debe indicar su nombre.<br>";
	}else{
		cadenaEnvio="nombre=" + document.getElementById("formularioContacto").nombre.value;
	}
	
	if ( document.getElementById("formularioContacto").email.value == "" ) {
		texto+=" * Debe indicar su e-mail.<br>";
	}
	
	if(document.getElementById("formularioContacto").email.value!=""){
		if(!validarEmail(document.getElementById("formularioContacto").email.value)){
				texto+=" * Formato de E-mail incorrecto.<br>";
		}else{
			cadenaEnvio+="&email=" + document.getElementById("formularioContacto").email.value;
		}
	}
	if ( document.getElementById("formularioContacto").comentarios.value == "" ){
		texto+=" * Debe incluir el motivo de su consulta.<br>";
	}else{
		cadenaEnvio+="&comentarios=" + document.getElementById("formularioContacto").comentarios.value;
	}	
	
	//Aqui vamos añadiendo los demas campos sino estan vacion
	
	if ( document.getElementById("formularioContacto").direccion.value != "" ){
		cadenaEnvio+="&direccion=" + document.getElementById("formularioContacto").direccion.value;
	}
	
	if ( document.getElementById("formularioContacto").poblacion.value != "" ){
		cadenaEnvio+="&poblacion=" + document.getElementById("formularioContacto").poblacion.value;
	}
	
	if ( document.getElementById("formularioContacto").provincia.value != "" ){
		cadenaEnvio+="&provincia=" + document.getElementById("formularioContacto").provincia.value;
	}
	
	if ( document.getElementById("formularioContacto").telefono.value != "" ){
		cadenaEnvio+="&telefono=" + document.getElementById("formularioContacto").telefono.value;
	}
	
	if ( document.getElementById("formularioContacto").movil.value != "" ){
		cadenaEnvio+="&movil=" + document.getElementById("formularioContacto").movil.value;
	}
	
	if ( document.getElementById("formularioContacto").cpostal.value != "" ){
		cadenaEnvio+="&cpostal=" + document.getElementById("formularioContacto").cpostal.value;
	}

	if ( document.getElementById("formularioContacto").fax.value != "" ){
		cadenaEnvio+="&fax=" + document.getElementById("formularioContacto").fax.value;
	}
	//if ( document.getElementById("formularioContacto").pais2.value != "" ){
		cadenaEnvio+="&pais=" + document.getElementById("formularioContacto").pais.options[document.getElementById("formularioContacto").pais.selectedIndex].text
	//}
	
	//Si falta algun campo obligatorio o el email no tiene un formato correcto
	//mostramos un mensaje de avios
	
	if ( texto != "" ){
		document.getElementById("mensajeError").innerHTML=texto;
		document.getElementById("capaError").style.display='block';
		
	}else{
		//alert(cadenaEnvio);
		document.getElementById("mensaje-respuesta").innerHTML="";
		document.getElementById("mensajeError").innerHTML="";
		document.getElementById("capaError").style.display='none';
		http.open("GET", "actualizer/formcorreosMultiple/envioSinBd.asp?" + cadenaEnvio, true);
		http.onreadystatechange = handleHttpResponseContacto;
		http.send(null);
	}
	
}

/****************************************************************
/ Nombre: cerrarAviso
/ Implentacion: 
/ Revision:
/ Descripcion: Cierra la capa del aviso del formulario
'***************************************************************/
function cerrarAviso(){
	document.getElementById("mensajeError").innerHTML="";
	document.getElementById("capaError").style.display='none';
}

function handleHttpResponseContacto() {
	if (http.readyState == 4) {    	
		//Aqui va el nombre de la capa donde queramos cargar el contenido
		document.getElementById("mensaje-respuesta").innerHTML = http.responseText;	
		document.getElementById("formularioContacto").reset();
	}    
}

//*********************************************************************************
//*********************************************************************************
function mostrarReferencia(id){
		if (document.getElementById("pk_info"+id).value == ""){
			document.getElementById("referencia").innerHTML = "";
			document.getElementById("referencia").style.display = "block";	
			return false;
		}
		var idReferencia = document.getElementById("pk_info"+id).value;
		http.open("GET", "./includes/getReferencia.asp?id=" + idReferencia, true);
		http.onreadystatechange = handleHttpResponseReferencia;
		http.send(null);
	
}

function handleHttpResponseReferencia() {
	if (http.readyState == 4) {    	
		//Aqui va el nombre de la capa donde queramos cargar el contenido
		document.getElementById("referencia").innerHTML = "<p class='descripcion'>-&nbsp;" + http.responseText + "</p>";	
		document.getElementById("referencia").style.display = "block";	
	}    
}

/****************************************************************
/ Nombre: openWindow
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Abre un popup
'***************************************************************/
	function openWindow(theURL,winName,features){
 		window.open(theURL,winName,features);
		return
	}


/****************************************************************
/ Nombre: muestraTema
/ Implentacion:
/ Revision:
/ Descripcion: Muestra los temas
'***************************************************************/
function muestraTema(id,numero) {
	for (i=1;i<=numero;i++){
		if (id != i){
			if (document.getElementById("filaContenidoTema"+ i).style.display == "block"){
				document.getElementById("filaContenidoTema"+ i).style.display = "none";
			}
				document.getElementById("enlaceTema"+ i).className = "desmarcado";
		}
	}
	if (document.getElementById("filaContenidoTema"+ id).style.display == "block") { 
		document.getElementById("filaContenidoTema"+ id).style.display = "none"; }
	else { 
		document.getElementById("filaContenidoTema"+ id).style.display = "block";
		document.getElementById("enlaceTema"+ id).className = "marcado";
		}
}


/****************************************************************
/ Nombre: capaPosition
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Posiciona una capa en el centro de la pantalla +- los pixeles deseados
'***************************************************************/
function capaPosition(layer, position){
		//element = document.getElementById(layer);
		//screenCenterX = document.body.clientWidth / 2;
		//element.style.left = screenCenterX + position;
		//element.style.display = 'inline';
	}


/****************************************************************************************
/ Nombre: ampliaImagen
/ Implentacion: PACO
/ Revision:
/ Descripcion: Muestra el PopUp de ampliacion de las imagenes y lo redimensiona
'***************************************************************************************/
function ampliaImagen(url){
	document.getElementById('imagenAmpliada').src = "includes/ajustaImagenAmpliada.asp?img=../actualizer/catalogosinreferencias/fotos/" + url;
	document.getElementById('capaImagenAmpliada').style.display='block';
	document.getElementById('cerrarImagenAmpliada').style.display='block';
	}

function redimensionarImagen(img){
	//var anchoImagen,altoImagen,anchoPantalla,altoPantalla;
	//img1 = new Image(); 
	//img1.src = img.src;
	//anchoImagen = img1.width;
	//altoImagen = img1.height;
//	anchoPantalla = window.screen.width;
	//anchoPantalla = 930
	//altoPantalla = window.screen.height - 240;
	//posicionx = (anchoPantalla/2) - (anchoImagen/2);
	//posiciony = (altoPantalla/2) - (altoImagen/2);
	
	// coloca la capa de la imagen y la redimensiona
	//document.getElementById('capaImagenAmpliada').style.top = posiciony + 'px';
	//document.getElementById('capaImagenAmpliada').style.left = posicionx + 'px';
	//document.getElementById('capaImagenAmpliada').style.width = anchoImagen + 'px';
	//document.getElementById('capaImagenAmpliada').style.height = altoImagen + 'px';
	// coloca un poco más arriba la capa del enlace para cerrar
	//posicionCerrar = posiciony - 19;
	//document.getElementById('cerrarImagenAmpliada').style.top = posicionCerrar + 'px';
	//document.getElementById('cerrarImagenAmpliada').style.left = posicionx + 'px';

	//document.getElementById('capaImagenAmpliada').style.display = 'block';
	//document.getElementById('cerrarImagenAmpliada').style.display = 'block';
	// en caso del formulario de contacto, ocultamos el combo
	//document.getElementById('pais').style.visibility = 'hidden';
}

function cerrarImagenAmpliada(){
	document.getElementById('imagenAmpliada').src = "";
	document.getElementById('capaImagenAmpliada').style.display = 'none';
	document.getElementById('cerrarImagenAmpliada').style.display = 'none';
	//document.getElementById('pais').style.visibility = 'visible';
}
//***************************************************************************
//***************************************************************************


/****************************************************************************************
/ Nombre: autentifica
/ Implentacion: JBERNALTE
/Parametros: [Type] (off) desautentifica (otra cosa) autentifica
/ Revision:
/ Descripcion: Login de usuario en la zona privada
'***************************************************************************************/
function autentifica(type){
	var strEnvio = '';
	
	if(type != 'off'){
		
		var campos = new Array();
		var mensajes = new Array();
		
		
		/* DENINE CAMPO A VALIDAR MENSAJE*/
		campos[0] = 'user'; mensajes[0] = 'Indique su usuario';
		campos[1] = 'password'; mensajes[1] = 'Indique su contraseña';
	
		
		valid = false; 
		i=0;
		
		for(campo in campos){
			valor = document.formLogin[campo].value;
			if (   (valor == '') || (valor == mensajes[i])  ) {
				document.formLogin[campo].value = mensajes[i];
				valid = false;
			}else{
				strEnvio += "" + campos[i] + "=" + document.formLogin[campo].value + "&";
				valid = true;
			}
			i++;
		}
		strEnvio += "login=on"
	}else{
		valid=true;
		strEnvio += "login=off"
		
	}
	
	if(valid){
		url = "includes/loginEngine.asp?" + strEnvio;
		http.open("GET", url , true);
		http.onreadystatechange = handleHttpResponseReload;
		http.send(null);		
	}else{
		return false;	
	}	
}


/****************************************************************************************
/ Nombre: edit, handleHttpResponseEdit
/ Implentacion: JBERNALTE
/Parametros: [Type] (off) previsualiza (otra cosa) edita
/ Revision:
/ Descripcion: Cambia a modo edicion en la zona privada
'***************************************************************************************/
function edit(type){
	var strEnvio = '';
	

		strEnvio += "edicionMode=" + type;

	
		url = "includes/loginEngine.asp?" + strEnvio;
		http.open("GET", url , true);
		http.onreadystatechange = handleHttpResponseReload;
		http.send(null);		
}


/****************************************************************************************
/ Nombre: edit, handleHttpResponseReload
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Recarga la pagina despues de ejecutar AJAX
'***************************************************************************************/
function handleHttpResponseReload() {
	if (http.readyState == 4) {    	
		window.location.reload();
		//document.getElementById("login").innerHTML =http.responseText;
	}    
}



/****************************************************************************************
/ Nombre: changePicture
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Cambia una imagen
'***************************************************************************************/
function changePicture(id, picture){
		
		document.getElementById(id).src = picture;
}

/****************************************************************
/ Nombre: compruebaFecha()
/ Implentacion: Fperez

/ Revision:
/ Descripcion: Comprueba que las fechas sean correctas
'***************************************************************/
function compruebaFecha(dia, mes, anyo){
	var error;
	if ((dia > 30) && ((mes == 2) || (mes == 4) || (mes == 6) || (mes == 9) || (mes == 11))){
		return false;
	}
	if ((dia > 29) && (mes == 2)){
		return false;
	}
	var resto = parseInt(anyo)%4;
	if (resto != 0){
		if ((dia > 28) && (mes == 2)){
			return false;
		}
	}
	
	return true;
}


function reposicionaLayers(){
	//capaPosition('CapaContenidoNoticias',-400);
	//capaPosition('CapaContenidoProductosSport', -392);
	//capaPosition('CapaContenidoProductosLaboral', -392);
	//capaPosition('CapaContenidoAlmacen', -400);
	submenuPosition('PuntosDeVenta', 80);
}

function limpiaCanvas(){
//	document.getElementById('CapaContenidoNoticias').style.display = 'none';
//	document.getElementById('CapaContenidoProductosSport').style.display = 'none';
//	document.getElementById('CapaContenidoProductosLaboral').style.display = 'none';
//	document.getElementById('CapaContenidoAlmacen').style.display = 'none';
}

function showCanvas(pagina){
	if(pagina=='puntos-de-venta'){
		document.getElementById('PuntosDeVenta').style.display = 'inline';
	}else{
	    document.getElementById('contenidos-2').style.display = 'inline';
	}
}


function muestraContenidos(layer, position){
	//alert(layer)
//	capaPosition(layer, position)
//	element = document.getElementById(layer);
//	element.style.display = 'inline';
	
}

function validaExperiencia(){
	var texto="";
	if (document.getElementById("nombreExp").value==""){
		texto+="Debe introducir su nombre.<br>"
	}
	else{
		var nombre=document.getElementById("nombreExp").value;
	}
	if (document.getElementById("experiencia").value==""){
		texto+="Debe introducir su experiencia.<br>"
	}else{
		var contenido=document.getElementById("experiencia").value;
	}
	if (texto!=""){
		document.getElementById("capaAviso").innerHTML=texto
		document.getElementById("capaAviso2").style.display="block";
	}else{
		var ciudad=document.getElementById("ciudadExp").value;
		//http.open("GET", "actualizer/experiencias/insertarExperiencia.asp?nombre=" + nombre + "&ciudad=" + ciudad + "&contenido=" + contenido , true);
		//http.onreadystatechange = handleHttpResponseExp;
		//http.send(null);	
		document.getElementById("formularioExperiencia").submit();
	}
}

function handleHttpResponseExp() {
	if (http.readyState == 4) {    	
		//Aqui va el nombre de la capa donde queramos cargar el contenido
		document.getElementById("capaAviso").innerHTML = http.responseText;	
		document.getElementById("capaAviso2").style.display = "block";	
	}    
}

function cerrarAviso2(){
	document.getElementById("capaAviso").innerHTML = "";	
		document.getElementById("capaAviso2").style.display = "none";
}

/************************* PARA LAS TRANSPARENCIAS ******************************************/
function encima(cont){
	document.getElementById("producto"+ cont).className="producto-activo";
}

function fuera(cont){
	document.getElementById("producto"+ cont).className="producto";
}


/****************************************************************************************
/ Nombre: getProvincia
/ Implentacion: JDolz
/ Revision:
/ Descripcion: recoje el id de la provincia y muestra el contenido
'***************************************************************************************/
function getProvincia(provincia){//alert(provincia);
	
	http.open("GET", "includes/getDistribuidores.asp?provincia=" + provincia , true);
	http.onreadystatechange = handleHttpResponseDistribuidor;
	http.send(null);
}
function handleHttpResponseDistribuidor() {
	if (http.readyState == 4) {  //  alert(http.responseText);	
		//Aqui va el nombre de la capa donde queramos cargar el contenido
		document.location = http.responseText;	
	}    
}
/****************************************************************************************
/ Nombre: ampliaImagen
/ Implentacion: PACO
/ Revision:
/ Descripcion: Muestra el PopUp de ampliacion de las imagenes y lo redimensiona
'***************************************************************************************/
var objeto_y;
var objeto_x;
function posiciona(){
	var obj = document.getElementById('cabecera');
	
	//document.getElementById('imagenAmpliada').src = "images/" + url;
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	objeto_x = curleft;
	objeto_y = curtop;
	alert(curtop);
//	return [curleft,curtop];
alert(document.getElementById("contenidos-2").style.left);
	document.getElementById("contenidos-2").style.left=(objeto_x + 585)+"px";
	}
function pedir(cual,info){	
	var p;
	p=document.getElementById("pedidos").pk_pedidos.value;
	var talla=document.getElementById("tallas").value;

	if(talla !=''){
	window.open('actualizer/pedidos/pedidos_va01.asp?pk_fotos='+cual+'&pk_pedidos='+p+'&info=' + info + '&talla=' + talla,'pedido','scrollbars=yes,width=640,height=640,top=0,left=0,status=no,toolbar=no,menubar=no,location=no,titlebar=0,resizable=no, fullscreen = no ');
	}else{
	
		alert("No ha seleccionado la talla");
		
	}
	
}




/****************************************************************************************
/ Nombre: submenuPosition
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Posiciona a partir del centro
'***************************************************************************************/

function submenuPosition(layer, position){
		//subMenuHide();
		try{
		element = document.getElementById(layer);
		screenCenterX = document.body.clientWidth / 2;
		element.style.left = screenCenterX + position;
		element.style.display = 'inline';
		}catch(e){ 
			return false
		}
		
		
	}
	
	
/****************************************************************************************
/ Nombre: musica
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Cambia la altura del frame superior
'***************************************************************************************/	
	function music(){

		var element = top.document.getElementById('homosapiensFrames');

		
		cadena = element.rows;
		cadena = cadena.substr(0,1);
		
		if(cadena == '0') {
		//ESTA APAGADO
			changeFrameHeight(40);
		}else{
			//ESTA VIVIBLE
			changeFrameHeightLess(40);
				
		}
		
	}

	
/****************************************************************************************
/ Nombre: changeFrameHeight
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Cambia la altura del frame superior
'***************************************************************************************/	
	function changeFrameHeight(alto){
		for(i=0; i<=alto; i++){	
			top.document.getElementById('homosapiensFrames').rows= i +',*';	
		}
	}
	
	/****************************************************************************************
/ Nombre: changeFrameHeight
/ Implentacion: JBERNALTE
/ Revision:
/ Descripcion: Cambia la altura del frame superior
'***************************************************************************************/	
	function changeFrameHeightLess(alto){
			top.document.getElementById('homosapiensFrames').rows= '0,*';	
	}
	
function cambiaColor(idproducto,pk_infoextra){
		http.open("GET", "includes/cambiaColor.asp?pk_infoextra=" + pk_infoextra , true);
		http.onreadystatechange = handleHttpResponseColor;
		http.send(null);	
		document.getElementById("capa-carrito").innerHTML="<a href='javascript:pedir(" + idproducto +"," + pk_infoextra +");'><img src='images/btn-carrito.jpg' alt='Comprar'  hspace='5' border='0' align='absmiddle' /></a>";
}	

function handleHttpResponseColor() {
	if (http.readyState == 4) {    	
		var respuesta=http.responseText;
		aux=respuesta.split("/-/");
		//window.location.reload();
		//document.getElementById("login").innerHTML =http.responseText;
		//document.getElementById("imagenAmpliada").src="includes/ajustaImagenAmpliada.asp?img=../actualizer/catalogosinreferencias/referenciasFotos/" + aux[0];
		document.getElementById("capa-imagen-ampliada").innerHTML='<a href="javascript:ampliarFicha();"><img src="includes/ajustaImagenAmpliada.asp?img=../actualizer/catalogosinreferencias/fotos/' + aux[0] + '" name="imagenAmpliada" hspace="10" vspace="5" border="0" align="right" id="imagenAmpliada" border="0"/></a>';
		document.getElementById("imagen-capa-ampliada").innerHTML='<img src="includes/ajustaImagenAmpliadaCapa.asp?img=../actualizer/catalogoSinReferencias/fotos/' + aux[0] + '" />';
		if ( aux[1] ==0){
			 aux[1] = "-"	;
		}
		
		document.getElementById("precio-producto").innerHTML="<big><big>" + aux[1] + "</big></big>&euro;";
	}    
}

function enviarProfesional(){
	//http.open("GET", "actualizer/formcorreosMultiple/envioProfesionales.asp" , true);
	//http.onreadystatechange = handleHttpResponseProfesionales;
	//http.send(null);
	document.getElementById("formularioRellenar").submit();
}

function handleHttpResponseProfesionales() {
	if (http.readyState == 4) {    	
		document.getElementById("respuesta-profesionales").innerHTML=http.responseText;
	}    
}

function ampliarFicha(id){
	document.getElementById("ficha-ampliada").style.display='block';
	document.getElementById("tallas").style.display='none';
}

function cerrarFichaAmpliada(){
	document.getElementById("ficha-ampliada").style.display='none';
	document.getElementById("tallas").style.display='block';
}


function verTallas(pk_fotos){
	//document.getElementById("tallas").submit();	
	var element = document.getElementById("tallasLayer");
//	alert(element);
	element.style.display = "block"
	
}

function hiddeTallas(){
	var element = document.getElementById("tallasLayer");
	element.style.display = "none";
}


function changeTalla(){
	
	
	var elementSelect = document.getElementById("tallas");
    var talla = elementSelect.options[elementSelect.selectedIndex].text
	
	if(talla !=""){
		var buttonTalla = document.getElementById("buttonTalla");
		var elementTabla = document.getElementById("tallasLayer");
		elementTabla.style.display = "none";
		buttonTalla.value = "Talla seleccionada:" + talla;
	}
}
