<!-- hide scripting from old browsers

	function getDayOWeek(dow) {
		var strDow;
		
		switch(dow) {
			case 0:
				strDow = "Sunday";
				break;
			case 1:
				strDow = "Monday";
				break;
			case 2:
				strDow = "Tuesday";
				break;
			case 3:
				strDow = "Wednesday";
				break;
			case 4:
				strDow = "Thursday";
				break;
			case 5:
				strDow = "Friday";
				break;
			case 6:
				strDow = "Saturday";
				break;
			default:
				strDow = "";
		}
		return strDow;
	}

//Returns the index of the select input item matching mText, mDefault if not found.
function set_select(mSelect, mText, mDefault) {
	if (mText.length > 0) {
		var i = 0;
		var found = (mSelect.options[i].text.toLowerCase() == mText.toLowerCase());
		while ( (i < mSelect.length) && (!found) ) {
			 found = (mSelect.options[i].text.toLowerCase() == mText.toLowerCase());
			 if (!found)
			 	i++;
		}
		if (!found ) {
			i = mDefault;
		}
		return i;
	} else {
		return mDefault;
	}
}

//Returns the index of the select input item whose *value* matches mText, mDefault if not found.
function set_select_by_value(mSelect, mText, mDefault) {
	var i = 0;
	var found = (mSelect.options[i].value == mText);
	while ( (i < mSelect.length) && (!found) ) {
		 found = (mSelect.options[i].value == mText);
		 if (!found)
		 	i++;
	}
	if (!found ) {
		i = mDefault;
	}
	return i;
}

function set_state(box) {
	//alert("The state of this checkbox is " + box.checked + ".");
	box.value = box.checked;
	//alert("The state of this checkbox is " + document.form1.LR.checked + ".");
}

function MakeArray(n){
	this.length = n;
	return this
}

function convert_display_field(mVal) {
	var mString = mVal;
	var regexp = /´/g;
	mString = mString.replace(regexp, "'");
	regexp = /¨/g;
	return mString.replace(regexp, "\"");
}

function convert_save_field(mVal) {
	//alert("In convert_save_field().");
	var regexp = /'/g;
	mVal = mVal.replace(regexp, "´");
	regexp = /\"/g;
	mVal = mVal.replace(regexp, "¨");
	regexp = /</g;
	mVal = mVal.replace(regexp, "");
	regexp = />/g;
	mVal = mVal.replace(regexp, "");
	return mVal;
}

function convert_save_field_html(mVal) {
	//alert("In convert_save_field().");
	var regexp = /'/g;
	mVal = mVal.replace(regexp, "´");
	regexp = /\"/g;
	mVal = mVal.replace(regexp, "¨");
	return mVal;
}

function trim(s) {
	// Remove leading spaces and carriage returns
	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')){
		s = s.substring(1,s.length);
	}
	
	// Remove trailing spaces and carriage returns
	while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')) {
		s = s.substring(0,s.length-1);
	}
	
	return s;
}

function convert_save_fields() {
	for (var i = 0; i < document.form1.elements.length; i++) {
		if ( ( document.form1.elements[i].type == "text" ) || ( document.form1.elements[i].type == "textarea" ) )  {
			document.form1.elements[i].value = convert_save_field(trim(document.form1.elements[i].value));
		}
	}
}

function convert_save_fields_html() {
	for (var i = 0; i < document.form1.elements.length; i++) {
		if ( ( document.form1.elements[i].type == "text" ) || ( document.form1.elements[i].type == "textarea" ) )  {
			document.form1.elements[i].value = convert_save_field_html(trim(document.form1.elements[i].value));
		}
	}
}

function formatCurrency(num, ucents) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
	num.substring(num.length-(4*i+3));
	if (ucents)
		return (((sign)?'':'-') + '$' + num + '.' + cents);
	return (((sign)?'':'-') + '$' + num);
}

/*
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
} // Ends the "trim" function
*/

// end hide scripting -->

