function IsNumeric(filed)
   { 
      var l=filed.value.length;
      var i;
      for(var i=0;i<=l;i++)
      {
         var strCheck="0123456789";
         var sCheck=filed.value.substr(i,1);
         
         if(sCheck>'')
         {
            if(strCheck.indexOf(sCheck) < 0)
            {		
            filed.value = filed.value.substr(0, (filed.value.length-1));
			alert("please enter only numeric figures");
            return false;
               
            }
         }
      }
      return true;
      
   }

function find(inForm,location,category,price,path)
{
  var url;
  if (location !='') {
	url=path+"jsp/list.jsp?location="+location+"&category="+category;
  }
  else {
	url="path+jsp/list.jsp?category="+category;
	}
 if (price!='')  {
    url=url +"&price="+price;
 }
document.location=url;
}

function openHtml(path) {
this.location=path;
 return;
 
}
function populateDropDown(inForm,selected) {
var selectedArray = eval(selected + "Array");
for (var i=0; i < selectedArray.length; i++) {
eval("inForm."+selected+".options[i]=" + "new Option" + selectedArray[i]);
  }
  }
  
function findD(location,category)
{
  var url;
  if (location !='') {
	url="jsp/list.jsp?location="+location+"&category="+category;
  }
  else {
	url="jsp/list.jsp?category="+category;
	}
 
document.location=url;
}

function submitCars(form) {

var url;

var tDay=new Date();
var fDay=new Date();
var dDay=new Date();
var dateFrom     = form.fromDate.value;
var toFrom     = form.toDate.value;
var df  = dateFrom.substring(0, 2);  // day From
fDay.setDate(df);
var mf = dateFrom.substring(3, 5);   // month From
fDay.setMonth(mf-1);
var yf = dateFrom.substring(6, 11);  // year From
fDay.setFullYear(yf);

var dt  = toFrom.substring(0, 2);  // day From
dDay.setDate(dt);
var mt = toFrom.substring(3, 5);   // month From
dDay.setMonth(mt-1);
var yt = toFrom.substring(6, 11);  // year From
dDay.setFullYear(yt);

if (form.fromDate.value == "")
  { alert("Please include the pick up date"); form.fromDate.focus(); return; }

if(fDay.getTime()<tDay.getTime()){
	alert("Please choose a Pick up Date later then Today"); form.fromDate.focus(); return; }

if (form.toDate.value == "")
  { alert("Please include the Drop OFF date"); form.toDate.focus(); return; }
if(dDay.getTime()<tDay.getTime()){
	alert("Please choose a Drop OFF Date later then Today"); form.toDate.focus(); return; }
	
if(dDay.getTime()<fDay.getTime()){
   alert("Please choose a Drop OFF Date later then Pick up Date"); form.toDate.focus(); return; }
	
document.location="jsp/offer car list.jsp?fromDate="+form.fromDate.value+"&toDate="+form.toDate.value+"&pickup_time="+form.pickup_time.options[form.pickup_time.selectedIndex].value+"&drop_time="+form.drop_time.options[form.drop_time.selectedIndex].value+"&transmition="+form.transmition.options[form.transmition.selectedIndex].value+"&carType="+form.carType.options[form.carType.selectedIndex].value;
}

function submitHotel(dt,mn,yr,nn,np,nr,price,location,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,where) {
var url;
var tDay=new Date();
var fDay=new Date();
fDay.setDate(dt);
fDay.setMonth(mn-1);
fDay.setFullYear(yr);

if(fDay.getTime()<tDay.getTime()){
alert("Please choose a Date later then Today");  return; }

var totalP=parseInt(0);
var ls_temp=parseInt(0);
 for (lan=1;lan<=10;lan++) {
  if (eval("r"+lan) != "" && eval("r"+lan) !=null){
   ls_temp=parseInt(eval("r"+lan));
   totalP=totalP+ls_temp;
  }
 }
 
 for (lan=1;lan<=parseInt(nr);lan++) {
  if ( eval("r"+lan) == "")
  { alert("Please include the nuber of guest for each room"); return; }  
} 
if (parseInt(np) != totalP)
 {alert("the number of guests in each rooms should sums up to the total number of guests"); document.frm.r1.focus(); return; }
  
if (where=="1") {
url="jsp/offer list.jsp?dt="+dt+"&mn="+mn+"&yr="+yr+"&nn="+nn+"&np="+np+"&nr="+nr+"&location="+location+"&r1="+r1+"&r2="+r2+"&r3="+r3+"&r4="+r4+"&r5="+r5+"&r6="+r6+"&r7="+r7+"&r8="+r8+"&r9="+r9+"&r10="+r10;
if (price!="0")
 url=url+"&price="+price;
if (location == "")
  { alert("Please chose location"); return false; }
document.location=url;
}else {
return true;
url="../../../jsp/offer.jsp?dt="+dt+"&mn="+mn+"&yr="+yr+"&nn="+nn+"&np="+np+"&nr="+nr+"&location="+location+"&r1="+r1+"&r2="+r2+"&r3="+r3+"&r4="+r4+"&r5="+r5+"&r6="+r6+"&r7="+r7+"&r8="+r8+"&r9="+r9+"&r10="+r10;
}

}


