  function ValidateQuery (form) {
    if(form.query.value == "" || form.query.value == null) {
      alert("Please enter your keywords");
      form.query.focus();
      return false;
    }
    return true;
  }

  function ValidateLogin (form) {
    if(form.user_name.value == "" || form.password.value == "") {
      alert("Please enter your User Name and Password");
      return false;
    }
    return true;
  }

  function AjaxTabView (show,hide,div,url) {
    document.getElementById(show).className = "current";
    document.getElementById(hide).className = "";
    var bcache = (url.indexOf("?") != -1)? "&t=" + new Date().getTime() : "?t=" + new Date().getTime();
    url = url + bcache;
    LoadPage(div,url);
  }


  function LoadPage (container, url) {
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) { return; }
    xmlHttp.onreadystatechange = function () {
      if (xmlHttp.readyState==4) {
        document.getElementById(container).innerHTML=xmlHttp.responseText;
      }
    }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
  }

  function GetXmlHttpObject() {
    var xmlHttp=null;
    try
      {
      xmlHttp=new XMLHttpRequest();
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
      catch (e)
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      }
    return xmlHttp;
  }

  function WP_File () {
    var ie = document.all;
    if (ie) {
      return true;
    } else {
      alert("You are attempting to open a WordPerfect document using Firefox. Firefox cannot handle this type of document properly.\n\nTo view this document, right click on the document link, select 'Save Link As', and save the document to your computer. Once the download is complete click the 'Open' link next to the document in the Downloads box.");
      return false;
    }
  }

  function expand (ch) {
    var img = ch + "-img";
    if (document.getElementById(ch).style.display=='' || document.getElementById(ch).style.display=='none') {
      document.getElementById(ch).style.display = "block";
      document.getElementById(img).src = "/images/minus.gif";
    } else {
      document.getElementById(ch).style.display = "none";
      document.getElementById(img).src = "/images/plus.gif";
    }
  }

  function PBClick (id) {

    var d = new Date();

    var purl = "/cgi-bin/mel/pbclick.cgi?id=" + id + "&t=" + d.getTime();

    var pr = false
    if (window.XMLHttpRequest)
    pr = new XMLHttpRequest()
    else if (window.ActiveXObject){
    try {
    pr = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    pr = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    pr.open('GET', purl, false)
    pr.send(null)

  }


