
function validat()
{
if(document.frm1.txt_name.value=="")
{
alert("Enter the name");
document.frm1.txt_name.focus();
return false;
}
if(document.frm1.txt_compname.value=="")
{
alert("Enter the Company Name");
document.frm1.txt_compname.focus();
return false;
}
if(document.frm1.txt_country.value=="")
{
alert("Enter the Country");
document.frm1.txt_country.focus();
return false;
}
if(document.frm1.txt_phone.value=="")
{
alert("Enter the Phone number");
document.frm1.txt_phone.focus();
return false;
}
if(document.frm1.txt_email.value=="")
{
alert("Enter the E_mail id");
document.getElementById("txt_email").focus();
return false;
}
if(document.frm1.txt_industry.value=="")
{
alert("Enter the Industry");
document.getElementById("txt_industry").focus();
return false;
}
if(document.frm1.txt_loandesired.value=="")
{
alert("Enter the Loan Desired");
document.getElementById("txt_loandesired").focus();
return false;
}
if(document.frm1.txt_loansize.value=="")
{
alert("Enter the Loan Size");
document.getElementById("txt_loansize").focus();
return false;
}
if(document.frm1.txt_sales.value=="")
{
alert("Enter the year Sales");
document.getElementById("txt_sales").focus();
return false;
}
if(document.frm1.txt_business.value=="")
{
alert("Enter the Years in Business");
document.getElementById("txt_business").focus();
return false;
}

/*if(document.frm1.txt_stpro.value=="")
{
alert("Enter When start this project");
document.frm1.txt_stpro.focus;
return false;
}*/
/*if(document.frm1.txt_country.value=="")
{
alert("Enter the Country");
document.frm1.txt_country.focus;
return false;
}

if(document.frm1.txt_phone.value=="")
{
alert("Enter the Phone number");
document.frm1.txt_phone.focus;
return false;
}
if(document.frm1.details.value=="")
{
alert("Enter your comments");
document.frm1.details.focus;
return false;
}*/
}

function ChkNumber(obj)
{
	
	 var strValidChars="0123456789";
	 var strChar;
	 var TotalNumCount=0;
	 var temp="";
	 var blnResult=true;
	 var strString;
	 strString=obj.value;
	 for(i=0;i<strString.length&&blnResult==true; i++)
	 {
		   strChar=strString.charAt(i);
		   if(strValidChars.indexOf(strChar)==-1)
		   {
			   blnResult=false;
		   }
		   else
		   {
			      temp+=strChar;
				  TotalNumCount++;
		   }
	 }
	 if(!blnResult)
	 {
		     obj.value=temp;
	 }
	 //return blnresult;
}
function ChkStrings(obj)
{
	
	var strValidChars="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var strChar;
	var TotalNumCount=0;
	var temp="";
	var blnResult=true;
	var strString;
	strString=obj.value;
	for(i=0; i<strString.length && blnResult==true; i++)
		{
			strChar=strString.charAt(i);
			if(strValidChars.indexOf(strChar)==-1)
			{
				blnResult=false;
			}
			else
			{
				if(strChar==" ")
				{
					if(strString.charAt(i+1)==" ")
						blnResult=false;
				}
				temp+=strChar;
				TotalNumCount++;
			}
			
		}
		if(temp.length==1)
		{
			if(strString.charAt(0)==" ")
			{
			temp="";
			blnResult=false;
			
			}
		}
	if(!blnResult)
	{
		obj.value=temp;
	}
	//return blnresult;
}
function ChkString(obj)
{
	
	var strValidChars="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ.";
	var strChar;
	var TotalNumCount=0;
	var temp="";
	var blnResult=true;
	var strString;
	strString=obj.value;
	for(i=0; i<strString.length && blnResult==true; i++)
		{
			strChar=strString.charAt(i);
			if(strValidChars.indexOf(strChar)==-1)
			{
			 blnResult=false;
			}
			else
			{
				if(strChar==" ")
				{
					if(strString.charAt(i+1)==" ")
						blnResult=false;
				}
				temp+=strChar;
				TotalNumCount++;
			}
			
		}
		if(temp.length==1)
		{
			if(strString.charAt(0)==" ")
			{
			temp="";
			blnResult=false;
			
			}
		}
	if(!blnResult)
	{
		obj.value=temp;
	}
	//return blnresult;
}
function ChkStrCom(obj)
{
	    var strValidChars="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.,()-_/";
		var strChar;
		var TotalNumCount=0;
		var temp="";
		var blnResult=true;
		var strString;
		strString=obj.value;
		
		for(i=0; i<strString.length && blnResult==true; i++)
		{
			strChar=strString.charAt(i);
			if(strValidChars.indexOf(strChar)==-1)
			{
				blnResult=false;
			}
			else
			{
				if(strChar==" ")
				{
					if(strString.charAt(i+1)==" ")
						blnResult=false;
				}
				temp+=strChar;
				TotalNumCount++;
			}
			
		}
		if(temp.length==1)
		{
			if(strString.charAt(0)==" ")
			{
			temp="";
			blnResult=false;
			
			}
		}
		
		if(!blnResult)
		{
			obj.value=temp;
		}
		//return blnresult;
}

function validate() {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.getElementById('txt_email').value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address');
	  document.getElementById('txt_email').focus();
      return false;
   }
}