
// Check Executive Registration Confirm Form
function checkResumeStep2(theForm)
{

if (!checkText(theForm.cardName,"Please fill in the \"Name On Card\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cardNumber,"Please fill in the \"Card Number\" field!", "yes"))	{
	return false;
}
if ( theForm.cardNumber.value.charAt(0) == "3" ){
	alert("We are sorry but we only accept Visa, Mastercard and Discover!")
	return false;
}
if (!checkPullDown(theForm.expmonth,"Please fill in the \"Expiration\" field!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.expyear,"Please fill in the \"Year\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cvv2,"Please fill in the \"CVV2\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}

return true;
}
// Check Executive Registration Confirm Form

// Check Executive Registration Form
function checkResumeStep1(theForm)
{
if (!checkEmail(theForm.email,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email2,"Please fill in the \"Confirm Email\" field!", "yes"))	{
	return false;
}
if (theForm.email.value != theForm.email2.value){
	alert("Emails do not match!")
	return false;
}
if (!checkText(theForm.fName,"Please fill in the \"First Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.lName,"Please fill in the \"Last Name\" field!", "yes"))	{
	return false;
}

if (!checkText(theForm.street,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.city,"Please fill in the \"City\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.state,"Please fill in the \"State\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.zip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.phone,"Phone", "yes"))	{
	return false;
}
if (!checkPhone(theForm.fax,"Fax", "no"))	{
	return false;
}
if (!checkPhone(theForm.cellular,"Cellular", "no"))	{
	return false;
}
if (!checkFileExt(theForm.sResume,"Please upload your resume!\nMake sure there are no special characters in your file name.", "doc, docx,pdf,txt,rtf", "yes"))	{
	return false;
}
return true;
}
// Check Executive Form


// Check Delete Account Tools
function checkDeleteAccount(theForm)
{
if (!checkText(theForm.sReason,"Please fill in the \"Reason\" field!", "yes"))	{
	return false;
}
 
if (confirm('Are you sure you want to delete your account?')){return true;}return false; void(0);

}


// Check Category Tools
function checkCat(theForm)
{
if (!checkText(theForm.sTitle,"Please fill in the \"Title\" field!", "yes"))	{
	return false;
}
uploadProgress();
return true;
}
// Check Category Form

// Check Send Profile Form
function checkEmailProfile(theForm)
{
if (!checkText(theForm.sFromName,"Please fill in the \"From Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.sFromEmail,"Please fill in the \"From Email\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sToName,"Please fill in the \"To Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.sToEmail,"Please fill in the \"To Email\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sSubject,"Please fill in the \"Subject\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
return true;
}
// Check Refer a Friend Form


// Check Refer a Friend Form
function checkRefer(theForm)
{
if (!checkText(theForm.yourName,"Please fill in the \"Your Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.yourEmail,"Please fill in the \"Your Email\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.friendsName,"Please fill in the \"Friends Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.friendsEmail,"Please fill in the \"Friends Email\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.friendsPhone,"Phone", "yes"))	{
	return false;
}
return true;
}
// Check Refer a Friend Form

// check q and a Form
function checkQandA(theForm)
{
if (!checkText(theForm.sName,"Please fill in the \"Name\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.sPhone,"Phone", "yes"))	{
	return false;
}
if (!checkEmail(theForm.sEmail,"Please use a properly formatted email!", "yes"))	{
	return false;
}
if (!checkText(theForm.sQuestion,"Please fill in the \"Question\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Contact Form


// Check Password Form
function checkPassword(theForm)
{
if (!checkText(theForm.password,"Please fill in the \"Password\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.password2,"Please fill in the \"Confirm Password\" field!", "yes"))	{
	return false;
}
if (theForm.password.value != theForm.password2.value){
	alert("Passwords do not match!")
	return false;
}
return true;
}
// Check Password Form

// Check Email Form
function checkUpdateEmail(theForm)
{
if (!checkEmail(theForm.email,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Password Form

// Check Help a Friend Form
function checkHelp(theForm)
{
if (!checkText(theForm.friendsName,"Please fill in the \"Friends Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.friendsEmail,"Please fill in the \"Friends Email\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.friendsPhone,"Phone", "yes"))	{
	return false;
}
return true;
}
// Check Help a Friend Form

// Check Profile Edit Form
function checkProfileEdit(theForm)
{
if (!checkPhone(theForm.phone,"Phone", "no"))	{
	return false;
}
if (!checkText(theForm.salary,"Please select a salary!", "yes"))	{
	return false;
}
if (!checkText(theForm.state,"Please select a State!", "yes"))	{
	return false;
}
return true;
}
// Check Profile Form

// Check Renewal Form
function checkRenew(theForm)
{
if (!checkText(theForm.billName,"Please fill in the \"Name On Card\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.billAddress,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.billState,"Please fill in the \"State\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.billZip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cardNumber,"Please fill in the \"Card Number\" field!", "yes"))	{
	return false;
}
if ( theForm.cardNumber.value.charAt(0) == "3" ){
	alert("We are sorry but we only accept Visa, Mastercard and Discover!")
	return false;
}
if (!checkPullDown(theForm.expmonth,"Please fill in the \"Expiration\" field!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.expyear,"Please fill in the \"Year\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cvv2,"Please fill in the \"CVV2\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
return true;
}


// Check Profile Form
function checkProfile(theForm)
{
if (!checkText(theForm.billName,"Please fill in the \"Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.billAddress,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.billState,"Please fill in the \"State\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.billZip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cardNumber,"Please fill in the \"Card Number\" field!", "yes"))	{
	return false;
}
if ( theForm.cardNumber.value.charAt(0) == "3" ){
	alert("We are sorry but we only accept Visa, Mastercard and Discover!")
	return false;
}
if (!checkPullDown(theForm.expmonth,"Please fill in the \"Expiration\" field!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.expyear,"Please fill in the \"Year\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cvv2,"Please fill in the \"CVV2\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
return true;
}
// Check Profile Form


// Check Profile Contact Form
function checkProfileEmail(theForm)
{
if (!checkText(theForm.name,"Please fill in the \"Name\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.phone,"Phone", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Profile Contact Form

// Check YP Registration Confirm Form
function checkYpConfirm(theForm)
{
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.strCAPTCHA,"Please fill in the \"Access Code\" field!", "yes"))	{
	return false;
}
return true;
}
// Check YP Registration Confirm Form

// Check YP Registration Form
function checkYp(theForm)
{
if (!checkText(theForm.fName,"Please fill in the \"First Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.lName,"Please fill in the \"Last Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email2,"Please fill in the \"Confirm Email\" field!", "yes"))	{
	return false;
}
if (theForm.email.value != theForm.email2.value){
	alert("Emails do not match!")
	return false;
}
if (!checkText(theForm.password1,"Please fill in the \"Password\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.password2,"Please fill in the \"Confirm Password\" field!", "yes"))	{
	return false;
}
if (theForm.password1.value != theForm.password2.value){
	alert("Passwords do not match!")
	return false;
}
if (!checkPullDown(theForm.howdidyouhear,"Select an option!", "yes"))	{
	return false;
}
if (!checkText(theForm.discipline,"Please fill in the \"Primary Discipline\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.street,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.city,"Please fill in the \"City\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.state,"Please fill in the \"State\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.zip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.phone,"Phone", "yes"))	{
	return false;
}
if (!checkPhone(theForm.fax,"Fax", "no"))	{
	return false;
}
if (!checkPhone(theForm.cellular,"Cellular", "no"))	{
	return false;
}
if (!checkFileExt(theForm.sResume,"Please upload your resume!\nMake sure there are no special characters in your file name.", "doc,docx,pdf,txt,rtf", "yes"))	{
	return false;
}

if (theForm.question1.value == "")
  {
    alert("Please enter a value for the \"Question 1\" field.");
    theForm.question1.focus();
    return (false);
  }
if (theForm.question1.value != "0")
  {
   if (theForm.question2.value == "")
  {
    alert("Please enter a value for the \"Question 2\" field.");
    theForm.question2.focus();
    return (false);
  }
  }
if (theForm.question1.value != "0")
  {
   if (theForm.question3.value == "")
  {
    alert("Please enter a value for the \"Question 3\" field.");
    theForm.question3.focus();
    return (false);
  }
  }

radioOption = -1;
for (i=0; i < theForm.question4.length; i++) {
if (theForm.question4[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 4\"");
return false;
}

if (theForm.question4[radioOption].value == "No")
{
radioOption = -1;
for (i=0; i < theForm.question5.length; i++) {
if (theForm.question5[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 5\"");
return false;
}
}

radioOption = -1;
for (i=0; i < theForm.question6.length; i++) {
if (theForm.question6[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 6\"");
return false;
}
radioOption = -1;
for (i=0; i < theForm.question7.length; i++) {
if (theForm.question7[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 7\"");
return false;
}
uploadProgress();
return true;
}
// Check Yp Form



// Check Executive Registration Confirm Form
function checkExectutiveConfirm(theForm)
{

if (!checkText(theForm.cardName,"Please fill in the \"Name On Card\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cardNumber,"Please fill in the \"Card Number\" field!", "yes"))	{
	return false;
}
if ( theForm.cardNumber.value.charAt(0) == "3" ){
	alert("We are sorry but we only accept Visa, Mastercard and Discover!")
	return false;
}
if (!checkPullDown(theForm.expmonth,"Please fill in the \"Expiration\" field!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.expyear,"Please fill in the \"Year\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cvv2,"Please fill in the \"CVV2\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.strCAPTCHA,"Please fill in the \"Access Code\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Executive Registration Confirm Form

// Check Executive Registration Form
function checkExecutive(theForm)
{
if (!checkText(theForm.fName,"Please fill in the \"First Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.lName,"Please fill in the \"Last Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email2,"Please fill in the \"Confirm Email\" field!", "yes"))	{
	return false;
}
if (theForm.email.value != theForm.email2.value){
	alert("Emails do not match!")
	return false;
}
if (!checkText(theForm.password1,"Please fill in the \"Password\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.password2,"Please fill in the \"Confirm Password\" field!", "yes"))	{
	return false;
}
if (theForm.password1.value != theForm.password2.value){
	alert("Passwords do not match!")
	return false;
}
if (!checkPullDown(theForm.howdidyouhear,"Select an option!", "yes"))	{
	return false;
}
if (!checkText(theForm.discipline,"Please fill in the \"Primary Discipline\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.street,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.city,"Please fill in the \"City\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.state,"Please fill in the \"State\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.zip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.phone,"Phone", "yes"))	{
	return false;
}
if (!checkPhone(theForm.fax,"Fax", "no"))	{
	return false;
}
if (!checkPhone(theForm.cellular,"Cellular", "no"))	{
	return false;
}
if (!checkFileExt(theForm.sResume,"Please upload your resume!\nMake sure there are no special characters in your file name.", "doc,docx,pdf,txt", "yes"))	{
	return false;
}

/// background questions

radioOption = -1;
for (i=0; i < theForm.question1.length; i++) {
if (theForm.question1[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 1\"");
return false;
}

// Check Question 1
if (theForm.question1[radioOption].value == "No")
{
// If Quesiton 1 = No
radioOption = -1;
for (i=0; i < theForm.question2.length; i++) {
if (theForm.question2[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 2\"");
return false;
}

radioOption = -1;
for (i=0; i < theForm.question3.length; i++) {
if (theForm.question3[i].checked) {
radioOption = i;
}

}
if (radioOption == -1) {
alert("You must select an option for \"Question 3\"");
return false;
}

radioOption = -1;
for (i=0; i < theForm.question4.length; i++) {
if (theForm.question4[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 4\"");
return false;
}
if (theForm.question4[radioOption].value != "None")
{
radioOption = -1;
for (i=0; i < theForm.question4b.length; i++) {
if (theForm.question4b[i].checked) {
radioOption = i;}
}
if (radioOption == -1) {
alert("You must select an option for \"Outplacement Company\"");
return false;
}
if (theForm.question4b[radioOption].value == "Other" && theForm.other4b.value == "")
{
    alert("Please enter a value for the \"Other\" field.");
    theForm.other4b.focus();
    return (false);
}


radioOption = -1;
for (i=0; i < theForm.question6.length; i++) {
if (theForm.question6[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 6\"");
return false;
}
}

}
radioOption = -1;
for (i=0; i < theForm.question5.length; i++) {
if (theForm.question5[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 5\"");
return false;
}

if (theForm.question5[radioOption].value == "Yes")
{
radioOption = -1;
for (i=0; i < theForm.question5b.length; i++) {
if (theForm.question5b[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"If yes, are you currently using a career coach?\"");
return false;
}
}
radioOption = -1;
for (i=0; i < theForm.question6.length; i++) {
if (theForm.question6[i].checked) {
radioOption = i;
}
}
if (radioOption == -1) {
alert("You must select an option for \"Question 6\"");
return false;
}
//


return true;
}
// Check Executive Form


// Check Recruiter Form
function checkRecruiter(theForm)
{
if (!checkText(theForm.sName,"Please fill in the \"Your Name\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.sPhone,"Phone", "yes"))	{
	return false;
}
if (!checkEmail(theForm.sEmail,"Please fill in the \"Email\" field!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.sLevel,"Please select an option!", "yes"))	{
	return false;
}
if (!checkPullDown(theForm.sJob,"Please select an option!", "yes"))	{
	return false;
}
if (!checkText(theForm.sSubject,"Please fill in the \"Subject\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sLocation,"Please fill in the \"Location\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sResponse,"Please fill in the \"Response\" field!", "yes"))	{
	return false;
}
if (!checkDate(theForm.sExpires, "no"))	{
	return false;
}
if (!checkText(theForm.sDescription,"Please fill in the \"Response\" field!", "yes"))	{
	return false;
}
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.iBot,"Please fill in the \"Math Problem\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Recruiter Form

// Check Corp Contact Form
function checkCorpContact(theForm)
{
if (!checkText(theForm.sName,"Please fill in the \"Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sPosition,"Please fill in the \"Position\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.sCompany,"Please fill in the \"sCompany\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.sPhone,"Phone", "no"))	{
	return false;
}
if (!checkEmail(theForm.sEmail,"Please use a properly formatted email!", "yes"))	{
	return false;
}
return true;
}
// Check Contact Form

// CheckContact Form
function checkContact(theForm)
{
if (!checkText(theForm.sName,"Please fill in the \"Name\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.sPhone,"Phone", "no"))	{
	return false;
}
if (!checkEmail(theForm.sEmail,"Please use a properly formatted email!", "yes"))	{
	return false;
}
return true;
}
// Check Contact Form

// Check Event Review Form
function checkEventReview(theForm)
{
if (!checkBox(theForm.iAuthorize,"You must agree to the terms and conditions!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.strCAPTCHA,"Please fill in the \"Access Code\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Event Review Form

// Check Event Registration Form
function checkEvent(theForm)
{
if (!checkText(theForm.fName,"Please fill in the \"First Name\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.lName,"Please fill in the \"Last Name\" field!", "yes"))	{
	return false;
}
if (!checkEmail(theForm.email,"Please use a properly formatted email!", "yes"))	{
	return false;
}
if (!checkText(theForm.street,"Please fill in the \"Address\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.zip,"Please fill in the \"Zip\" field!", "yes"))	{
	return false;
}
if (!checkPhone(theForm.phone,"Phone", "yes"))	{
	return false;
}
if (!checkText(theForm.cardName,"Please fill in the \"Name On Card\" field!", "yes"))	{
	return false;
}
if (!checkNumbers(theForm.cardNumber,"Please fill in the \"Card Number\" field!", "yes"))	{
	return false;
}
if ( theForm.cardNumber.value.charAt(0) == "3" ){
	alert("We are sorry but we only accept Visa, Mastercard and Discover!")
	return false;
}
if (!checkText(theForm.expmonth,"Please fill in the \"Expiration\" field!", "yes"))	{
	return false;
}
if (!checkText(theForm.expyear,"Please fill in the \"Year\" field!", "yes"))	{
	return false;
}
return true;
}
// Check Event Registration Form


// register script
function registerCheck(theForm)
{

if (theForm.username.value == "")
  {
    alert("Please enter a value for the \"Email Address (username)\" field.");
    theForm.username.focus();
    return (false);
  }
	var ValidEmail=IsValidEmail (theForm.username.value);
	if ((ValidEmail==false) && (theForm.username.value != "")){
	alert("You have entered in a invalid email address");
	theForm.username.focus();
	return (false);
	}
 	if (theForm.billingFirstName.value == "")
  {
    alert("Please enter a value for the \"Billing First Name\" field.");
    theForm.billingFirstName.focus();
    return (false);
  }
   	if (theForm.billingLastName.value == "")
  {
    alert("Please enter a value for the \"Billing Last Name\" field.");
    theForm.billingLastName.focus();
    return (false);
  }
	if (theForm.billingAddress1.value == "")
  {
    alert("Please enter a value for the \"Billing Address\" field.");
    theForm.billingAddress1.focus();
    return (false);
  }
  	if (theForm.billingCity.value == "")
  {
    alert("Please enter a value for the \"Billing City\" field.");
    theForm.billingCity.focus();
    return (false);
  }
  	if (theForm.billingState.value == "")
  {
    alert("Please enter a value for the \"Billing State\" field.");
    theForm.billingState.focus();
    return (false);
  }
  	if (theForm.billingZip.value == "")
  {
    alert("Please enter a value for the \"Billing Zip\" field.");
    theForm.billingZip.focus();
    return (false);
  }
if (theForm.billingPhoneArea.value == ""  || theForm.billingPhonePrefix.value == ""  ||  theForm.billingPhoneSuffix.value == "")
  {
    alert("Please enter a value for the \"Billing Home Phone\" field.");
    theForm.billingPhoneArea.focus();
    return (false);
  }
  
  if (theForm.shipFirstName.value == "")
  {
    alert("Please enter a value for the \"Shipping First Name\" field.");
    theForm.shipFirstName.focus();
    return (false);
  }
   	if (theForm.shipLastName.value == "")
  {
    alert("Please enter a value for the \"Shipping Last Name\" field.");
    theForm.shipLastName.focus();
    return (false);
  }
	if (theForm.shipAddress1.value == "")
  {
    alert("Please enter a value for the \"Shipping Address\" field.");
    theForm.shipAddress1.focus();
    return (false);
  }
  	if (theForm.shipCity.value == "")
  {
    alert("Please enter a value for the \"Shipping City\" field.");
    theForm.shipCity.focus();
    return (false);
  }
  	if (theForm.shipState.value == "")
  {
    alert("Please enter a value for the \"Shipping State\" field.");
    theForm.shipState.focus();
    return (false);
  }
  	if (theForm.shipZip.value == "")
  {
    alert("Please enter a value for the \"Shipping Zip\" field.");
    theForm.shipZip.focus();
    return (false);
  }
if (theForm.shipPhoneArea.value == ""  || theForm.shipPhonePrefix.value == ""  ||  theForm.shipPhoneSuffix.value == "")
  {
    alert("Please enter a value for the \"Shipping Home Phone\" field.");
    theForm.shipPhoneArea.focus();
    return (false);
  }
  
if (theForm.cardType.value == "")
  {
    alert("Please enter a value for the \"Card Type\" field.");
    theForm.cardType.focus();
    return (false);
  }
  
  if (theForm.cardType.value == "American Express")
  {
  if (theForm.cardNumber.value.length  != 15)   {
    alert("Please make sure you have a valid American Express number!");
    theForm.cardNumber.focus();
    return (false);
	}
	}
  else {
    if (theForm.cardNumber.value.length  != 16)  {
    alert("You have entered in an Invalid Card Number!");
    theForm.cardNumber.focus();
    return (false);
	}
	}
if (!hkCardNumber(theForm.cardNumber.value)) {
		valid = 0
		alert("Please Enter in Numbers Only")
		theForm.cardNumber.focus();
    	return (false);
	}

if (!hkExpiration(theForm.expiration.value)) {
		valid = 0
		alert("Please enter a correct value for the \"Expiration Date\" field.")
		theForm.expiration.focus();
    	return (false);
	}
 if (theForm.expiration.value.length  <= 4)
  {
    alert("Please make sure the format of your \"Expiration Date\" is as follows \"00/00\"");
    theForm.expiration.focus();
    return (false);
  }
  return (true);
}
//
//
// duplicate address for user
function sameAddress(theForm)
{
	var strErrorVal = "The following fields are required for this Feature: ";
	var focus = 0;
	if (theForm.billingFirstName.value == "")
	{
		strErrorVal += "First Name, ";
		focus = 1;
	}
	if (theForm.billingLastName.value == "")
	{
		strErrorVal += "Last Name, ";
		focus = 2;
	}
	if (theForm.billingAddress1.value == "")
	{
		strErrorVal += "Address, ";
		focus = 3;
	}
	 if ( (theForm.billingCity.value == "") )
	{
		strErrorVal += "City, ";
		focus = 4;
	}
	 if ( (theForm.billingState.value == "") )
	{
		strErrorVal += "State, ";
		focus = 5;
	}
 if ( (theForm.billingZip.value == "") )
	{
		strErrorVal += "Zip ";
		focus = 6;
	}
 if ( (theForm.billingPhoneArea.value == "" || theForm.billingPhonePrefix.value == "" || theForm.billingPhoneSuffix.value == "") )
	{
		strErrorVal += "Home Phone ";
		focus = 7;
	}
	
if (focus != 0){
	theForm.sameAsBilling.checked=false;

	alert(strErrorVal); }
else {
theForm.shipFirstName.value = theForm.billingFirstName.value
theForm.shipLastName.value = theForm.billingLastName.value
theForm.shipCompanyName.value = theForm.billingCompanyName.value
theForm.shipAddress1.value = theForm.billingAddress1.value
theForm.shipAddress2.value = theForm.billingAddress2.value
theForm.shipCity.value = theForm.billingCity.value
theForm.shipState.value = theForm.billingState.value
theForm.shipZip.value = theForm.billingZip.value
theForm.shipPhoneArea.value = theForm.billingPhoneArea.value
theForm.shipPhonePrefix.value =	theForm.billingPhonePrefix.value
theForm.shipPhoneSuffix.value =	theForm.billingPhoneSuffix.value
theForm.shipCompPhoneArea.value = theForm.billingCompPhoneArea.value
theForm.shipCompPhonePrefix.value = theForm.billingCompPhonePrefix.value
theForm.shipCompPhoneSuffix.value = theForm.billingCompPhoneSuffix.value
theForm.shipCompPhoneExt.value = theForm.billingCompPhoneExt.value
	}
}


function hkCardNumber(TheNumber) {
var valid = 1
var hkGoodNumbers = "0123456789"
var i = 0
if (TheNumber=="") {
valid = 0
	}
for (i =0; i <= TheNumber.length -1; i++) {
if (hkGoodNumbers.indexOf(TheNumber.charAt(i)) == -1) {
valid = 0
}
	}
return valid
}

function hkExpiration(TheNumber2) {
var valid = 1
var hkGoodNumbers2 = "0123456789/"
var i = 0
if (TheNumber2=="") {
valid = 0
	}
for (i =0; i <= TheNumber2.length -1; i++) {
if (hkGoodNumbers2.indexOf(TheNumber2.charAt(i)) == -1) {
valid = 0
}
	}
return valid
}

// Checks to see if Email is formatted correctly
function IsValidEmail (strEmail){
		var bIsValid=true;
		var Space1=" ";
		var At1="@";
		var Dot1=".";
		var strTemp=new String(strEmail);
		if (strTemp.length < 5) 
				bIsValid = false;
		
		if (strTemp.indexOf(Space1)>0)
				bIsValid = false;
		
		if (strTemp.indexOf(At1)<2)
				bIsValid = false;
		
		if (strTemp.lastIndexOf(Dot1) < strTemp.indexOf(At1, 1) + 1)
				bIsValid = false;
		return bIsValid; 
}
//

