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 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 formReset() {
	document.getElementById("idForm").reset();
}

function reserva(varidioma)	{ 
	var frm = self.document.idForm;
	MsgError = "";
	ok1 = (frm.cmpapellidos.value == "");
	ok2 = (frm.cmpnombre.value == "");
	ok3 = (frm.cmptelefono.value == "");
	ok4 = (frm.cmppais.value == "");
	ok5 = (frm.cmpemail.value == "");
	ok6 = (frm.cmppasaporte.value == "");
	ok7 = (frm.cmpin.value == "");
	ok8 = (frm.cmpout.value == "");
	ok9 = (frm.cmphuesped.value == "");
	if (varidioma == 0) {
		if (ok1) MsgError = "* El campo Apellido no puede estar vacío\n";
		if (ok2) MsgError = MsgError + "* El campo Nombre no puede estar vacío \n";
		if (ok3) MsgError = MsgError + "* El campo Telefono no puede estar vacío \n";
		if (ok4) MsgError = MsgError + "* El campo Pais no puede estar vacío \n";
		if (ok5) MsgError = MsgError + "* El campo E-Mail no puede estar vacío \n";
		if (ok6) MsgError = MsgError + "* El campo Pasaporte no puede estar vacío \n";
		if (ok7) MsgError = MsgError + "* El campo Fecha llegada no puede estar vacío \n";
		if (ok8) MsgError = MsgError + "* El campo Fecha Salida no puede estar vacío \n";
		if (ok9) MsgError = MsgError + "* El campo N° Huesped no puede estar vacío \n";
	} else {
		if (ok1) MsgError = "* The Last Name field can not be empty\n";
		if (ok2) MsgError = MsgError + "* The Name field can not be empty \n";
		if (ok3) MsgError = MsgError + "* The Phono field can not be empty \n";
		if (ok4) MsgError = MsgError + "* The Country field can not be empty \n";
		if (ok5) MsgError = MsgError + "* The E-Mail field can not be empty \n";
		if (ok6) MsgError = MsgError + "* The Passport Nº field can not be empty \n";
		if (ok7) MsgError = MsgError + "* The In field can not be empty El campo \n";
		if (ok8) MsgError = MsgError + "* The Out field can not be empty El campo \n";
		if (ok9) MsgError = MsgError + "* The Guest Nº field can not be empty \n";
	}	
	if (ok1 || ok2 || ok3 || ok4 || ok5 || ok6 || ok7 || ok8 || ok9) {
		alert(MsgError);
	} else {
		frm.HotelOp.value = 6; 
		frm.action = "acciones.php"; 
		frm.target = "";
		alert("Se ha enviado satisfactoriamente su solicitud de reserva, pronto estaremos en contacto"); 
		frm.submit();
	}
}

function contactenos(varidioma)	{ 
	var frm = self.document.idForm;
	MsgError = "";
	ok1 = (frm.cmpnombre.value == "");
	ok2 = (frm.cmpemail.value == "");
	ok3 = (frm.cmptelefono.value == "");
	ok4 = (frm.cmpobservaciones.value == "");
	if (varidioma == 0) {
		if (ok1) MsgError = "* El campo Nombre no puede estar vacío\n";
		if (ok2) MsgError = MsgError + "* El campo Email no puede estar vacío \n";
		if (ok3) MsgError = MsgError + "* El campo Telefono no puede estar vacío \n";
		if (ok4) MsgError = MsgError + "* El campo Comentarios no puede estar vacío \n";
	} else {
		if (ok1) MsgError = "* The Name field can not be empty\n";
		if (ok2) MsgError = MsgError + "* The E-Mail field can not be empty \n";
		if (ok3) MsgError = MsgError + "* The Phono field can not be empty \n";
		if (ok4) MsgError = MsgError + "* The Comments field can not be empty \n";	
	}
	if (ok1 || ok2 || ok3 || ok4) {
		alert(MsgError);
	} else {
		frm.HotelOp.value = 7; 
		frm.action = "acciones.php"; 
		frm.target = "";
		alert("Se ha enviado satisfactoriamente su consulta, pronto estaremos en contacto"); 
		frm.submit();
	}
}
