<!-- hide script for older browsers
	
		function ignoreSpaces(string) {
			var temp = "";
			string = '' + string;
			splitstring = string.split(" ");
			for(j = 0; j < splitstring.length; j++) {
				temp += splitstring[j];
			}	
			return temp;
		} //end ignoreSpaces
		
		//Trim functions.
		function trim(stringToTrim) {
			return stringToTrim.replace(/^\s+|\s+$/g,"");
		}
		function ltrim(stringToTrim) {
			return stringToTrim.replace(/^\s+/,"");
		}
		function rtrim(stringToTrim) {
			return stringToTrim.replace(/\s+$/,"");
		}
		
		//Used for AJAX calls
		function GetXmlHttpObject() {
			var xmlHttp = null;
			try
			{
			// Firefox, Opera 8.0+, Safari
			xmlHttp = new XMLHttpRequest();
			}
			catch (e)
			{
			// Internet Explorer
			try
				{
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e)
				{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
			}
			return xmlHttp;
		}
		
		//Trims a string in javascript
		function trim(str) {
			str = str.replace(/^[ ]+(.*)$/, '$1'); // Trims leading spaces
			str = str.replace(/^(.*)[ ]+$/, '$1'); // Trims trailing spaces
			return str;
		}
		
		//Allows layers to be hidden/visible on an html page
		function toggleLayer(whichLayer, layerValue) {
			if (document.getElementById) {
				// this is the way the standards work
				var style2 = document.getElementById(whichLayer).style;
				//style2.display = style2.display = layerValue;
				//style2.display = style2.display? "":"block";
			}
			else if (document.all) {
				// this is the way old msie versions work
				var style2 = document.all[whichLayer].style;
				//style2.display = style2.display? "":"block";
				//style2.display = style2.display = layerValue;
			}
			else if (document.layers) {
				// this is the way nn4 works
				var style2 = document.layers[whichLayer].style;
				//style2.display = style2.display? "":"block";
				//style2.display = style2.display = layerValue;
			}
			style2.display = style2.display = layerValue;
		}

		/***********************************************************************************
		 *	function	:	launchWindow
		 *	purpose		:	Creates a new child window
		 *	parameters	:	file - The url of the file to be loaded into the new window
		 *					name - The name of the new child window
		 *					winwidth - The width of the new window
		 *					winheight - The height of the new window
		 *
		 *  NOTE: The name variable can contain NO spaces!
		 **********************************************************************************/
		function launchWindow(file, name, winwidth, winheight) {
			// Variable declaration
			var windowAttributes;

			// Set the window attributes
			windowAttributes = "width="+winwidth+",height="+winheight+",toolbar=no, " +
			"directories=no,location=no,menubar=no,resizable=yes,dependent=yes,scrollbars=yes";
			//alert(file + "  " + name.replace(/ /g, "_"));
			// Open the new window
			hwnd = window.open(file, name, windowAttributes);

			// Make sure the new window has the focus
			hwnd.focus()
		}

		function CheckDate(dates, field)  {
		    var REG = /^([1][0-2]|[1-9]|[0][1-9])(\/|\-)([1-2][0-9]|[1-9]|[0][1-9]|[3][0-1])(\/|\-)([1-2][0-9][0-9][0-9]|[0-9][0-9])$/;

			if (dates.match(REG))  {
			    null;
			} //end if
			else { 
				alert("The date you entered is invalid!\r\nCorrect Form: mm/dd/yyyy");
				field.value = "";
				field.focus();
				return false;	
			}  //  end else
		}  //  end CheckDate()
		
		function CheckEmail(emails, field)  {
			var REG = /^\S+\@\S+\.\S+$/;
			if (trim(emails).match(REG))  {
			    null;
			} //end if
			else { 
				alert("The e-mail address you entered is invalid!\r\nPlease try again.");
				//field.value = "";
				field.focus();
				return false;
		    } //end if	
		}  //  end CheckEmail()
		
		//Ensures the password has at least one digit
		function CheckPassword(number, field) {
			//Needs to be at least Five non-space characters and include at least 1 digit
			var REG = /^\S{5}\S*$/;
			var REG2 = /\d/;
			if ((number.match(REG)) && (number.match(REG2))) {
			    null;
			} //end if
			else { 
				alert("The password you entered is invalid!\r\nIt must be at least 5 characters long\r\nand contain at least 1 digit.");
				field.value = "";
				field.focus();
				return false;
		    } //end if	
		}  //  end CheckPassword()
		
		function CheckPhoneInt(phone, field) {
			//For international phone numbers. Does very little checks
			var REG = /^[^a-zA-Z][^a-zA-Z]+\d\d$/;   
			if (phone.match(REG))  {
			    null;
			} //end if
			else { 
				alert("The phone number you entered is invalid! Please try again.\r\nNOTE: Your phone number cannot contain any characters only numbers.");
				field.focus();
				return false;
		    } //end if	
		}  //  end CheckPhoneUS()
		
		function CheckPhoneUS(phone, field) {
			//for US phone numbers, invalid for international numbers
			var REG = /^\(*\d{3}\)*( *|-*)\d{3}-\d{4}$/;
			if (phone.match(REG))  {
			    null;
			} //end if
			else { 
				alert("The phone number you entered is invalid!\r\nPlease try again.");
				field.value = ""
				field.focus();
				return false;
		    } //end if	
		}  //  end CheckPhoneInt()
		
		function CheckNumeric(number, field) {
		    var REG = /^\d\d*$/;
		    if (number.match(REG)) {
				null;
		    } //end if
		    else {
				alert("The value you entered is invalid!\r\nIt must be an integer i.e. (1..2..3..).");
				field.value = "";
				field.focus();
				return false;
		    } //end else
		} //end CheckNumeric
		
		function CheckZip(number, field) {
		    var REG = /^(\d\d\d\d\d|\d\d\d\d\d-\d\d\d\d)$/;
		    if (number.match(REG)) {
				null;
		    } //end if
		    else {
				alert("The Zip Code you entered is invalid!\r\nIt needs to be in the following format:\r\n24060 or 24060-1234");
				field.value = "";
				field.focus();
				return false;
		    } //end else
		} //end CheckZip
		
		function CheckMoney(number, field) {
			var REG = /^\d+(.\d\d$|\d*$)/; 
			if (number.match(REG))  {
			    null;
			} //end if
			else { 
				alert("The value you entered is invalid!\r\nIt must be a monetary value.");
				field.value = ""
				field.focus();
				return false;
		    } //end if	
		}  //  end CheckMoney()
		
		function getSelectedRadio(buttonGroup) {
		   // returns the array number of the selected radio button or -1 if no button is selected
		   if (buttonGroup[0]) { 
			  // if the button group is an array (one button is not an array)
		      for (var i=0; i<buttonGroup.length; i++) {
		         if (buttonGroup[i].checked) {
		            return i
		         }
		      }
		   } 
		   else {
		      if (buttonGroup.checked) { 
				return 0; 
			  } 
			  // if the one button is checked, return zero
		   }
		   
		   // if we get to this point, no radio button is selected
		   return -1;
		} // Ends the "getSelectedRadio" function

		function getSelectedRadioValue(buttonGroup) {
			// returns the value of the selected radio button or "" if no button is selected
			var i = getSelectedRadio(buttonGroup);
			if (i == -1) {
			   return "";
			} 
			else {
			   if (buttonGroup[i]) { 
			      // Make sure the button group is an array (not just one button)
			      return buttonGroup[i].value;
			   } 
			   else { 
				  // The button group is just the one button, and it is checked
			      return buttonGroup.value;
			   }
			}
		} // Ends the "getSelectedRadioValue" function 
		
		function getSelectedCheckbox(buttonGroup) {
		   // Go through all the check boxes. return an array of all the ones
		   // that are selected (their position numbers). if no boxes were checked,
		   // returned array will be empty (length will be zero)
		   var retArr = new Array();
		   var lastElement = 0;
		   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
			  for (var i=0; i<buttonGroup.length; i++) {
				 if (buttonGroup[i].checked) {
					retArr.length = lastElement;
					retArr[lastElement] = i;
					lastElement++;
				 }
			  }
		   } else { // There is only one check box (it's not an array)
			  if (buttonGroup.checked) { // if the one check box is checked
				 retArr.length = lastElement;
				 retArr[lastElement] = 0; // return zero as the only array value
			  }
		   }
		   return retArr;
		} // Ends the "getSelectedCheckbox" function
		
		function getSelectedCheckboxValue(buttonGroup) {
		   // return an array of values selected in the check box group. if no boxes
		   // were checked, returned array will be empty (length will be zero)
		   var retArr = new Array(); // set up empty array for the return values
		   var selectedItems = getSelectedCheckbox(buttonGroup);
		   if (selectedItems.length != 0) { // if there was something selected
			  retArr.length = selectedItems.length;
			  for (var i=0; i<selectedItems.length; i++) {
				 if (buttonGroup[selectedItems[i]]) { // Make sure it's an array
					retArr[i] = buttonGroup[selectedItems[i]].value;
				 } else { // It's not an array (there's just one check box and it's selected)
					retArr[i] = buttonGroup.value;// return that value
				 }
			  }
		   }
		   return retArr;
		} // Ends the "getSelectedCheckBoxValue" function
	
	// stop hiding -->
