    
    // returns true if the String passed in 
    // as a param is empty/nothing but whitespaces
    function isBlank(s) {
		var blank = true;
		if (s == null) {
			blank = true;
		} else {
			for (var n=0; n<s.length; n++ ) {
				var c = s.charAt(n);
				if ( (c != ' ') && (c != '\n') && (c != '\t') ) {
					blank = false;
					break;
				}			
			}
		}
		
		return blank;
    }
    
	// returns a String containing the number of 
	// decimal places requested in the numOfPlaces
	// parameter, based on the value in the 
	// markToDisplay parameter
	// the markToDisplay parameter should be a 
	// String which can be parsed into a float
	function fixDecPlaces(markToDisplay, numOfPlaces) {
		var fixedString = markToDisplay;
		
		var markNum = parseFloat(markToDisplay);
		if (!isNaN(markNum)) {
			// make sure the number has the designated
			// number of decimal places
			var indexOfDec = markToDisplay.indexOf(".");
			if (indexOfDec < 0) {				
				// add a dec point and trailing zeros
				var decStr = "";
				for (var n=0; n<numOfPlaces; n++) {
					decStr = decStr + "0";
				}
				if (decStr.length > 0) {
					fixedString = fixedString + "." + decStr;
				}
			} else {
				// compare the actual # of decimal places
				// to the desired # of decimal places
				var actualNumOfPlaces = 
					(markToDisplay.substring
						(indexOfDec + 1, markToDisplay.length)).length;								
				
				// if there are too many dec places
				// then round to the correct # of places
				if (actualNumOfPlaces > numOfPlaces) {
					var multiplyByStr = "1";
					for (var n=0; n<numOfPlaces; n++) {
						multiplyByStr = multiplyByStr + "0";
					} 
					var multiplyBy = parseFloat(multiplyByStr);					
					var roundedNum = Math.round(markNum*multiplyBy)/multiplyBy;
					fixedString = roundedNum + "";
					
					// now call this function recursively to make
					// sure the rounded number has the correct
					// # of decimal places showing
					fixedString = fixDecPlaces(fixedString, numOfPlaces);
				}		
						
				// if there are not enough dec places
				// then append some trailing zeros
				else if (actualNumOfPlaces < numOfPlaces) {
					var difference = numOfPlaces - actualNumOfPlaces;
					var zeros = "";
					for (var n=0; n<difference; n++) {
						zeros = zeros + "0";
					}
					fixedString = markToDisplay + zeros;
				}
			}
		}
		
		return fixedString;
	} 
	
	// sDate must be in the format MM/DD/YYYY 
	// found this code here: http://www.codingforums.com/archive/index.php/t-14325.html
	function isDate(sDate) {	
		if (sDate == null) {
			return false;
		}
		var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/
		if (re.test(sDate)) {
			var dArr = sDate.split("/");
			var d = new Date(sDate);
			return d.getMonth() + 1 == dArr[0] && d.getDate() == dArr[1] && d.getFullYear() == dArr[2];
		}
		else {
			return false;
		}
	}
	
	function isNumber(sNum) {
		var isANumber = false;
		
		// parseFloat returns a float consisting
		// of the first number chars in the string
		// even if they are trailed by non-number chars
		var num = parseFloat(sNum);
		if (!isNaN(num)) {
			isANumber = true;
			
			// now see if there were any String
			// chars that were thrown away by parseFloat,
			// and if so, return false
			if(sNum.length != num.toString().length) {
				isANumber = false;
			}
		}
		
		return isANumber;
	}

 