	

if( document.captureEvents && Event.KEYDOWN ) {

  document.captureEvents( Event.KEYDOWN );

}



function ValidateChars(e)

{



	if( !e ) {



		if( window.event ) {

		  //Internet Explorer

		  e = window.event;

		} else {

		  //total failure, we have no way of referencing the event

		  return;

		}

	}

	if( typeof( e.keyCode ) == 'number'  ) {

		//DOM

		e = e.keyCode;

	} else if( typeof( e.which ) == 'number' ) {

		//NS 4 compatible

		e = e.which;

	} else if( typeof( e.charCode ) == 'number'  ) {

		//also NS 6+, Mozilla 0.9+

		e = e.charCode;

	} else {

		//total failure, we have no way of obtaining the key code // suck my balls

		return;

	}

	key = e;



	//        + home, del, end, tab, backspace       

	if ((key >= 97 && key <= 122) || (key >= 192 && key <= 255) || (key >= 65 && key <= 90) || key == 8 || key == 32 || key == 46 || key == 35 || key == 36 || key == 9 || (key >= 37 && key <= 40)  )

		return true;

	return false;

}



function ValidateNumbers(e)

{

		if( !e ) {

		if( window.event ) {

		  //Internet Explorer

		  e = window.event;

		} else {

		  //total failure, we have no way of referencing the event

		  return;

		}

	}

	if( typeof( e.keyCode ) == 'number'  ) {

		//DOM

		e = e.keyCode;

	} else if( typeof( e.which ) == 'number' ) {

		//NS 4 compatible

		e = e.which;

	} else if( typeof( e.charCode ) == 'number'  ) {

		//also NS 6+, Mozilla 0.9+

		e = e.charCode;

	} else {

		//total failure, we have no way of obtaining the key code 

		return;

	}

	key = e;



	//        + home, del, end, tab, backspace       

	if ((key >= 48 && key <= 57) || key == 8 || key == 46 || (key >= 37 && key <= 40) || key == 35 || key == 36 || (key >= 96 && key <= 105) || key == 9)

		return true;

	return false;

}



function ValidateFloat(e)

{

		if( !e ) {



		if( window.event ) {

		  //Internet Explorer

		  e = window.event;

		} else {

		  //total failure, we have no way of referencing the event

		  return;

		}

	}

	if( typeof( e.keyCode ) == 'number'  ) {

		//DOM

		e = e.keyCode;

	} else if( typeof( e.which ) == 'number' ) {

		//NS 4 compatible

		e = e.which;

	} else if( typeof( e.charCode ) == 'number'  ) {

		//also NS 6+, Mozilla 0.9+

		e = e.charCode;

	} else {

		//total failure, we have no way of obtaining the key code // suck my balls

		return;

	}

	key = e;



	//         + home, del, end, tab, backspace,           

	if ((key >= 48 && key <= 57) || key == 8 || key == 46 || (key >= 37 && key <= 40) || key == 35 || key == 36 || (key >= 96 && key <= 105) || key == 9 || key == 190 || key == 110)

		return true;

	return false;

}
