version=navigator.appVersion; 
dom=document.getElementById?1:0; 

ie5=(version.indexOf("MSIE 5")>-1 &&  dom)?1:0; 
ie6=(version.indexOf("MSIE 6")>-1 &&  dom)?1:0; 
ie4=(document.all && !dom)?1:0; 
ns5=(dom && parseInt(version) >= 5) ?1:0; 
ns4=(document.layers && !dom)?1:0;


function ocultarCapa(){
	if(ns5){
		document.getElementById("cargando").style.visibility='hidden';
		document.getElementById("web").style.visibility='visible';
	}
	else if(ns4){
		document.cargando.visibility='hidde';
		document.web.visibility='show';
	}
	else{
		document.all["cargando"].style.visibility='hidden';
		document.all["web"].style.visibility='visible';
	}
}

function aumentaImage(capa,img,dir,ancho,alto){
	inc=2; // Siempre par
	tope=alto*inc; // Alto máximo
	imagen=document.getElementById(img);
	objeto=document.getElementById(capa);
	objeto.style.zIndex=99;
	if (imagen.height<tope){
			coef=ancho/alto;
			imagen.height=parseInt(imagen.height)+parseInt(inc);
			imagen.width=parseInt(imagen.width)+parseInt(inc*coef);
			objeto.style.top=parseInt(objeto.style.top)-parseInt(inc);
			if (coef>1 && coef<2) coef=1;
			if (dir=="c")
				objeto.style.left=parseInt(objeto.style.left)-parseInt((inc*coef)/2);
			if (dir=="i")
				objeto.style.left=parseInt(objeto.style.left)-parseInt(inc*coef);
	}
	a=setTimeout("aumentaImage('"+capa+"','"+img+"','"+dir+"',"+ancho+","+alto+")",15);
}

function disImage(capa,img,ancho,alto,izq,arriba){

	clearTimeout(a);
	//alert(imagen.height+","+imagen.width);

	imagen=document.getElementById(img);
	objeto=document.getElementById(capa);
	objeto.style.zIndex=1;
	objeto.style.left=izq;
	objeto.style.top=arriba;
	imagen.width=ancho;
	imagen.height=alto;
}
