// JavaScript Document

				function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0 
					 var obj=MM_findObj(objStr); 
				 if (obj && obj[1]) obj=obj[1]; 
				 if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')'); 
				 } 
					
				
				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 oculto(tabla,estado){
				alert(tabla);
				alert(estado);
				document.getElementById(tabla).style.display=estado;
				}
				
				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_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_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("#2")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
				}
				
				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];}
				}
						// ---------------------------------------			
		
				// mueestra idiomas 
				// ---------------------------------------			
				function posicionaCapasMenu()
				{
					var x= Math.floor(document.body.clientWidth / 2) -501; 
					if(x<0){x=0;};
					
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");
					for(i = 0; i < c.length; i++)
					{
						var elemento = c[i];
						var lstrPadre = "";
						if (elemento.id.substr(0,1) == "P") 
						{
							lintPadre = getPadre(elemento.id);
							lintNivel = getNivel(elemento.id);
							lstrPadre = "" + 	lintPadre;
							
							if ((lstrPadre.substr(0,1) == "1") && (lintNivel == 1))
								document.getElementById(elemento.id).style.left= eval(x + 300) + "px";																					
							if ((lstrPadre.substr(0,1) == "1") && (lintNivel == 2))
								document.getElementById(elemento.id).style.left= eval(x + 450) + "px";																											
							if ((lstrPadre.substr(0,1) == "1") && (lintNivel == 3))												
								document.getElementById(elemento.id).style.left= eval(x + 600) + "px";																											
						}
					}					

					document.getElementById("capaImgPortada").style.left= eval(x + (-9)) + "px";										
					document.getElementById("P2/O21/N1").style.left= eval(x + 360) + "px";										
					document.getElementById("P21/O211/N2").style.left= eval(x + 510) + "px";										
					document.getElementById("P3/O31/N1").style.left= eval(x + 420) + "px";																				
					
				}			

				// Variable de control de la rama inicial de catalogo seleccionada
				var lblnEnMenu = false;		
				
				function setEnMenu (pblnEnMenu)		
				{
					lblnEnMenu = pblnEnMenu;
				}

				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 abreOpcion (pintPadre,pintElemento,pintNivel)
				{		
					estableceOpcionesNoVisibles (pintElemento,pintNivel);
					estableceOpcionesVisibles (pintElemento,pintNivel);
					lblnMenuAbierto = true;
					lblnClickOpcion = true;
				}
				
				function actualizaEstiloOpcionesNoSeleccionadas (pintPadre,pintElemento,pintNivel)
				{
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");
					var lstrDivId ;
					var ldivCapa ;					
					for(i = 0; i < c.length; i++)
					{
						var elemento = c[i];
						if (elemento.id.substr(0,1) == "P") 
						{
							lintPadre = getPadre(elemento.id);
							lintElemento = getElemento(elemento.id);							
							lintNivel = getNivel(elemento.id);	
							//if (lintPadre == pintPadre && lintNivel == pintNivel)
							if (lintNivel == pintNivel)						
							{
								lstrDivId = "TDP" + lintPadre + "/O" + lintElemento + "/N" + lintNivel;
								ldivCapa = document.getElementById(lstrDivId);								
								if (ldivCapa != null)
								{
									ldivCapa.className = "bots_menu";
								}
							}
						}
					}
				}	
				
				// ---------------------------------------								
				function actualizaEstiloOpcionSeleccionada (pintPadre,pintElemento,pintNivel)
				{
					var lstrDivId = "TDP" + pintPadre + "/O" + pintElemento + "/N" + pintNivel;
					var ldivCapa = document.getElementById(lstrDivId);
					if (ldivCapa != null)
					{
							if (ldivCapa.className != "bots_menu_set")
								ldivCapa.className = "bots_menu_set";
					}
				}				
				
				// ---------------------------------------
				function cierraOpcion (pintElemento,pintNivel)
				{
					estableceOpcionesNoVisibles2 (pintElemento,pintNivel);
				}		
				
				// ---------------------------------------
				function cierraOpcionCascada (pintElemento,pintNivel)
				{
					estableceOpcionesNoVisibles2 (pintElemento,pintNivel,true);
				}						
				
				// ---------------------------------------		
				function estableceOpcionesNoVisibles2 (pintElemento,pintNivel,pblnCascada)
				{
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");
					if (pintNivel > 0)
					{
						for(i = 0; i < c.length; i++)
						{
								var elemento = c[i];
								if (elemento.id.substr(0,1) == "P") 								
								{
									lintPadre = getPadre(elemento.id);
									lintElemento = getElemento(elemento.id);							
									lintNivel = getNivel(elemento.id);	
									//alert("" + pintElemento + "-" + pintNivel + "\n" + elemento.id );		
									if ((lintElemento == pintElemento) && (lintNivel == pintNivel))
									{
										elemento.style.visibility = "hidden";
										elemento.style.zIndex = 0;
										if (pblnCascada)
											estableceOpcionesNoVisibles2 (lintPadre,pintNivel-1,true)
									}
								}			
						}
					}
				}
				
				
				// ---------------------------------------		
				function estableceOpcionesNoVisibles (pintElemento,pintNivel)
				{
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");
					for(i = 0; i < c.length; i++)
					{
							var elemento = c[i];
							if (elemento.id.substr(0,1) == "P") 							
							{
								lintPadre = getPadre(elemento.id);
								lintNivel = getNivel(elemento.id);			
								//alert(pintElemento + "-" + pintNivel + "\n"+lintPadre + "-" + lintNivel);							
								if ((lintPadre != pintElemento) && (lintNivel >= pintNivel))
								{
									elemento.style.visibility = "hidden";
									elemento.style.zIndex = 0;
								}
						}		
					}
				}
				
				// ---------------------------------------		
				function estableceOpcionesNoVisiblesAll ()
				{
					//alert("estableceOpcionesNoVisiblesAll");
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");
					for(i = 0; i < c.length; i++)
					{
							var elemento = c[i];
							if (elemento.id.substr(0,1) == "P")
							{
								elemento.style.visibility = "hidden";
 								elemento.style.zIndex = 0;
							}
					}
				}				
				
				// ---------------------------------------		
				function estableceOpcionesVisibles (pintElemento,pintNivel)
				{
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");		
					for(i = 0; i < c.length; i++)
					{
							var elemento = c[i];
							if (elemento.id.substr(0,1) == "P") 								
							{
								lintPadre = getPadre(elemento.id);
								lintNivel = getNivel(elemento.id);				
								//alert(pintElemento + "-" + pintNivel + "\n"+lintPadre + "-" + lintNivel + "\n"+ elemento.id);					
								if ((lintPadre == pintElemento) && (lintNivel = pintNivel + 1))
								{
									elemento.style.visibility = "visible";				
									elemento.style.zIndex = 2000;		
								}
							}		
					}
					lblnMenuAbierto = false;
				}		
				

				// ---------------------------------------		
				function getPadre (lstrId)
				{
					var lintPadre = "";
					var lintPadreTemp;
					var arrayOfStrings = lstrId.split("/");
					if (arrayOfStrings.length==3)
					{ 
						lintPadreTemp = arrayOfStrings[0];					
							
						lintPadre	= eval(lintPadreTemp.substr(1));
					}
					return lintPadre;
				}				

				// ---------------------------------------		
				function getElemento (lstrId)
				{
					var lintElemento = "";
					var lintElementoTemp;
					var arrayOfStrings = lstrId.split("/");
					if (arrayOfStrings.length==3)
					{ 					
						lintElementoTemp = arrayOfStrings[1];					
							
						lintElemento	= eval(lintElementoTemp.substr(1));
					}					
					return lintElemento;
				}				

		
				// ---------------------------------------		
				function getNivel (lstrId)
				{
					var lintNivel = "";
					var lintNivelTemp;
					var arrayOfStrings = lstrId.split("/");
					if (arrayOfStrings.length==3)
					{ 					
						lintNivelTemp = arrayOfStrings[2];					
							
						lintNivel	= eval(lintNivelTemp.substr(1));
					}					
					return lintNivel;
				}			
			
				// ---------------------------------------
				// 11 Capa - Mobiliario Baņo (Royo Bath) --> 69 Flash				
				// 12 Capa - Griferia (Gribagno) --> 106 Flash				
				// 13 Capa - Hidromasaje (Aquaidro) --> 142 Flash												
				function abreMenuGraficoArticulo (pintPadre,pintElemento,pintNivel,pstrArticulo)
				{
					var lstrRaiz = "";
					var pintPadreTemp = "" + pintPadre;
					//alert(pintPadre + " " + pintElemento + " " + pintNivel);

					//alert("padre temp length "  + pintPadreTemp.length)	;	
					if (pintPadreTemp.length > 2)
					{
						pintPadreTemp = pintPadreTemp.substring(0,pintPadreTemp.length-1) + "1";
						//alert("padre temp "  + pintPadreTemp)	;					
					}

					//alert(pintPadreTemp);
					//alert(pintElemento);					
					//alert(pintNivel);										

					lstrRaiz = ObtieneIdRaiz (pintPadreTemp,pintElemento,pintNivel)
					//alert(lstrRaiz);															
					if (pstrArticulo != null) 
						subMenuActualizaMenuGaleriaArticulo (pintPadre,pintElemento,eval(pintNivel) + 1,pstrArticulo);
					
					//alert(lstrRaiz);
					
					// Actualiza el flash
					if (lstrRaiz == "11")
						MM_controlShockwave('menu_catalogo','','GotoFrame','90');
					if (lstrRaiz == "12")
						MM_controlShockwave('menu_catalogo','','GotoFrame','127');
					if (lstrRaiz == "13")
						MM_controlShockwave('menu_catalogo','','GotoFrame','163');

				}
				
				function abreMenuGraficoFamilia (pintPadre,pintElemento,pintNivel,pstrFamilia)
				{
					var lstrRaiz = "";
					var pintPadreTemp = "" + pintPadre;
					//alert(pintPadre + " " + pintElemento + " " + pintNivel);

					//alert("padre temp length "  + pintPadreTemp.length)	;	
					if (pintPadreTemp.length > 2)
					{
						pintPadreTemp = pintPadreTemp.substring(0,pintPadreTemp.length-1) + "1";
						//alert("padre temp "  + pintPadreTemp)	;					
					}

					//alert(pintPadreTemp);
					//alert(pintElemento);					
					//alert(pintNivel);										

					lstrRaiz = ObtieneIdRaiz (pintPadreTemp,pintElemento,pintNivel)
					//alert(lstrRaiz);															
					if (pstrFamilia != null) 
						subMenuActualizaMenuGaleriaFamilia (pintPadre,pintElemento,eval(pintNivel) + 1,pstrFamilia);
					
					//alert(lstrRaiz);
					
					// Actualiza el flash
					if (lstrRaiz == "11")
						MM_controlShockwave('menu_catalogo','','GotoFrame','90');
					if (lstrRaiz == "12")
						MM_controlShockwave('menu_catalogo','','GotoFrame','127');
					if (lstrRaiz == "13")
						MM_controlShockwave('menu_catalogo','','GotoFrame','163');

				}				
				
				/*
				function iniciaMenuGrafico ()
				{
					subMenuActualizaMenuGaleria (0,0,0,0);
					MM_controlShockwave('menu_catalogo','','GotoFrame','1');						
					MM_controlShockwave('menu_catalogo','','Play','1');
				}	
				*/

				// ---------------------------------------				
				function ObtieneIdRaiz (pintPadre,pintElemento,pintNivel)
				{
					/*
					alert(pintPadre + " " + pintElemento + " " + pintNivel);
					pintElemento = pintElemento + "";
					try
					{
						return pintElemento.substring(0,2);
					}
					catch(e)
					{
						alert(e.message);
					}
					*/
					//alert(pintPadre + " " + pintElemento + " " + pintNivel);
					//alert(pintPadre + " " + pintElemento + " " + pintNivel);
					var c = document.getElementsByTagName("body")[0].getElementsByTagName("DIV");							
					if (pintNivel == 2)
					{
						return pintPadre;
					}
					else
					{
						for(i = 0; i < c.length; i++)
						{
								var elemento = c[i];	
								if (elemento.id.substr(0,1) == "P") 								
								{
									lintPadre = getPadre(elemento.id);
									lintNivel = getNivel(elemento.id);									
									lintElemento = getElemento(elemento.id);												
									if ((lintElemento == pintPadre))
									{
										return ObtieneIdRaiz (lintPadre,lintElemento,lintNivel);
									}
								}			
						}					
					}
					
				}

				// ---------------------------------------	
				function cierraMenus ()
				{
					//alert("cierra menus " + lblnMenuAbierto + " " + lblnClickOpcion);
					//if ((lblnMenuAbierto) && (!lblnClickOpcion))
					//	estableceOpcionesNoVisiblesAll();
					//lblnClickOpcion = false;
					if (!lblnEnMenu)
					{
						estableceOpcionesNoVisiblesAll();		
					}

				}
			
				// ---------------------------------------	
				function cargaImagenFamiliaRaiz(pstrCodElemento)
				{
					//alert("cargaImagenFamiliaRaiz " + pstrCodElemento);
					var lcapaImgPortada = document.getElementById("capaImgPortada");
					var limgPortada = document.getElementById("imgPortada");
					
					//alert(lcapaImgPortada.id);
					//alert(limgPortada.id);
					
					//limgPortada.style.backgroundImage = "url()";
					
					if (pstrCodElemento == "MOBILIARIO_DE_BANO")
					{
							//alert("background MOBILIARIO_DE_BANO");					
							//limgPortada.style.backgroundImage = lstrImgMobiliario;
							limgPortada.style.backgroundImage = "url(" + lstrImgMobiliario + ")"; 
					}
					if (pstrCodElemento == "GRIFERIA")
					{
							//alert("background GRIFERIA");											
							//limgPortada.style.backgroundImage = lstrImgGriferia;
							limgPortada.style.backgroundImage = "url(" + lstrImgGriferia + ")"; 							
					}
					if (pstrCodElemento == "HIDROMASAJE")
					{
							//alert("background HIDROMASAJE");											
							//limgPortada.style.backgroundImage = lstrImgHidromasaje;
							limgPortada.style.backgroundImage = "url(" + lstrImgHidromasaje + ")"; 							
					}
							
					if (lcapaImgPortada != null)
					{
						//alert("muestra capa");							
						lcapaImgPortada.style.visibility = "visible";
					}
					
				}			
				
				// ---------------------------------------	
				function actualizaFlashMenu (pstrPadre,pstrElemento,pstrNivel,pstrCodElemento)
				{
					estableceOpcionesNoVisiblesAll ();
					subMenuAbreOpcion (pstrPadre,pstrElemento,pstrNivel);
					cargaImagenFamiliaRaiz(pstrCodElemento);
				}






