// JavaScript Document

function CheckInfo() {
var errors = 0;
var msg = "The following requirements have not been met:\n";
var saveErrors = "";

if((document.MyOtherForm.F_UserName.value == ''))
			{ saveErrors += "      - Please enter a username\n";  errors++; }
if((document.MyOtherForm.F_Password.value == ''))
			{ saveErrors += "      - Please enter a password\n";  errors++; }

if (saveErrors != "") {
			msg += "\n   - Missing Data:\n" + saveErrors;
	    	alert(msg);
			return false;
}
			return true;
}
//-->

//-->

// JavaScript Document
function CheckInfo1() {
var errors = 0;
var msg = "The following requirements have not been met:\n";
var saveErrors = "";

if((document.MyOtherForm1.F_LastName.value == '' || document.MyOtherForm1.F_LastName.value.length <3))
			{ saveErrors += "      - Please enter the first 3 letters of last name\n";  errors++; }
if((document.MyOtherForm1.F_BonusCard.value == '' || document.MyOtherForm1.F_BonusCard.value.length <11))
			{ saveErrors += "      - Please enter your 11 digit Bonuscard number\n";  errors++; }

	if (!IsNumeric(document.MyOtherForm1.F_BonusCard.value)) 
   { 
      alert('Please enter only numbers in the bonuscard field') 
      document.MyOtherForm1.F_BonusCard.value = ""; 
      return false; 
   }
   	
if (saveErrors != "") {
			msg += "\n   - Missing Data:\n" + saveErrors;
	    	alert(msg);
			return false;
}
			return true;
}
//-->

// JavaScript Document
function CheckInfo2() {
var errors = 0;
var msg = "The following requirements have not been met:\n";
var saveErrors = "";

if((document.MyOtherForm2.F_LastName.value == '' || document.MyOtherForm2.F_LastName.value.length <3))
			{ saveErrors += "      - Please enter the first 3 letters of last name\n";  errors++; }
if((document.MyOtherForm2.F_BonusCard.value == '' || document.MyOtherForm2.F_BonusCard.value.length <11))
			{ saveErrors += "      - Please enter your 11 digit Bonuscard number\n";  errors++; }
/*if((document.MyOtherForm2.F_BonusCard.value != ''))
			var bcnum =  document.MyOtherForm2.F_BonusCard.value;
			var bcnum1 = bcnum.substr(0, 2);
			if((bcnum1 != '41')){
				{ saveErrors += "      - Please enter your 11 digit Bonuscard number starting with 41 as shown in the example\n";  errors++; }
			}*/
	if (!IsNumeric(document.MyOtherForm2.F_BonusCard.value)) 
   { 
      alert('Please enter only numbers in the bonuscard field') 
      document.MyOtherForm2.F_BonusCard.value = ""; 
      return false; 
   }
   	
if (saveErrors != "") {
			msg += "\n   - Missing Data:\n" + saveErrors;
	    	alert(msg);
			return false;
}
			return true;
}
//-->

// JavaScript Document
function CheckBCedit() {
var errors = 0;
var msg = "The following requirements have not been met:\n";
var saveErrors = "";

if((document.MyOtherForm.F_FirstName.value == ''))
			{ saveErrors += "      - Please enter your first name\n";  errors++; }
if((document.MyOtherForm.F_LastName.value == ''))
			{ saveErrors += "      - Please enter your last name\n";  errors++; }
if((document.MyOtherForm.F_Address1.value == ''))
			{ saveErrors += "      - Please enter your address\n";  errors++; }
if((document.MyOtherForm.F_City.value == ''))
			{ saveErrors += "      - Please enter your city\n";  errors++; }
if((document.MyOtherForm.F_State.value == ''))
			{ saveErrors += "      - Please enter your state\n";  errors++; }
if((document.MyOtherForm.F_Zipcode.value == ''))
			{ saveErrors += "      - Please enter your zip code\n";  errors++; }
   	
if (saveErrors != "") {
			msg += "\n   - Missing Data:\n" + saveErrors;
	    	alert(msg);
			return false;
}
			return true;
}

// JavaScript Document