function Add_A_Favorite() 
{ 
if (window.external) 
// if the browser is IE open the add favorite window
{
external.AddFavorite(parent.parent.location.href, document.title)
// Add the document location and title to the AddFavorite window
}
else 
// Display and alert box for any other browser.
{
alert("Sorry, your browser doesn't support this feature." + 
"\nPlease use the bookmark feature of your browser to save the location of this page.");
}

}

function ShowRange(inForm,selected)
{
    if (selected =='0')  {
	  document.all('11').style.display='';
	  }
	else {
	  document.all('11').style.display='none';
	}
}

function mmLoadMenus() { 
  if (window.mm_menu_0705205059_0) return;
   window.mm_menu_0705205059_0_1 = new Menu("Central Valley",110,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_1.addMenuItem("SAN JOSE","location='/jsp/list.jsp?category=0&location=San_Jose'");
    mm_menu_0705205059_0_1.addMenuItem("TURRIALBA","location='/jsp/list.jsp?category=0&location=Turialba'");
     mm_menu_0705205059_0_1.hideOnMouseOut=true;
     mm_menu_0705205059_0_1.bgColor='#555555';
     mm_menu_0705205059_0_1.menuBorder=1;
     mm_menu_0705205059_0_1.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_1.menuBorderBgColor='#777777';
    window.mm_menu_0705205059_0_2 = new Menu("North Pacific",163,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_2.addMenuItem("TAMARINDO","location='/jsp/list.jsp?category=0&location=Tamarindo'");
    mm_menu_0705205059_0_2.addMenuItem("FLAMINGO BEACH","location='/jsp/list.jsp?category=0&location=Flamingo_Beach'");
    mm_menu_0705205059_0_2.addMenuItem("PAPAGAYO","location='/jsp/list.jsp?category=0&location=Papagayo'");
    mm_menu_0705205059_0_2.addMenuItem("NOSARA","location='/jsp/list.jsp?category=0&location=Nosara'");
    mm_menu_0705205059_0_2.addMenuItem("SAMARA","location='/jsp/list.jsp?category=0&location=Samara'");
    mm_menu_0705205059_0_2.addMenuItem("MAL PAIS","location='/jsp/list.jsp?category=0&location=Mal_pais'");
    mm_menu_0705205059_0_2.addMenuItem("MONTEZUMA","location='/jsp/list.jsp?category=0&location=Montezuma'");
    mm_menu_0705205059_0_2.addMenuItem("TAMBOR","location='/jsp/list.jsp?category=0&location=Tambor'");
     mm_menu_0705205059_0_2.hideOnMouseOut=true;
     mm_menu_0705205059_0_2.bgColor='#555555';
     mm_menu_0705205059_0_2.menuBorder=1;
     mm_menu_0705205059_0_2.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_2.menuBorderBgColor='#777777';
    window.mm_menu_0705205059_0_3 = new Menu("Central Pacific",167,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_3.addMenuItem("MANUEL&nbsp;ANTONIO","location='/jsp/list.jsp?category=0&location=Manuel_Antonio'");
    mm_menu_0705205059_0_3.addMenuItem("JACO","location='/jsp/list.jsp?category=0&location=Jaco'");
    mm_menu_0705205059_0_3.addMenuItem("PLAYA&nbsp;HERMOSA","location='/jsp/list.jsp?category=0&location=Playa_Hermosa'");
    mm_menu_0705205059_0_3.addMenuItem("PLAYA&nbsp;HERADURA","location='/jsp/list.jsp?category=0&location=Playa_Heradura'");
    mm_menu_0705205059_0_3.addMenuItem("ESTERILLOS","location='/jsp/list.jsp?category=0&location=Esterillos'");
    mm_menu_0705205059_0_3.addMenuItem("BEJUCO","location='/jsp/list.jsp?category=0&location=Bejuco'");
    mm_menu_0705205059_0_3.addMenuItem("DOMINICAL","location='/jsp/list.jsp?category=0&location=Dominical'");
     mm_menu_0705205059_0_3.hideOnMouseOut=true;
     mm_menu_0705205059_0_3.bgColor='#555555';
     mm_menu_0705205059_0_3.menuBorder=1;
     mm_menu_0705205059_0_3.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_3.menuBorderBgColor='#777777';
    window.mm_menu_0705205059_0_4 = new Menu("Northean Territiries",180,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_4.addMenuItem("ARENAL","location='/jsp/list.jsp?category=0&location=Arenal'");
    mm_menu_0705205059_0_4.addMenuItem("MONTEVERDE","location='/jsp/list.jsp?category=0&location=Monteverde'");
    mm_menu_0705205059_0_4.addMenuItem("POAS","location='/jsp/list.jsp?category=0&location=Poas'");
    mm_menu_0705205059_0_4.addMenuItem("RINCON&nbsp;DE&nbsp;LA&nbsp;VIEJA","location='/jsp/list.jsp?category=0&location=Rincon_de_la_vieja'");
     mm_menu_0705205059_0_4.hideOnMouseOut=true;
     mm_menu_0705205059_0_4.bgColor='#555555';
     mm_menu_0705205059_0_4.menuBorder=1;
     mm_menu_0705205059_0_4.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_4.menuBorderBgColor='#777777';
    window.mm_menu_0705205059_0_5 = new Menu("Carribbean Cost",131,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_5.addMenuItem("PUERTO&nbsp;VIEJO","location='/jsp/list.jsp?category=0&location=Puerto_Viejo'");
    mm_menu_0705205059_0_5.addMenuItem("TORTUGUERO","location='/jsp/list.jsp?category=0&location=Tortuguero'");
     mm_menu_0705205059_0_5.hideOnMouseOut=true;
     mm_menu_0705205059_0_5.bgColor='#555555';
     mm_menu_0705205059_0_5.menuBorder=1;
     mm_menu_0705205059_0_5.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_5.menuBorderBgColor='#777777';
    window.mm_menu_0705205059_0_6 = new Menu("South Pacific",147,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0705205059_0_6.addMenuItem("OSA&nbsp;PENINSULA","location='/jsp/list.jsp?category=0&location=Osa_Peninsula'");
     mm_menu_0705205059_0_6.hideOnMouseOut=true;
     mm_menu_0705205059_0_6.bgColor='#555555';
     mm_menu_0705205059_0_6.menuBorder=1;
     mm_menu_0705205059_0_6.menuLiteBgColor='#FFFFFF';
     mm_menu_0705205059_0_6.menuBorderBgColor='#777777';
  window.mm_menu_0705205059_0 = new Menu("root",142,18,"",12,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_1);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_2);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_3);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_4);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_5);
  mm_menu_0705205059_0.addMenuItem(mm_menu_0705205059_0_6);
   mm_menu_0705205059_0.hideOnMouseOut=true;
   mm_menu_0705205059_0.childMenuIcon="/images/arrows.gif";
   mm_menu_0705205059_0.bgColor='#555555';
   mm_menu_0705205059_0.menuBorder=1;
   mm_menu_0705205059_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0705205059_0.menuBorderBgColor='#777777';



if (window.mm_menu_0104103704_0) return;
  window.mm_menu_0104103704_0 = new Menu("root",101,15,"",9,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,500,-5,7,true,true,true,0,true,true);
  mm_menu_0104103704_0.addMenuItem("BUDGET","window.open('http://www.cupotico.com/coupons/cars/cars1/cars1.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("EUROPCAR","window.open('http://www.cupotico.com/coupons/cars/cars2/cars2.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("TOYOTA","window.open('http://www.cupotico.com/coupons/cars/cars3/cars3.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("NATIONAL","window.open('http://www.cupotico.com/coupons/cars/cars4/cars4.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("SUZUKI","window.open('http://www.cupotico.com/coupons/cars/cars5/cars5.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("PAYLESS","window.open('http://www.cupotico.com/coupons/cars/cars6/cars6.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("MAPACHE","window.open('http://www.cupotico.com/coupons/cars/cars7/cars7.html', '_self');");
  mm_menu_0104103704_0.addMenuItem("ADOBE","window.open('http://www.cupotico.com/coupons/cars/cars8/cars8.html', '_self');");
  mm_menu_0104103704_0.hideOnMouseOut=true;
  mm_menu_0104103704_0.bgColor='#555555';
  mm_menu_0104103704_0.menuBorder=1;
  mm_menu_0104103704_0.menuLiteBgColor='';
  mm_menu_0104103704_0.menuBorderBgColor='#FFFFFF';
  
  if (window.mm_menu_0104103702_0) return;
  window.mm_menu_0104103702_0 = new Menu("root",141,15,"",9,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,500,-5,7,true,true,true,0,true,true);
  mm_menu_0104103702_0.addMenuItem("BEST OF COSTA RICA","window.open('/costaricapackages/best_of_costa_rica.html', '_self');");
  mm_menu_0104103702_0.addMenuItem("ADVENTURE PACKAGE","window.open('/costaricapackages/costa_rica_adventure_package.html', '_self');");
  mm_menu_0104103702_0.addMenuItem("VOLCANOES & BEACH PACKAGE","window.open('/costaricapackages/volcanoes_costa_rica_package.html', '_self');");
  mm_menu_0104103702_0.addMenuItem("BEACH & SUN","window.open('/costaricapackages/beach_and_sun.html', '_self');");

 if (window.mm_menu_0705205058_0) return;
   window.mm_menu_0705205058_0 = new Menu("root",171,15,"",9,"#FFFFFF","#FFCC00","#3399CC","#3399CC","left","middle",3,0,500,-5,7,true,true,true,0,true,true);
  mm_menu_0705205058_0.addMenuItem("PLAYA&nbsp;HERADURA - LOS SUENIOS","window.open('/jsp/listRental.jsp?location=Playa_Heradura', '_self');");
  mm_menu_0705205058_0.addMenuItem("PLAYA&nbsp;HERMOSA","window.open('/jsp/listRental.jsp?location=Playa_Hermosa', '_self');");
  mm_menu_0705205058_0.addMenuItem("MANUEL&nbsp;ANTONIO","window.open('/jsp/listRental.jsp?location=Manuel_Antonio', '_self');");
  mm_menu_0705205058_0.addMenuItem("TAMARINDO","window.open('/jsp/listRental.jsp?location=Tamarindo', '_self');");
  mm_menu_0705205058_0.addMenuItem("NOSARA","window.open('/jsp/listRental.jsp?location=Nosara', '_self');");
   mm_menu_0705205058_0.hideOnMouseOut=true;
   mm_menu_0705205058_0.bgColor='#555555';
   mm_menu_0705205058_0.menuBorder=1;
   mm_menu_0705205058_0.menuLiteBgColor='';
   mm_menu_0705205058_0.menuBorderBgColor='#FFFFFF';
   
   mm_menu_0705205059_0.writeMenus();
   mm_menu_0104103704_0.writeMenus();
   mm_menu_0104103702_0.writeMenus();
   mm_menu_0705205058_0.writeMenus();
   

} // mmLoadMenus()

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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 showRooms(selected){
  for (var i=1;i<5;i++) {
    if (i<=selected){
	 if (i==1 && selected ==1){ 
	    document.all.room.style.display='none'; 
	 }
	 else{
    	document.all.room.style.display='';
	 }
	if ( i>1)
     eval("document.all('r"+i+"')").style.display=''; 
	}else{
       eval("document.all('r"+i+"')").style.display='none';
	} 
  }//for
}
var maxG=0;
var roomG=0;
function showChildren(selected,room){
  for (var i=1;i<=4;i++) {
    if (i<=selected){
	  eval("document.all('c"+i+"r"+room+"')").style.display='';
	  eval("document.all('child"+i+"')").style.display='';
	  document.all.age.style.display='';
    } 
	else {
 	      eval("document.all('c"+i+"r"+room+"')").style.display='none';
		  setMax();
		 if (i > maxG ) {
	       eval("document.all('child"+i+"')").style.display='none';
		 }
	     if (selected<1 &&room==roomG)
	      document.all.age.style.display='none';
    } 
  }//for
  if (selected > maxG){
    maxG=selected;
	roomG= room
  }
}

function setMax(){
var child=0;
maxG=0;
roomG=0;
	for (var i=1;i<=4;i++) {
 		child =eval("document.all('chr"+i+"')").value;
 		if (child > maxG ){
 		 maxG=child;
  		 roomG=i;
 		}
	}
return true;
}

function showTabs(selected){
  var j=0;
  for (var i=100;i<104;i++) {
    j=i+10;
    if (i==selected){
      eval("document.all('"+i+"')").style.display='';
	  eval("document.all('"+j+"')").background='images/yellow_tabB.gif';
    } 
	else {
	    eval("document.all('"+i+"')").style.display='none';
		eval("document.all('"+j+"')").background='images/yellow_tabBE.gif';
    } 
  }
}

function submitactivity(form) {
var url;

if (document.frm.loc2.options[document.frm.loc2.selectedIndex].value == "")
  { alert("Please choose location"); document.loc2.focus(); return; }
document.location="jsp/listActivity.jsp?location="+document.frm.loc2.options[document.frm.loc2.selectedIndex].value+"&activity="+document.frm.activity.options[document.frm.activity.selectedIndex].value;
}
