// JavaScript Document


function  validate(){
if(document.contact.a1_Name.value==""){
alert("First and Last Name is required ");
return false;
}
if(document.contact.a2_HomePhone.value==""){
alert("Home Phone Number is required ");
return false;
}
if(!IsNumeric(document.contact.a2_HomePhone.value)){
		alert("Invalid Home Phone Number!");
		document.contact.a2_HomePhone.value='';
		document.contact.a2_HomePhone.focus();
		return false;
        }
if(document.contact.a3_CellPhone.value!=""){

if(!IsNumeric(document.contact.a3_CellPhone.value)){
		alert("Invalid Mobile Phone Number!");
		document.contact.a3_CellPhone.value='';
		document.contact.a3_CellPhone.focus();
		return false;
        }
}

if(document.contact.a5_State.value=="Choose One"){
alert("State of Residence is required ");
return false;
}
if(document.contact.a6_UnsecuredDebt.value=="Select an amount"){
alert("Debt Amount is required ");
return false;
}
return true;
}
function IsNumeric(sText)

	{
 	 	var ValidChars = "0123456789-.";
   		var IsNumber=true;
  	 	var Char;

 		count = 0;
  	 for (i = 0; i < sText.length && IsNumber == true; i++) 
     	 { 

     	 Char = sText.charAt(i); 
     	 if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
	if(Char.indexOf('.') != -1)
	{
		count++;
		
	}	
      }

if(count > 1)
IsNumber = false;

   return IsNumber;
   
   }
