// emty field...................................
function isempty(val,msg)
  {
	 if(val.value=="")
	  {
		 alert(msg);
		 val.focus();
		 return false;
	  }
	  
	 return true; 
  }

// Numeric field.................................
function isnumeric(val,msg)
  {
	   var exp = /^[0-9]+$/;
		
	   if(val.value.match(exp))
	    {
		   return true;
		}
	   else
	    {
		   alert(msg);
		   val.focus();
		   return false;	 
		}
  }
  
// alphabate field................................  
function isalpha(val,msg)
  {
	   var exp = /^[a-zA-Z]+$/;
		
	   if(val.value.match(exp))
	    {
		   return true;
		}
	   else
	    {
		   alert(msg);
		   val.focus();
		   return false;	 
		}
  }
  
//alphanumeric field..................................  
function isalphanumeric(val,msg)
  {
	   var exp =  /^[0-9a-zA-Z]+$/;
		
	   if(val.value.match(exp))
	    {
		   return true;
		}
	   else
	    {
		   alert(msg);
		   val.focus();
		   return false;	 
		}
  }
  
// length of the field................................. 
function islength(val,min,max,msg)
  {
	   if(val.value.length >= min && val.value.length <= max)
		{
			return true;
		}
	   else
	    {
			alert("Please enter between " +min+ " and " +max+ " characters");
			val.focus();
			return false;
		}
	
  }
  
// email field..........................................

function isemail(val,msg)
  {
	   var exp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		
	   if(val.value.match(exp))
	    {
		   return true;
		}
	   else
	    {
		   alert(msg);
		   val.focus();
		   return false;	 
		}
  }
  
// selection field.......................................

function isselection(val,msg)
 {
	if(val.value == "Please Choose")
	 {
		alert(msg);
		val.focus();
		return false;
	 }
	else
	 {
		return true;
	 }
 }

  
  
  