
//Property Rentals javascript 3.0

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
function resetRows(thefield){
if (thefield.value=="")
thefield.value = 10
}

function setNote(thefield){
if (thefield.value== "")
thefield.value = "note:"
}

function setSleep2(thefield){
thefield.value = "2"
}

function popUp(thePage,popW,popH){
   w = screen.availWidth;
   h = screen.availHeight;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;
window.open(thePage,'Photos','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);
}

function validateConfirm(theForm) {

     if (theForm.c_name.value.length==0){
        alert('Please enter your name');
		 theForm.c_name.focus();
        return (false);
      }

     if (theForm.c_phone.value.length==0){
        alert('Please enter your phone number');
		 theForm.c_phone.focus();		
        return (false);
      }
	  
	 if (theForm.c_email.value.length==0){
		alert(' Please enter your email address');
		 theForm.c_email.focus();
        return (false);
      }
	  
	 var filter = /\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi;
     if (filter.test(theForm.c_email.value) != true){
     alert("Your email address does not appear to be valid.");
     theForm.c_email.focus();
     return (false);
	 }

else {theForm.submit();}
	  
}

function validateBooking(theForm) {

     if (theForm.arrive_date.value.length==0){
        alert('Please select an Arrive Date');
        return (false);
      }

     if (theForm.depart_date.value.length==0){
        alert('Please select an Depart Date');
        return (false);
      } 

else {theForm.submit();}
	  }
	  
function validateFriend(theForm) {

     if (theForm.friend_name.value.length==0){
        alert('Need a name for your friend');
	    theForm.friend_name.focus();	
        return (false);
      }
	  
	  if (theForm.friend_email.value.length==0){
		alert(' Need an email address for your friend');
	    theForm.friend_email.focus();		
        return (false);
      }
	  
	 var filter1 = /\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi;
     if (filter1.test(theForm.friend_email.value) != true){
     alert("Your friend's email address does not appear to be valid.");
     theForm.friend_email.focus();
     return (false);
	 }
	 
	      if (theForm.your_name.value.length==0){
        alert('Need your name');
        theForm.your_name.focus();		
        return (false);
      }
	  
	  if (theForm.your_email.value.length==0){
		alert(' Need your email address');
        theForm.your_email.focus();		
        return (false);
      }
	  
	 var filter1 = /\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi;
     if (filter1.test(theForm.your_email.value) != true){
     alert("Your  email address does not appear to be valid.");
     theForm.your_email.focus();
     return (false);
	 }

else {theForm.submit();}
	  
}

function validateCall(theForm) {

     if (theForm.name.value.length==0){
        alert('Need your name');
		theForm.name.focus();
        return (false);
      }
	  
	  if (theForm.phone.value.length==0){
		alert('Need your phone number');
	    theForm.phone.focus();
        return (false);
      }
	  
	  if (theForm.email.value.length==0){
		alert('Need your email address');
        theForm.email.focus();
		return (false);
      }
	  
	 var filter1 = /\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi;
     if (filter1.test(theForm.email.value) != true){
     alert("Your email address does not appear to be valid.");
     theForm.email.focus();
     return (false);
	 }
	 
else {theForm.submit();}
	  
}

