	// LAST UPDATED 11/23/2006
	
	// http://www.somacon.com/p143.php
	// return the value of the radio button that is checked
	// return an empty string if none are checked, or
	// there are no radio buttons
	function getCheckedValue(radioObj) {
		if(!radioObj)
			return "1";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
		{
			alert(radioObj.value)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "2";
		}
		for(var i = 0; i < radioLength; i++) {			
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "3";
	}
	
	// http://www.somacon.com/p143.php
	// set the radio button with the given value as being checked
	// do nothing if there are no radio buttons
	// if the given value does not exist, all the radio buttons
	// are reset to unchecked
	function setCheckedValue(radioObj, newValue) {
		if(!radioObj)
			return;
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			radioObj.checked = (radioObj.value == newValue.toString());
			return;
		}
		for(var i = 0; i < radioLength; i++) {
			radioObj[i].checked = false;
			if(radioObj[i].value == newValue.toString()) {
				radioObj[i].checked = true;
			}
		}
	}

	
	//http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&87256B14007C5C6A87256AFB0013C722
	function trim(inputString)
	{
	   // Removes leading and trailing spaces from the passed string. Also removes
	   // consecutive spaces and replaces it with one space. If something besides
	   // a string is passed in (null, custom object, etc.) then return the input.
	   if (typeof inputString != "string") { return inputString; }
	   var retValue = inputString;
	   var ch = retValue.substring(0, 1);
	   while (ch == " ") { // Check for spaces at the beginning of the string
		  retValue = retValue.substring(1, retValue.length);
		  ch = retValue.substring(0, 1);
	   }
	   ch = retValue.substring(retValue.length-1, retValue.length);
	   while (ch == " ") { // Check for spaces at the end of the string
		  retValue = retValue.substring(0, retValue.length-1);
		  ch = retValue.substring(retValue.length-1, retValue.length);
	   }
	   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
		  retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	   }
	   return retValue; // Return the trimmed string back to the user
	} // End the "trim" function
	
	// http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&D3A3ACA9908EBBCB87256D420073A729&Remote
	// by Matt Holthe
	function isValidDateString(dateStr)		
	{
		var reg = /^\d{2}\/\d{2}\/\d{4}$/
		if (reg.test(dateStr) == false) { return false; }
		var parts = dateStr.split("/");
		var dt = new Date(parseFloat(parts[2]), parseFloat(parts[1]-1), parseFloat(parts[0]), 0, 0, 0, 0);
		if (parseFloat(parts[0]) != dt.getDate()) { return false; }
		if (parseFloat(parts[1])-1 != dt.getMonth()) { return false; }
		return true;
	} // End isValidDateString function	
	
	//Original Source: http://www.cs.tut.fi/~jkorpela/forms/file.html
	// FILE UPLOAD FORM - MP3 FORMAT
	function isMP3Format(ext)
	{
		ext = ext.substring(ext.length-3,ext.length);
	  	ext = ext.toLowerCase();
		if(ext != "mp3") { return false; }
		else { return true; }
	}

	//Original Source: http://www.cs.tut.fi/~jkorpela/forms/file.html	
	// FILE UPLOAD FORM - MP3 FORMAT	
	function isMPEGFormat(ext)
	{
		ext = ext.substring(ext.length-4,ext.length);
	  	ext = ext.toLowerCase();
//		if((ext != ".mpg") && (ext != "mpeg") && (ext != ".mov")){ return false; }
		if(ext != ".swf") { return false; }
		else { return true; }
	}
	
	function isImageFormat(ext)
	{
		ext = ext.substring(ext.length-4,ext.length);
	  	ext = ext.toLowerCase();
		if((ext != ".jpg") && (ext != "jpeg") && (ext != ".gif") && (ext != ".bmp")){ return false; }
		else { return true; }
	}

	function isUploadFormat(ext)
	{
		ext = ext.substring(ext.length-4,ext.length);
	  	ext = ext.toLowerCase();
		if((ext != ".jpg") && (ext != "jpeg") && (ext != ".gif") && (ext != ".swf") && (ext != ".mp3") && (ext != ".bmp") ){ return false; }
		else { return true; }
	}
				
	function isJPEGFormat(ext)
	{
		ext = ext.substring(ext.length-4,ext.length);
	  	ext = ext.toLowerCase();
		if((ext != ".jpg") && (ext != "jpeg")){ return false; }
		else { return true; }
	}
	
	function isBannerFormat(ext)
	{
		ext = ext.substring(ext.length-4,ext.length);
	  	ext = ext.toLowerCase();
		if((ext != ".jpg") && (ext != "jpeg") && (ext != ".gif") && (ext != ".bmp") && (ext != ".swf")){ return false; }
		else { return true; }
	}	
	
	// Contains http://
	function isHttpPrefixed(http)
	{
		http = http.substring(0,7);
	  	http = http.toLowerCase();
		if(http != 'http://') { return false; }
		else { return true; }
	}	
	
	// http://www.pbdr.com/vbtips/asp/JavaNumberValid.htm
    // check for valid numeric strings	
	function isNumeric(strString)
   	{
		var strValidChars = "0123456789.-";
		var strChar;
		var blnResult = true;
	
		if (strString.length == 0) return false;

	
		//  test strString consists of valid characters listed above
		for (i = 0; i < strString.length && blnResult == true; i++)
		{
			strChar = strString.charAt(i);
			if (strValidChars.indexOf(strChar) == -1) { blnResult = false; }
		}
		return blnResult;
   	}
	
   	/**
	* Returns the value of the selected radio button in the radio group, null if
	* none are selected, and false if the button group doesn't exist
	*
	* @param {radio Object} or {radio id} el
	* OR
	* @param {form Object} or {form id} el
	* @param {radio group name} radioGroup
	*/
	function $RF(el, radioGroup) {
		/*
		if($(el).type && $(el).type.toLowerCase() == 'radio') {
			var radioGroup = $(el).name;
			var el = $(el).form;
		} 
		else if ($(el).tagName.toLowerCase() != 'form') {
			return false;
		}
		
		var res = $(el).getInputs('radio', radioGroup).find(function(re) {return re.checked;});
		if(res != null) { return $F(res); } else { return "";	}
		*/
		var typeValue = Form.getInputs(el,'radio',radioGroup).find(function(radio) { return radio.checked; }).value;
		//alert(typeValue);
		return typeValue;
	}
   	
	// http://www.breakingpar.com/bkp/home.nsf/Doc!OpenNavigator&87256B280015193F87256C40004CC8C6
	// by Matt Holthe
	function isValidEmail(emailAddress)
	{
    	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    	return re.test(emailAddress);
	}	




