//<!-- =================================================================== -->
// validate industry insight series form
function checkIndustryInsightSeries(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validAlphaCharSymField(theForm.fullName,1))
   {
      alert("Please enter a valid name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.fullName.focus();
      return false;
   }

   if (!validAlphaCharSymField(theForm.company,1))
   {
      alert("Please enter a valid company name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.company.focus();
      return false;
   }

   if (!validEmailField(theForm.email,1))
   {
      alert("Please enter a valid email.");
      theForm.email.focus();
      return false;
   }

// phone field no longer optional
//   if(theForm.phone.value.length != 0)
//   {
//      if (!validPhoneField(theForm.phone,10,25))
//      {
//         alert("Please enter a valid 10 digit phone number. \nSymbols allowed: ( ) - . and leading +");
//         theForm.phone.focus();
//         return false;
//      }
//   }

   if (!answeredButtongrp(theForm.cbRegisterFor))
   {
      alert("What would you like to register for? \nPlease select at least one checkbox.");
      return false;
   }

// passed form validation...
   // submit form
   theForm.submit();
}


//<!-- =================================================================== -->
// validate webcast form
function checkWebcast(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validAlphaCharSymField(theForm.fullName,1))
   {
      alert("Please enter a valid name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.fullName.focus();
      return false;
   }

   if (!validEmailField(theForm.email,1))
   {
      alert("Please enter a valid email.");
      theForm.email.focus();
      return false;
   }

   if(theForm.phone.value.length != 0)
   {
      if (!validPhoneField(theForm.phone,10,25))
      {
         alert("Please enter a valid 10 digit phone number. \nSymbols allowed: ( ) - . and leading +");
         theForm.phone.focus();
         return false;
      }
   }

// passed form validation...

   // submit form
   theForm.submit();
}




//<!-- =================================================================== -->
// validate white paper form
function checkWhitePaper(theForm, googleAnalyticsLink)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validAlphaCharSymField(theForm.fullName,1))
   {
      alert("Please enter a valid name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.fullName.focus();
      return false;
   }

   if (!validEmailField(theForm.email,1))
   {
      alert("Please enter a valid email.");
      theForm.email.focus();
      return false;
   }

//   if(theForm.phone.value.length != 0)
//   {
//      if (!validPhoneField(theForm.phone,10,25))
//      {
//         alert("Please enter a valid 10 digit phone number. \nSymbols allowed: ( ) - . and leading +");
//         theForm.phone.focus();
//         return false;
//      }
//   }

/*
   if (!validAlphaCharSymField(theForm.firstName,1))
   {
      alert("Please enter a valid first name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.firstName.focus();
      return false;
   }

   if (!validAlphaCharSymField(theForm.lastName,1))
   {
      alert("Please enter a valid last name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.lastName.focus();
      return false;
   }

   if (!validAlphaCharSymField(theForm.company,1))
   {
      alert("Please enter a valid company name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.company.focus();
      return false;
   }

   if (!validPhoneField(theForm.phone,10,25))
   {
      alert("Please enter a valid 10 digit phone number. \nSymbols allowed: ( ) - . and leading +");
      theForm.phone.focus();
      return false;
   }

   if (!validEmailField(theForm.email,1))
   {
      alert("Please enter a valid email.");
      theForm.email.focus();
      return false;
   }

   if (!answeredButtongrp(theForm.numInCompany))
   {
      alert("Please select # in company.");
      return false;
   }

   if (!answeredButtongrp(theForm.purchaseTimeFrame))
   {
      alert("Please select purchase time frame.");
      return false;
   }

   if (!validAllCharExceptField(theForm.comments))
   {
      alert("Additional Information field contains invalid symbol(s): # % * = \"");
      theForm.comments.focus();
      return false;
   }
*/

// passed form validation...

   // add google tracking
   if(googleAnalyticsLink)
   {
      urchinTracker(googleAnalyticsLink);
   }

   // submit form
   theForm.submit();
}


//<!-- =================================================================== -->
// Unsubscribe (Opt out) of email lists
function checkUnsubscribe(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validEmailField(theForm.email,1))
   {
      alert("Please enter a valid email.");
      theForm.email.focus();
      return false;
   }
   theForm.submit();
}


//<!-- =================================================================== -->
// validate login form
function checkLogin(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validAlphaCharsField(theForm.userID,1))
   {
      alert("Please enter a valid user name.");
      theForm.userID.focus();
      return false;
   }

   if (!validAlphaCharsField(theForm.password,1))
   {
      alert("Please enter a valid password.");
      theForm.password.focus();
      return false;
   }

   // submit form
   theForm.submit();
}


//<!-- =================================================================== -->
// validate invite form
function checkInvite(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validAlphaCharSymField(theForm.inviterFirstName,1))
   {
      alert("Please enter a valid first name for inviter. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.inviterFirstName.focus();
      return false;
   }

   if (!validEmailField(theForm.inviterEmail,1))
   {
      alert("Please enter a valid email for inviter.");
      theForm.inviterEmail.focus();
      return false;
   }


   if (!validAlphaCharSymField(theForm.inviteeFirstName,1))
   {
      alert("Please enter a valid first name for invitee. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.inviteeFirstName.focus();
      return false;
   }

   if (!validAlphaCharSymField(theForm.inviteeLastName,1))
   {
      alert("Please enter a valid last name for invitee. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.inviteeLastName.focus();
      return false;
   }

   if (!validEmailField(theForm.inviteeEmail,1))
   {
      alert("Please enter a valid email for invitee.");
      theForm.inviteeEmail.focus();
      return false;
   }

   if (!validAllCharExceptField(theForm.introText))
   {
      alert("Intro text contains invalid symbol(s): # % * = \"");
      theForm.introText.focus();
      return false;
   }

   // submit form
   theForm.submit();
}


//<!-- =================================================================== -->
// validate RSVP form
function checkRSVP(theForm)
{ 	
   if (!document.getElementById)
   {
      return true;  // not available on this browser - leave validation to the server
   }

   if (!validEmailField(theForm.inviteeEmail,1))
   {
      alert("Please enter a valid email.");
      theForm.inviteeEmail.focus();
      return false;
   }


   if (!validAlphaCharSymField(theForm.inviteeFirstName,1))
   {
      alert("Please enter a valid first name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.inviteeFirstName.focus();
      return false;
   }

   if (!validAlphaCharSymField(theForm.inviteeLastName,1))
   {
      alert("Please enter a valid last name. \nSymbols allowed: - _ . , ' ( ) & / :");
      theForm.inviteeLastName.focus();
      return false;
   }

   if(theForm.inviteePhone.value.length != 0)
   {
      if (!validPhoneField(theForm.inviteePhone,10,25))
      {
         alert("Please enter a valid 10 digit phone number. \nSymbols allowed: ( ) - . and leading +");
         theForm.inviteePhone.focus();
         return false;
      }
   }

   if (!answeredButtongrp(theForm.attending))
   {
      alert("Please let us know if you will be attending.");
      return false;
   }

   if (!validAllCharExceptField(theForm.addlInfo))
   {
      alert("Additional Information field contains invalid symbol(s): # % * = \"");
      theForm.addlInfo.focus();
      return false;
   }

   // submit form
   theForm.submit();
}


//<!-- =================================================================== -->
