function checkNumeric(evt)
{
  var oEvent = (window.event) ? window.event : evt;

  //hmmm in mozilla this is jacked, so i have to record these seperate
  //what key was pressed
  var nKeyCode = oEvent.keyCode ? oEvent.keyCode :
                 oEvent.which ? oEvent.which :
                 void 0;

  var bRet = true;


  var bIsFunctionKey = false;
  var asciiBack = 8;
  var asciiTab = 9;
  var asciiSHIFT = 16;
  var asciiCTRL = 17;
  var asciiALT = 18;
  var asciiHome = 36;
  var asciiLeftArrow = 37;
  var asciiRightArrow = 39;
  var asciiMS = 92;
  var asciiView = 93;
  var asciiF1 = 112;
  var asciiF2 = 113;
  var asciiF3 = 114;
  var asciiF4 = 115;
  var asciiF5 = 116;
  var asciiF6 = 117;
  var asciiF11 = 122;
  var asciiF12 = 123;
  var asciiF11 = 122;
  //hmmm in mozilla the keycode would contain a function key ONLY IF the charcode IS 0
  //else key code and charcode read funny, the charcode for 't'
  //returns 116, which is the same as the ascii for F5
  //SOOO,... to check if a the keycode is truly a function key,
  //ONLY check when the charcode is null OR 0, IE returns null, mozilla returns 0

  if (oEvent.charCode == null || oEvent.charCode == 0) {
    bIsFunctionKey = (nKeyCode >= asciiF2 && nKeyCode <= asciiF12) || (nKeyCode == asciiALT || nKeyCode == asciiMS || nKeyCode == asciiView || nKeyCode == asciiHome || nKeyCode == asciiBack)
  }


  //convert the key to a character, makes for more readable code
  var sChar = String.fromCharCode(nKeyCode).toUpperCase();

  //get the active tag that has the focus on the page, and its tag type
  var oTarget = (oEvent.target) ? oEvent.target : oEvent.srcElement;
  var sTag = oTarget.tagName.toLowerCase();
  var sTagType = oTarget.getAttribute("type");

  var bAltPressed = (oEvent.altKey) ? oEvent.altKey : oEvent.modifiers & 1 > 0;
  var bShiftPressed = (oEvent.shiftKey) ? oEvent.shiftKey : oEvent.modifiers & 4 > 0;
  var bCtrlPressed = (oEvent.ctrlKey) ? oEvent.ctrlKey : oEvent.modifiers & 2 > 0;

  if (nKeyCode < 45 || nKeyCode > 57) {
    bRet = false;
  } else if (bCtrlPressed && (sChar == 'A' || sChar == 'C' || sChar == 'V' || sChar == 'X')) { // ALLOW cut, copy and paste, and SELECT ALL
    bRet = true;
  } else if (bShiftPressed && nKeyCode == asciiTab) {//allow shift + tab
    bRet = true;
  }


  bRet = bRet && (sChar == '0' || sChar == '1' || sChar == '2' || sChar == '3' || sChar == '4' || sChar == '5' || sChar == '6' || sChar == '7' || sChar == '8' || sChar == '9');

  if (!bRet) {
    try {
      oEvent.returnValue = false;
      oEvent.cancelBubble = true;

      if (document.all) { //IE
        oEvent.keyCode = 0;
      } else { //NS
        oEvent.preventDefault();
        oEvent.stopPropagation();
      }
    } catch(ex) {
      //alert(ex);
    }
  }
  return bRet;

}

function showTip(e, fArg)
{

  var posx = 0;
  var posy = 0;
  if (!e) var e = window.event;
  if (e.pageX || e.pageY)
  {
    posx = e.pageX;
    posy = e.pageY;
  }
  else if (e.clientX || e.clientY)
  {
    posx = e.clientX + document.body.scrollLeft;
    posy = e.clientY + document.body.scrollTop;
  }

  //Locate object
  var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']");

  if (tooltipOBJ != null)
  {
    //Assign position
    //var tooltipLft = (document.body.offsetWidth ? document.body.offsetWidth : document.body.style.pixelWidth) - (tooltipOBJ.offsetWidth ? tooltipOBJ.offsetWidth : (tooltipOBJ.style.pixelWidth ? tooltipOBJ.style.pixelWidth : 380)) - 30;
    //var tooltipTop = (document.body.scrollTop || document.documentElement.scrollTop) + event.clientY;

    if (navigator.appName == 'Netscape')
    {
      tooltipLft = posx + 10;
      tooltipTop = posy + 10;
      tooltipOBJ.style.top = tooltipTop + "px";
      tooltipOBJ.style.left = tooltipLft + "px";
      tooltipOBJ.style.visibility = "visible";
    }
    else
    {
      tooltipLft = e.clientX + 10;
      tooltipTop = (document.body.scrollTop || document.documentElement.scrollTop) + e.clientY + 10;

      if ((e.clientX > tooltipLft) && (e.clientY < (tooltipOBJ.scrollHeight?tooltipOBJ.scrollHeight:tooltipOBJ.style.pixelHeight) + 10))
      {
        tooltipTop = (document.body.scrollTop?document.body.scrollTop:document.body.offsetTop) + e.clientY + 20;
      }
      tooltipOBJ.style.left = tooltipLft;
      tooltipOBJ.style.top = tooltipTop;
      tooltipOBJ.filters(0).Apply();
      tooltipOBJ.style.visibility = "visible";
      tooltipOBJ.filters(0).Play();
    }
  }
}

function hideTip(fArg)
{
  var tooltipOBJ = (document.getElementById) ? document.getElementById('tt' + fArg) : eval("document.all['tt" + fArg + "']");
  if (tooltipOBJ != null)
  {
    tooltipOBJ.style.visibility = "hidden";
  }
}

