// form script

function DisableSubmit() {

    var theMessage = "The following fields are required:         "
    var noErrors = theMessage

	// make sure field is not blank
	if (document.main_form.name.value=="") {
	theMessage = theMessage + "\n  - Name";
	}

	if (document.main_form.company_name.value=="") {
	theMessage = theMessage + "\n  - Comany Name";
	}

	if (document.main_form.phone.value=="") {
	theMessage = theMessage + "\n  - Contact Phone";
	}

	// validate an e-mail address
	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.main_form.email.value)){
	theMessage = theMessage + "\n  - E-mail address must be valid";
	}

    // Make sure a selection list is used
    var listCheck = document.main_form.interest.selectedIndex;
    if (document.main_form.interest.options[listCheck].value=="none" || document.main_form.interest.options[listCheck].value=="null") {
    theMessage = theMessage + "\n  - Please state the area of interest";
    }

	if (document.main_form.details.value=="Please enter your enquiry details..." || document.main_form.details.value=="")  {
	theMessage = theMessage + "\n  - Please detail your enquiry";
	}

    // If no errors, submit the form
    if (theMessage == noErrors) {

	document.main_form.Submit.disabled = true;
	document.main_form.Submit2.disabled = true;
	document.main_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