﻿function validate()
{
	var frm=document.frm;
	if(frm.txtCompany.value=='')
	{
		alert("Enter Company Name");
		frm.txtCompany.focus();
		return false;
	}
	
	
	if(frm.txtStreet.value=='')
	{
		alert("Enter Street Address");
		frm.txtStreet.focus();
		return false;
	}
	
	
		if(frm.txtCity.value=='')
	{
		alert("Enter the City");
		frm.txtCity.focus();
		return false;
	}
	
	if(frm.txtState.value=='')
	{
		alert("Enter the State");
		frm.txtState.focus();
		return false;
	}
	

		if(frm.txtPostal.value=='')
	{
		alert("Enter the Postal Code");
		frm.txtPostal.focus();
		return false;
	}
	
		 if(isNaN(frm.txtPostal.value)) 
	{
		alert("Please Enter a Number Only");
		frm.txtPostal.focus();
		return false;
    }

	
		if(frm.txtPhone.value=='')
	{
		alert("Enter the Telephone Number");
		frm.txtPhone.focus();
		return false;
	}
	
	 if (!(frm.txtPhone.value.search(/^[0-9][0-9][0-9]\-[0-9][0-9][0-9]\-[0-9][0-9][0-9][0-9]$/) != -1))
	 {
		 alert("Phone Number Format is 123-123-1234");
		 frm.txtPhone.focus();
		 return false;
	}	
	
	
		if(frm.txtFax.value=='')
	{
		alert("Enter the Fax");
		frm.txtFax.focus();
		return false;
	}
	
	 if(isNaN(frm.txtFax.value)) 
	{
		alert("Please Enter a Number Only.");
		frm.txtFax.focus();
		return false;
    }


	if(frm.txtBusiness.value=='')
	{
		alert("Enter the Nature of Business");
		frm.txtBusiness.focus();
		return false;
	}

if(frm.txtOfficer.value=='')
	{
		alert("Enter the Authorized officer");
		frm.txtOfficer.focus();
		return false;
	}
	
	if(frm.txtEmail.value=='')
	{
		alert("Enter the Email Address");
		frm.txtEmail.focus();
		return false;
	}


if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.txtEmail.value))){
		alert("Enter the valid Email Address");
		frm.txtEmail.focus();
		return false
		}	
		
if(frm.txtWebsite.value=='')
	{
		alert("Enter the Website");
		frm.txtWebsite.focus();
		return false;
	}
	
	if(frm.txtCredit.value=='')
	{
		alert("Enter the Approximate Credit Required Per Month $");
		frm.txtCredit.focus();
		return false;
	}
	
	
	
	if(frm.txtBankName.value=='')
	{
		alert("Enter the Bank Name");
		frm.txtBankName.focus();
		return false;
	}
	
	
	if(frm.txtBankContact.value=='')
	{
		alert("Enter the Bank Contact");
		frm.txtBankContact.focus();
		return false;
	}
	
	
	if(frm.txtBranch.value=='')
	{
		alert("Enter the Branch");
		frm.txtBranch.focus();
		return false;
	}
	
	if(frm.txtAccount.value=='')
	{
		alert("Enter the Account");
		frm.txtAccount.focus();
		return false;
	}
	
	if(frm.txtApplication.value=='')
	{
		alert("Enter the credit application");
		frm.txtApplication.focus();
		return false;
	}
	
	
	if(frm.txtApplication1.value=='')
	{
		alert("Enter the credit application");
		frm.txtApplication1.focus();
		return false;
	}
	
	if(frm.txtInform.value=='')
	{
		alert("Enter the Additional Information");
		frm.txtInform.focus();
		return false;
	}


	return true;
	
}