function checkAddress(){


// Create a JS array of form fields to loop over and make sure they're not blank

fieldList = new Array("firstName","lastName","address1","city","state","zip");
fieldNames = new Array("First Name","Last Name","Address Line 1","City","State","Zip Code");

// set Payment method indicator to OFF

eval("document.images.ipaymentMethod.src = '/images/clearpixel.gif'");

var showError = 0;
var myErr = "_________________________________________________________________\n\nThese entry(s) need attention:        \n_________________________________________________________________\n\n\n";
// create an index loop that loops through [fieldlist] and checks to see if its empty

	for(i=0;i<fieldList.length;i++){
	
	eval("document.images.i" + fieldList[i] + ".src =" + "\'/images/clearpixel.gif\'");
	
	// check to see if the formfield has been left blank
	if (eval("document.forms.accountInfo." + fieldList[i] + ".value") == ''){
		
		  // if it has swap image to attention image
	      eval("document.images.i" + fieldList[i] + ".src =" + "'/images/attention.gif'");
          myErr+='*  ' +fieldNames[i]+' cannot be left blank.\n';
		  showError = 1;}
	
	}

	
	//check state to make sure its not set at "Pick a State"
	
	if(document.forms.accountInfo.paymentMethod.selectedIndex == 0){
		myErr+='*  You must pick a Payment Method (Credit Card or Check).\n';
		showError = 1;
		;
		
		eval("document.images.ipaymentMethod.src = '/images/attention.gif'");}
		
		
	// if we had errors, notify the user
	
	if (showError == 1){alert(myErr + '\n\n');return false}
}

function checkCredit(){


// Create a JS array of form fields to loop over and make sure they're not blank

fieldList = new Array("cardNumber","cardholderStreet","cardholderZip","cardholderName");
fieldNames = new Array("Credit Card Number","Billing Address","Cardholder Zip","Cardholder Name");


var showError = 0;
var myErr = "_________________________________________________________________\n\nThese entry(s) need attention:        \n_________________________________________________________________\n\n\n";

eval("document.images.icardType.src = '/images/clearpixel.gif'");

// create an index loop that loops through [fieldlist] and checks to see if its empty


	for(i=0;i<fieldList.length;i++){
	
	eval("document.images.i" + fieldList[i] + ".src =" + "\'/images/clearpixel.gif\'");
	
	// check to see if the formfield has been left blank
	if (eval("document.forms.creditForm." + fieldList[i] + ".value") == ''){
		
		
		  // if it has swap image to attention image
	      eval("document.images.i" + fieldList[i] + ".src =" + "'/images/attention.gif'");
          myErr+='*  ' +fieldNames[i]+' cannot be left blank.\n';
		  showError = 1;}
	
	}

	
	//check Card Type to make sure its not set at "Pick a State"
	
	if(document.forms.creditForm.cardType.selectedIndex == 0){
		myErr+='*  You must pick a Credit Card type.\n';
		showError = 1;
		
		eval("document.images.icardType.src = '/images/attention.gif'");}
	
	// check payment amount and see make sure its not less than 50% of Amount Due
	/*
	var str = pmtAmt.replace("%24","");
	str = str.replace("%2C","");

	if (parseInt(str) < parseInt(minAmt)){
		myErr+='\n* The minimum acceptable payment for this account is: $' + parseInt(minAmt) + '.00\n\n';
		showError = 1;
		
		eval("document.images.ipaymentAmount.src = '/images/attention.gif'");}


    // if we had errors, notify the user, and return false to stop submission
	*/
	
	if (document.forms.creditForm.receiptDelivery[0].checked == true && (document.forms.creditForm.deliveryEmail.value.length <= 5 || document.forms.creditForm.deliveryEmail.value.indexOf('@') == -1 || document.forms.creditForm.deliveryEmail.value.indexOf('.') == -1)){
		myErr+='*  Please specify the email address where your receipt should be delivered.\n';
		showError = 1;}
		
	//if (document.forms.creditForm.receiptDelivery[1].checked == true && document.forms.creditForm.deliveryEmail.value.indexOf('@') == -1 || document.forms.creditForm.deliveryEmail.value.indexOf('.') == -1){
	//	myErr+='*  Email address you provided is not a valid email address.\n';
	//	showError = 1;}				
	
	if (showError == 1){alert(myErr + '\n\n');return false}else{return true;}

}


