	function IsNumberPressed(bIncludeComma)
	{
		var nTabKey = 9;
		var nBkSpace = 8;
		var nDelKey = 46;
		var nShiftKey = 16;
		var nArrowLeft = 37;
		var nArrowRight = 39;
		var nHomeKey = 36;
		var nEndKey = 35;
		//var nCommaKey = 188;
		var nCommaKey = 190;
		var nAltCommaKey = 110;
		
	    var pressedKey = window.event.keyCode;
	    
	    //alert(pressedKey);
		
		return ( ( ( ( pressedKey > 47 ) && ( pressedKey < 58 ) ) ||
					( ( pressedKey > 95 ) && ( pressedKey < 106 ) ) ||
					(pressedKey == nBkSpace) || 
					( (pressedKey == nCommaKey) && (bIncludeComma) ) || 
					( (pressedKey == nAltCommaKey) && (bIncludeComma) ) || 
					(pressedKey == nTabKey) || 
					(pressedKey == nDelKey) || 
					(pressedKey == nShiftKey) ||
					(pressedKey == nHomeKey) ||
					(pressedKey == nEndKey) ||
					(pressedKey == nArrowLeft) || 
					(pressedKey == nArrowRight) ) );
		
	}
	
	
	function focusElem(sID)
	{
		var Elem = document.getElementById(sID);
		if (Elem) {
			Elem.select();
			Elem.focus();
		}
	}
	
	
	
	function checkObjectvalueBetween( oObj, nMin, nMax, bCanBeZero )
	{
		
		if (oObj) {
		
			var sValue = oObj.value;
			if (Trim(sValue)=='') {
				sValue='0';
				oObj.value='0';
			} 
			
			if ((sValue < nMin) && ((sValue != 0) || (!bCanBeZero)) ) {
				oObj.value = nMin;
			} else
				{
					if (sValue > nMax) {
						oObj.value = nMax;
					}
			}
		}
	}



	function showHelp(sHelpID)
	{
		var wHelp = window.open('./ShowHelp.aspx?helpid=' + sHelpID, 'wHelp', 'toolbar=0; menu=0; width=500; height=500');
		wHelp.focus();
	}
	
	function LTrim(str)
	{
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(0)) != -1) {
		var j=0, i = s.length;

		while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
			j++;

		s = s.substring(j, i);
	}
	return s;
	}


	function RTrim(str)
	{
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
		var i = s.length - 1;

		while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
			i--;

		s = s.substring(0, i+1);
	}

	return s;
	}

	function Trim(str)
	{
	return RTrim(LTrim(str));
	}
	
	
	function RoundValue( sValue, nDigits )
	{
		var nValue = 0.00000;
		nValue = parseFloat(sValue);
		nValue = nValue.toFixed(nDigits);
		return(nValue);
	}
	
	