<!--

function isNumber(inputStr) {
 for (i=0; i<inputStr.length; i++) {
  var oneChar =  inputStr.substring(i, i+1)
  if((oneChar < "0" || oneChar > "9" ) && ((oneChar != ".") && (oneChar != "-"))) {
   return false;
  }
 }
 return true;
}// close isNumber
  
function printResults() { //print the browser screen
 if(document.all) {
  window.focus();
 } 
  window.print();  
}//close function printResults()


function breakString0(s, maxLength, breakChar) {
//this was set up to break up long URL's stored in a database that would otherwise cause formatting to fail by forcing table widths to grow beyond their design.  It works best with strings where the available area to display the string is somewhere in the area of 35 or more characters as the routine attempts to break the string on a character near the maxLength value, such as a backslash.  To simply break up a string to fit it in a narrow "left column" area use the function breakString1 below
 var tString = "";
 var oString = "";
 if(s.length > maxLength) {

  while(s.length > maxLength) {
   tString = s.substr(0, maxLength);
   //search backwards and find the first instance of breakChar
   var breakCharPos = tString.lastIndexOf(breakChar);
   oString += s.substr(0, breakCharPos+1) + "<br>"; //add the section of s to the output string  
   s = s.substr(breakCharPos + 1) //remove the 'chunk from the original string
  }//close the while loop 
  oString += s;
 }else{
  oString = s;
 }//close if(s.length > maxLength)
 return oString;
}// close function breakString (breakAt, breakChar)


function breakString1(s, maxLength) {
//this was set up to break up long URL's or email addresses so that they might be displayed in narrow column areas without pushing fixed table widths apart.
 var oString = "";
 if(s.length > maxLength) {
  while(s.length > maxLength) {
   oString += s.substr(0, maxLength) + "<br>"; //add the section of s to the output string ;
   s = s.substr(maxLength) //remove the 'chunk from the original string
  }//close the while loop 
  oString += s;
 }else{
  oString = s;
 }//close if(s.length > maxLength)
 return oString;
}// close function breakString (breakAt, breakChar)


function isBlank(s) { //returns true if a field contains only blanks
for (var i=0; i<s.length; i++) {
var c = s.charAt(i);
if ((c !=' ') && (c != '\n') && (c != '\t')) return false;
}
return true;
}

function filter(s) { //filter textStrings for troublesome characters (for text GOING to the database)
s = String(s);
var complete = "";
var continueChecking = true;

if((String(s) == "null") || (isBlank(String(s))) || (String(s) == "undefined")) {
s = "";
}//close the IF loop

s = s.replace(/\r\n/g, "<br>");
s = s.replace(/\"/g, "&#034;");
s = s.replace(/\'/g,  "&#039;");

while(continueChecking) {
  complete = true;
  if(s.charAt(0) == " ") {//remove leading spaces
  s = s.substring(1, s.length);
  complete = false;
  }//close the IF loop

  if(s.charAt(s.length-1) == " ") {//remove trailing spaces
  s = s.substring(0,s.length-1);
  complete = false;
  }//close the IF loop

  if((s.substr(0, 4) == "<BR>") || (s.substr(0, 4) == "<br>")) {//remove any leading <br> tags (maybe added above)
  s = s.substring(4);
  complete = false;
  }//close the IF loop

  if((s.substr(s.length-4) == "<BR>") || (s.substr(s.length-4) == "<br>")) {//remove any trailing <br> tags (maybe added above)
  s = s.substring(0, s.length-4);
  complete = false;
  }//close the IF loop

  if(complete) {
  continueChecking = false;
  }
}//close the WHILE loop
return s;
}//close the function


function dispFilter(s) {

s = s.replace(/<br>/g, "\r\n");
s = s.replace(/&#034;/g,"\"" );
s = s.replace(/&#039;/g, "\'" );
s = s.replace(/null/g,"");
s = s.replace(/undefined/g,"");
return s;
}//close function dispFilter(s)

//-->
