<!--
function echeck(str) {

var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Please enter a valid email address")
return false
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Please enter a valid email address")
return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Please enter a valid email address")
return false
}

if (str.indexOf(at,(lat+1))!=-1){
alert("Please enter a valid email address")
return false
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Please enter a valid email address")
return false
}

if (str.indexOf(dot,(lat+2))==-1){
alert("Please enter a valid email address")
return false
}

if (str.indexOf(" ")!=-1){
alert("Please enter a valid email address")
return false
}

return true 
}


function validateForm(thisForm){
// Map the illegal JavaScript field names from salesforce.com here then validate the variable name
var FirstName = document.getElementById('first_name');
var LastName = document.getElementById('last_name');
var contactPref = document.getElementById('00N30000000xswv');
var Phone = document.getElementById('phone');
var contactTime = document.getElementById('00N30000000xsmr');
var email = document.getElementById('email');
var street = document.getElementById('street');
var City = document.getElementById('city');
var Country = document.getElementById('country');
var State = document.getElementById('state');
var PostCode = document.getElementById('zip');
var Campaign_ID = document.getElementById('Campaign_ID');
var reason = document.getElementById('00N30000000xvTy');
var description = document.getElementById('description');
var permission = document.getElementById('permission');

with (thisForm) {
if (FirstName.value.length < 1) {
alert("Please enter your first name.");
FirstName.focus();
} else if (LastName.value.length < 1) {
alert("Please enter your last name.");
LastName.focus();
} else if (Phone.value.length < 10) {
alert("Please enter your full phone number with area code.");
Phone.focus();
} else if (contactTime.selectedIndex == 0) {
alert("Please specify when you prefer to be contacted.");
contactTime.focus();
} else if ((email.value==null)||(email.value=="")){
alert("E-mail should contain a valid entry")
email.focus();
} else if (echeck(email.value)==false){
email.value=""
email.focus();
} else if (street.value.length == 0) {
alert("Please enter your street address.");
street.focus();
} else if (City.value.length < 2) {
alert("City must contain a valid entry.");
City.focus();
} else if (Country.selectedIndex == 0) {
alert("Country must contain a valid entry.");
Country.focus();
} else if (((Country.options[Country.selectedIndex].text.substr(0,13) == "United States") && (State.value.length < 2)) || ((Country.options[Country.selectedIndex].text.substr(0,13) == "Canada") && (State.value.length < 2))) {
alert("State/Province must contain a valid entry.");
State.focus();
} else if (((Country.options[Country.selectedIndex].text.substr(0,13) == "United States") && (PostCode.value.length < 5)) || ((Country.options[Country.selectedIndex].text.substr(0,13) == "Canada") && (PostCode.value.length < 6))) {
alert("Postal/Zip Code should contain a valid entry.");
PostCode.focus();
} else if (Campaign_ID.selectedIndex == 0) {
alert("Please tell us how you found us.");
Campaign_ID.focus();
} else if (reason.selectedIndex == 0) {
alert("Please the reason for your contact submission.");
reason.focus();
} else if (description.value.length < 2) {
alert("Please let us know how we may assist you.");
description.focus();
} else if (permission.value.length < 2) {
alert("Please confirm we have permission to contact you.");
permission.focus();
} else {
return true;
}
return false;
}
}
-->