<!-- trims white space off the tail of a string -->
function RTrim(str)  
{
   return( (ar=/(^[\s\S]*\S+)\s*$/.exec(str)) ? ar[1] : "" ); 
}

<!-- trims white space off the head of a string -->
function LTrim(str)    
{
   return( (ar=/^\s*([\s\S]*$)/.exec(str)) ? ar[1] : "" ); 
}

<!-- trims white space off both ends of a string -->
function Trim(str)    
{
   return( (ar=/^\s*([\s\S]*\S+)\s*$/.exec(str)) ? ar[1] : "" );
}

<!-- test for Numeric complete number string -->
function IsNumeric(strString)
{
   <!-- Declaration of Variables -->
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   <!-- 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;
}

<!-- Replace any character with another character -->
function Replace(Entry, InChar, OutChar) 
{
   <!-- Declaration of Variables -->
   var Temp = "" + Entry; 
   var PositionOfChar;

   <!-- Loop through all characters in string and replace
   while (Temp.indexOf(InChar)>-1) 
   {
	PostionOfChar = Temp.indexOf(InChar);
	Temp = "" + (Temp.substring(0, PostionOfChar) + OutChar + 
	Temp.substring((PostionOfChar + InChar.length), Temp.length));
   }

   return Temp;

}

<!-- display a new browser window -->
function DisplayWindow(url,h,w, WinName) 
{
  <!-- Declaration of Variables -->
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;

	<!-- Check if Window Name has been left out of the function call -->
	<!-- Test for undefined or null variables -->
	if (!WinName)
	{
	  <!-- Set variable becuase it is used -->
	  WinName = '';
	}		
	
  <!-- Dispaly new browser window -->
  popupWindow =
    eval("window.open('"+url+"', '"+WinName+"', 'width="+w+",height="+h+
    ",top="+wint+",left="+winl+
    ",menubar=no,toolbar=no,location=center,scrollbars=no"+
    ",resizable=no,status=no,location=no')")
}

<!-- display a new browser window -->
function DisplayWindowScroll(url,h,w, WinName) 
{
  <!-- Declaration of Variables -->
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;

	<!-- Check if Window Name has been left out of the function call -->
	<!-- Test for undefined or null variables -->
	if (!WinName)
	{
	  <!-- Set variable becuase it is used -->
	  WinName = '';
	}	
	
  <!-- Dispaly new browser window -->
  popupWindow =
    eval("window.open('"+url+"', '"+WinName+"', 'width="+w+",height="+h+
    ",top="+wint+",left="+winl+
    ",menubar=no,toolbar=no,location=center,scrollbars=Yes"+
    ",resizable=no,status=no,location=no')")
}

<!-- display a new browser window -->
function DisplayWindowReSize(url,h,w, WinName) 
{
  <!-- Declaration of Variables -->
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;

	<!-- Check if Window Name has been left out of the function call -->
	<!-- Test for undefined or null variables -->
	if (!WinName)
	{
	  <!-- Set variable becuase it is used -->
	  WinName = '';
	}	
	
  <!-- Dispaly new browser window -->
  popupWindow =
    eval("window.open('"+url+"', '"+WinName+"', 'width="+w+",height="+h+
    ",top="+wint+",left="+winl+
    ",menubar=no,toolbar=no,location=center,scrollbars=Yes"+
    ",resizable=Yes,status=no,location=no')")
}


<!-- Function to display and turn off one object -->
function ToggleOne(objToDisplayHide)
{ 
	 <!-- Check for Objects present state
	 if (objToDisplayHide.style.display == '')
	 {
	    objToDisplayHide.style.display = 'None';
	 }
	 else
	 {
      objToDisplayHide.style.display = '';
	 }
      
   <!-- Return value to calling function. -->
   return true;
}

<!-- Function to display one object and turn off one object -->
function ToggleTwo(objToDisplay, objToHide)
{ 
   objToDisplay.style.display = '';
   objToHide.style.display = 'None';
      
   <!-- Return value to calling function. -->
   return true;
} 