  var bNS6Comp;
  var bMinIE4;
  var bOpera;
  var bExclude;
/* ---------------- Browser Detection Functions -------------------*/
  function getBrowser(){
    var bKDE=false;
    var bSaf=false;
    bNS6Comp=false;
    bMinIE4=false;
    bOpera=false;
    bExclude=false;
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    var is_nav=((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav6=(is_nav && (is_major == 5));
    var is_nav6up=(is_nav && (is_major >= 5));
    var is_gecko=(agt.indexOf('gecko') != -1);
    var is_firefox=(is_gecko && agt.indexOf("Firefox")!=-1);
    var is_named_safari=(agt.indexOf('safari') != -1);
    var is_safari=(document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(!navigator.accentColorName)?true:false;
    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
    if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
      bKDE=true;
    }else if(is_named_safari && is_safari){
      bSaf=true;
    }else if(is_opera5up){
      bOpera=true;
    }else if(is_nav6||is_nav6up||is_firefox||bKDE||bSaf){
      bNS6Comp=true;
    }else if(is_ie && (is_major >= 4)){
      bMinIE4=true;
    }else if(is_nav && agt.indexOf('webtv')!=-1){
      bExclude=true;
    }else{
      bExclude=true;
    }
/* ---------------- Begin Safari 3 Patch ------------------*/
    if(is_named_safari){
      bNS6Comp=true;
      bKDE=false;
      bOpera=false;
      bMinIE4=false;
      bExclude=false;
    }
/* ---------------- End Safari 3 Patch ------------------*/
  }

/* ----------------  Menu Bar Mouse Event Functions  -------------------*/
  function onBarItem(cellID,divID){
    var objCell = getObject(cellID);
    objCell.className = "hasMenuOn";
    showMenu(divID);
  }
  function offBarItem(cellID){
    var objCell = getObject(cellID);
    objCell.className = "hasMenuOff";
  }

/* ---------------- "On Menu" Mouse Event Functions ------------*/
  function setBarClass(cellID,classID){
    var objCell = getObject(cellID);
    objCell.className = classID;
  }
  function resetBarClass(tableID,cellID){
    var objTbl = getObject(tableID);
    var objCell = getObject(cellID);
    if(!objTbl){
      clearAllMenus();
    }
    objCell.className = "hasMenuOff";
  }
  function setBarLinkOn(cellID,linkID){
    clearAllMenus();
    var objCell = getObject(cellID);
    var objLink = getObject(linkID);
    objCell.className = "barSingleOn";
    objLink.style.color = "#800000";
    objLink.style.textDecoration = "none";
  }
  function setBarLinkOff(cellID,linkID){
    clearAllMenus();
    var objCell = getObject(cellID);
    var objLink = getObject(linkID);
    objCell.className = "barSingleOff";
    objLink.style.color = "#151515";
    objLink.style.textDecoration = "none";
  }
/* ---------------- Menu Visibility Management Functions ------------------*/
  function clearAllMenus(){
    if(bNS6Comp){
      document.getElementById("divProd").style.visibility = "hidden";
      document.getElementById("divAbout").style.visibility = "hidden";
      document.getElementById("divContact").style.visibility = "hidden";
      document.getElementById("divTechLibraries").style.visibility = "hidden";
      document.getElementById("divInstall").style.visibility = "hidden";
    }else if(bMinIE4||bOpera){
      document.all.divProd.style.visibility = "hidden";
      document.all.divAbout.style.visibility = "hidden";
      document.all.divContact.style.visibility = "hidden";
      document.all.divTechLibraries.style.visibility = "hidden";
      document.all.divInstall.style.visibility = "hidden";
    }else{
      if(bExclude){
        var sMsg = "Your web browser is not fully enabled to run client scripts.\r";
        sMsg += "The menus for this web site will not function in your browser.";
        alert(sMsg);
      }
    }
  }
  function showMenu(divID){
    clearAllMenus();
    var objDiv = getObject(divID);
    objDiv.style.visibility = "visible";
  }
/* ----------------  Menu Cell Mouse Event Functions  -------------------*/
  function setMenuItem(cellID,linkID,cellClassID,linkClassID){
    var objCell = getObject(cellID);
    var objLink = getObject(linkID);
    objCell.className = cellClassID;
    objLink.className = linkClassID;
  }
/* ---------------- Menu Positioning Function ---------------------------*/
function init(){
  getBrowser();
  /*loadimages();*/
  var objDivProducts = getObject('divProd');
  var objCell = getObject('cellProducts');
  var objTbl = getObject('tblProd');
  var iNavBarTop = DL_GetElementTop(objCell);
  var iMenusTop = iNavBarTop + 21;
  var iLeft = DL_GetElementLeft(objCell);
  objDivProducts.style.top = iMenusTop;
  objDivProducts.style.left = iLeft - 3;
  var objDivAbout = getObject('divAbout');
  objCell = getObject('cellAbout');
  objTbl = getObject('tblAbout');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivAbout.style.top = iMenusTop;
  objDivAbout.style.left = iLeft - 3;
  var objDivContact = getObject('divContact');
  objCell = getObject('cellContact');
  objTbl = getObject('tblContact');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivContact.style.top = iMenusTop;
  objDivContact.style.left = iLeft - 3;
  var objDivTechLibraries = getObject('divTechLibraries');
  objCell = getObject('cellTechLibraries');
  objTbl = getObject('tblTechLibraries');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivTechLibraries.style.top = iMenusTop;
  objDivTechLibraries.style.left = iLeft - 3;
  var objDivInstall = getObject('divInstall');
  objCell = getObject('cellInstall');
  objTbl = getObject('tblInstall');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivInstall.style.top = iMenusTop;
  objDivInstall.style.left = iLeft - 3;
  if(bNS6Comp){
    window.captureEvents(Event.ONRESIZE);
    window.onresize = resize;
  }else if(bMinIE4||bOpera){
    window.attachEvent("onresize", resize);
  }
}
function resize(){
  var objDivProducts = getObject('divProd');
  var objCell = getObject('cellProducts');
  var objTbl = getObject('tblProd');
  var iMenusTop = DL_GetElementTop(objCell);
  var iLeft = DL_GetElementLeft(objCell);
  objDivProducts.style.top = iMenusTop;
  objDivProducts.style.left = iLeft;
  var objDivAbout = getObject('divAbout');
  objCell = getObject('cellAbout');
  objTbl = getObject('tblAbout');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivAbout.style.top = iMenusTop;
  objDivAbout.style.left = iLeft - 3;
  var objDivContact = getObject('divContact');
  objCell = getObject('cellContact');
  objTbl = getObject('tblContact');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivContact.style.top = iMenusTop;
  objDivContact.style.left = iLeft - 3;
  var objDivTechLibraries = getObject('divTechLibraries');
  objCell = getObject('cellTechLibraries');
  objTbl = getObject('tblTechLibraries');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivTechLibraries.style.top = iMenusTop;
  objDivTechLibraries.style.left = iLeft - 3;
  var objDivInstall = getObject('divInstall');
  objCell = getObject('cellInstall');
  objTbl = getObject('tblInstall');
  iNavBarTop = DL_GetElementTop(objCell);
  iMenusTop = iNavBarTop + 21;
  iLeft = DL_GetElementLeft(objCell);
  objDivInstall.style.top = iMenusTop;
  objDivInstall.style.left = iLeft - 3;
}

/* ----------------  Scrolling Sub-Section Functions  -------------------------------*/

  function moveUpOC(){
    var objTbl = getObject("tblOurCompany");
    objTbl.style.marginTop = -120;
  }
  function moveDownOC(){
    var objTbl = getObject("tblOurCompany");
    objTbl.style.marginTop = 0;
  }

  function moveUpOurC(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -120;
  }
  function moveDownOurC(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = 0;
  }
  function moveUpOurC2(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -240;
  }
  function moveDownOurC2(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -120;
  }
  function moveUpOurC3(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -360;
  }
  function moveDownOurC3(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -240;
  }
  function moveUpOurC4(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -480;
  }
  function moveDownOurC4(){
    var objTbl = getObject("tblOurCustomers");
    objTbl.style.marginTop = -360;
  }
  function moveUpQTI(){
    var objTbl = getObject("tblInfo");
    objTbl.style.marginTop = -120;
  }
  function moveDownQTI(){
    var objTbl = getObject("tblInfo");
    objTbl.style.marginTop = 0;
  }
  function moveUpQTI2(){
    var objTbl = getObject("tblInfo");
    objTbl.style.marginTop = -240;
  }
  function moveDownQTI2(){
    var objTbl = getObject("tblInfo");
    objTbl.style.marginTop = -120;
  }
  function showCursor(spnID){
    var objSpn = getObject(spnID);
    if(document.all){
      objSpn.style.cursor = "hand";
    }else{
      objSpn.style.cursor = "pointer";
    }
  }
  function hideCursor(spnID){
    var objSpn = getObject(spnID);
    if(document.all){
      objSpn.style.cursor = "default";
    }else{
      objSpn.style.cursor = "default";
    }
  }

/* ----------------  DHTML API Functions  -------------------------------*/
  function getObject(sObjID){
    var obj;
    var q = "\"";
    if(bNS6Comp){
      var sID = q + sObjID.toString() + q;
      obj = eval("document.getElementById(" + sID + ")");
    }else{
      obj = eval("document.all." + sObjID);
    }
    return obj;
  }
  function DL_GetElementLeft(eElement){
    if (!eElement && this){                     // if argument is invalid (not specified, is null or is 0)
      eElement = this;                          // and function is a method
    }                                           // identify the element as the method owner
    var DL_bIE = document.all ? true : false;   // initialize var to identify IE
    var nLeftPos = eElement.offsetLeft;         // initialize var to store calculations
    var eParElement = eElement.offsetParent;    // identify first offset parent element
    while (eParElement != null){                // move up through element hierarchy
      if(DL_bIE){                               // if browser is IE, then...
         if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") ){ // if parent is not a table or the body
           nLeftPos += eParElement.clientLeft;  // append cell border width to calcs
         }
      }
      else{                                     // if browser is Gecko, then...
         if(eParElement.tagName == "TABLE"){    // if parent is a table, then get its border as a number
            var nParBorder = parseInt(eParElement.border);
            if(isNaN(nParBorder)){              // if no valid border attribute, then... 
               var nParFrame = eParElement.getAttribute('frame');  // check the table's frame attribute
               if(nParFrame != null){           // if frame has ANY value, then...
                  nLeftPos += 1;                // append one pixel to counter
               }
            }
            else if(nParBorder > 0){            // if a border width is specified, then...
               nLeftPos += nParBorder;          // append the border width to counter
            }
         }
      }
      nLeftPos += eParElement.offsetLeft;       // append left offset of parent
      eParElement = eParElement.offsetParent;   // and move up the element hierarchy
    }                                           // until no more offset parents exist
    return nLeftPos;                            // return the number calculated
  }
  function DL_GetElementTop(eElement){
    if (!eElement && this){                      // if argument is invalid (not specified, is null or is 0)
      eElement = this;                           // and function is a method
    }                                            // identify the element as the method owner
    var DL_bIE = document.all ? true : false;    // initialize var to identify IE
    var nTopPos = eElement.offsetTop;            // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element
    while (eParElement != null){                 // move up through element hierarchy
      if(DL_bIE){                                // if browser is IE, then...
        if( (eParElement.tagName != "TABLE") && (eParElement.tagName != "BODY") ){ // if parent a table cell, then...
          nTopPos += eParElement.clientTop;      // append cell border width to calcs
        }
      }
      else{                                      // if browser is Gecko, then...
        if(eParElement.tagName == "TABLE"){      // if parent is a table, then get its border as a number
          var nParBorder = parseInt(eParElement.border);
          if(isNaN(nParBorder)){                 // if no valid border attribute, then...
            var nParFrame = eParElement.getAttribute('frame');  // check the table's frame attribute
            if(nParFrame != null){               // if frame has ANY value, then...
              nTopPos += 1;                      // append one pixel to counter
            }
          }
          else if(nParBorder > 0){               // if a border width is specified, then...
            nTopPos += nParBorder;               // append the border width to counter
          }
        }
      }
      nTopPos += eParElement.offsetTop;          // append top offset of parent
      eParElement = eParElement.offsetParent;    // and move up the element hierarchy
    }                                            // until no more offset parents exist
    return nTopPos;                              // return the number calculated
  }
