//Creada por Henry F.C y modificada por Guillermo Arias Cruz para Zews S.A
var ventana;
var cont=0;

function PopUp(img,enca){
  foto1= new Image();
  foto1.src=(img);
  Control(img,enca);
  }

function Control(img,enca){
if((foto1.width!=0)&&(foto1.height!=0)){
	verFoto(img,enca);
}
  else{
	funcion="Control('"+img+"','"+enca+"')";
	intervalo=setTimeout(funcion,10);
  }
}
function verFoto(img,enca){
  ancho=foto1.width;
  alto=foto1.height;
   if(cont==1){
            cont=0;
            ventana.close();
            ventana=null;
    }
  ventana = window.open("ver_foto.php?foto="+img+"&an="+ancho+"&al="+alto+"&tit="+enca,"Imagen","width="+ancho+",height="+alto+",left=190,top=110,scrollbars=no,menubars=no,statusbar=NO,status=NO,resizable=NO,location=NO")
  //ventana.moveTo((screen.width - ancho)/2,(screen.height - (alto))/2)//centra la ventana
  cont++;
  }
  
function habilitar(cbo,txt){
  with (document.forms['reservacion'])  
   {
	if (cbo.options[cbo.selectedIndex].value!='0'){
			Show('ampliacion');
			txt.disabled = false;
		}else{
			Hide('ampliacion');
			txt.disabled = true;
			}
   }
};

var nav4 = window.Event ? true : false;
function NumEdad(evt){ 
    var key = nav4 ? evt.which : evt.keyCode;
    return (key <= 13 || (key >= 48 && key <= 57));
}

function Def() {
  for(var i=0; i<arguments.length; ++i){
	  if(typeof(arguments[i])=='undefined') return false;}
  return true;
}
function Show(e) {
  if(!(e=document.getElementById(e))) return;
  if(e.style && Def(e.style.visibility)) e.style.visibility='visible';
}
function Hide(e) {
  if(!(e=document.getElementById(e))) return;
  if(e.style && Def(e.style.visibility)) e.style.visibility='hidden';
}


