
// Create global variables for browser type
var isIE = new Boolean(false);
var isNav = new Boolean(false);
var unSupported = new Boolean(false);
var layer = new String();
var style = new String();

// Determine if the browser is Internet Explorer, Navigator,
// or other. Also, set the layer variable depending on the
// type of access it needs.
function checkBrowser(){
  if(navigator.userAgent.indexOf("MSIE") != -1){
    isIE = true;
    layer = ".all";
    style = ".style";
  }else if(navigator.userAgent.indexOf("Nav") != -1){
    isNav = true;
    layer = ".layers";
    style = "";
  }else{
    unSupported = true;
  }
}

// Take the layer state passed in, and change it.
function changeState(layerRef, state){
  eval("document" + layer + "['" + layerRef + "']" + style + ".visibility = '" + state + "'");
}

//-------------------------------------------------------------------------------------


function ValidateTextSearchForm()
{

  if (document.TextSearchForm.sp.value == "")
  {
    alert("Please enter a value for the \"Search Term\" field.");
    document.TextSearchForm.sp.select();
    return (false);
  }

  if (document.TextSearchForm.sp.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Search Term\" field.");
    document.TextSearchForm.sp.select();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-# \t\r\n\f";
  var checkStr = document.TextSearchForm.sp.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \"#\" characters in the \"Search Term\" field.");
    document.TextSearchForm.sp.select();
    return (false);
  }
  return (true);
}

//-------------------------------------------------------------------------------------


function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}

//-------------------------------------------------------------------------------------


function tallWindow(name)
{
  var tall_window = 
    window.open(name,"plain","width=625,height=800,scrollbars,resizable");
    small_window.focus();
    return true;
}

//-------------------------------------------------------------------------------------


function smallWindow(name)
{
  var small_window = 
    window.open(name,"plain","width=500,height=350,scrollbars,resizable");
    small_window.focus();
    return true;
}

//-------------------------------------------------------------------------------------

function mediumWindow(name)
{
  var medium_window = 
    window.open(name,"plain","width=640,height=480,scrollbars,resizable");
    medium_window.focus();
    return true;
}

//-------------------------------------------------------------------------------------

function longWindow(name)
{
  var long_window = 
    window.open(name,"plain","width=500,height=450,scrollbars,resizable");
    long_window.focus();
    return true;
}

//-------------------------------------------------------------------------------------

function pictureWindow(name)
{
  var picture_window = 
    window.open(name,"plain","width=650,height=700,scrollbars,resizable");
    picture_window.focus();
    return true;
}

//-------------------------------------------------------------------------------------

function NotWorkingYet()
{
   alert("The requested operation is not available.")
   return (false);
}

//-------------------------------------------------------------------------------------

function page_onchange()
	{
	document.Redirection.submit();
	return 0;
	}