// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
          eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
          if (restore) selObj.selectedIndex=0;
        }
		
	
function onSubmit() {
			
		 
		
			
		 var errormessage="";
		/* if(document.frm.beds.value == "" )
    	 {
		   errormessage = " Please select beds ";		 
 	     }	  
		 
 		 if(document.frm.island.value == "" )
    	 {
		   errormessage += " and Destinations";		 
 	     }	  
*/

       if(errormessage ==""){
	   document.getElementById('theForm').submit();
	   }
	
	   
 		
		//closeAndReloadParent();
}

function readCookie(name)  
 {  
   
     var cookiename = name + "=";  
   
     var ca = document.cookie.split(';');  
   
     for(var i=0;i < ca.length;i++)  
     {  
   
         var c = ca[i];  
   
         while (c.charAt(0)==' ') c = c.substring(1,c.length);  
   
         if (c.indexOf(cookiename) == 0) return c.substring(cookiename.length,c.length);  
   
     }  
   
     return null;  
   
 } 
 
 
 // this deletes the cookie when called



function removeCookie(name,str) {
  document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
  var cur_url = self.location.href;
	  
	  cur_url = cur_url.substr(0,cur_url.indexOf("#"))+"#"+str;
	 
  window.location.href = cur_url;
  window.location.replace( cur_url );
  window.location.reload();
}

function setCookie(name,str){
 
    var days = 100; 
	var date = new Date();  
    date.setTime(date.getTime ()+(days*24*60*60*1000));  
    var expires = "; expires="+date.toGMTString();
	var last_city_choice=readCookie(name);
	 if(last_city_choice==null  || last_city_choice!=str){
		   document.cookie = ' '+name+'='+ str + expires;  
				   // alert(last_city_choice);
	   }
	  var cur_url = self.location.href;
	 
	  cur_url = cur_url.substr(0,cur_url.indexOf("#"))+"#"+str;
	 
  window.location.href = cur_url;
  window.location.replace( cur_url );
  window.location.reload();
  
 }
