      function validateDecInput(ctl) {
         if (event.keyCode > 47 && event.keyCode < 58) {
	        // do everything as usual
	     }
         else {
            if (event.keyCode == 46) {
               // decimal point pressed on keyboard.
               var p=ctl.value.indexOf(".");
               // has a decimal point already been entered?
               if (p > -1) {
                  event.keyCode = 0; // cancel the decimal point keystroke
               } // end if
            } else {
	       event.keyCode = 0; // cancel the non numeric keystroke
	    } // end if
	 } // end if      
      } // end of function validateDecInput()
//   ----------------------------------------------------------------------------


//   +--------------------------------------------------------------------------+
//   | Allow pasting of decimal numbers only.                                   |
//   |   Use the Following in your <INPUT> tag:                                 |
//   |             onKeyPress="validateDecInput(this);"                         |
//   |             onpaste="validateDecPaste(this);"                            |
//   +--------------------------------------------------------------------------+
      function validateDecPaste(ctl) {
         var s = clipboardData.getData("Text");
	 var n = 0;
	 var bBad = false;
         var s2 = "";
	 var sCheck = "0123456789.";
	 var p=0;
	 var nDecCount = 0;

	 for (n=0; n < s.length; n++) {
	    s2 = s.substr(n,1);
	    p=sCheck.indexOf(s2);
	       if (p==-1) {
		  bBad = true;
	          break;
	       } // end if
	       if (s2 == ".") {
	          nDecCount++;
	       } // end if
	 } // next n

            if (nDecCount > 1) {
               bBad = true;
            } // end if
            
	    if (bBad == true) {
               clipboardData.setData("Text",ctl.value);
               alert("you can only paste a number to this field.");
	    } // end if      
      } // end of function validateDecPaste()
//   ----------------------------------------------------------------------------      
      
      
//   +--------------------------------------------------------------------------+
//   | Allow input of numeric digits only.                                      |
//   |   Use the Following in your <INPUT> tag:                                 |
//   |             onKeyPress="validateIntInput();"                             |
//   |             onpaste="validateIntPaste(this);"                            |
//   +--------------------------------------------------------------------------+
      function validateIntInput() {
         if (event.keyCode > 47 && event.keyCode < 58) {
	        // do everything as usual
	     }
         else {
	    event.keyCode = 0; // cancel the non numeric keystroke
	 } // end if
      } // end of function validateIntInput()
//   ----------------------------------------------------------------------------   


//   +--------------------------------------------------------------------------+
//   | Allow pasting of numeric digits only.                                    |
//   |   Use the Following in your <INPUT> tag:                                 |
//   |             onKeyPress="validateIntInput();"                             |
//   |             onpaste="validateIntPaste(this);"                            |
//   +--------------------------------------------------------------------------+
      function validateIntPaste(f) {
         var s = clipboardData.getData("Text");
	 var n = 0;
	 var bBad = false;
         var s2 = "";
	 var sCheck = "0123456789";
	 var p=0;

	 for (n=0; n < s.length; n++) {
	    s2 = s.substr(n,1);
	    p=sCheck.indexOf(s2);
	       if (p==-1) {
		  bBad = true;
	          break;
	       } // end if
	    } // next n

	    if (bBad == true) {
               clipboardData.setData("Text",f.value);
               alert("you can only paste a number to this field.");
	    } // end if
      } // end of function validateIntPastr()
//   ----------------------------------------------------------------------------   
   
