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("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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];}

}

function unhideLayer(layer) {

	document.getElementById(layer).style.visibility = "visible";

}

function hideLayer(layer) {

	document.getElementById(layer).style.visibility = "hidden";

}


function windowWidth(){
	
	if (window.innerWidth){
        if (document.body.offsetWidth){
            if (window.innerWidth!=document.body.offsetWidth)
                return document.body.offsetWidth;
            }
        return (window.innerWidth);                     // Mozilla
    }


    if (document.documentElement.clientWidth)
        return document.documentElement.clientWidth;    // IE6


    if (document.body.clientWidth)
        return document.body.clientWidth;               // IE DHTML-compliant any other
		
		
		
}



function blockHeaderNosotros() {
	
	total_width = windowWidth();
	posicion_deseada = parseInt((total_width - 975) / 2);
	posicion_deseada_2 = posicion_deseada + 971;
	
	
	document.getElementById("borde_lateral_izquierdo").style.left = posicion_deseada +"px";
	document.getElementById("borde_lateral_derecho").style.left = posicion_deseada_2 +"px";
	document.getElementById("header_layer").style.left = posicion_deseada +"px";
	document.getElementById("navegacion_layer").style.left = posicion_deseada +"px";
	document.getElementById("searcher").style.left = posicion_deseada +"px";
	
	
	document.getElementById("borde_lateral_izquierdo").style.position = "fixed";
	document.getElementById("borde_lateral_derecho").style.position = "fixed";
	document.getElementById("header_layer").style.position = "fixed";
	document.getElementById("navegacion_layer").style.position = "fixed";
	document.getElementById("searcher").style.position = "fixed";
	
	centraContenido();
	
}


function blockHeader() {
	
	total_width = windowWidth();
	posicion_deseada = parseInt((total_width - 975) / 2);
	posicion_deseada_2 = posicion_deseada + 971;
	
	document.getElementById("borde_lateral_izquierdo").style.left = posicion_deseada +"px";
	document.getElementById("borde_lateral_derecho").style.left = posicion_deseada_2 +"px";
	document.getElementById("header_layer").style.left = posicion_deseada +"px";
	document.getElementById("navegacion_layer").style.left = posicion_deseada +"px";
	
	document.getElementById("borde_lateral_izquierdo").style.position = "fixed";
	document.getElementById("borde_lateral_derecho").style.position = "fixed";
	document.getElementById("header_layer").style.position = "fixed";
	document.getElementById("navegacion_layer").style.position = "fixed";
	
	centraContenido();

}


function bloqueaBarras() {
	
	total_width = windowWidth();
	posicion_deseada = parseInt((total_width - 975) / 2);
	posicion_deseada_2 = posicion_deseada + 971;
	
	document.getElementById("borde_lateral_izquierdo").style.left = posicion_deseada +"px";
	document.getElementById("borde_lateral_derecho").style.left = posicion_deseada_2 +"px";
	
	document.getElementById("borde_lateral_izquierdo").style.position = "fixed";
	document.getElementById("borde_lateral_derecho").style.position = "fixed";
		
//	centraContenido();

}


function blockHeaderTiendas() {
	
	total_width = windowWidth();
	posicion_deseada = parseInt((total_width - 975) / 2);
	posicion_deseada_2 = posicion_deseada + 971;
	
	document.getElementById("borde_lateral_izquierdo").style.left = posicion_deseada +"px";
	document.getElementById("borde_lateral_derecho").style.left = posicion_deseada_2 +"px";
	document.getElementById("header_layer").style.left = posicion_deseada +"px";
	document.getElementById("navegacion_layer").style.left = posicion_deseada +"px";
	document.getElementById("searcher").style.left = posicion_deseada +"px";
	
	document.getElementById("borde_lateral_izquierdo").style.position = "fixed";
	document.getElementById("borde_lateral_derecho").style.position = "fixed";
	document.getElementById("header_layer").style.position = "fixed";
	document.getElementById("navegacion_layer").style.position = "fixed";
	document.getElementById("searcher").style.position = "fixed";
	
	centraContenido();
	
}

