// JavaScript Document

//OCULTAR SELECT antes de abrir capa desde Flash ////////////////////////////////////////
function escondeSelects(capaAbrir){
    var selects = document.getElementsByTagName("select");
    for( var i=0; i<selects .length; i++ ){
        selects[i].style.display = "none";
    }
//1º metemos contenido
textos=new Array()
textos[0]=' ';
textos[1]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="735" height="514" title="vestidos08"><param name="movie" value="../flash/vestidosPrimavera08.swf"><param name="quality" value="high"><embed src="../flash/vestidosPrimavera08.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="735" height="514"></embed></object>';
textos[2]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="735" height="514" title="camisas08"><param name="movie" value="/flash/camisasPrimavera08.swf"><param name="quality" value="high"><embed src="/flash/camisasPrimavera08.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="735" height="514"></embed></object>';
textos[3]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="735" height="514" title="polos-baño08"><param name="movie" value="../flash/polosPrimavera08.swf"><param name="quality" value="high"><embed src="../flash/polosPrimavera08.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="735" height="514"></embed></object>';
textos[4]='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="735" height="514"><param name="movie" value="../flash/bebePrimavera08.swf"><param name="quality" value="high"><embed src="../flash/bebePrimavera08.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="735" height="514"></embed></object>';

if (capaAbrir=="vestidos"){
document.all.contenido.innerHTML=textos[1];
}
else if (capaAbrir=="camisas"){
document.all.contenido.innerHTML=textos[2];
}
else if (capaAbrir=="polos"){
document.all.contenido.innerHTML=textos[3];
}
else{
document.all.contenido.innerHTML=textos[4];
}

//2º hacemos aparecer capa
ApareceCapa('capaContenido');
}
//////////////////////////////////////////////////////////////////////////////////////////

//MOSTRAR SELECT antes de abrir capa desde Flash /////////////////////////////////////////
function muestraSelects(capaCerrar){
    var selects = document.getElementsByTagName("select");
    for( var i=0; i<selects .length; i++ ){
        selects[i].style.display = "inline";
    }
	document.all.contenido.innerHTML=textos[0];
	ApagaCapa('capaContenido');
}
//////////////////////////////////////////////////////////////////////////////////////////

//Visibilidad de Capas ///////////////////////////////////////////////////////////////////
var nc = (document.layers) ? true:false
var ie = (document.all) ? true:false
var n6 = (document.getElementById) ? true:false
  
function ApareceCapa(capa){
	if(ie)
		document.all[capa].style.visibility="visible";
	else if(nc)
		document.layers[capa].visibility="show";
	else if(n6)
		document.getElementById(capa).style.visibility="visible";
}

function ApagaCapa(capa){
	if(ie)
		document.all[capa].style.visibility="hidden";
	else if(nc)
		document.layers[capa].visibility="hide";
	else if(n6)
		document.getElementById(capa).style.visibility="hidden";
}
//////////////////////////////////////////////////////////////////////////////////////////

//ROLLOVER - Dreamweaver///////////////////////////////////////////////////////////////////
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//////////////////////////////////////////////////////////////////////////////////////////

//Cestas/////////////////////////////////////////////////////////////////////////////////
var seleccion="";
var variable1="cerrar";
var variable2="";
var variable3="../img/cestas/cerrar_over.gif";

textos=new Array()
textos[0]="<table width='425' height='308' border='0' cellpadding='0' cellspacing='0'><tr><td height='24' colspan='3'><img src='../img/comunes/spacer.gif' width='1' height='24'></td></tr><tr><td height='39' colspan='2' align='right'><img src='../img/cestas/txtCestas.gif' width='258' height='39'></td><td width='25' rowspan='3'><img src='../img/comunes/spacer.gif' width='25' height='1'></td></tr><tr><td height='25' colspan='2'><img src='../img/comunes/spacer.gif' width='1' height='25'></td></tr><tr><td width='92'>&nbsp;</td><td width='319' align='right' valign='top'>Cada cesta se presenta como un &quot;<strong>nido</strong>&quot;: todas las prendas se colocan sobre un fondo de musgo artificial y en el centro se coloca un pollito de cuerda; incluyendo tambi&eacute;n unos jaboncitos con forma de &quot;ovejitas&quot;, caracolas marinas...para que las prendas queden impregnadas de un agradabe aroma.<br><br>La elaboraci&oacute;n de las cestas ser&aacute; siempre con dise&ntilde;os propios, pudiendo elegir en cada momento cualquiera de las prendas de la colecci&oacute;n.</td></tr><tr><td height='66' colspan='3' align='center' valign='bottom'>Tanto el <strong>encargo</strong> como el <strong>pago</strong> se podr&aacute;n realizar por <strong>tel&eacute;fono</strong> a partir de 60 &euro;.<br><br></td></tr></table>";

textos[1]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta1GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";
textos[2]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta2GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";
textos[3]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta3GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";
textos[4]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta4GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";
textos[5]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta5GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";
textos[6]="<table width='425' border='0' cellspacing='0' cellpadding='0'><tr><td width='11' height='1' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td rowspan='3' bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='11' height='1'></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='50' colspan='3' align='right' valign='top'><a href='javascript:cerrarVentana();' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage(variable1,variable2,variable3,1)'><img src='../img/cestas/cerrar.gif' alt='Click para cerrar ventana' name='cerrar' width='56' height='15' border='0'></a></td><td width='1' rowspan='3' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr><tr><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td><td width='392' height='246' bgcolor='#FFFFFF'><img src='../img/cestas/cesta6GR.jpg' width='392' height='246'></td><td width='10' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='10' height='1'></td></tr><tr><td height='10' colspan='3' bgcolor='#FFFFFF'><img src='../img/comunes/spacer.gif' width='1' height='10'></td></tr><tr><td bgcolor='#EEEEEE'><img src='../img/comunes/spacer.gif' width='1' height='1'></td><td height='1' colspan='5' bgcolor='#C4C4C4'><img src='../img/comunes/spacer.gif' width='1' height='1'></td></tr></table>";

function cerrarVentana(){
document.all.txtCestas.innerHTML=textos[0];
document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
seleccion="";
}

function cambiarImg(evento,imgCambio,img,txt){
if (evento=="click"){
seleccion=imgCambio;

	switch (imgCambio) {
	case "cesta1":
	document.all.cesta1.src=img; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
	break;
	
	case "cesta2":
	document.all.cesta2.src=img; document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
	break;
	
	case "cesta3":
	document.all.cesta3.src=img; document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
	break;
	
	case "cesta4":
	document.all.cesta4.src=img; document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
	break;	
	
	case "cesta5":
	document.all.cesta5.src=img; document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta6.src="../img/cestas/cesta6PQ.gif";
	break;	
	
	case "cesta6":
	document.all.cesta6.src=img; document.all.cesta1.src="../img/cestas/cesta1PQ.gif"; document.all.cesta2.src="../img/cestas/cesta2PQ.gif"; document.all.cesta3.src="../img/cestas/cesta3PQ.gif"; document.all.cesta4.src="../img/cestas/cesta4PQ.gif"; document.all.cesta5.src="../img/cestas/cesta5PQ.gif"; 
	break;	
	}



document.all.txtCestas.innerHTML=textos[txt];
}

else if (evento=="over"){
	if (seleccion!=imgCambio){
	document.all[imgCambio].src=img;
	}
}

else{
img=img.replace ("_over.",".")

	if (seleccion!=imgCambio){
	document.all[imgCambio].src=img;
	}
}
}
//////////////////////////////////////////////////////////////////////////////////////////
