function showMajor(majorid) {
   document.searchform.majorcat.value=majorid;   
   document.searchform.minorcat.value=-1;
   document.searchform.submit();
}
function showMinor(minorid, majorid) {
   document.searchform.majorcat.value=majorid;
   document.searchform.minorcat.value=minorid;
   document.searchform.submit();
}

function showFrontEntry (entryno) {
    document.searchform.option.value = "showaward";
    document.searchform.entryno.value = entryno;
    document.searchform.submit();
}

function check_search_form()
{
   if(eval("document.searchform.keyword").value.length < 3)
   {
       alert("You need to supply a keyword of at least three (3) characters.");
       return false;
   }
//   document.searchform.keyword.value = document.searchform2.keyword.value;
//   document.searchform.field.value   = document.searchform2.field.options[document.searchform2.field.selectedIndex].value;
   showMajor(-1,'search');   
   return false;
}

function changeStyle(mystyle) {

   if (mystyle == 3) {
      var searchid = document.mainform.searchid.value;   
      var entryno = document.mainform.entryno.value;   
      var displaypage = document.mainform.displaypage.value;   
      var height = 720;

      var sc_width  = screen.width;
      var sc_height = screen.height;

      if (sc_height < 768 && height > 580)
         height = 580;
 
      if (sc_height >= 768 && height > 748)
         height = 748;

      open("/awards_search_new?option=slide&entryno="+entryno+"&searchid="+searchid+"&displaypage="+displaypage, "slide", "height="+height+",width=600,toolbars=no,location=no,menubar=no,statusbar=no,scrollbars=yes"); 
      return;
    }

    document.mainform.option.value = "browse";
    document.mainform.displaypage.value = "1";
    document.mainform.showstyle.value = mystyle;
    document.mainform.submit();
}

function showPage (displaypage) {
    document.mainform.option.value = "browse";
    document.mainform.displaypage.value = displaypage;
    document.mainform.submit();
}

function showEntry (entryno) {
    document.mainform.option.value = "showaward";
    document.mainform.entryno.value = entryno;
    document.mainform.submit();
}

function displayAward (entryno) {
   document.mainform.oldoption.value = document.mainform.option.value;
   document.mainform.option.value = "showaward";
   document.mainform.entryno.value = entryno;
   document.mainform.submit();
}

function goURL (url, memno)
{
   var wID = window.open ("/adabd_goURL?url="+url+"&no="+memno, 
      "newurl",
      "width=620,height=470,scrollbars=yes,resizable=yes,toolbar=yes,status=yes,location=yes");
}

function showImage(location, entryno, other, width, height)
{
   var sc_width  = screen.width;
   var sc_height = screen.height;

   if (sc_height < height)
      height = sc_height;

   if (sc_width < width)
      width = sc_width;

   if (height < 300)
      height = 300;
      
   if (width < 600)
      width = 600;

   window.open("/awards_image?image="+location+"&entryno="+entryno, 
      ""+entryno+other+"", 
      "height="+height+",width="+width+",location=no,menubar=no,toolbar=no,status=no,scrollbars=auto");

}

function displayADABD (ADABDid)
{
   window.open("/adabd_display?ADABDid="+ADABDid, 
      "ADABD",
      "menubar=no,status=no,location=no,toolbar=no,height=500,width=560,scrollbars=yes");
}

function search_back()
{
   document.mainform.option.value = "browse";
   document.mainform.submit();
}
