/*   function pawan()
   {
   if(!string_value(document.frm.name,3,50,' name','Y'))
   {
   		return false;
   }
   if(!xxx(document.frm.email,7,35,' email','Y'))
   {
   		return false;
   }
   if(!phone_fax(document.frm.contact,8,50,' contact number','Y'))
   {
   		return false;
   }
   if(!string_value(document.frm.comment,25,255,' comment','y'))
   {
   		return false;
   }
   return true;
   }
   */
function pawan()
{
var numericExpression = /^[0-9]+$/;
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
var alphaExp = /^[a-zA-Z]+$/;
var name = document.frm.name.value.match(alphaExp);
var email = document.frm.email.value.match(emailExp);
var contact = document.frm.contact.value.match(numericExpression);
if(document.frm.name.value == "")
{
alert("Please Enter  Name!");
document.frm.name.focus();
return false;
}
if(!email)
{
alert("Please enter your email(Like a@b.com)!");
document.frm.email.focus();
return false;
}
if(!contact)
{
alert("Please enter a valid contact No.!");
document.frm.contact.focus();
return false;
exit;
}
else
{
return true;
}
}
//
//
//function phone_fax(fldname,minlength,maxlength,msg,required)
//	{
//	indx = "0123456789-[]()";
//
//	str = fldname.value;
//
//	
//	
//	if(required == 'Y'){
//		if(str.length == 0){
//			alert("please enter "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//
//if((str.length >0) && (str.length < minlength))
//	{
//		alert(msg+" allowed minimum "+minlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//
//	if(str.length > maxlength){
//		alert(msg+" allowed maximum "+maxlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//	if(str.length > 0){
//		
//			for(i=0;i<str.length;i++){
//			if(indx.indexOf(str.charAt(i)) < 0){
//				alert("invalid "+msg+".");
//				fldname.focus();
//				return false;
//			}
//		}
//	}
//	return true;
//}
//
//
//
//
//
//
//function xxx(fldname,minlength,maxlength,msg,required){
//	indx = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-@.";
//	str = fldname.value;
//
//	if(required == 'Y'){
//		if(str.length == 0){
//			alert("please enter "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//
//	if(str.length > maxlength){
//		alert(msg+" allowed maximum "+maxlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//	if(str.length > 0){
//		for(i=0;i<str.length;i++){
//			if(indx.indexOf(str.charAt(i)) < 0){
//				alert("invalid "+msg+".");
//				fldname.focus();
//				return false;
//			}
//		}
//
//		if((str.indexOf('@') < 0) || (str.indexOf('.') < 0)){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;			
//		}
//
//		if((str.charAt(0) == '@') || (str.charAt(0) == '.')){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//
//		if((str.charAt(str.length-1) == '@') || (str.charAt(str.length-1) == '.')){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//
//		if((str.indexOf('@@') >= 0) || (str.indexOf('..') >= 0)){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//
//		if((str.indexOf('@.') >= 0) || (str.indexOf('.@') >= 0)){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//
//		flag = 0;
//		for(i=0;i<str.length;i++){
//			if(str.charAt(i) == '@')
//				flag++;
//		}
//
//		if(flag > 1){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//	return true;
//}
//
//function number(fldname,minlength,maxlength,minvalue,maxvalue,msg,required){
//	indx = "0123456789";
//	str = fldname.value;
//	if(required == 'Y'){
//		if(str.length == 0){
//			alert("please enter "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//
//	if(str.length < minlength){
//		alert(msg+" must  be "+minlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//	
//	if(str.length > maxlength){
//		alert(msg+" allowed maximum "+maxlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//	if(str.length > 0){
//		for(i=0;i<str.length;i++){
//			if(indx.indexOf(str.charAt(i)) < 0){
//				alert("invalid "+msg+".");
//				fldname.focus();
//				return false;
//			}
//		}
//
//		if(eval(str) < minvalue){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//
//		if(eval(str) > maxvalue){
//			alert("invalid "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//	return true;
//}
//
//
//
//
//function string_value(fldname,minlength,maxlength,msg,required){
//	indx = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_:/, ";
//	str = fldname.value;
//	if(required == 'Y'){
//		if(str.length == 0){
//			alert("please enter "+msg+".");
//			fldname.focus();
//			return false;
//		}
//	}
//
//	if(str.length < minlength){
//		alert(msg+" must not be less than "+minlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//	if(str.length > maxlength){
//		alert(msg+" allowed only "+maxlength+" characters.");
//		fldname.focus();
//		return false;
//	}
//
//	if(str.length > 0){
//		for(i=0;i<str.length;i++){
//			if(indx.indexOf(str.charAt(i)) < 0){
//				alert("invalid "+msg+".\nSpecial Characters(! ~ @ # $ % @ ^ & * [] {} +) Not Allowed)");
//				fldname.focus();
//				return false;
//			}
//		}
//
//		flag = 0;
//		for(i=0;i<str.length;i++){
//			if(str.charAt(i) != " "){
//				flag = 1;
//				break;
//			}
//		}
//
//		if(flag == 0){
//			alert("please enter "+msg+".");
//			fldname.focus();
//			fldname.value = "";
//			return false;
//		}
//	}
//	return true;
//}
