<!-- mydia enterprises, inc --------------------------------------------------------------------->
<!-- javascript to validate the cabovillarentals.com form ----------------------------->

function check_first_choice(form) {
var first=document.forms[0].first_choice.value;
    if ( first == "none_selected") {
        alert("Please select your first choice for a rental.");
	 document.forms[0].first_choice.focus();
        return false;
    }
    else return true;
}

function check_second_choice(form) {
var second=document.forms[0].second_choice.value;
    if ( second == "none_selected") {
        alert("Please select your second choice for a rental.");
	 document.forms[0].second_choice.focus();
        return false;
    }
    else return true;
}

function check_third_choice(form) {
var third=document.forms[0].third_choice.value;
    if ( third == "none_selected") {
        alert("Please select your third choice for a rental.");
	 document.forms[0].third_choice.focus();
        return false;
    }
    else return true;
}

function check_dates(form) {
var month1=document.forms[0].starting_month.value;
var day1=document.forms[0].starting_date.value;
var year1=document.forms[0].starting_year.value;
var month2=document.forms[0].ending_month.value;
var day2=document.forms[0].ending_date.value;
var year2=document.forms[0].ending_year.value;
    if (month1 == month2 && day1 == day2 && year1 == year2) {
        alert("Please select a valid set of dates.");
	 document.forms[0].starting_month.focus();
        return false;
    }
    else return true;
}

function first_name(form){
var first_name=document.forms[0].first_name.value;
var first_length=first_name.length;
    if (first_length < 1) {
        alert("Please enter your first name.");
	document.forms[0].first_name.focus();
        return false;
    }
    else return true;
}

function last_name(form){
var last_name=document.forms[0].last_name.value;
var last_length=last_name.length;
    if (last_length < 1) {
        alert("Please enter your last name.");
	document.forms[0].last_name.focus();
        return false;
    }
    else return true;
}

function check_address(form){
var address=document.forms[0].address.value;
var address_length=address.length;
    if (address_length < 1) {
        alert("Please enter your address.");
	document.forms[0].address.focus();
        return false;
    }
    else return true;
}

function city(form){
var city=document.forms[0].city.value;
var city_length=city.length;
    if (city_length < 1) {
        alert("Please enter your city.");
	document.forms[0].city.focus();
        return false;
    }
    else return true;
}

function area_code1(form){
var area_code1=document.forms[0].phone_area_code.value;
var code1=area_code1.length;
    if (code1 != 3) {
        alert("Please enter a valid area code.");
	document.forms[0].phone_area_code.focus();
        return false;
    }
    else return true;
}

function phone_number1(form){
var phone=document.forms[0].phone_number.value;
var phone1=phone.length;
    if (phone1 < 7) {
        alert("Please enter a valid phone number.");
	document.forms[0].phone_number.focus();
        return false;
    }
    else return true;
}

function check_email(form){
var email=document.forms[0].email_address.value;
var input_len1=email.length;
    if (input_len1 == 0 || email.indexOf ('@', 0) == -1 || email == "user@domain.com") {
        alert("Please enter a valid e-mail address.");
	document.forms[0].email_address.focus();
        return false;
    }
    else return true;
}

function submitme(form) {
      if(check_first_choice(form) && check_second_choice(form) && check_third_choice(form) && check_dates(form) && first_name(form) && last_name(form) && check_address(form) && city(form) && area_code1(form) && phone_number1(form) && check_email(form)) {
           //alert("All input is acceptable."); 
           document.forms[0].action="http://www.webcom.com/cgi-bin/form";
	    document.forms[0].method="POST";
	    return true;
      }
      else return false;
}

<!-- end of javascript validation of the form -------------------------------------------------->
<!-- mydia enterprises, inc, http://www.meiconsulting.com/ ------------------------->