function isNumberKey(evt) {
	if(evt.alterKey)
		return false;
	if(evt.shiftKey)
		return false;
	
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if (charCode != 108 && evt.ctrlKey || charCode == 46)
		return true;
	if(charCode >= 96 && charCode <= 105)
		return true;
	if ( (charCode > 31 && (charCode < 48 || charCode > 57)))
		return false;

	return true;
}

function skipToNextField(obj, charCount, nextField, prevField, evt) {
	var val = obj.value;
	var objRegExp  = /(^-?\d\d*$)/;

	var result = objRegExp.test(val);
	if(!result) {
		obj.value = "";
		return false;
	}
	var caret = doGetCaretPosition(obj);
	
	if(obj.value.length >= charCount && caret >= charCount) {
		var obj_next = document.getElementById(nextField).focus();
		
		doSetCaretPosition(obj_next, 0);
	}
}
function skipToPrevField(obj, prevField, evt) {
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	var caret = doGetCaretPosition(obj);
}
/*
 **  Returns the caret (cursor) position of the specified text field.
 **  Return value range is 0-oField.length.
 */
 function doGetCaretPosition (oField) {

   // Initialize
   var iCaretPos = 0;

   // IE Support
   if (document.selection) { 

     // Set focus on the element
     oField.focus ();

     // To get cursor position, get empty selection range
     var oSel = document.selection.createRange ();

     // Move selection start to 0 position
     oSel.moveStart ('character', -oField.value.length);

     // The caret position is selection length
     iCaretPos = oSel.text.length;
   }

   // Firefox support
   else if (oField.selectionStart || oField.selectionStart == '0')
     iCaretPos = oField.selectionStart;

   // Return results
   return (iCaretPos);
 }
 /*
  **  Sets the caret (cursor) position of the specified text field.
  **  Valid positions are 0-oField.length.
  */
  function doSetCaretPosition (oField, iCaretPos) {

    // IE Support
    if (document.selection) { 

      // Set focus on the element
      oField.focus ();
 
      // Create empty selection range
      var oSel = document.selection.createRange ();
 
      // Move selection start and end to 0 position
      oSel.moveStart ('character', -oField.value.length);
 
      // Move selection start and end to desired position
      oSel.moveStart ('character', iCaretPos);
      oSel.moveEnd ('character', 0);
      oSel.select ();
    }

    // Firefox support
    else if (oField.selectionStart || oField.selectionStart == '0') {
      oField.selectionStart = iCaretPos;
      oField.selectionEnd = iCaretPos;
      oField.focus ();
    }
  }
