// JavaScript Document


// THE LINK TO THIS HAS BEEN PLACED IN THE HEADER.PHP FILE OF THE VECTOR TEMPLATE


function validateForm(myForm) {
var alertMsg = "Please correct the following errors:\n";
if (myForm.your_name.value == "") alertMsg += "\nYour name has not been filled in";
if (validate_email(myForm.email)) 
{
// do nothing since we got a good e-mail
}
else {
	alertMsg += "\nYour email address appears to be filled in incorrectly";
}
if (myForm.phone.value == "") alertMsg += "\nYour phone number has not been filled in";
if (alertMsg != "Please correct the following errors:\n") {
alert(alertMsg);
return false;
} else {
return true;
} }



function validate_email(field)
{
with(field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
{return false;}
else {return true;}
}
}

function popUp(pagename, window_width1, window_height1) 
{
    windowHandle = window.open(pagename,'windowName',',scrollbars=no,resizable=no,toolbar=no,menubar=no,width='+window_width1+',height='+window_height1);
}
