function checkInput(obj, Allow)
		{
	    if(Allow == 1 && AllowOnly('a..z\'.- ')) //First Name, Last name
	    {
	        return false;
	    }
	    if(Allow == 2 && AllowOnly('0..9'))  //Numeric only
	    {
	        return false;
	    }
	    if(Allow == 3 && AllowOnly('a..z|0..9| \'-.&\(\)')) //Institution names, Addresses
	    {
	        return false;
	    }
	    if(Allow == 4 && AllowOnly('0..9|-/ \(\)'))  //Phone Numbers
	    {
	        return false;
	    }
	    if(Allow == 5 && AllowOnly('a..z|0..9|_.@ '))  //Email address
	    {
	        return false;
	    }
	     if(Allow == 6 && AllowOnly('a..z|0..9|_$.'))  //Username, password
	    {
	        return false;
	    }	
	    if(Allow == 7 && AllowOnly('0..9|/-'))  //Date
	    {
	        return false;
	    }
	    if(Allow == 8 && AllowOnly('a-z|0..9|_:/.-?%&=*+')) //URL
	    {
	        return false;
	    }
	    
	   if(Allow == 9 && AllowOnly('a..z'))  //text only
	    {
	        return false;
	    }
}

function CheckTextArea()
  {
        if(event.keyCode!=13)
        {
           AllowOnly('a..z|.|_|A..Z|0..9|@|!|#|$|%|^|&| |+|\(|\)|/|-|,|;|:|\'');
        }
}
function AllowOnly(Expression, e)
{
	Expression = Expression.replace(/a..z/i, "abcdefghijklmnopqrstuvwxyz");
	Expression = Expression.replace(/0..9/i, "0123456789");
	Expression = Expression.replace(/|/i, "");

    if (!e) var e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	
	var ch = String.fromCharCode(code);
	ch = ch.toLowerCase();
	Expression = Expression.toLowerCase();
	var a = Expression.indexOf(ch);
	if (a == -1) {
	    if (e.keyCode) window.event.keyCode = 0; //IE
	    else if (e.which) e.preventDefault(); //FF
	}
}


