

function isEmpty(field, msg){
    //alert("in form_Validation");
	//alert(field.length);
	if(field.length == 0){
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
	return true;
}

function isNumeric(field, msg){
	var numericExpression = /^[0-9]+$/;
	if(field.match(numericExpression)){
		return true;
	} 
	else {
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}

function ispnr(field, msg){
	var numericExpression = /^[0-9-]+$/;
	if(field.match(numericExpression)){
		return true;
	} 
	else {
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}
function isChecked(field,msg){
   if(field==''){
     alert(msg);
     self.location="feedback.jsp";
     field.focus();
     return false;
   }
   else
     return true;
      
    
}
function isRadioChecked(field1,field2,msg){
   if((false==field1.checked) && (false==field2.checked)){
     alert(msg);
     self.location="feedback.jsp";
     field.focus();
     return false;
   }
   else
     return true;
      
    
}
function isAlphabet(field, msg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(field.match(alphaExp)){
		return true;
	}
	else {
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}

function isAlphanumeric(field, msg){
	var alphaExp = /^[\s0-9a-zA-Z]+$/;
	if(field.match(alphaExp)){
		return true;
	}
	else {
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}

function lengthRestriction(field, min, max, msg){
	var uInput = field;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	}
	else {
		//alert("Please enter between " +min+ " and " +max+ " characters in the " +msg+ " field!");
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}

function emailValidator(field, msg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(field.match(emailExp)){
		return true;
	}
	else {
		alert(msg);
		self.location="feedback.jsp";
		field.focus();
		return false;
	}
}

function test2()
{
	for(var i = 1;i<4;i++)
	{
		test3(i);
	}
}

function test3(i)
{
	var w1 = "m_";
	var w2 = "_n";
	word = w1 + i + w2;
	alert(word);
}
