function intOnly(i) 
{
	if(i.value.length>0) 
	{
		i.value = i.value.replace(/[^\d]+/g, ''); 
	}
}

function EnableNumericOnly(e)
{
	var numerics = new Array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
	var key;
    if(window.event)
    {
    	key = window.event.keyCode;     //IE
    } else {
		key = e.which;     //firefox
	}
	
	var allowedKeys = new Array(8, 48);//Delete, backspace
	for(i=0; i<numerics.length; i++)
    {
		if (key == allowedKeys[i]) {
			return true;
		}
	}
	//Please note 632nn are arrow keys in mac only...
	var allowedKeys = new Array('0', '8', '9', '33', '34', '35', '36', '37', '38', '39', '40', '46', '96', '97', '98', '99', '100', '101', '102', '103', '104', '105', '106', '107', '63232', '63233', '63234', '63235', '63272');
	for(i=0; i<allowedKeys.length; i++)
	{
		if (allowedKeys[i] == key)
		{
			return true;
		}
	}
	for(i=0; i<numerics.length; i++)
    {
		//case-insensitive comparation
        if(numerics[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
		{
			return true;
		}
	}
/*	alert(key);
	alert(String.fromCharCode(key));
*/
	return false;
}


function ShowHideArea(){
	var args = ShowHideArea.arguments;
	var ctrl=findObj(args[0]);
	var flag = args[1];
	if (ctrl) {
		if (flag) {
			ctrl.style.visibility="visible";
			ctrl.style.display="inline";
		} else {
			ctrl.style.visibility="hidden";
			ctrl.style.display="none";
		}
	}
}

function findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