function checkCheck(){


// Create a JS array of form fields to loop over and make sure they're not blank

fieldList = new Array("aba","accountNumber","checkCity","checkName","checkNumber","checkState","checkStreet","checkZip");
fieldNames = new Array("Bank Rounting Number","Checking Account Number","City on Check","Name on Check","Check Number","State on Check", "Address on Check","Zip on Check");


var showError = 0;
var myErr = "_________________________________________________________________\n\nThese entry(s) need attention:        \n_________________________________________________________________\n\n\n";


// create an index loop that loops through [fieldlist] and checks to see if its empty


	for(i=0;i<fieldList.length;i++){
	
	eval("document.images.i" + fieldList[i] + ".src =" + "\'/images/clearpixel.gif\'");
	
	// check to see if the formfield has been left blank
	if (eval("document.forms.checkForm." + fieldList[i] + ".value") == ''){
		
		
		  // if it has swap image to attention image
	      eval("document.images.i" + fieldList[i] + ".src =" + "'/images/attention.gif'");
          myErr+='*  ' +fieldNames[i]+' cannot be left blank.\n';
		  showError = 1;}
	
	}	
	
	// check payment amount and see make sure its not less than 50% of Amount Due

	/*var str = pmtAmt.replace("%24","");
	str = str.replace("%2C","");

	if (parseInt(str) < parseInt(minAmt)){
		myErr+='\n* The minimum acceptable payment for this account is: $' + parseInt(minAmt) + '.00\n\n';
		showError = 1;
		
		eval("document.images.ipaymentAmount.src = '/images/attention.gif'");}*/


    // if we had errors, notify the user, and return false to stop submission
	
	if (document.forms.checkForm.aba.value.length != 9){
	myErr+='*  Bank Routing number must be exactly 9 numbers.\n';
	showError = 1
	}
	
	if (document.forms.checkForm.accountNumber.value.length < 5 || document.forms.checkForm.accountNumber.value.length > 15){
	myErr+='*  Checking Account number must be between 5 and 15 numbers.\n';
	showError = 1
	}
	
	if (document.forms.checkForm.receiptDelivery[0].checked == true && (document.forms.checkForm.deliveryEmail.value.length <= 5 && document.forms.checkForm.deliveryEmail.value.indexOf('@') == -1 && document.forms.checkForm.deliveryEmail.value.indexOf('.') == -1)){
		myErr+='*  Please specify the email address where your receipt should be delivered.\n';
		showError = 1;}
		
	//if (document.forms.checkForm.receiptDelivery[0].checked == true && document.forms.checkForm.deliveryEmail.value.indexOf('@') == -1 || document.forms.checkForm.deliveryEmail.value.indexOf('.') == -1){
	//	myErr+='*  Email address you provided is not a valid email address.\n';
	//	showError = 1;}		

	if (showError == 1){alert(myErr + '\n\n');return false}else{return true;}
	
}

function checkPin(){


// Create a JS array of form fields to loop over and make sure they're not blank

fieldList = new Array("accountNumber","pin");
fieldNames = new Array("Account Number","PIN");

var showError = 0;
var myErr = "_________________________________________________________________\n\nThese entry(s) need attention:        \n_________________________________________________________________\n\n\n";
// create an index loop that loops through [fieldlist] and checks to see if its empty

	for(i=0;i<fieldList.length;i++){
	
	eval("document.images.i" + fieldList[i] + ".src =" + "\'/images/clearpixel.gif\'");
	
	// check to see if the formfield has been left blank
	if (eval("document.forms.loginForm." + fieldList[i] + ".value") == ''){
		
		  // if it has swap image to attention image
	      eval("document.images.i" + fieldList[i] + ".src =" + "'/images/attention.gif'");
          myErr+='*  ' +fieldNames[i]+' cannot be left blank.\n';
		  showError = 1;}
	
	}

	if(document.forms.loginForm.pin.value == 'cred' || document.forms.loginForm.pin.value == 'creditor' || document.forms.loginForm.pin.value == 'CRED' || document.forms.loginForm.pin.value == 'CREDITOR'){
	
		myErr+='*  Please disregard the PIN Number listed on the letter you received.\n    Please enter your Social Security Number as your PIN.\n';
		document.forms.loginForm.doSSN.value = 0;
		document.forms.loginForm.pin.value = '';
		document.forms.loginForm.pin.focus();
		showError = 1;
	}

	//check state to make sure its not set at "Pick a State"
	
	/*if(document.forms.loginForm.miranda.checked == false){
		myErr+='*  Click the check box indicating you have read the \'Attempt to Collect A Debt\' statement.\n';
		showError = 1;}*/
		
		
	// if we had errors, notify the user
	
	if (showError == 1){
		alert(myErr + '\n\n');return false
		}else{
		return true}
}


function validateTOS(response){

     if(response == 'yes'){
	  }else{
	  document.forms['tosform'].currentStep.value = 'exitPmd';
	  }

	  document.forms['tosform'].submit();
}
