/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
function echeck(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		return false
	 }

	 return true					
}
function valid()
{
	if(document.frmfeedback.txtName.value == "")
	{
		alert("Please enter your Name");
		document.frmfeedback.txtName.value = "";
		document.frmfeedback.txtName.focus();
		return false;
	}
	if(document.frmfeedback.txtEmail.value == "")
	{
		alert("Please enter your E-mail");
		document.frmfeedback.txtEmail.value = "";
		document.frmfeedback.txtEmail.focus();
		return false;
	}
	var emailID = document.frmfeedback.txtEmail;
	if (echeck(emailID.value) == false)
	{
		alert("Please enter correct your E-mail");
		document.frmfeedback.txtEmail.focus();
		return false;
	}
	if(document.frmfeedback.txtPhone.value == "")
	{
		alert("Please enter your Phone Number");
		document.frmfeedback.txtPhone.value = "";
		document.frmfeedback.txtPhone.focus();
		return false;
	}
	if(document.frmfeedback.txtPhone.value != "")
	{
	    chk1="01293456789";
		for(j=0;j!=document.frmfeedback.txtPhone.value.length;j++)
		{
		 ch1=document.frmfeedback.txtPhone.value.charAt(j);
		 rtn1=chk1.indexOf(ch1);
		 if(rtn1==-1)
		 {
			alert("Please enter correct your Phone Number!");
			document.frmfeedback.txtPhone.focus();
			return false;
			break;	
		 }
		}	
	}
return true;
}