
function changeStat(){
	var stat = "varholidayrentals.co.uk : The French properties holiday rentals";
	window.status = stat;
	return true;
}


function open_window(url) {
email = window.open(url,"eMail",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=800,height=300,left=400,top=100');
}

function open_window2(url) {
email = window.open(url,"eMail",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=800,height=300,left=400,top=100');
}


function open_window3(url) {
email = window.open(url,"eMail",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=800,height=300,left=400,top=100');
}


function open_window4(url) {
email = window.open(url,"eMail",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=800,height=300,left=400,top=100');
}

function open_windowGif(url) {
email = window.open(url,"eMail",'toolbar=0,location=0,directories=0,status=0,menubar=yes,scrollbars=yes,resizable=yes,left=0,top=0');
}




// Check for email address: look for [@] and [.] 

function isEmail(elm) {
    if (elm.value.indexOf("@") + "" != "-1" &&
        elm.value.indexOf(".") + "" != "-1" &&
        elm.value != "") 
    return true;
    else return false;
}

// Check for null and for empty

function isFilled(elm) {
    if (elm.value == "" ||
        elm.value == null) 
    return false;
    else return true;
}

// Check for value of 0

function select1(elm) {

    if (elm.value == "0") 
    return false;
    else return true;
}

function isInt(elm) {
var elmstr = elm.value + ""; 
    if (elmstr == "") return false;
    for (var i = 0; i < elmstr.length; i++) {
        if (elmstr.charAt(i) < "0" ||
            elmstr.charAt(i) > "9") {
        return false;
        }
    }
return true;
}


function isReady(form) {


    // is fname element filled?

    if (isFilled(form.fname) == false) {
    alert("Please enter your first name.");
    form.fname.focus();
    return false;
    }

    // is lname element filled?

    if (isFilled(form.lname) == false) {
    alert("Please enter your Last name.");
    form.lname.focus();
    return false;
    }

    // is address1 element filled?

    if (isFilled(form.address1) == false) {
    alert("Please enter your address.");
    form.address1.focus();
    return false;
    }


    // is town element filled?

    if (isFilled(form.town) == false) {
    alert("Please enter your town/city.");
    form.town.focus();
    return false;
    }

    // is postcode element filled?

    if (isFilled(form.postcode) == false) {
    alert("Please enter your postcode.");
    form.postcode.focus();
    return false;
    }



    // is telephone filled?

    if (isInt(form.tel) == false) { 
    alert("Please enter your telephone number.");
    form.tel.value = '';
    form.tel.focus();
    return false;
    }

    // is address element a real email address?

    if (isEmail(form.email) == false) { 
    alert("Please enter your email address.");
    form.email.focus();
    return false;
    }

    // is a property selected?
	
    if (select1(form.property) == false) { 
    alert("Please select a property");
    form.property.focus();
    return false;
    }

    // is a number of people?
	
    if (select1(form.numberofpeople) == false) { 
    alert("Please select the number of people");
    form.numberofpeople.focus();
    return false;
    }


    // is a arrival day selected?
	
    if (select1(form.arrivalday) == false) { 
    alert("Please select day of arrival");
    form.arrivalday.focus();
    return false;
    }

    // is a arrival month selected?
	
    if (select1(form.arrivalmonth) == false) { 
    alert("Please select the month of arrival");
    form.arrivalmonth.focus();
    return false;
    }

    // is arrival year selected

    if (select1(form.arrivalyear) == false) { 
    alert("Please select the year of arrival");
    form.arrivalyear.focus();
    return false;
    }

    // is depart day selected

    if (select1(form.departday) == false) { 
    alert("Please select the day of departure");
    form.departday.focus();
    return false;
    }

    // is depart month selected

    if (select1(form.departmonth) == false) { 
    alert("Please select the month of departure");
    form.departmonth.focus();
    return false;
    }


    // is depart day selected

    if (select1(form.departyear) == false) { 
    alert("Please select the year of departure");
    form.departyear.focus();
    return false;
    }

    // is cleaner selected

    if (select1(form.cleaner) == false) { 
    alert("Please select if you require a cleaner");
    form.cleaner.focus();
    return false;
    }


return true;
}

