function isNum(value)
{ 
	for (i = 0; i < value.length; i++) 
	{
		c = value.charAt(i);
		if ( c < "0"  ||  c > "9" )
			return false;
	}
	return true;
}

function isEmail(string) 
{
   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()&$#%";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}                      
function isProper(string) 
{
   if (!string) return false;
   var iChars = "*|\\:<>[]{}`/;()@&$#%+~^=";

   for (var i = 0; i < string.length; i++) {
      if (iChars.indexOf(string.charAt(i)) != -1)
         return false;
   }
   return true;
}    

function validator(theForm)
{


var nextstep = false;
for(var i=0; i<theForm.MovingForward.length; i++)
    {
    if(theForm.MovingForward[i].checked)
      {
        nextstep= true;
      }
    }

if (nextstep == "")
  {
   alert("Please choose how you would like to move forward with getting information on TALX solutions.");
   return false;
  } 


var verifications = false;
for(var i=0; i<theForm.Verifications.length; i++)
    {
     if(theForm.Verifications[i].checked)
	  {
       verifications= true;
      }
    }

if (verifications == "")
  {
   alert("Please rate your interest in learning more about employment verifications.");
   return false;
  } 

var payadvices = false;
for(var i=0; i<theForm.PayAdvices.length; i++)
    {
     if(theForm.PayAdvices[i].checked)
	  {
       payadvices= true;
      }
    }

if (payadvices == "")
 {
   alert("Please rate your interest in learning more about paperless pay.");
   return false;
 } 

var unemploymentclaims = false;
for(var i=0; i<theForm.UnemploymentClaims.length; i++)
    {
     if(theForm.UnemploymentClaims[i].checked)
	  {
       unemploymentclaims= true;
      }
    }

if (unemploymentclaims == "")
  {
   alert("Please rate your interest in learning more about unemployment claims.");
   return false;
  }


var w2s = false;
for(var i=0; i<theForm.W2Process.length; i++)
    {
     if(theForm.W2Process[i].checked)
	  {
       w2s= true;
      }
    }

if (w2s == "")
 {
  alert("Please rate your interest in learning more about W-2 Processing, Reprints and Corrections.");
  return false;
 }
 


var taxcredit = false;
for(var i=0; i<theForm.TaxCredit.length; i++)
    {
     if(theForm.TaxCredit[i].checked)
	  {
       taxcredit= true;
      }
    }

if (taxcredit == "")
 {
  alert("Please rate your interest in learning more about work opportunity tax credit applications.");
  return false;
 }
 

var newhire = false;
for(var i=0; i<theForm.NewHire.length; i++)
    {
     if(theForm.NewHire[i].checked)
	  {
       newhire= true;
      }
    }

if (newhire == "")
  {
   alert("Please rate your interest in learning more about new hire processing.");
   return false;
  } 

var I9 = false;
for(var i=0; i<theForm.I9.length; i++)
    {
     if(theForm.I9[i].checked)
	  {
       I9= true;
      }
    }

if (I9 == "")
  {
   alert("Please rate your interest in learning more about I-9 processing and storage.");
   return false;
  } 

var Assessments = false;
for(var i=0; i<theForm.Assessments.length; i++)
    {
     if(theForm.Assessments[i].checked)
	  {
       Assessments= true;
      }
    }

if (Assessments == "")
  {
   alert("Please rate your interest in learning more about Assessments and Talent Acquisition.");
   return false;
  } 
  
var Garnishments = false;
for(var i=0; i<theForm.Garnishments.length; i++)
    {
     if(theForm.Garnishments[i].checked)
	  {
       Garnishments= true;
      }
    }

if (Garnishments == "")
  {
   alert("Please rate your interest in learning more about Garnishments.");
   return false;
  } 

var DataBreach = false;
for(var i=0; i<theForm.DataBreach.length; i++)
    {
     if(theForm.DataBreach[i].checked)
	  {
       DataBreach= true;
      }
    }

if (DataBreach == "")
  {
   alert("Please rate your interest in learning more about Data Breach Solutions.");
   return false;
  } 



if (theForm.Name.value=="" ||  (isProper(theForm.Name.value) == false))
  {
    alert("Please enter your name.  Characters only.");
   theForm.Name.focus();
    return (false);
  }
				if (document.theForm.Title.value=="" ||  (isProper(document.theForm.Title.value) == false))
  {
    alert("Please enter your Title.  Characters only.");
    document.theForm.Title.focus();
    return (false);
  }
		
	 if (document.theForm.Organization.value == "" || (isProper(document.theForm.Organization.value) == false))

  {

    alert("Please enter the name of your Organization.  Alphanumeric only.");

    document.theForm.Organization.focus();

    return (false);

  }

if (theForm.State.selectedIndex == 0) 
  {
    alert('Please select your state.');
	theForm.State.focus();
    return false;
  }
	
	
if ((theForm.Email.value.indexOf ('@',0) == -1) || (theForm.Email.value == ""))
  {
    alert("Please verify your email address.");
    theForm.Email.focus();
    return (false);
  } 
	 
if (theForm.Phonearea.value == "")
  {
    alert("Please enter your area code.");
    theForm.Phonearea.focus();
    return (false);
  }
 
if (((theForm.Phonearea.value / theForm.Phonearea.value) != 1) && (theForm.Phonearea.value != 0)) 
  {
    alert('Please enter only a number into this text box');
    theForm.Phonearea.focus();
    return (false);
  }
    
if (theForm.phone.value == "")
  {
    alert("Please enter your phone number.");
    theForm.phone.focus();
    return (false);
  }
 
if (((theForm.phone.value / theForm.phone.value) != 1) && (theForm.phone.value != 0)) 
  {
    alert('Please enter only a number into this text box');
    theForm.phone.focus();
    return (false);
  }

if (theForm.phone2.value == "")
  {
    alert("Please enter your phone number.");
    theForm.phone2.focus();
    return (false);
  }

var empnum = false;
for(var i=0; i<theForm.Employees.length; i++)
  {if(theForm.Employees[i].checked)
   {
    empnum = true;
   }
  }

if (empnum == "")
  {
    alert("Please choose the number of employees in your organization.");
    return false;
  } 

}