function centraContenido() {
	

	document.getElementById("base").style.left = posicion_deseada +"px";

}


function centraContinuamenteTiendas() {
	
	setInterval("blockHeaderTiendas()",1);
	
	
}





function preloadAreasComunes() {
	
	
	MM_preloadImages('./images/comun/util_icon_btn1_facebook.gif' , './images/comun/util_icon_btn1_myspace.gif' , './images/comun/util_icon_btn1_flickr.gif' , './images/comun/util_icon_btn1_youtube.gif' ,'./images/comun/es_nav_btn1_coleccion.gif' , './images/comun/es_nav_btn1_lookbook.gif' , './images/comun/es_nav_btn1_estilismo.gif' , './images/comun/es_nav_btn1_nosotros.gif' ,'./images/comun/es_nav_btn1_tiendas.gif' , './images/comun/util_btn1_english.gif','./images/comun/util_btn1_spanish.gif','./images/comun/es_util_btn1_miseleccion.gif','./images/comun/es_util_btn1_buscar.gif' )	;
	
	putNewBg();
	

}

function preloadColeccion() {
	
	
	MM_preloadImages('images/seccion-coleccion/es_col_nav_btn0_enlarge.gif' , 'images/seccion-coleccion/es_col_nav_btn0_add_blk.gif','images/grid_roll_bg_40.png'  )	;
	

}

function preloadColeccionDetalle() {
	
	
	MM_preloadImages('images/seccion-coleccion/col_nav_btn1_next.png' , 'images/seccion-coleccion/col_nav_btn1_previous.png' , 'images/seccion-coleccion/es_col_nav_btn1_index.gif' , 'images/seccion-coleccion/es_col_nav_btn1_add.gif' , 'images/seccion-coleccion/es_col_nav_btn1_download.gif' , 'images/seccion-coleccion/es_col_nav_btn1_next.gif' , 'images/seccion-coleccion/es_col_nav_btn1_previous.gif' , 'images/seccion-coleccion/cargando_galeria.gif' , './images/seccion-coleccion/preloader_galeria.gif','./images/seccion-coleccion/col_preloader_text.gif','./images/seccion-coleccion/col_preloader.gif')	;
	

}

function preloadEstilismo() {
	
	
	MM_preloadImages('images/seccion_estilismo/estil_btn1_plus.gif' , 'images/seccion_estilismo/estil_btn1_minus.gif' ,'images/seccion_estilismo/es_estil_add_rollover_text.gif' , 'images/seccion_estilismo/estil_btn1_close.png' , 'images/seccion_estilismo/estil_btn1_zoom.gif'  )	;
	

}


function preloadNosotrosEmpresa() {
	
	
	MM_preloadImages('images/seccion-nosotros/nos_btn1_backtotop_icon.gif', './images/seccion-nosotros/es_nos_cinfo_btn1_download.gif' )	;
	

}

function preloadNosotrosNoticias() {
	
	
	MM_preloadImages('images/seccion-nosotros/tags/es_tag_btn1_collab.gif' , 'images/seccion-nosotros/tags/es_tag_btn1_fan_of.gif' , 'images/seccion-nosotros/tags/es_tag_btn1_general.gif' , 'images/seccion-nosotros/tags/es_tag_btn1_latest.gif' , 'images/seccion-nosotros/tags/es_tag_btn1_listening.gif' ,'images/seccion-nosotros/tags/es_tag_btn1_wearing.gif'  ,'images/seccion-nosotros/tags/es_tag_btn1_welove.gif')	;
	

}

function preloadTiendas() {
	
	
	MM_preloadImages('images/seccion-tiendas/es_tiendas_btn1_viewmap.gif' )	;
	

}

