// form script

function DisableSubmit() {

    var theMessage = "The following fields are required:    "
    var noErrors = theMessage

	// make sure field is not blank
	if (document.quick_form.full_name.value=="") {
	theMessage = theMessage + "\n  - Full Name";
	}

	if (document.quick_form.address.value=="") {
	theMessage = theMessage + "\n  - Address";
	}

	if (document.quick_form.city.value=="") {
	theMessage = theMessage + "\n  - City";
	}
	
	if (document.quick_form.post_code.value=="") {
	theMessage = theMessage + "\n  - Post Code";
	}
	
	if (document.quick_form.phone.value=="") {
	theMessage = theMessage + "\n  - Contact Phone";
	}

	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.quick_form.email.value)){
	theMessage = theMessage + "\n  - E-mail address must be valid";
	}
	
	// check confirmation email
	if (document.quick_form.email.value != document.quick_form.email2.value){
	theMessage = theMessage + "\n  - Confirmation E-mail does not match";
	}

    // Make sure a selection list is used
    var listCheck = document.quick_form.area.selectedIndex;
    if (document.quick_form.area.options[listCheck].value=="none" || document.quick_form.area.options[listCheck].value=="null") {
    theMessage = theMessage + "\n  - Please state the area of interest";
    }

	if (document.quick_form.details.value=="Please enter your enquiry details..." || document.quick_form.details.value=="")  {
	theMessage = theMessage + "\n  - Please detail your enquiry";
	}

    // If no errors, submit the form
    if (theMessage == noErrors) {

	document.quick_form.Submit.disabled = true;
	document.quick_form.Submit2.disabled = true;
	document.quick_form.submit();


    } else {

    // If errors were found, show alert message
    alert(theMessage);
    return false;
    }
}

function clearText(thefield)
				{
					if (thefield.defaultValue == thefield.value)
									thefield.value = ""

				} 

// end form script