<!--
function frm_creditapplicationValidate() {
	//validate mode
	//-------------
	if(document.frm_creditapplication.chkNewAccount.checked == false && document.frm_creditapplication.chkChangeAddress.checked == false && document.frm_creditapplication.chkChangeTitle.checked == false){ 
		document.frm_creditapplication.chkNewAccount.focus();
		alert("Please enter the application type"); 
		return false;       
	}  
	//validate customer info
	//----------------------
	if(document.frm_creditapplication.txtTitle.value.length == 0){ 
		document.frm_creditapplication.txtTitle.focus();       
		alert("Please enter your full legal trading title"); 
		return false;       
	}    
	if(document.frm_creditapplication.txtVatNo.value.length == 0){ 
		document.frm_creditapplication.txtVatNo.focus();       
		alert("Please enter your vat number"); 
		return false;       
	}
	if(document.frm_creditapplication.chkSoleTrader.checked == false && document.frm_creditapplication.chkPartnership.checked == false){ 
		document.frm_creditapplication.chkSoleTrader.focus();
		alert("Please let us know if your a sole trader or partnership"); 
		return false;       
	} 
	if(document.frm_creditapplication.txtCompanyReg.value.length == 0){ 
		document.frm_creditapplication.txtCompanyReg.focus();       
		alert("Please enter your company registration number"); 
		return false;       
	}    
	if(document.frm_creditapplication.txtDateFormed.value.length == 0 || document.frm_creditapplication.txtDateFormed.value == "dd/mm/yy"){ 
		document.frm_creditapplication.txtDateFormed.focus();       
		alert("Please enter the date it was formed"); 
		return false;       
	}   				
	if(document.frm_creditapplication.txtStatementAddress.value.length == 0){ 
		document.frm_creditapplication.txtStatementAddress.focus();       
		alert("Please enter your statement address"); 
		return false;       
	}  
	if(document.frm_creditapplication.txtPostcode.value.length == 0){ 
		document.frm_creditapplication.txtPostcode.focus();       
		alert("Please enter your postcode"); 
		return false;       
	}  
	if(document.frm_creditapplication.txtDeliveryAddress.value.length == 0){ 
		document.frm_creditapplication.txtDeliveryAddress.focus();       
		alert("Please enter the delivery address...or type 'AS ABOVE'"); 
		return false;       
	}  			 
	if(document.frm_creditapplication.txtContactName.value.length == 0){ 
		document.frm_creditapplication.txtContactName.focus();       
		alert("Please enter your contact name"); 
		return false;       
	}  			 
		//validate email
		//--------------
		if(document.frm_creditapplication.txtEmail.value.length == 0){ 
			document.frm_creditapplication.txtEmail.focus();       
			alert("Please enter your email"); 
			return false;       
		}    
		if(-1 == document.frm_creditapplication.txtEmail.value.indexOf("@")){ 
			document.frm_creditapplication.txtEmail.focus(); 
			alert("Your email must have a '@'");        
			return false;        
		}
		if(-1 != document.frm_creditapplication.txtEmail.value.indexOf("#")){ 
			document.frm_creditapplication.email.focus(); 
			alert("Your email must not have an '#' in it");        
			return false; 		       
		}    
		if(-1 != document.frm_creditapplication.txtEmail.value.indexOf(" ")){ 
			document.frm_creditapplication.txtEmail.focus(); 
			alert("Your email must not have a space in it");        
			return false; 		       
		}	
		if(document.frm_creditapplication.txtEmail.value.length == (frm_creditapplication.txtEmail.value.indexOf("@")+1)){ 
			document.frm_creditapplication.txtEmail.focus(); 
			alert("Your email must have a domain name after the '@'."); 
			return false;       
		}    	
		if(-1 == document.frm_creditapplication.txtEmail.value.indexOf(".")){ 
			document.frm_creditapplication.txtEmail.focus(); 
			alert("Your email must have a fullstop");        
			return false;        
		}							
		if(document.frm_creditapplication.txtEmail.value.length == (frm_creditapplication.txtEmail.value.indexOf(".")+1)){ 
			document.frm_creditapplication.txtEmail.focus(); 
			alert("Your email must have a domain name after the fullstop"); 
			return false;       
		}  
	if(document.frm_creditapplication.txtTelephone.value.length == 0){ 
		document.frm_creditapplication.txtTelephone.focus();       
		alert("Please enter your telephone"); 
		return false;       
	}  			 
	if(document.frm_creditapplication.txtFax.value.length == 0){ 
		document.frm_creditapplication.txtFax.focus();       
		alert("Please enter your fax"); 
		return false;       
	}  		

	//validate origin of shipment
	//----------------------------
	if(document.frm_creditapplication.chkDirectDebit.checked == false && document.frm_creditapplication.chkBACS.checked == false && document.frm_creditapplication.chkCreditCard.checked == false && document.frm_creditapplication.chkSendDetailsLater.checked == false){ 
		document.frm_creditapplication.chkDirectDebit.focus();
		alert("Please enter a method of payment"); 
		return false;       
	}    			
	if(document.frm_creditapplication.txtCreditAmount.value.length == 0){ 
		document.frm_creditapplication.txtCreditAmount.focus();       
		alert("Please enter your required credit limit"); 
		return false;       
	}   			
	if(document.frm_creditapplication.chkImporting.checked == false && document.frm_creditapplication.chkExporting.checked == false){ 
		document.frm_creditapplication.chkImporting.focus();
		alert("Please tell us if your importing or exporting"); 
		return false;       
	}		
	if(document.frm_creditapplication.txtCostofConsignment.value.length == 0){ 
		document.frm_creditapplication.txtCostofConsignment.focus();       
		alert("Please enter the cost of the consignment"); 
		return false;       
	}   			
	if(document.frm_creditapplication.txtConsignmentDate.value.length == 0 || document.frm_creditapplication.txtConsignmentDate.value == "dd/mm/yy"){ 
		document.frm_creditapplication.txtConsignmentDate.focus();       
		alert("Please enter the date of the consignment"); 
		return false;       
	}   
	
	//validate references			
	//---------------------
	if(document.frm_creditapplication.txtAccountsName.value.length == 0){ 
		document.frm_creditapplication.txtAccountsName.focus();       
		alert("Please enter the accountants name"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtAccountantsAddress.value.length == 0){ 
		document.frm_creditapplication.txtAccountantsAddress.focus();       
		alert("Please enter the accountants address"); 
		return false;       
	}   	
	
	//Bank Details
	//-------------
	if(document.frm_creditapplication.txtBankName.value.length == 0){ 
		document.frm_creditapplication.txtBankName.focus();       
		alert("Please enter the bank name"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtBankSortCode.value.length == 0){ 
		document.frm_creditapplication.txtBankSortCode.focus();       
		alert("Please enter the bank sort code"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtAccountName.value.length == 0){ 
		document.frm_creditapplication.txtAccountName.focus();       
		alert("Please enter the account name"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtAccountNo.value.length == 0){ 
		document.frm_creditapplication.txtAccountNo.focus();       
		alert("Please enter the banks account number"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtBankAddress.value.length == 0){ 
		document.frm_creditapplication.txtBankAddress.focus();       
		alert("Please enter the banks address"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtBankPostcode.value.length == 0){ 
		document.frm_creditapplication.txtBankPostcode.focus();       
		alert("Please enter the banks postcode"); 
		return false;       
	}   		

	//For Non-Ltd Customers
	//-----------------------
	if(document.frm_creditapplication.txtDirectorsName.value.length == 0){ 
		document.frm_creditapplication.txtDirectorsName.focus();       
		alert("Please enter the directors name...or type 'N/A'"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtDirectorsAddress.value.length == 0){ 
		document.frm_creditapplication.txtDirectorsAddress.focus();       
		alert("Please enter the directors address...or type 'N/A'"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtGondrandUKRepName.value.length == 0){ 
		document.frm_creditapplication.txtGondrandUKRepName.focus();       
		alert("Please enter the Gondrand uk reps name...or type 'N/A'"); 
		return false;       
	}   
	if(document.frm_creditapplication.txtBranchRef.value.length == 0){ 
		document.frm_creditapplication.txtBranchRef.focus();       
		alert("Please enter the branch ref...or type 'N/A'"); 
		return false;       
	}  
	 		     	
	//send form info
	//--------------  	
	return true;
}
//-->