function CheckInfo3() {
var errors = 0;
var msg = "The following requirements have not been met:\n";
var saveErrors = "";

// Put field checks below this point.
// Check the length of the value of the element named f_storenum
if(document.MyOtherForm.F_Password.value != '' && document.MyOtherForm.F_Password_check.value != ''){
	if(document.MyOtherForm.F_Password.value != document.MyOtherForm.F_Password_check.value){
		alert ('Passwords do not match.')
	document.MyOtherForm.F_Password.value=''
	document.MyOtherForm.F_Password_check.value=''
	return false; 
		} 
}
	
if(document.MyOtherForm.F_Password.value.length < 4)
		{ saveErrors += "      - Password must be between 4 to 10 characters\n";  errors++; }
if(document.MyOtherForm.F_Password.value.length > 10)
		{ saveErrors += "      - Password must be between 4 to 10 characters\n";  errors++; }
if(document.MyOtherForm.F_EmailPreference1.checked == 0 && document.MyOtherForm.F_EmailPreference2.checked == 0 && document.MyOtherForm.F_EmailPreference3.checked == 0)
	    { saveErrors += "      - Please select a email notification checkbox, weekly, monthly, or none\n";  errors++; }
if(document.MyOtherForm.F_FirstName.value == "")
		{ saveErrors += "      - Please enter your first name\n";  errors++; }
if(document.MyOtherForm.F_LastName.value == "")
		{ saveErrors += "      - Please enter your last name\n";  errors++; }
if(document.MyOtherForm.F_EmailAddress.value == "")
		{ saveErrors += "      - Please enter a valid username\n";  errors++; }
if(document.MyOtherForm.F_Password.value == "")
		{ saveErrors += "      - Please enter a password\n";  errors++; }
if(document.MyOtherForm.F_Password_check.value == "")
		{ saveErrors += "      - Please confirm password\n";  errors++; }
if(WithoutSelectionValue(document.MyOtherForm.F_PreferredStoreNew))
		{ saveErrors += "      - Please select a store\n";  errors++; }

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

if (saveErrors != "") {
			msg += "\n   - Missing Data:\n" + saveErrors;
	    	alert(msg);
			return false;
}
			return true;
}

//-->

// JavaScript Document

function CheckInfo4() {
var errormessage = new String();

// Put field checks below this point.
// Check the length of the value of the element named f_storenum
if(document.MyOtherForm.F_Password.value != '' && document.MyOtherForm.F_Password_check.value != ''){
	if(document.MyOtherForm.F_Password.value != document.MyOtherForm.F_Password_check.value){
		alert ('Passwords do not match.')
	document.MyOtherForm.F_Password.value=''
	document.MyOtherForm.F_Password_check.value=''
	return false; 
		} 
}

if(WithoutContent(document.MyOtherForm.F_EmailAddress.value))
		{ errormessage += "\n\nPlease enter a valid username."; }
if(WithoutContent(document.MyOtherForm.F_Password.value))
		{ errormessage += "\n\nPlease enter a password."; }
if(WithoutContent(document.MyOtherForm.F_Password_check.value))
		{ errormessage += "\n\nPlease confirm password."; }
	
// Put field checks above this point.
if(errormessage.length > 2) {
	alert('INCOMPLETE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()

function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

//-->

function CheckInfo5() {
var errormessage = new String();

// Put field checks below this point.
// Check the length of the value of the element named f_storenum
if(document.MyOtherForm.F_Password.value != '' && document.MyOtherForm.F_Password_check.value != ''){
	if(document.MyOtherForm.F_Password.value != document.MyOtherForm.F_Password_check.value){
		alert ('Passwords do not match.')
	document.MyOtherForm.F_Password.value=''
	document.MyOtherForm.F_Password_check.value=''
	return false; 
		} 
}
	
if(document.MyOtherForm.F_Password.value.length < 4)
		{ errormessage += "\n\nPassword must be between 4 to 10 characters."; }
if(document.MyOtherForm.F_Password.value.length > 10)
		{ errormessage += "\n\nPassword must be between 4 to 10 characters."; }
	
if(WithoutContent(document.MyOtherForm.F_Username.value))
		{ errormessage += "\n\nPlease enter a valid username."; }
if(WithoutContent(document.MyOtherForm.F_TempPassword.value))
		{ errormessage += "\n\nPlease enter a your temporary password."; }
if(WithoutContent(document.MyOtherForm.F_Password.value))
		{ errormessage += "\n\nPlease enter a password."; }
if(WithoutContent(document.MyOtherForm.F_Password_check.value))
		{ errormessage += "\n\nPlease enter a confirm password."; }
	
// Put field checks above this point.
if(errormessage.length > 2) {
	alert('INCOMPLETE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()

function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

//-->

// JavaScript Document

function emailpref() {
var errormessage = new String();

// Put field checks below this point.
// Check the length of the value of the element named f_storenum
{
document.MyOtherForm.F_EmailPreference1.checked=false;
document.MyOtherForm.F_EmailPreference2.checked=false;
}
	
// Put field checks above this point.
if(errormessage.length > 2) {
	alert('INCOMPLETE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()

function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

//-->

function emailpref1() {
var errormessage = new String();

// Put field checks below this point.
// Check the length of the value of the element named f_storenum
{
document.MyOtherForm.F_EmailPreference3.checked=false;
}
	
// Put field checks above this point.
if(errormessage.length > 2) {
	alert('INCOMPLETE:' + errormessage);
	return false;
	}
return true;
} // end of function CheckRequiredFields()

function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { return false; }
		}
	}
return true;
}

//-->

// JavaScript Document
function keyCheck(eventObj, obj)
{
	var keyCode

	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}

	var str=obj.value

	if(keyCode==46){ 
		if (str.indexOf(".")>0){
			return false
		}
	}

	if((keyCode<48 || keyCode >58)){ // Allow only integers and decimal points
		return false
	}

	return true
}

<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
//  End -->

<!-- begin
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.MyOtherForm.F_EmailAddress
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 // END -->
//-->


