<!--
   // this is a global variable for the openWindow function - DO NOT MOVE OR REMOVE!
   var status = null;
   
   function openWindow(URL) 
	{
   	if (status && status.open) 
		{
   		status.close();
   		status = open(URL, 'status','width=575,top=10,left=10,height=500,resizable=yes,scrollbars=yes');
   	}
   	else 
		{
   		status = open(URL, 'status','width=575,top=10,left=10,height=500,resizable=yes,scrollbars=yes');
   	}
   }

   function isWhiteSpace(s) {
   	/************************************************************************
   	*									*
   	*	This checks for white space entries				*
   	*									*
   	************************************************************************/	
   	var whitespace = " \t\n\r";
   	var i;
   	if (isEmpty(s)) return true;
   	for (i = 0; i < s.length; i++) {
   		if (whitespace.indexOf(s.charAt(i)) == -1)
   			return false;
   	}
   	return true;
   }
   
   function isEmpty(s) {
   	/************************************************************************
   	*									*
   	*	This helps check for white space entries			*
   	*									*
   	************************************************************************/
   	return ((s == null) || (s.length == 0) || (s == ""));
   }

   function trim(theValue) 
   { 
      var start = -1; 
      var end = -1; 
      
      for (i = 0; i < theValue.length; i++) 
      { 
         if (!isWhiteSpace(theValue.charAt(i))) 
         { 
   	      start = i; 
      	   break; 
         } 
      } 
      
      for (i = theValue.length; i > -1; i--) 
      { 
         if (!isWhiteSpace(theValue.charAt(i))) 
         { 
   	      end = i; 
      	   break; 
         } 
      } 
      
      // Grab the value between the first and last characters 
      var formatted = theValue.substring(start, end + 1) 
      
      return formatted; 
   }

   function formFieldsToUpperCase(form) {	// receives a form object
   	/************************************************************************
   	*									*
   	*	Per Larry and Troy, all DB fields should be in upper case	*
   	*	before we send them to the DB. This just converts all text	*
   	*	field values to uppercase onSubmit instead of distracting 	*
   	*	the customer while they type.					*
   	*									*
   	************************************************************************/
   	for (i = 0; i < form.elements.length; i++) {
   		if (form.elements[i].type == "text") {
   			form.elements[i].value = form.elements[i].value.toUpperCase();
   		}
   	}
   }

   function formatStringReturnString(str) { 
   	/************************************************************************
   	*									*
   	*	This accepts a string variable and formats it in such a 	*
   	*	fashion that the first character is capitalized and the  	*
   	*	remaining characters are in lower case. This is useful  	*
   	*	for names and addresses, etc.				 	*
   	*									*
   	************************************************************************/
   	str = new String(str);
   	firstLetr = str.charAt(0); 
   	firstLetr = firstLetr.toUpperCase(); 
   	nameFill = ""; 
   	nameFill += firstLetr; 
   	for (i=1; i < str.length; i++) { 
   		if (str.charAt(i) == " " || str.charAt(i) == "-") { 
   			nameFill += str.charAt(i); 
   			i++; 
   			nameFill += str.charAt(i).toUpperCase(); 
   			continue; 
   		} 
   		nameFill += str.charAt(i).toLowerCase(); 
   		/* alert(nameFill); */ 
   	} 
   	return nameFill;
   } 

   function formatString(str) { 
   	/************************************************************************
   	*									*
   	*	This accepts a string variable and formats it in such a 	*
   	*	fashion that the first character is capitalized and the  	*
   	*	remaining characters are in lower case. This is useful  	*
   	*	for names and addresses, etc.				 	*
   	*									*
   	************************************************************************/
   	str = new String(str);
   	firstLetr = str.charAt(0); 
   	firstLetr = firstLetr.toUpperCase(); 
   	nameFill = ""; 
   	nameFill += firstLetr; 
   	for (i=1; i < str.length; i++) { 
   		if (str.charAt(i) == " " || str.charAt(i) == "-") { 
   			nameFill += str.charAt(i); 
   			i++; 
   			nameFill += str.charAt(i).toUpperCase(); 
   			continue; 
   		} 
   		nameFill += str.charAt(i).toLowerCase(); 
   		/* alert(nameFill); */ 
   	} 
   	document.write(nameFill); 
   } 

   function validEmail (e) {
   	if (!isWhiteSpace(e.value)) {
   	       	var validFlag = true;
           	if (e.value.indexOf("@") == -1 || e.value.indexOf(".") == -1) {
           		validFlag = false;
           	}
           	if (!validFlag) {
           		alert('Every email address should contain the "@" and "." characters. Please make sure that the email address is correct!');
           		e.value = "";
           		e.focus();
           	}
   	}
   }

   function textCheck(textbox) {
   	if (!isWhiteSpace(textbox.value)) {
   		var numbers = "0123456789";
   		for (i = 0; i < textbox.value.length; i++) {
   			if (numbers.indexOf(textbox.value.charAt(i)) != -1) {
   					alert('Please enter only text in this field (no numbers)');
   					textbox.value = "";
   					textbox.focus();
   					return false;
   			}
   		}
   	}
   }

   function validateText(textField) {
   	if (!isWhiteSpace(textField.value)) {
           	var badChars = '"';
           	var validFlag = true;
           	var goodValue = "";
           	for (i = 0; i < textField.value.length; i++) {
           		if (badChars.indexOf(textField.value.charAt(i)) != -1) {
           			validFlag = false;
           		}
           	}
           	if (!validFlag) {
           	        alert('Please do not use the " character');
           		for (i = 0; i < textField.value.length; i++) {
           			if (badChars.indexOf(textField.value.charAt(i)) == -1) {
           				goodValue += textField.value.charAt(i);
           			}			
           		}				
           		textField.value = goodValue;
           		textField.focus();
           	}
   	}
   }
   
   function numbersOnly(numBox) {
   	if (!isWhiteSpace(numBox.value)) {
   		var numbers = "0123456789";
   		for (i = 0; i < numBox.value.length; i++) {
   			if (numbers.indexOf(numBox.value.charAt(i)) == -1) {
   					alert('Please enter only numbers in this field (no letters or other characters)');
   					numBox.value = "";
   					numBox.focus();
   					return false;
   			}
   		}
   
   	}
   }

// -->