  function PopUpWin(dFileName,WinName)

  {

      props=window.open(dFileName,WinName,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=470,height=410, left = 409.5, top = 381.5");
  }



  function ChkBoxAll(iindex, chkarray, Allbox) {

    var box = "";
    var stbox = eval("document.forms[" + iindex + "]." + Allbox);

    for (var i=0; i<chkarray.length; i++) {
      box = eval("document.forms[" + iindex + "]." + chkarray[i]);
      if (stbox.checked == true) {
        box.checked = true;
      } else {
        box.checked = false;
      }
    }
  }
  
  
    function cPopUpWin(dFileName,WinName)
  
    {
  
        props=window.open(dFileName,WinName,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=470,height=410, left = 409.5, top = 381.5");
    }
  
  
  
    function ChkBoxAll(iindex, chkarray, Allbox) {
  
      var box = "";
      var stbox = eval("document.forms[" + iindex + "]." + Allbox);
  
      for (var i=0; i<chkarray.length; i++) {
        box = eval("document.forms[" + iindex + "]." + chkarray[i]);
        if (stbox.checked == true) {
          box.checked = true;
        } else {
          box.checked = false;
        }
      }
  }

  function ChkBoxAll2(iindex, chkarray, Allbox) {

    var box = "";
    var stbox = eval("document.forms[" + iindex + "]." + Allbox);
    box = eval("document.forms[" + iindex + "]." + chkarray);
    chkarray = box;

    for (var i=0; i<chkarray.length; i++) {

      if (stbox.checked == true) {
        box[i].checked = true;
      } else {
        box[i].checked = false;
      }
    }

  }

  function check(form) {
    searchqry = form.searchqry.value;

    if (searchqry == "" || searchqry == " ")  {
      alert ("\nSearch Failed.")
      return false;
    } else {
      return true;
    }
  }

  function confirm_delete(url) {

    if (confirm("Are you sure you want to delete this item ?")) {
    window.location = url;
    }
  }
  function toggle(n) {

    if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1 && navigator.appVersion.charAt(0)) {

      if (document.all) {

        if (document.all('id' + n).style.display == '') {
        document.all('id' + n).style.display = 'none';
        }
        else {
        document.all('id' + n).style.display = '';
        }
      }
    }
    else {

      if (document.getElementById) {

        if (document.getElementById('id' + n).style.display == '') {
        document.getElementById('id' + n).style.display = 'none';
        }
        else {
        document.getElementById('id' + n).style.display = '';
        }
      }
    }

  }


  function closeMenus(total_ids) {
    i = 1;
    while (i <= total_ids) {

      if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1 && navigator.appVersion.charAt(0)) {
      document.all('id' + i).style.display = "none";
      }
      else {
      document.getElementById('id' + i).style.display = "none";
      }
    i++;
    }
  }


  function openMenu(menu_id) {
    if (menu_id) {

      if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1 && navigator.appVersion.charAt(0)) {
      document.all('id' + menu_id).style.display = "";
      }
      else {
      document.getElementById('id' + menu_id).style.display = '';
      }
    }
  }
  function toggle_symbol() {


    if (document.all) {

      if (document.all.symbol.innerHTML == '+') {
      document.all.symbol.innerHTML = '–';
      }
      else {
      document.all.symbol.innerHTML = '+';
      }

    }

    else {

      if (document.getElementById('symbol').innerHTML == '+') {
      document.getElementById('symbol').innerHTML = '–';
      }
      else {
      document.getElementById('symbol').innerHTML = '+';
      }
    }

  }

        function la(){
      document.forms.logon.user.focus();
        }


        function checkLogon(){

      returnthis = true

      if (!document.forms.logon.user.value){
        returnthis = false;
      }

      if (!document.forms.logon.txtpassword.value){
          returnthis = false;
      }

      if (!returnthis){alert("Please fill out both your username\nand password before logging in.");}

      return returnthis;
        }


    function transp(what,howmuch){
      what.style['opacity'] = (howmuch/100);
      what.style['MozOpacity'] = (howmuch/100);
      what.style['KhtmlOpacity'] = (howmuch/100);
      what.style['filter'] = 'alpha(opacity: '+howmuch+')';

    }

    function cPopUpWin(dFileName,WinName)
    {
      propsW=window.open(dFileName,WinName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=210,left=150,top=250');
    }







    function checker(valuer){

      for(i=0;i<document.forms[0].reggrps.length-1;i++){

        document.forms[0].reggrps[i].checked = valuer;

      }


    }

    function notPublic(){

      pubbox = document.getElementById('public');

      pubbox.checked = false;


    }


    function doubleChecker(){

      foundVal = 0;

      for(i=0;i<document.forms[0].reggrps.length-1;i++){

        if(document.forms[0].reggrps[i].checked){
          foundVal = 1;
          break;
        }

      }

      if(foundVal ==0){

        tmpBox = document.getElementById('public');
        tmpBox.checked = true;

      }

    }



// This bit of code allows us to use document.getElementById even for IE5..

  if(document.all && !document.getElementById) {
      document.getElementById = function(id) {
           return document.all[id];
      }
}



function submitLogon(){

  returnThis = true

  if (!document.forms.logonmain.user.value || !document.forms.logonmain.txtpassword.value){
    alert("You need to enter both your username and password before you can log in.");
    document.forms.logonmain.user.focus();
    returnThis = false;
  }

  return returnThis;
}


// TEXT FUNCTIONS


//
// Setup global variables
//
// fontSize - default value
// fMax - largest font size
// fMin - smallest font size
// isIE501 - is the user agent MSIE 5.01
//
var fontSize = 100;
var fMax = 200;
var fMin = 100;
var isIE501 = navigator.userAgent.indexOf("MSIE 5.01") > 0 ? true : false;
var isNN6 = navigator.userAgent.indexOf("Netscape6") > 0 ? true : false;
var isIE=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var SKIP_VISIBLE = "#000";      //value is black
var SKIP_INVISIBLE = "#fff";    //value is white
//
// setFontSize
//
// Retrieves cookie value and applies to font size
//
function setFontSize() {
  var tempSize = getCookie("fontSize");
  if((tempSize != null) && (tempSize >= fMin) && (tempSize <= fMax)) {
    fontSize = tempSize;
  } else {
    setCookie("fontSize", fontSize, "", "/");
  }
  document.body.style.fontSize = (fontSize/100)+"em";
}


//
// changeFontSize(bool increment)
//
// changes document font size and records size value in cookie
//
function changeFontSize(increment) {
  if(increment) {
    fontSize=parseInt(fontSize) + parseInt(10);
  } else {
    fontSize=parseInt(fontSize) - parseInt(10);
  }

  if(fontSize > fMax) {
    fontSize = fMax;
  }
  if(fontSize < fMin) {
    fontSize = fMin;
  }


  document.body.style.fontSize = (fontSize/100)+"em";

  setCookie('fontSize', fontSize, "", "/");
}
//
// incrementFontSize
//
function incrementFontSize() {
  changeFontSize(true);
}

//
// decrementFontSize
//
function decrementFontSize() {
  changeFontSize(false);
}


//
// Sets a Cookie with the given name and value.
//

function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}


//
// Gets the value of the specified cookie.
//
// name  Name of the desired cookie.
//
// Returns a string containing value of specified cookie,
//   or null if cookie does not exist.
//
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}




function do_onload() {
  setFontSize();
  externalLinks();
}



//
// trigger onLoad function (do_onload)
//
if (window.addEventListener) {
  window.addEventListener("load", do_onload, false);
} else {
  if (window.attachEvent) {
    window.attachEvent("onload", do_onload);
  } else {
    if (document.getElementById) {
      window.onload = do_onload;
    }
  }
}



function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}