<!-- // Activate HTML comment cloak

//-- DISABLE RIGHT CLICK - BEGIN
//
// Include this in a standard INCLUDE file to disable the right-click menu:
function CaptureClick(e) {
  var message="Copyright © Foundation One. All rights reserved.\nReproduction in whole or in part is strictly prohibited.";
	if (document.all) {
		if (event.button == 2) {
			alert(message);
			return false;
		}
	}
	if (document.layers) {
		if (e.which == 3) {
			alert(message);
			return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=CaptureClick;
//
//-- DISABLE RIGHT CLICK - END


// Function to remove leading and trailing spaces from a string.
function Trim(theString) {
  if(theString == null || theString == "")
    return "";
  else return (theString.replace(/^\s+|\s+$/g, ""));
}

// Function returns the string with any blank spaces on the right removed.
function RTrim(theString) {
  return String(theString).replace(/(\s+$)/g, "");
}

//-- Function returns the leftmost (theLength) characters of a string.
function LEFT(theString, theLength) {
  if (theString.length > theLength) {
    return theString.substr(0, theLength);
  } else {
    return theString.substr(0, theString.length);
  }
}

// Function to determine if a Form text field is empty.
function IsEmpty(theElement) {
  if(theElement.value == null || theElement.value == "")
    return true;
  else return false;
}

// Function to determine if a selection has been made on a Form SELECT,
// with value 0, the first option, corresponding to no choice.
function IsNoSelection(theSelect) {
  if(theSelect.selectedIndex == 0)
    return true;
  else return false;
}

// Function returns the index in the OPTIONS array of a SELECT
// with value corresponding to the cValue parameter.
function getSelectedIndex(theSelect, cValue) {
  var nRetIndex = 0;
  var lFound = false;

  for (var i= 0; i < theSelect.length; i++) {
    if(theSelect.options[i].value == cValue) {
      nRetIndex = i;
      break;
    }
  }
return nRetIndex;
}


// Function to go to a URL, passed as a string.
// Called in SELECT for SiteLinks, as in
//  <select name="selSiteLinks" OnChange="gotoURL(this.options[this.selectedIndex].value)" >
function gotoURL(strURL)
{
  if (strURL != "")
  parent.location.href = strURL;
}



// Function to go to a URL, passed as a string of parameters as
// ('parent', '/folder/sample.asp')
// Called in Button Style buttons
function F1_goToURL() { //v3.0
  var i, args=F1_goToURL.arguments; document.F1_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


// Function to go back to a previous URL of the current page.
// Default is to go back to the calling URL of the current page.
// Called in 'Back To' buttons, as in
//  <a name="BackToIndex" HREF="javascript:goBack()" >
function goBack(strURL)
{
  var lReturnValue = true;
  // First, check for parameter and use it.
  if (typeof strURL == 'string' && strURL.length > 0) {
    // Parameter passed and it's a non-empty string.
    // Assume it's a valid URL and go to that URL.
    parent.location.href = strURL;
  } else if (typeof F1SV_indexURL == 'string' && F1SV_indexURL.length > 0) {
    // F1 Session Variable 'F1SV_indexURL' exists and it's a non-empty string.
    // Assume it's a valud URL and go to that URL.
    parent.location.href = F1SV_indexURL;
  } else if ( (document.referrer != "") && (document.referrer.indexOf("foundation1") != -1) ) {
    // OK, nothing else happening, but we were referred from
    // within the Foundation1 site, go back to previous URL.
    self.history.back();
  } else {
    // Well, we've run out of options, so just go Home.
    parent.location.href = "/";
  }
  return lReturnValue;
}


// Function to open a new popup window to view HTML at a URL, passed as a string.
function popWin(url) {
  var newWin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=600,height=500,top=50,left=50');
  self.name = "popWin";
}

//-- Function to open a new browser window to view (picture/something)
//-- at a URL, passed as a string.
function newWindow(strPictURL, strWinOpts)
{
  if (strPictURL != "") {

    var url = "";
    var name = "newWin";
  	var features = "";
		var WindowOptions = "";
    // First, check for URL parameter and use it.
    if (typeof strPictURL == 'string' && strPictURL.length > 0) {
    // Parameter passed and it's a non-empty string.
      url = strPictURL;
    }		
    // Now, check for window options parameter and use it.
    if (typeof strWinOpts == 'string' && strWinOpts.length > 0) {
      // Parameter passed and it's a non-empty string.
			WindowOptions = strWinOpts;
    }		
    // Basic window configuration options.
    features += "toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1";
	  // Height, in pixels, of window's document display area.
    if (WindowOptions.length > 0 && WindowOptions.indexOf("height") == -1) {
      // 'height' not passed in parameter, use default of 550.
      features += ",height=550";
		}
	  // Width, in pixels, of window's document display area.
    if (WindowOptions.length > 0 && WindowOptions.indexOf("width") == -1) {
      // 'width' not passed in parameter, use default of 550.
    	features += ",width=550";
		}
    // Set Top Left position for the window.
    if (WindowOptions.length > 0 && WindowOptions.indexOf("top") == -1) {
      // 'top' not passed in parameter, use default of 75.
      features += ",top=75";
		}
    if (WindowOptions.length > 0 && WindowOptions.indexOf("left") == -1) {
      // 'left' not passed in parameter, use default of 75.
      features += ",left=75";
		}
    // If window options passed, add them to 'features'.
    if (WindowOptions.length > 0) {
      features += "," + WindowOptions;
		}
	  var PicWindow = window.open(url, name, features);
    //self.name = "newWin";

	}
}

// Function to set a new CSS class for an object.
// Used to control the button class 'rollover'.
function F1_NewClass(obj, new_style) {
	obj.className=new_style;
}


// This is the function to open the "debugging console window."
// Use it to debug scripts! To write to it , use
//   debugWindow.document.writeln(....), e.g.
//   debugWindow.document.writeln('the value of buttonObj is '+buttonObj+'&lt;br&gt;').
function debugConsole() {
  debugWindow = window.open("","debugWin","toolbar=no,scrollbar=yes,width=300,height=400");
}

// This is the function to write to the "debugging console window."
function debugWrite(txtMsg) {
  debugWindow.document.writeln(txtMsg + '<br>');
}

// This is a function to emulate VFP's WAIT WINDOW command.
function WaitWin(txtMsg) {
  window.alert(txtMsg);
}


// Function checks for SQL Inject code in input string.
// Function is also included in "commonjs.asp".
function chkSQLinject(theString) {
  var replaceString = new String("");
  var newString = new String("");
  // Replace single quote with 2 single quotes.
  // newString = theString.replace(/'[^']/g, "''");
  // newString = theString.replace(/'(?!')/g, "''");
  // Replace --, SQL Server comment beginning.
  newString = theString.replace(/--/g, "-");
  // Replace --, SQL Server end of statement with wrong character.
  newString = newString.replace(/;/g, ",");
	// Check for SQL reserved words.
  newString = newString.replace(/\s*select\s+/gi, " selct ");
  newString = newString.replace(/\s*insert\s+/gi, " insrt ");
  newString = newString.replace(/\s*update\s+/gi, " updte ");
  newString = newString.replace(/\s*delete\s+/gi, " delte ");
  newString = newString.replace(/\s*create\s+/gi, " crate ");
  newString = newString.replace(/\s*alter\s+/gi, " altr ");
  newString = newString.replace(/\s*drop\s+/gi, " drp ");
  newString = newString.replace(/\s*union\s+/gi, " onion ");
  newString = newString.replace(/\s*join\s+/gi, " juin ");
  newString = newString.replace(/\s*execute\s+/gi, " excute ");
  newString = newString.replace(/\s*exec\s+/gi, " exce ");
	// Check for SQL stored procedures.
  newString = newString.replace(/xp_cmdshell/gi, " ps_cndshell ");
  newString = newString.replace(/xp_reg/gi, " ps_rug ");
  newString = newString.replace(/xp_sendmail/gi, " ps_sendmaul ");
  newString = newString.replace(/sp_makewebtask/gi, " ps_makewebtusk ");
  newString = newString.replace(/sp_OACreate/gi, " ps_OACrate ");
  newString = newString.replace(/sp_OAMethod/gi, " ps_OAMathod ");
  newString = newString.replace(/sp_OAGetProperty/gi, " ps_OAGutProperti ");
	// Check for HTML stuff.
  newString = newString.replace(/\s*script\s*/gi, "scpt ");
  newString = newString.replace(/\s*http:/gi, " htfu= ");
  newString = newString.replace(/\s*href\s*/gi, " hruf ");
  newString = newString.replace(/\s*src\s*=/gi, " soc = ");
  newString = newString.replace(/</g, "[");
  newString = newString.replace(/>/g, "]");
	// Remove right blanks and return resultant string.
  return String(newString).replace(/(\s*$)/g, "");
}

// Deactivate HTML comment cloak -->


