// JavaScript Document

function validateEmailId(strObj)
		{
			s= strObj.value;
			apos = s.indexOf("@"); 
			dotpos = s.indexOf(".");
			lastpos = s.length-1;
			var strValid =/^[A-Za-z0-9\-\_\.\@\;\,\']/ ;
			var strEmail,arrEmail,strFlag,strEmailAddr ;

			strEmail="";

			for(k=0;k<s.length;k++)
			{
				if(s.charCodeAt(k)!=13 && s.charCodeAt(k)!=10 && s.charCodeAt(k)!=32)
				{
					strEmail=strEmail + s.charAt(k);
				}
			}
			for(var i=0;i<strObj.value.length-1;i++)
   				{ 
   					if((strObj.value.charAt(i).search(strValid)) == -1)
   					{
   						alert("Please enter valid email id");
						strObj.select();
						strFlag = "false" ;
       						return false;
   					}
   				}
				    
				apos = strObj.value.indexOf("@"); 
				dotpos = strObj.value.indexOf(".");
				lastpos = strObj.value.length-1;

				if((apos<1) || (dotpos<1)||(dotpos==lastpos))
				{
					alert("Please enter valid email id");
					strObj.select();
					strFlag = "false" ;
						return false;
				}			
				if(strFlag != "false")
				{				
					return true ;
				}
				else
				{
					return false ;
				}
			}
			
function Verify()
		{		
		if(document.Client.rdoCorp.checked)
			{
			document.Client.hidClient.value = "Corporation";
			}
			 if(document.Client.rdoInd.checked)
			{
			document.Client.hidClient.value = "Individual";
			}
		if(document.Client.txtName.value=="")
			{
				alert("Please enter your Name.");
				document.Client.txtName.focus();
			}
			if(document.Client.txtEmail.value=="")
			{
				alert("Please enter your email id.");
				document.Client.txtEmail.focus();
			}	
			if(document.Client.txtPhone.value=="")
			{
			alert("Please enter your Phone Number.");
			document.Client.txtPhone.focus();
			}		
			
			if(document.Client.txtEmail.value!="" && !validateEmailId(document.Client.txtEmail))
			{
				document.Client.txtEmail.focus();
			}
		 if(document.Client.txtPhone.value != "" && document.Client.txtEmail.value != "" && document.Client.txtName.value != "")
			 {			
			document.Client.hidSave.value = "Save";
			document.Client.submit();
			 }
		}
		