// JavaScript Document




function isEmailAddr(ContactEmail)
{
  var result = false
  var theStr = new String(ContactEmail)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FormValidator(form1)
{

  if (form1.ContactName.value == "")
  {
    alert("Please enter your name.");
    form1.ContactName.focus();
    return (false);
  }

  if (form1.ContactEmail.value == "")
  {
    alert("Please enter your e-mail address.");
    form1.ContactEmail.focus();
    return (false);
  }

  if (!isEmailAddr(form1.ContactEmail.value))
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    form1.ContactEmail.focus();
    return (false);
  }
   
  if (form1.ContactEmail.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"email\" field.");
    form1.ContactEmail.focus();
    return (false);
  }
  
  if (form1.Phone.value == "")
  {
    alert("Please enter your phone number.");
    form1.Phone.focus();
    return (false);
  }
  
  if (form1.CompanyName.value == "")
  {
    alert("Please enter your company's name.");
    form1.CompanyName.focus();
    return (false);
  }
  
  if ( ( document.form1.SponsorshipLevel[0].checked == false )
    && ( document.form1.SponsorshipLevel[1].checked == false )
	&& ( document.form1.SponsorshipLevel[2].checked == false ) )
    {
        alert ( "Please tell us your sponsorship level." );
       return (false);
    }
  
  
  if (form1.Track.value == "")
  {
    alert("Please enter your Technology Track.");
    form1.Track.focus();
    return (false);
  }
    
	
  if ( ( document.form1.EmailType[0].checked == false )
    && ( document.form1.EmailType[1].checked == false ) )
    {
        alert ( "Please specify an email type." );
       return (false);
    }	
	
	
	
  if (form1.PrivacyPolicy.value == "")
  {
    alert("Please enter a link to your privacy policy.");
    form1.PrivacyPolicy.focus();
    return (false);
  }
  
  if (form1.Address.value == "")
  {
    alert("Please enter your company's address.");
    form1.Address.focus();
    return (false);
  }
  
  if (form1.City.value == "")
  {
    alert("Please enter your company's city.");
    form1.City.focus();
    return (false);
  }
  
  if (form1.State.value == "")
  {
    alert("Please enter your company's state.");
    form1.State.focus();
    return (false);
  }
  
  if (form1.Zip.value == "")
  {
    alert("Please enter your company's zip code.");
    form1.Zip.focus();
    return (false);
  }
  
    if (form1.Description.value == "")
  {
    alert("Please enter a description.");
    form1.Description.focus();
    return (false);
  }
  
   	if ( ( document.form1.Agree.checked == false ) )
    {
        alert ( "Please agree to the terms." );
       return (false);
    }
   
  
 /* if (form1.ProductDescription.value.length > 200)
  {
    alert("Your \"product description\" is too long.  Please edit for length.");
    form1.ProductDescription.focus();
    return (false);
  }*/
var maxwords=80
if (document.images){
var temp=form1.ProductDescription.value.split(" ")
if (temp.length>maxwords){
alert("Your \"product description\" is too long.  Please edit for length.")
return false
}
}
  
  return (true);
}