//---- V A L I D A T I O N    F U N T I O N  

function mf_validation(obj,type,msg) 
{ 

			if (type=="B") 
			{ 
		 
				if(obj.value=="") 
				{ 
					alert(msg); 
					obj.focus(); 
					return false; 
				} 
			} // end if type B 
			if (type=="N") 
			{ 
				if(obj.value=="" || obj.value<=0 || isNaN(obj.value)==true) 
				{ 
					alert(msg); 
					obj.focus(); 
					return false; 
				} 
 
			} // end if type N 
 
			if (type=="E") 
			{ 
				if(emailCheck(obj.value)==false) 
					{ 
						alert(msg); 
						obj.focus(); 
						return false; 
					} 
 
			} // end if type E 
 
} // END FUNCTION  


function mf_phone(obj,msg) 
{ 

	var echeck=/^[0-9]+([-][0-9])*[0-9]+/;
	if(!echeck.test(obj.value))
	{
		alert(msg); 	
		obj.focus(); 
		return false; 

	}


}


function emailCheck(str1) 
{ 
	for (var i = 0; i < str1.length; i++)
		{
			 var ch = str1.substring(i, i + 1);
			if ( ((ch < "a" || "z" < ch) && (ch < "64" || "Z" < ch)) && (ch < "0" || "9" < ch) && (ch != '_') && (ch != '.'))
				return false;
		}

		echeck=/^[a-zA -Z0-9]+([._-][a-zA-Z0-9]+)*\@[a-zA-Z0-9]+([._-][a-zA-Z0-9]+)*\.[a-zA-Z]+([._-][a-zA-Z]+)*/;
		if(!echeck.test(str1))
			return false;


}//end of function emailCheck
