function blnkN()
{
document.form1.name.value="";	
	
}
function blnkE()
{
document.form1.email.value="";	
	
}

function blnkP()
{
document.form1.phone.value="";	
	
}

function blnkC()
{
document.form1.comments.value="";	
	
}

function valform()
{
	var uname="";
	var regexp=/^[a-zA-Z ]+$/;
	var msg="";
	uname=document.form1.name.value;
	var len=document.form1.name.value.length;
	var lblname=document.getElementById('name')
	var emailID=document.form1.email.value;
	var mobile="";
	var mobregexp=/^[\d-\+]+$/;
	mobile=document.form1.phone.value;
	var moblen=document.form1.phone.value.length;
	var choice=document.form1.services.value;
	var remarks="";
	remarks=document.form1.comments.value;
	var comlen=document.form1.comments.value.length; 
	var imglen=document.form1.img.value.length;
	//alert(imglen);
	if((uname=="")||(len<4)||(len>300)||(!regexp.test(uname)))
	{
	  document.form1.name.focus();
	  lblname.style.color='red';
	  msg="\n Enter Name 4-300 alphabets only";
	  alert(msg);
	  return false;
	}
	else if( !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailID)))
	{
		
		var lblemail=document.getElementById('email')
		lblemail.style.color='red';
	 	document.form1.email.focus();
		alert("Enter valid email id ");
		return false;
	}
	else if((mobile=="")||(moblen<2)||(moblen>40)||(!mobregexp.test(mobile)))
	{
	  	var lblmob=document.getElementById('phone')
	  	lblmob.style.color='red';
	  	document.form1.phone.focus();
	  	alert("Enter valid Phone no.");
		return false;
	}
	else if(choice== 0)
	{
       	alert("You didn't select services.\n");
		return false;
	}
	else if((comlen<15)||(comlen>3500))
	{
		var lblcom=document.getElementById('comments');
	  	lblcom.style.color='red';
	  	document.form1.comments.focus();
		alert('\n Enter 4-500 characters in comments');
		return false;
	}
	else if((imglen<4) || (imglen>7))
	{
		var lblimg=document.getElementById('img');
	  	lblimg.style.color='red';
	  	document.form1.img.focus();
		alert("Enter Proper Captcha Code");
		return false;
		
	}
/*	else if(! (document.form1.img.value=='<%=session("captcha")%>'))
	{
		alert("hi");
		return false;
	}*/
	else
	 return true;
}


