function AgentValidateForm(theForm)
{
  if (theForm.First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.First_Name.focus();
    return (false);
  }
  if (theForm.First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.First_Name.focus();
    return (false);
  }

  if (theForm.Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Last_Name.focus();
    return (false);
  }
  if (theForm.Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Last_Name.focus();
    return (false);
  }

  if (theForm.Address.value == "")
  {
    alert("Please enter a value for the \" Address\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.Address.value.length <5)
  {
    alert("Address Entered is too short");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length <2)
  {
    alert("City Entered is too short");
    theForm.City.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex < 0)
  {
    alert("Please select one of the \" State\" options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex == 0)
  {
    alert("The first \" State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.Zip1.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (theForm.Zip1.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip1.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip2.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \"Zip Code (Part 2)\" field.");
    theForm.Zip2.focus();
    return (false);
  }

  var checkStr = theForm.Phone1.value;

  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Area Code)\" field.");
    theForm.Phone1.focus();
    return (false);
  }

   checkStr = theForm.Phone2.value;
   
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 2)\" field.");
    theForm.Phone2.focus();
    return (false);
  }
	
	checkStr = theForm.Phone3.value;
	
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 4))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 3)\" field.");
    theForm.Phone3.focus();
    return (false);
  }


   if (isEmail(theForm.Email.value)==false)
	{
		alert("Please enter a valid Email address");
		theForm.Email.focus();
		return (false);
	}

  if (theForm.Operation.value==0)
  {		
  if (theForm.hearaboutus.selectedIndex < 0)
  {
    alert("Please select one of the \"Hear About Us\" options.");
    theForm.hearaboutus.focus();
    return (false);
  }

  if (theForm.hearaboutus.selectedIndex == 0)
  {
    alert("The first \"Hear About Us\" option is not a valid selection.  Please choose one of the other options.");
    theForm.hearaboutus.focus();
    return (false);
  }
  
   if (theForm.UserName.value == "")
  {
    alert("Please enter a value for the \"User Name\" field.");
    theForm.UserName.focus();
    return (false);
  }

  if (theForm.UserName.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User Name\" field.");
    theForm.UserName.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.UserName.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"User Name\" field.");
    theForm.UserName.focus();
    return (false);
  }

  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length <5)
  {
    alert("Please enter at least 5 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Password.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }
  }
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function EditMemberValidateForm(theForm)
{
  if (theForm.First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.First_Name.focus();
    return (false);
  }

  if (theForm.First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.First_Name.focus();
    return (false);
  }

  if (theForm.Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Last_Name.focus();
    return (false);
  }

  if (theForm.Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Last_Name.focus();
    return (false);
  }

  if (theForm.hint.selectedIndex <= 0)
  {
    alert("Please select a hint for password protection.");
    theForm.hint.focus();
    return (false);
  }  
  
  if (theForm.HintAns.value == "")
  {
    alert("Please enter a value for the \" Hint Answer\" field.");
    theForm.HintAns.focus();
    return (false);
  }

  var checkStr = theForm.Phonex1.value;

  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Area Code)\" field.");
    theForm.Phonex1.focus();
    return (false);
  }

   checkStr = theForm.Phonex2.value;
   
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 2)\" field.");
    theForm.Phonex2.focus();
    return (false);
  }
	
	checkStr = theForm.Phonex3.value;
	
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 4))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 3)\" field.");
    theForm.Phonex3.focus();
    return (false);
  }


   if (isEmail(theForm.Email.value)==false)
	{
		alert("Please enter a valid Email address");
		theForm.Email.focus();
		return (false);
	}

  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \" Address (1)\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length <5)
  {
    alert("Address (1) Entered is too short");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length <2)
  {
    alert("City Entered is too short");
    theForm.City.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex < 0)
  {
    alert("Please select one of the \" State\" options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex == 0)
  {
    alert("The first \" State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.Zip1.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (theForm.Zip1.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip1.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip2.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \"Zip Code (Part 2)\" field.");
    theForm.Zip2.focus();
    return (false);
  }
  if (theForm.isFree.value!=1)
  {
  if (theForm.Holder_First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.Holder_First_Name.focus();
    return (false);
  }

  if (theForm.Holder_First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.Holder_First_Name.focus();
    return (false);
  }
  
  if (theForm.Holder_Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }

  if (theForm.Holder_Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }  

  if (theForm.paymentmethodid.selectedIndex <= 0)
  {
    alert("Please select a valid payment method option.");
    theForm.paymentmethodid.focus();
    return (false);
  }

if (theForm.paymentmethodid.value==1)	
{
  if (theForm.mcardtype.selectedIndex < 0)
  {
    alert("Please select one of the \" Credit Card Type\" options.");
    theForm.mcardtype.focus();
    return (false);
  }

  if (theForm.mcardtype.selectedIndex == 0)
  {
    alert("The first \" Credit Card Type\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mcardtype.focus();
    return (false);
  }
  
  if (theForm.mCardNo.value == "")
  {
    alert("Please enter valid credit card number.");
    theForm.mCardNo.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Month)\" options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex == 0)
  {
    alert("The first \" Expiration (Month)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Year)\" options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex == 0)
  {
    alert("The first \" Expiration (Year)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (CheckCreditCard(theForm.mCardNo.value,theForm.mcardtype.value)==false)
  {
    alert("Credit card number entered is invalid.");
    theForm.mCardNo.focus();
    return (false);
  }
  }
/*if (theForm.paymentmethodid.value==2)	
{
  if (theForm.Check_Number.value == "")
  {
    alert("Please enter valid check number.");
    theForm.Check_Number.focus();
    return (false);
  }
}  
*/  
  
  }
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function EditBusinessValidateForm(theForm)
{
  if (theForm.Listing_Name.value == "")
  {
    alert("Please enter a value for the \" Business Name\" field.");
    theForm.Listing_Name.focus();
    return (false);
  }

  if (theForm.Listing_Name.value.length <2)
  {
    alert("Business Name Entered is too short.");
    theForm.Listing_Name.focus();
    return (false);
  }

  if (theForm.sectorid.selectedIndex <= 0)
  {
    alert("Please select a Business Sector.");
    theForm.sectorid.focus();
    return (false);
  }  
  
   if ((theForm.Email_Address1.value.length>0) && (isEmail(theForm.Email_Address1.value)==false))
	{
		alert("Email address Entered is Invalid...");
		theForm.Email_Address1.focus();
		return (false);
	}

   if ((theForm.Email_Address2.value.length>0) && (isEmail(theForm.Email_Address2.value)==false))
	{
		alert("Email address Entered is Invalid...");
		theForm.Email_Address2.focus();
		return (false);
	}

  var checkStr = theForm.Phonex1.value;

  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Area Code)\" field.");
    theForm.Phonex1.focus();
    return (false);
  }

   checkStr = theForm.Phonex2.value;
   
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 2)\" field.");
    theForm.Phonex2.focus();
    return (false);
  }
	
	checkStr = theForm.Phonex3.value;
	
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 4))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 3)\" field.");
    theForm.Phonex3.focus();
    return (false);
  }

  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \" Address (1)\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length <5)
  {
    alert("Address (1) Entered is too short");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length <2)
  {
    alert("City Entered is too short");
    theForm.City.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex < 0)
  {
    alert("Please select one of the \" State\" options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex == 0)
  {
    alert("The first \" State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.Zip1.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (theForm.countryid.selectedIndex == 0)
  {
  if (theForm.Zip1.value.length < 5)
  {
    alert("Please enter at least 5 digits in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }
}

if (theForm.countryid.selectedIndex == 0)
{
  if (checkalphanumeric(theForm.Zip1.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }
}

  if (checkalphanumeric(theForm.Zip2.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \"Zip Code (Part 2)\" field.");
    theForm.Zip2.focus();
    return (false);
  }

  return (true);
}
////////////////////////////////////////////////////////////////////////////

function SignupValidateForm1(theForm)
{
  if (theForm.Listing_Name.value == "")
  {
    alert("Please enter a value for the \" Listing Name \" field.");
    theForm.Listing_Name.focus();
    return (false);
  }

  if (theForm.Listing_Name.value.length <2)
  {
    alert("Listing Name  Entered is too short.");
    theForm.Listing_Name.focus();
    return (false);
  }

  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \" Address (1)\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length <5)
  {
    alert("Address (1) Entered is too short");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length <2)
  {
    alert("City Entered is too short");
    theForm.City.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex < 0)
  {
    alert("Please select one of the \" State\" options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.stateid.selectedIndex == 0)
  {
    alert("The first \" State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateid.focus();
    return (false);
  }

  if (theForm.Zip1.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (theForm.Zip1.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip1.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.Zip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.Zip2.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \"Zip Code (Part 2)\" field.");
    theForm.Zip2.focus();
    return (false);
  }

  var checkStr = theForm.Phonex1.value;

  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Area Code)\" field.");
    theForm.Phonex1.focus();
    return (false);
  }

   checkStr = theForm.Phonex2.value;
   
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 2)\" field.");
    theForm.Phonex2.focus();
    return (false);
  }
	
	checkStr = theForm.Phonex3.value;
	
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 4))
  {
    alert("Please enter only digit characters in the \" Phone Number (Part 3)\" field.");
    theForm.Phonex3.focus();
    return (false);
  }

  if (theForm.sectorid.selectedIndex < 0)
  {
    alert("Please select one of the \"Business Sector\" options.");
    theForm.sectorid.focus();
    return (false);
  }

  if (theForm.sectorid.selectedIndex == 0)
  {
    alert("The first \"Business Sector\" option is not a valid selection.  Please choose one of the other options.");
    theForm.sectorid.focus();
    return (false);
  }


  if (theForm.hearaboutus.selectedIndex < 0)
  {
    alert("Please select one of the \"Hear About Us\" options.");
    theForm.hearaboutus.focus();
    return (false);
  }

  if (theForm.hearaboutus.selectedIndex == 0)
  {
    alert("The first \"Hear About Us\" option is not a valid selection.  Please choose one of the other options.");
    theForm.hearaboutus.focus();
    return (false);
  }
  

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function SignupValidateForm2(theForm)
{
  if (theForm.mFirst_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.mFirst_Name.focus();
    return (false);
  }

  if (theForm.mFirst_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.mFirst_Name.focus();
    return (false);
  }
  
  if (theForm.mLast_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.mLast_Name.focus();
    return (false);
  }

  if (theForm.mLast_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.mLast_Name.focus();
    return (false);
  }  

  if (theForm.mAddress1.value == "")
  {
    alert("Please enter a value for the \" Address (1) \" field.");
    theForm.mAddress1.focus();
    return (false);
  }

  if (theForm.mAddress1.value.length <5)
  {
    alert("Address (1) Entered is too short");
    theForm.mAddress1.focus();
    return (false);
  }

  if (theForm.mCity.value == "")
  {
    alert("Please enter a value for the \" City\" field.");
    theForm.mCity.focus();
    return (false);
  }

  if (theForm.mCity.value.length <2)
  {
    alert("City Entered is too short");
    theForm.mCity.focus();
    return (false);
  }

  if (theForm.mstateid.selectedIndex < 0)
  {
    alert("Please select one of the \" State\" options.");
    theForm.mstateid.focus();
    return (false);
  }

  if (theForm.mstateid.selectedIndex == 0)
  {
    alert("The first \" State\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mstateid.focus();
    return (false);
  }

  if (theForm.mZip1.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.mZip1.focus();
    return (false);
  }

  if (theForm.mZip1.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.mZip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.mZip1.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.mZip1.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.mZip2.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \"Zip Code (Part 2)\" field.");
    theForm.mZip2.focus();
    return (false);
  }

  var checkStr = theForm.mPhonex1.value;

  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Primary Phone Number (Area Code)\" field.");
    theForm.mPhonex1.focus();
    return (false);
  }

   checkStr = theForm.mPhonex2.value;
   
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 3))
  {
    alert("Please enter only digit characters in the \" Primary Phone Number (Part 2)\" field.");
    theForm.mPhonex2.focus();
    return (false);
  }
	
	checkStr = theForm.mPhonex3.value;
	
  if ( (checkalphanumeric(checkStr)==false) || (checkStr.length < 4))
  {
    alert("Please enter only digit characters in the \" Primary Phone Number (Part 3)\" field.");
    theForm.mPhonex3.focus();
    return (false);
  }

   if (theForm.mEmail_Address1.value != "")
   {
   if (isEmail(theForm.mEmail_Address1.value)==false)
	{
		alert("Please enter a valid Email address");
		theForm.mEmail_Address1.focus();
		return (false);
	}
	}
	
   if (theForm.mUserName.value == "")
  {
    alert("Please enter a value for the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }

  if (theForm.mUserName.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.mUserName.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }

  if (theForm.mPassword.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.mPassword.focus();
    return (false);
  }

  if (theForm.mPassword.value.length <5)
  {
    alert("Please enter at least 5 characters in the \"Password\" field.");
    theForm.mPassword.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.mPassword.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"Password\" field.");
    theForm.mPassword.focus();
    return (false);
  }

  if (theForm.mhint.selectedIndex < 0)
  {
    alert("Please select one of the \"Password Question\" options.");
    theForm.mhint.focus();
    return (false);
  }

  if (theForm.mhint.selectedIndex == 0)
  {
    alert("The first \"Password Question\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mhint.focus();
    return (false);
  }
  
   if (theForm.mHintAns.value == "")
  {
    alert("Please enter a value for the \"Password Answer\" field.");
    theForm.mHintAns.focus();
    return (false);
  }
  
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function SignupValidateForm3(theForm)
{
  if (theForm.Holder_First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.Holder_First_Name.focus();
    return (false);
  }

  if (theForm.Holder_First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.Holder_First_Name.focus();
    return (false);
  }
  
  if (theForm.Holder_Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }

  if (theForm.Holder_Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }  

  if (theForm.mcardtype.selectedIndex < 0)
  {
    alert("Please select one of the \" Credit Card Type\" options.");
    theForm.mcardtype.focus();
    return (false);
  }

  if (theForm.mcardtype.selectedIndex == 0)
  {
    alert("The first \" Credit Card Type\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mcardtype.focus();
    return (false);
  }
  
  if (theForm.mCardNo.value == "")
  {
    alert("Please enter valid credit card number.");
    theForm.mCardNo.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Month)\" options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex == 0)
  {
    alert("The first \" Expiration (Month)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Year)\" options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex == 0)
  {
    alert("The first \" Expiration (Year)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (CheckCreditCard(theForm.mCardNo.value,theForm.mcardtype.value)==false)
  {
    alert("Credit card number entered is invalid.");
    theForm.mCardNo.focus();
    return (false);
  }
  
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function CheckCreditCard(CardNo,CardType)
{
// CCN_digits is where we store just the digits from the Card Number
	var CCN_digits = ""

// ------------------------------------------------------------------------------------------------------
// remove everything but the digits from the entered Card Number
// ------------------------------------------------------------------------------------------------------
	for (var i = 0; i < CardNo.length; i++)
		{
		if (jsVersion > 1.1)
			{
			if ((!isNaN(CardNo.charAt(i))) && (CardNo.charAt(i) != " "))
				CCN_digits = CCN_digits + CardNo.charAt(i);
			}
		else
			{
			if ((CardNo.charAt(i) == "0") || (CardNo.charAt(i) == "1") || (CardNo.charAt(i) == "2") || (CardNo.charAt(i) == "3") || (CardNo.charAt(i) == "4") || (CardNo.charAt(i) == "5") || (CardNo.charAt(i) == "6") || (CardNo.charAt(i) == "7") || (CardNo.charAt(i) == "8") || (CardNo.charAt(i) == "9"))
				CCN_digits = CCN_digits + CardNo.charAt(i);
			}
		}

// *** debug -----------------------------------------------------------------------
// alert ("CCN_digits.length = " + CCN_digits.length + " CCN_digits = " + CCN_digits);
// *** debug -----------------------------------------------------------------------

// ------------------------------------------------------------------------------------------------------
// validcard is the true/false indicator for a valid card - it is returned to the caller
// ------------------------------------------------------------------------------------------------------
	var validcard = false;

// ------------------------------------------------------------------------------------------------------
// msgind is used to communicate the type of alert to post in case of a problem
//	1=invalid prefix (prefix does not match card type)
//	2=invalid number of digits in card number for the card type selected
// ------------------------------------------------------------------------------------------------------
	var msgind = 0;

// ------------------------------------------------------------------------------------------------------
// Check the card for having a valid prefix and number of digits (length) for the card type.
// Note - the if, else if construct was used here because switch/case is not supported by JavaScript 1.0
// ------------------------------------------------------------------------------------------------------
//							AMEX		DISCOVER		MASTERCARD		VISA
// ------------------------------------------------------------------------------------------------------
//		VALID LENGTHS		 15				  16			16			13/16
// ------------------------------------------------------------------------------------------------------
//		VALID PREFIXES	 34				6011			51			  4
//							 37								52
//							 								53
//							 								54
//							 								55
// ------------------------------------------------------------------------------------------------------
	if (CardType == "American Express")
		if (CCN_digits.length == 15)
			if ((CCN_digits.substring (0, 2) == "34") || (CCN_digits.substring (0, 2) == "37"))
				validcard = true;
			else
				msgind = 1;
		else	
			msgind = 2;
	else if (CardType == "Discover")
		if (CCN_digits.length == 16)
			if (CCN_digits.substring (0, 4) == "6011")
				validcard = true;
			else
				msgind = 1;
		else	
			msgind = 2;
	else if (CardType == "Master Card")
		if (CCN_digits.length == 16)
			if ((CCN_digits.substring (0, 2) >= "51") && (CCN_digits.substring (0, 2) <= "55"))
				validcard = true;
			else
				msgind = 1;
		else	
			msgind = 2;
	else if (CardType == "Visa")
		if ((CCN_digits.length == 16)  || (CCN_digits.length ==13))
			if (CCN_digits.substring (0, 1) == "4")
				validcard = true;
			else
				msgind = 1;
		else	
			msgind = 2;
	else
// ------------------------------------------------------------------------------------------------------
// this should be impossible to reach as long as all valid card types are in the list above....
// ------------------------------------------------------------------------------------------------------
		//alert ("Sorry, "+ CardType + " is not currently being accepted - please contact us by phone or email.");

	if (!validcard)
		{
		if (msgind == 1)
// ------------------------------------------------------------------------------------------------------
//			Invalid prefix
// ------------------------------------------------------------------------------------------------------
			alert ("The Card Number ("+CardNo + ") and the Card Type (" + CardType + ") do not match.");

		else if (msgind == 2)
// ------------------------------------------------------------------------------------------------------
//			Invalid number of digits (length)
// ------------------------------------------------------------------------------------------------------
			alert ("The Card Number ("+CardNo + ") is not the right length for the Card Type (" + CardType + ").");
		}

	if (!validcard)
		return (validcard);



	var CheckSum = 0;
// for loop
	for (var x = 1; x <= CCN_digits.length; x++)
		{
// BUG-FIX 1999.12.21
//		var CurrentDigit = CCN_digits.charAt(CardNo.length - x); CHANGED TO:
		var CurrentDigit = CCN_digits.charAt(CCN_digits.length - x);
// BUG-FIX THANKS TO Curt Cloninger
// x is subtracted from the length of the CCN to point at the digits from RIGHT to LEFT
		if (x % 2 == 0)
			{
// even position in credit card number (2nd, 4th, etc. from RIGHT of Credit Card Number)
			var WorkDigit = CurrentDigit * 2;	
			if (WorkDigit > 9)
				{ 
				CheckSum = CheckSum + (1 - 0);
				CheckSum = CheckSum + (WorkDigit % 10 - 0);
				
				}
			else
				{
				CheckSum = CheckSum + (WorkDigit - 0);
				
				}	
			}
		else
			{
// odd position in credit card number (1st, 3rd, etc. from RIGHT of Credit Card Number)
			CheckSum = CheckSum + (CurrentDigit - 0);
			
			}
		}
// end for loop

	if (CheckSum % 10) 
		{ 
		validcard = false; 
		alert ("I'm sorry, the Card Number ("+ CardNo +") is not correct - perhaps there is a typo or two numbers are reversed?"); 
		} 
	
	return (validcard); 
	}
///////////////////////////////////////////////////////////////////////////////////
function SignupValidateForm4(theForm)
{
   if (theForm.mUserName.value == "")
  {
    alert("Please enter a value for the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }

  if (theForm.mUserName.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.mUserName.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"User Name\" field.");
    theForm.mUserName.focus();
    return (false);
  }
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function EmailValidateForm(theForm)
{
   if ((theForm.userid.value == "") || (theForm.userid.value.length > 32) || (theForm.userid.value.length <3))
  {
    alert("Your login id must be at least 3 characters and no greater than 32 characters.");
    theForm.userid.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.userid.value)==false)
  {
    alert("Invalid Character(s) in Login ID.");
    theForm.userid.focus();
    return (false);
  }

   if ((theForm.password.value == "") || (theForm.password.value.length > 32) || (theForm.password.value.length <4))
  {
    alert("Your password must be at least 4 characters and no greater than 32 characters.");
    theForm.password.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.password.value)==false)
  {
    alert("Invalid Character(s) in Password.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value !=theForm.password2.value)
  {
    alert("Password re-typed does not match your password");
    theForm.password2.focus();
    return (false);
  }

  if (theForm.security_question.selectedIndex <= 0)
  {
    alert("You Must Select a Security Question.");
    theForm.security_question.focus();
    return (false);
  }

   if (theForm.Security_Answer.value == "")
  {
    alert("Security Answer can not be left blank.");
    theForm.Security_Answer.focus();
    return (false);
  }

  if ((theForm.dob_month.selectedIndex <= 0) || (theForm.dob_day.value == "") || (theForm.dob_year.value == ""))
  {
    alert("Date of birth entered is invalid.");
    theForm.dob_month.focus();
    return (false);
  }

if (isNaN(Date.parse(theForm.dob_month.selectedIndex+'/'+theForm.dob_day.value+'/'+theForm.dob_year.value))==true)
{
    alert("Date of birth entered is invalid.");
    theForm.dob_month.focus();
    return (false);
  }

   if ((theForm.current_email.value.length>0) && (isEmail(theForm.current_email.value)==false))
	{
		alert("Please enter a valid Email address");
		theForm.current_email.focus();
		return (false);
	}

  if (theForm.first_name.value == "")
  {
    alert("Please enter a value for the first name.");
    theForm.first_name.focus();
    return (false);
  }

  if (theForm.last_name.value == "")
  {
    alert("Please enter a value for the last name.");
    theForm.last_name.focus();
    return (false);
  }

  if (theForm.Street_Address.value == "")
  {
    alert("Please enter a value for street address.");
    theForm.Street_Address.focus();
    return (false);
  }
  
  if (theForm.city.value == "")
  {
    alert("Please enter a value for the city.");
    theForm.city.focus();
    return (false);
  }

if (theForm.country.selectedIndex <= 0)
  {
    alert("select a country.");
    theForm.country.focus();
    return (false);
  }
  
if ((getSelectedValue(theForm.country) == 241) || (getSelectedValue(theForm.country) == 38)) 
  {
  if (theForm.state.selectedIndex <=0)
  {
    alert("select a state.");
    theForm.state.focus();
    return (false);
  }
  }

  if (theForm.zip_code.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }

  if (theForm.zip_code.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.zip_code.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }
  
  var checkStr = theForm.Phone.value;
  if (checkStr!="") {
  if ((checkalphanumeric(checkStr)==false) || (checkStr.length < 10))
  {
    alert("Phone Number is invalid or too short.");
    theForm.Phone.focus();
    return (false);
  }
  }

if (theForm.occupation.selectedIndex <= 0)
  {
    alert("Select your Occupation.");
    theForm.occupation.focus();
    return (false);
  }

if (theForm.industry.selectedIndex <= 0)
  {
    alert("Select your Industry.");
    theForm.industry.focus();
    return (false);
  }

if (theForm.sourceid.selectedIndex <= 0)
  {
    alert("Select how did you hear about us.");
    theForm.sourceid.focus();
    return (false);
  }
  
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function GetPasswordValidateForm(theForm)
{
  if (theForm.MemberUserName.value == "")
  {
    alert("Please enter a value for the User Name field.");
    theForm.MemberUserName.focus();
    return (false);
  }

if (theForm.security_question.selectedIndex <= 0)
  {
    alert("Select Security Question.");
    theForm.security_question.focus();
    return (false);
  }

if (theForm.security_question.selectedIndex <= 0)
  {
    alert("Select Security Question.");
    theForm.security_question.focus();
    return (false);
  }

  if (theForm.HintAns.value == "")
  {
    alert("Please enter a value for the Password Answer field.");
    theForm.HintAns.focus();
    return (false);
  }
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function ReferValidateForm(theForm)
{
  if (theForm.YourName.value == "")
  {
    alert("Please enter a value for Your Name field.");
    theForm.YourName.focus();
    return (false);
  }

   if (isEmail(theForm.YourEmail.value)==false)
	{
		alert("Your Email is Invalid.Please enter a valid Email address");
		theForm.YourEmail.focus();
		return (false);
	}

   if (isEmail(theForm.friendEmail.value)==false)
	{
		alert("Your friend Email is Invalid.Please enter a valid Email address");
		theForm.friendEmail.focus();
		return (false);
	}

  if (theForm.Comments.value == "")
  {
    alert("Please enter a value for Comments field.");
    theForm.Comments.focus();
    return (false);
  }

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function SupportValidateForm(theForm)
{
	if (theForm.Subject.value.length == 0)
	{
		alert("Please enter some text in the Subject");
		theForm.Subject.focus();
		return (false);
	}	

   if (isEmail(theForm.FromEmail.value)==false)
	{
		alert("Enter a valid Email Address");
		theForm.FromEmail.focus();
		return (false);
	}

	if (theForm.Message.value.length == 0)
	{
		alert("Please enter some text in the message");
		theForm.Message.focus();
		return (false);
	}	

	
	return true
}

///////////////////////////////////////////////////////////////////////////////////
function UpgradeValidateForm(theForm)
{
  if (theForm.Holder_First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.Holder_First_Name.focus();
    return (false);
  }

  if (theForm.Holder_First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.Holder_First_Name.focus();
    return (false);
  }
  
  if (theForm.Holder_Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }

  if (theForm.Holder_Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }  

  if (theForm.mcardtype.selectedIndex < 0)
  {
    alert("Please select one of the \" Credit Card Type\" options.");
    theForm.mcardtype.focus();
    return (false);
  }

  if (theForm.mcardtype.selectedIndex == 0)
  {
    alert("The first \" Credit Card Type\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mcardtype.focus();
    return (false);
  }
  
  if (theForm.mCardNo.value == "")
  {
    alert("Please enter valid credit card number.");
    theForm.mCardNo.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Month)\" options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex == 0)
  {
    alert("The first \" Expiration (Month)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Year)\" options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex == 0)
  {
    alert("The first \" Expiration (Year)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (CheckCreditCard(theForm.mCardNo.value,theForm.mcardtype.value)==false)
  {
    alert("Credit card number entered is invalid.");
    theForm.mCardNo.focus();
    return (false);
  }

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function GreetingValidateForm(theForm)
{
var counter=0;
	for (var i = 0; i < theForm.mynd.length; i++) {
		if (theForm.mynd[i].checked) {
			counter=counter+1;
		}
	}	

  if (counter==0)	
  {	
    alert("Select a Card.");
	return false;
  }	
  
  if (theForm.Heading.value == "")
  {
    alert("Please enter heading for your card.");
    theForm.Heading.focus();
    return (false);
  }

   if (isEmail(theForm.tEmail.value)==false)
	{
		alert("Please enter a valid To Email address");
		theForm.tEmail.focus();
		return (false);
	}

   if (isEmail(theForm.fEmail.value)==false)
	{
		alert("Please enter a valid From Email address");
		theForm.fEmail.focus();
		return (false);
	}

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function GetAgentPasswordValidateForm(theForm)
{
  if (theForm.OldPassword.value == "")
  {
    alert("Please enter a value for the Old Password field.");
    theForm.OldPassword.focus();
    return (false);
  }

  if (theForm.NewPassword.value == "")
  {
    alert("Please enter a value for the New Password field.");
    theForm.NewPassword.focus();
    return (false);
  }

  if (theForm.NewPassword.value.length <5)
  {
    alert("Please enter at least 5 characters in the \"New Password\" field.");
    theForm.NewPassword.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.NewPassword.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"New Password\" field.");
    theForm.NewPassword.focus();
    return (false);
  }
  
  if (theForm.ConfirmNewPassword.value == "")
  {
    alert("Please enter a value for the Confirm New Password field.");
    theForm.ConfirmNewPassword.focus();
    return (false);
  }

  if (theForm.ConfirmNewPassword.value.length <5)
  {
    alert("Please enter at least 5 characters in the \"Confirm New Password\" field.");
    theForm.ConfirmNewPassword.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.ConfirmNewPassword.value)==false)
  {
    alert("Please enter only letter and digit characters in the \"Confirm New Password\" field.");
    theForm.ConfirmNewPassword.focus();
    return (false);
  }
  
  if (theForm.NewPassword.value != theForm.ConfirmNewPassword.value)
  {
    alert("Password confirmation does not match New Password.");
    theForm.ConfirmNewPassword.focus();
    return (false);
  }

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function Validate_PowerSearch(theForm)
{
	var tstring=theForm.SearchString.value;
	 if (tstring.length < 3)
		{
		  alert("Please enter at least 3 characters to search field.");
		  theForm.SearchString.focus();
		  return (false);
		}

 return true; 
}


///////////////////////////////////////////////////////////////////////////////////
function EventsValidateForm(theForm)
{
if (theForm.Event_Start.value.length <5)
  {
    alert("Event Start Date is invalid.");
    theForm.Event_Start.focus();
    return (false);
  }

if (theForm.Event_End.value.length >0)
  {
if (theForm.Event_End.value.length <5)
  {
    alert("Event End Date is invalid.");
    theForm.Event_End.focus();
    return (false);
  }  
  }

  if (theForm.Title.value.length <5)
  {
    alert("Title Entered is too short.");
    theForm.Title.focus();
    return (false);
  }

  if (theForm.URL.value.length <5)
  {
    alert("URL Entered is too short.");
    theForm.URL.focus();
    return (false);
  }

  if (theForm.Location.value.length <3)
  {
    alert("Location Entered is too short.");
    theForm.Location.focus();
    return (false);
  }
  
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function ClassValidateForm(theForm)
{
   if ((theForm.userid.value == "") || (theForm.userid.value.length > 32) || (theForm.userid.value.length <3))
  {
    alert("Your login id must be at least 3 characters and no greater than 32 characters.");
    theForm.userid.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.userid.value)==false)
  {
    alert("Invalid Character(s) in Login ID.");
    theForm.userid.focus();
    return (false);
  }

   if ((theForm.password.value == "") || (theForm.password.value.length > 32) || (theForm.password.value.length <4))
  {
    alert("Your password must be at least 4 characters and no greater than 32 characters.");
    theForm.password.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.password.value)==false)
  {
    alert("Invalid Character(s) in Password.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value !=theForm.password2.value)
  {
    alert("Password re-typed does not match your password");
    theForm.password2.focus();
    return (false);
  }

  if (theForm.security_question.selectedIndex <= 0)
  {
    alert("You Must Select a Security Question.");
    theForm.security_question.focus();
    return (false);
  }

   if (theForm.Security_Answer.value == "")
  {
    alert("Security Answer can not be left blank.");
    theForm.Security_Answer.focus();
    return (false);
  }

   if (isEmail(theForm.current_email.value)==false)
	{
		alert("Please enter a valid Email address");
		theForm.current_email.focus();
		return (false);
	}

  if (theForm.first_name.value == "")
  {
    alert("Please enter a value for the first name.");
    theForm.first_name.focus();
    return (false);
  }

  if (theForm.last_name.value == "")
  {
    alert("Please enter a value for the last name.");
    theForm.last_name.focus();
    return (false);
  }

  if (theForm.Street_Address.value == "")
  {
    alert("Please enter a value for street address.");
    theForm.Street_Address.focus();
    return (false);
  }
  
  if (theForm.city.value == "")
  {
    alert("Please enter a value for the city.");
    theForm.city.focus();
    return (false);
  }

if (theForm.country.selectedIndex <= 0)
  {
    alert("select a country.");
    theForm.country.focus();
    return (false);
  }
  
if ((getSelectedValue(theForm.country) == 241) || (getSelectedValue(theForm.country) == 38)) 
  {
  if (theForm.state.selectedIndex <=0)
  {
    alert("select a state.");
    theForm.state.focus();
    return (false);
  }
  }

  if (theForm.zip_code.value == "")
  {
    alert("Please enter a value for the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }

  if (theForm.zip_code.value.length < 5)
  {
    alert("Please enter at 5 digits in the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }

  if (checkalphanumeric(theForm.zip_code.value)==false)
  {
    alert("Please enter only alphanumeric characters in the \" Zip Code\" field.");
    theForm.zip_code.focus();
    return (false);
  }
  
  var checkStr = theForm.Phone.value;
  if (checkStr!="") {
  if ((checkalphanumeric(checkStr)==false) || (checkStr.length < 10))
  {
    alert("Phone Number is invalid or too short.");
    theForm.Phone.focus();
    return (false);
  }
  }
 
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
function ClassifiedReply(theForm)
{
	if (theForm.Name.value.length == 0)
	{
		alert("Please your Name");
		theForm.Name.focus();
		return (false);
	}	

   if (isEmail(theForm.Email.value)==false)
	{
		alert("Enter a valid Email Address");
		theForm.Email.focus();
		return (false);
	}

	if (theForm.Subject.value.length == 0)
	{
		alert("Please enter some text in the Subject");
		theForm.Subject.focus();
		return (false);
	}	

	if (theForm.Message.value.length == 0)
	{
		alert("Please enter some text in the message");
		theForm.Message.focus();
		return (false);
	}	

	
	return true
}

///////////////////////////////////////////////////////////////////////////////////
function AdValidateForm(theForm)
{

if (theForm.opr.value==1)
{
  if (theForm.classid.selectedIndex < 0)
  {
    alert("Please select one of the \"Category\" options.");
    theForm.classid.focus();
    return (false);
  }

  if (theForm.classid.selectedIndex == 0)
  {
    alert("Your Category selection is invalid.");
    theForm.classid.focus();
    return (false);
  }

  if (theForm.classsubid.selectedIndex < 0)
  {
    alert("Please select one of the \"Sub-Category\" options.");
    theForm.classsubid.focus();
    return (false);
  }

  if (theForm.classsubid.selectedIndex == 0)
  {
    alert("Your Sub-Category selection is invalid.");
    theForm.classsubid.focus();
    return (false);
  }

 }
 
  if (theForm.AD_Title.value == "")
  {
    alert("Please enter a value for the \" Title\" field.");
    theForm.AD_Title.focus();
    return (false);
  }

  if (theForm.AD_Title.value.length <3)
  {
    alert("Title Entered is too short.");
    theForm.AD_Title.focus();
    return (false);
  }

  if (theForm.AD_Quantity.value == "")
  {
    alert("Please enter a value for the \" Quantity\" field.");
    theForm.AD_Quantity.focus();
    return (false);
  }

  if (theForm.AD_Price.value == "")
  {
    alert("Please enter a value for the \" Price\" field.");
    theForm.AD_Price.focus();
    return (false);
  }
  
if (theForm.AD_Expires.value.length <5)
  {
    alert("Ad Expiration Date is invalid.");
    theForm.AD_Expires.focus();
    return (false);
  }

  if (theForm.AD_Description.value == "")
  {
    alert("Please enter a value for the \" Description\" field.");
    theForm.AD_Description.focus();
    return (false);
  }

  return (true);
}
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
function SignupValidateFormPayment(theForm)
{
  if (theForm.Holder_First_Name.value == "")
  {
    alert("Please enter a value for the \" First Name\" field.");
    theForm.Holder_First_Name.focus();
    return (false);
  }

  if (theForm.Holder_First_Name.value.length <2)
  {
    alert("First Name Entered is too short.");
    theForm.Holder_First_Name.focus();
    return (false);
  }
  
  if (theForm.Holder_Last_Name.value == "")
  {
    alert("Please enter a value for the \" Last Name\" field.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }

  if (theForm.Holder_Last_Name.value.length <2)
  {
    alert("Last Name Entered is too short.");
    theForm.Holder_Last_Name.focus();
    return (false);
  }  
//----------------------------- Credit Card --------------------------------
if (theForm.mPaymentMethodID.value==1)
{
  if (theForm.mcardtype.selectedIndex < 0)
  {
    alert("Please select one of the \" Credit Card Type\" options.");
    theForm.mcardtype.focus();
    return (false);
  }

  if (theForm.mcardtype.selectedIndex == 0)
  {
    alert("The first \" Credit Card Type\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mcardtype.focus();
    return (false);
  }
  
  if (theForm.mCardNo.value == "")
  {
    alert("Please enter valid credit card number.");
    theForm.mCardNo.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Month)\" options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpmonth.selectedIndex == 0)
  {
    alert("The first \" Expiration (Month)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpmonth.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex < 0)
  {
    alert("Please select one of the \"Expiration (Year)\" options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (theForm.mexpyear.selectedIndex == 0)
  {
    alert("The first \" Expiration (Year)\" option is not a valid selection.  Please choose one of the other options.");
    theForm.mexpyear.focus();
    return (false);
  }

  if (CheckCreditCard(theForm.mCardNo.value,theForm.mcardtype.value)==false)
  {
    alert("Credit card number entered is invalid.");
    theForm.mCardNo.focus();
    return (false);
  }
}
//------------------------ End Credit Card Check -------------------------------
if (theForm.mPaymentMethodID.value==2)
{
  if (theForm.mCheckNo.value == "")
  {
    alert("Please enter a value for the \" Check Number\" field.");
    theForm.mCheckNo.focus();
    return (false);
  }

}  
  
  return (true);
}
///////////////////////////////////////////////////////////////////////////////////