// JavaScript Document

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_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



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_validateForm() { //v4.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

    if (val) { nm=val.name; if ((val=val.value)!="") {

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

        if (p<1 || p==(val.length-1)) errors+='- '+nm+' Debe contener un e-mail válido.\n';

      } else if (test!='R') { num = parseFloat(val);

        if (isNaN(val)) errors+='- '+nm+' Debe contener un número.\n';

        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

          min=test.substring(8,p); max=test.substring(p+1);

          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }

  } if (errors) alert('Se han producido los siguientes errores:\n'+errors);

  document.MM_returnValue = (errors == '');

}



function fecha() {

var months = new Array();

months[0] = 'Enero';

months[1] = 'Febrero';

months[2] = 'Marzo';

months[3] = 'Abril';

months[4] = 'Mayo';

months[5] = 'Junio';

months[6] = 'Julio';

months[7] = 'Agosto';

months[8] = 'Septiembre';

months[9] = 'Octubre';

months[10] = 'Noviembre';

months[11] = 'Diciembre';

var days = new Array();

days[0] = 'Domingo';

days[1] = 'Lunes';

days[2] = 'Martes';

days[3] = 'Miércoles';

days[4] = 'Jueves';

days[5] = 'Viernes';

days[6] = 'Sábado';

now = new Date();

var dayname = days[now.getDay()];

var monthname = months[now.getMonth()];

var dayofmonth =now.getDate();

var year = now.getYear();

if (year < 1000) year += 1900;

document.write(dayname + ' ' + dayofmonth + ' ' + monthname + ' ' + year);	

}



function validaSelect()

{

    if (reservas.tipoHabitacion[0].selected == true)

    {

	alert('Debe seleccionar un tipo de habitación');

	}

	if (reservas.in_dia[0].selected == true && reservas.in_mes[0].selected == true && reservas.in_ano[0].selected == true)

    {

	alert('Por favor ingrese fecha de ingreso (Check-in)');

	}

	if (reservas.out_dia[0].selected == true && reservas.out_mes[0].selected == true && reservas.out_ano[0].selected == true)

    {

	alert('Por favor ingrese fecha de salida (Check-out)');

	}

}





function mmLoadMenus() {

  if (window.mm_menu_0807134750_0) return;

  window.mm_menu_0807134750_0 = new Menu("root",127,16,"",10,"#000000","#000000","#E9E0C5","#DACB9E","left","middle",3,0,1000,-5,7,true,false,true,5,true,true);

  mm_menu_0807134750_0.addMenuItem("Premium&nbsp;Plus","location='index.php?Id=3&submod=Pplus'");

  mm_menu_0807134750_0.addMenuItem("Premium&nbsp;Sur","location='index.php?Id=3&submod=Psur'");

  mm_menu_0807134750_0.addMenuItem("Country&nbsp;Sur","location='index.php?Id=3&submod=Cou'");

  mm_menu_0807134750_0.addMenuItem("Eco&nbsp;Sur","location='index.php?Id=3&submod=Eco'");

  mm_menu_0807134750_0.addMenuItem("Estandar&nbsp;Sur","location='index.php?Id=3&submod=Est'");

   mm_menu_0807134750_0.hideOnMouseOut=true;

   mm_menu_0807134750_0.bgColor='#555555';

   mm_menu_0807134750_0.menuBorder=1;

   mm_menu_0807134750_0.menuLiteBgColor='#FFFFFF';

   mm_menu_0807134750_0.menuBorderBgColor='#777777';



mm_menu_0807134750_0.writeMenus();

} // mmLoadMenus()



function writeFlash(url_root, width, height, bgcolor, version, name){

			if (version == null || version == ''){

				version = '7,0,0,0';

			}

			document.writeln("<object name='"+name+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");

			document.writeln(" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+"' ");

		    document.writeln(" width='"+width+"' height='"+height+"'> ");

		    document.writeln("<param name='movie' value='"+url_root+"'>");

		    document.writeln("<param name='quality' value='high'>");

		    document.writeln("<param name='menu' value='false'>");

		    document.writeln("<param name='wmode' value='transparent'>");		    

		    if (bgcolor == null || bgcolor == 'FFFFFF'){

				document.writeln("<param name='wmode' value='transparent'>");

			}

		    document.writeln("<embed src='"+url_root+"' ");

		    if (bgcolor == null || bgcolor == 'FFFFFF'){

				document.writeln(" wmode='transparent' ");

			}

		    document.writeln(" quality='high' bgcolor='#"+bgcolor+"'  width='"+width+"' height='"+height+"' ");

		    document.writeln(" type='application/x-shockwave-flash' ");

		    document.writeln(" pluginspage='http://www.macromedia.com/shockwav/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>");

		    document.writeln("</embed></object>");

		}

		





function popup(url){

	window.open(url,"fotos","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=440,left=50,top=50")

}

function popupv(url){

	window.open(url,"fotos","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=440,height=600,left=50,top=50")

}