

function fnSubmit()
{
	with (document.frmInfo)
	{
		if(name.value=="")
		{
			alert("Please Enter Your Name.");
			name.focus();
			return false;
		}
		
		if(selday.value=="0")
		{
			alert("Please Select Your day of Birth.");
			selday.focus();
			return false;
		}
		
		if(selmonth.value=="0")
		{
			alert("Please Select Your month of Birth.");
			selmonth.focus();
			return false;
		}
		
		if(selyear.value=="0")
		{
			alert("Please Select Your year of Birth.");
			selyear.focus();
			return false;
		}
		
		if(type.value=="0")
		{
			alert("Please Select Type of Loan.");
			type.focus();
			return false;
		}
		
		if(selCity.value=="0")
		{
			alert("Please Select Your City.");
			selCity.focus();
			return false;
		}
		
		if(address1.value=="")
		{
			alert("Please Enter Your Address With Pincode.");
			address1.focus();
			return false;
		}
		
		if(txtContact.value=="-STD-")
		{
			alert("Please Mention STD Code.");
			txtContact.focus();
			return false;
		}
		
		if (IsNumeric(txtContact.value)==false)
		{
		   alert ("Please Give Numeric Value");
		   txtContact.focus();
			return false;
		}
		
		if(txtContactNo.value=="")
		{
			alert("Please Mention Land Line No.");
			txtContactNo.focus();
			return false;
		}
		
		if (IsNumeric(txtContactNo.value)==false)
		{
		   alert ("Please Give Numeric Value");
			txtContactNo.focus();
			return false;
		}
		
		if(txtMobile.value=="")
		{
			alert("Please Mention Mobile No.");
			txtMobile.focus();
			return false;
		}
		
		if (IsNumeric(txtMobile.value)==false)
		{
		   alert ("Please Give Numeric Value");
			txtMobile.focus();
			return false;
		}
		
		if(txtEmail.value=="")
		{
			alert("Please Enter Email Id.");
			txtEmail.focus();
			return false;
		}
		else
		with (txtEmail)
              {
                apos=value.indexOf("@")
                dotpos=value.lastIndexOf(".")
				if (apos<1||dotpos-apos<2) 
  				{alert("Please Give Proper EmailID!");return false}
				
			  }
			  
		if(txtloanAmt.value=="")
		{
			alert("Please Enter Loan Ammount.");
			txtloanAmt.focus();
			return false;
		}
		
		if (IsNumeric(txtloanAmt.value)==false)
		{
		   alert ("Please Give Numeric Value");
			txtloanAmt.focus();
			return false;
		}
		
		if(txtMonInc.value=="")
		{
			alert("Please Enter Your Monthly Income.");
			txtMonInc.focus();
			return false;
		}
		
		if (IsNumeric(txtMonInc.value)==false)
		{
		   alert ("Please Give Numeric Value");
		
		}
		
		if(selEmpType.value=="0")
		{
			alert("Please Select Your Employment Type.");
			selEmpType.focus();
			return false;
		}
		
		if(txtOrgName.value=="")
		{
			alert("Please Enter Your Organisation Name.");
			txtOrgName.focus();
			return false;
		}
		
				
				
		if(selpoi.value=="0")
		{
			alert("Please Select Your Proof of Identity.");
			selpoi.focus();
			return false;
		}
		
		if(txtIDnumber.value=="")
		{
			alert("Please Enter Your ID Number.");
			txtIDnumber.focus();
			return false;
		}
		
		
		
		else {
				submit();
			}
		
		
		
	}
	
	
	
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
