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("Invalid Email Address.")
return false
}

if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid Email Address.")
return false
}

if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid Email Address.")
return false
}

if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid Email Address.")
return false
}

if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid Email Address.")
return false
}

if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid Email Address.")
return false
}

if (str.indexOf(" ")!=-1){
alert("Invalid E-mail Address.")
return false
}

return true
}

function checkform ( form )
{

// ** START **

if(form.customfield_company.value == "") {
alert("Please enter your company name.");
return false;
}

var emailID=form.customfield_email;

if ((emailID.value==null)||(emailID.value=="")){
alert("Please enter your email address");
emailID.focus();
return false;
}
if (echeck(emailID.value)==false){
emailID.value="";
emailID.focus();
return false;
}
if(form.customfield_first_name.value == "") {
alert("Please enter your first name.");
return false;
}
if(form.customfield_last_name.value == "") {
alert("Please enter your last name.");
return false;
}
if(form.customfield_evening_phone.value == "") {
alert("Please enter your direct phone number.");
return false ;
}
if(form.customfield_day_phone.value == "") {
alert("Please enter your office phone number.");
return false ;
}
if(form.customfield_best_time_to_call.value == "") {
alert("Please enter the best time to call you.");
return false ;
}
if(form.customfield_address.value == "") {
alert("Please enter your mailing address.");
return false ;
}
if(form.customfield_city.value == "") {
alert("Please enter your city.");
return false ;
}
if(form.customfield_state.selectedIndex == 0) {
alert("Please select your state.");
return false ;
}
if(form.customfield_zip.value == "") {
alert("Please enter your zipcode.");
return false ;
}
if(form.customfield_portfolio_value.selectedIndex == 0) {
alert("Please select your portfolio value.");
return false ;
}
if(form.customfield_more_info.value == "") {
alert("Please send us any comments or notes you might have.");
return false ;
}
// ** END **
return true;
}
