function newWin(elem) {
    var win = window.open(elem.href, "ashbury", "menubar=no,toolbar=no");
    return false;
}


function check_contact_form(ev) {
    gotowhich = "";
    textbox_OK(document.getElementById("query"), document.getElementById("query"));
    textbox_OK(document.getElementById("forename"), document.getElementById("forename"));
    textbox_OK(document.getElementById("surname"), document.getElementById("surname"));
    textbox_OK(document.getElementById("tel"), document.getElementById("tel"));
    email_OK(document.getElementById("email"), document.getElementById("email"));

    if (gotowhich != "") {
        gotowhich.focus();
        window.scrollBy(0, -50);
        alert("Please check the questions marked and try again.");
        YAHOO.util.Event.preventDefault(ev);
        return false;
    } else {
        return true;
    }
}




function ashburyAvailabilityChecker(id) {
 YAHOO.util.Event.onAvailable(id, this.handleOnAvailable, this);
}

ashburyAvailabilityChecker.prototype.handleOnAvailable = function() {
 if(this.id=="contactform") {
   YAHOO.util.Event.addListener(this, "submit", check_contact_form);
 }
}


var contactform = new ashburyAvailabilityChecker('contactform');


