//v1.0

//Variables para tipo de navegador y versión
var sNavegador; 
var sVersion; 

//Establece el tipo de navegador usado
function setTipoNaveg(){ 
	var aNavFull = new Array("opera", "msie", "netscape", "gecko", "mozilla"); 
	var aNavVers = new Array("opera", "msie", "netscape", "rv",    "mozilla"   ); 
  var aNavAbrv = new Array("op",    "ie",   "ns",       "mo",    "ns"   ); 
  var sInfo = navigator.userAgent.toLowerCase();; 

  sNavegador = ""; 
  for (var i = 0; i < aNavFull.length; i++){ 
   if ((sNavegador == "") && (sInfo.indexOf(aNavFull[i]) != -1)){ 
    sNavegador = aNavAbrv[i]; 
    sVersion = String(parseFloat(sInfo.substr(sInfo.indexOf(aNavVers[i]) + aNavVers[i].length + 1))); 
   } 
  } 
} 

//Llama a la función que establece el tipo de navegador
setTipoNaveg();

//Devuelve el tipo de navegador
function getNombreNaveg(){ 
return sNavegador; 
} 
//Devuelve la versión del navegador
function getVersionNaveg(){ 
return sVersion; 
}

//Cambia el source de los botones de las opciones de cabecera
//cuando el ratón pasa por encima
//1-torreón
//2-catering
//3-mi abuela
//4-casa salvi
function opcCab(foco, numopc)
{
	if (foco)
	{
		document.all.item("BTNCAB" + numopc).src = "../../img/btn" + numopc + "on.gif";
		document.all.item("OPCCAB" + numopc).src = "../../img/opc" + numopc + "on.gif";
	}
	else
	{
		document.all.item("BTNCAB" + numopc).src = "../../img/btn" + numopc + ".gif";
		document.all.item("OPCCAB" + numopc).src = "../../img/opc" + numopc + ".gif";
	}
}

//Aplica transición a la foto
function applyImageTransition (obj, imgsrc)
{
	if (getNombreNaveg() == "ie")
		obj.filters(0).Apply();
		obj.src=imgsrc;
    if (getNombreNaveg() == "ie")
    	obj.filters(0).Play();
}




	var ie45,ns6,ns4,dom;
        if (navigator.appName=="Microsoft Internet Explorer")
          ie45=parseInt(navigator.appVersion)>=4;
        else if (navigator.appName=="Netscape"){
          ns6=parseInt(navigator.appVersion)>=5;
          ns4=parseInt(navigator.appVersion)<5;}
        dom=ie45 || ns6;

	var head="display:";

	// Función que despliega o no los submenus.

	function doit(header,param)
		{
                if (dom){
		var head=header.style;
		var aux=document.all[header.sourceIndex-param];
		if (head.display=="none")
			{
			document.all[document.obj1.sourceIndex+1].style.display="none";
			document.all[document.obj2.sourceIndex+1].style.display="none";
			document.all[document.obj3.sourceIndex+1].style.display="none";
			document.all[document.obj4.sourceIndex+1].style.display="none";
			//document.all[document.obj5.sourceIndex+2].style.display="none";
			//document.all[document.all[document.obj1.sourceIndex+1].sourceIndex-param].src="../img/flechas/pls.gif";
			//document.all[document.all[document.obj2.sourceIndex+1].sourceIndex-param].src="../img/flechas/pls.gif";
			//document.all[document.all[document.obj3.sourceIndex+1].sourceIndex-param].src="../img/flechas/pls.gif";
			//document.all[document.all[document.obj4.sourceIndex+1].sourceIndex-param].src="../img/flechas/pls.gif";
			//document.all[document.all[document.obj5.sourceIndex+1].sourceIndex-param].src="../img/flechas/pls.gif";

			head.display="";
			//aux.src = "/img/menutorreon.gif";
			}
		else
			{
			head.display="none";
			//aux.src = "/img/menutorreon.gif";
			}
		}
		}