function preloadTiendasDetalle() {
	
	
	MM_preloadImages('images/seccion-tiendas/eng_tiendas_nav_btn1_index.gif' )	;
	

}

	function baseTotalHeight() {
		
		altura_pantalla = $(window).height();
		altura_pagina = $(document).height();
		
		if ( altura_pantalla > altura_pagina) $("#base").height( altura_pantalla );
		else $("#base").height( altura_pagina );
		
		

	
	}
	

	function CalculaAlturas(qual) {
      
	
		altura = (document.getElementById('footer').offsetTop);
				
		document.getElementById("base").style.height = altura + 215 + "px";		
		
		document.getElementById("footer").style.visibility = "visible";
		
		document.getElementById("borde_lateral_izquierdo").style.height = document.getElementById("base").style.height;
		
		document.getElementById("borde_lateral_derecho").style.height = document.getElementById("base").style.height;
		
		document.getElementById("borde_lateral_izquierdo_summer").style.height = document.getElementById("base").style.height;
		
		document.getElementById("borde_lateral_derecho_summer").style.height = document.getElementById("base").style.height;
		
		
		putNewBg();
		
}

	function CalculaAlturas_2() {
      
				
		altura = document.body.offsetHeight;
		
		//document.getElementById("base").style.height = altura + 65 + "px";
		
		baseTotalHeight();
		
		document.getElementById("footer").style.visibility = "visible";
			
		CorrectLines();		
					
	}
	
	function CalculaAlturas_bsk() {
      			
		altura = document.body.offsetHeight;
		
		document.getElementById("base").style.height = altura + 65 + "px";		
		
		document.getElementById("footer").style.visibility = "visible";
		
		CorrectLines();		
					
	}

     function CalculaAlturas_tiendas() {
      
		altura = document.body.offsetHeight;
		//document.getElementById("base").style.height = altura + 65 + "px";		
		//document.getElementById("footer").style.top = "860px";
		document.getElementById("footer").style.visibility = "visible";
		
		CorrectLines();				
					
	}


	function CalculaAlturas_estilismo() {
      
				
	    altura = document.body.offsetHeight;
		
		//document.getElementById("base").style.height = altura + 65 + "px";		
		baseTotalHeight();

		document.getElementById("footer").style.visibility = "visible";
		
		CorrectLines();			
					
	}

	function CalculaAlturas_3() {
      
		
		altura = (document.getElementById('footer').offsetTop);
		
		//document.getElementById("base").style.height = altura + 42 + "px";		
		
		document.getElementById("footer").style.visibility = "visible";
		
		CorrectLines();		
					
	}
	
	function CorrectLines() {
		
			
				putNewBg();
	
				//CONTENIDO ES MAYOR QUE LA ALTURA DEL MONITOR
				document.getElementById("borde_lateral_izquierdo").style.height = parseInt(document.getElementById("footer").style.top) + 50 + "px";
				document.getElementById("borde_lateral_derecho").style.height = parseInt(document.getElementById("footer").style.top) + 50 + "px";
				document.getElementById("borde_lateral_izquierdo_summer").style.height = parseInt(document.getElementById("footer").style.top) + 50 + "px";
				document.getElementById("borde_lateral_derecho_summer").style.height = parseInt(document.getElementById("footer").style.top) + 50 + "px";
				
				//MONITOR MAYOR QUE EL CONTENIDO
				
				
				
			if (screen) {
	
				if (screen.height  > document.body.scrollHeight ) { 
					
					//alert("screen.height "+screen.height);
					//alert("document.body.scrollHeight "+document.body.scrollHeight);
					document.getElementById("borde_lateral_izquierdo").style.height = ( screen.height - 120)  + "px";
					document.getElementById("borde_lateral_derecho").style.height = ( screen.height - 120) + "px";
					document.getElementById("borde_lateral_izquierdo_summer").style.height = ( screen.height - 120)  + "px";
					document.getElementById("borde_lateral_derecho_summer").style.height = ( screen.height - 120) + "px";
					
					
				
				} else {
					
					//alert("document.body.scrollHeight "+document.body.scrollHeight);
					//alert("-----screen.height "+screen.height);
					
					var altura =  document.body.scrollHeight  + "px";
					
					document.getElementById("borde_lateral_derecho").style.height = altura;
					document.getElementById("borde_lateral_izquierdo").style.height = altura;
					document.getElementById("borde_lateral_derecho_summer").style.height = altura;
					document.getElementById("borde_lateral_izquierdo_summer").style.height = altura;
					
					
						
				}
			
			}
			
			baseTotalHeight();
	}





