// 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.Name.value == "")
  {
    alert("Please enter your name.");
    form1.Name.focus();
    return (false);
  }

  if (form1.Title.value == "")
  {
    alert("Please enter your title.");
    form1.Title.focus();
    return (false);
  }

  if (form1.Company.value == "")
  {
    alert("Please enter your company name.");
    form1.Company.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 ( ( document.form1.Interest[0].checked == false )
    && ( document.form1.Interest[1].checked == false ) )
    {
        alert ( "Please tell us your interest." );
       return (false);
    }
  
  if ( ( document.form1.ITR[0].checked == false )
    && ( document.form1.DEMO[1].checked == false )
	&& ( document.form1.TSS[2].checked == false ) )
    {
        alert ( "Please tell us the event in which you are interested." );
       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);
}