//var menuobj=document.getElementById? document.getElementById("describe") : document.all? document.all.describe : document.layers? document.dep1.document.dep2 : ""
var menuobj=document.getElementById ? document.getElementById("describe") : document.all.describe;

function showit(which) {
    menuobj=document.getElementById ? document.getElementById("describe") : document.all.describe;
    clear_delayhide()
    thecontent=(which==-1)? "" : submenu[which]
    if (document.getElementById||document.all)
    menuobj.innerHTML=thecontent
    /*
    else if (document.layers){
    menuobj.document.write(thecontent)
    menuobj.document.close()
    }*/
}
function resetit(e) {
    menuobj=document.getElementById ? document.getElementById("describe") : document.all.describe;
    if (document.all&&!menuobj.contains(e.toElement))
    delayhide=setTimeout("showit(-1)",delay_hide)
    else if (document.getElementById&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    delayhide=setTimeout("showit(-1)",delay_hide)
}
function clear_delayhide() {
    if (window.delayhide)
    clearTimeout(delayhide)
}
function contains_ns6(a, b) {
    while (b.parentNode)
    if ((b = b.parentNode) == a)
    return true;
    return false;
}

function 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 == "TD")     // if parent a table cell, then...
         {
            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...
            {                                // check the table's frame attribute
               var nParFrame = eParElement.getAttribute('frame');
               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 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 == "TD")     // 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...
            {                                // check the table's frame attribute
               var nParFrame = eParElement.getAttribute('frame');
               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
}

function getWindowWidth() {
    var windowWidth = 0;
        if (typeof(window.innerWidth) == 'number') {
            windowWidth = window.innerWidth;
        }
    else {
        if (document.documentElement && document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        }
    else {
            if (document.body && document.body.clientWidth) {
            windowWidth = document.body.clientWidth;
            }
        }
    }
    return windowWidth;
}

function getWindowHeight() {
    var windowHeight = 0;
        if (typeof(window.innerHeight) == 'number') {
            windowHeight = window.innerHeight;
        }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
    else {
            if (document.body && document.body.clientHeight) {
            windowHeight = document.body.clientHeight;
            }
        }
    }
    return windowHeight;
}

function showTooltip(srcId,obj){
    var toolTip=document.getElementById(srcId+'_dsc');
    var srcObj=document.getElementById(srcId);
    var srcTop=getElementTop(srcObj);
    var srcLeft=getElementLeft(obj);
    srcLeft=srcLeft.toString();
    srcTop=eval(30 + srcTop);
    toolTip.style.top=srcTop+'px';
    toolTip.style.left=srcLeft.replace(/px/gi,'')-182+'px';
    toolTip.className='dscv';
}

function hideTooltip(srcId){
    document.getElementById(srcId+'_dsc').className='dsc';
}

function showTooltip_popup(srcId,obj){
/*
    if (srcId == "popup1") {
        hideTooltip_popup('popup2');
    } else {
        hideTooltip_popup('popup1');
    }
*/
    var toolTip=document.getElementById(srcId+'_dsc');
    var srcObj=document.getElementById(srcId);
    var srcTop=getElementTop(srcObj);
    var srcLeft=getElementLeft(obj);
    srcLeft=srcLeft.toString();
    srcTop=eval(srcTop);
    toolTip.style.top=srcTop+'px';
    toolTip.style.left=srcLeft.replace(/px/gi,'')-300+'px';
    toolTip.className='dscv_popup';
}

function hideTooltip_popup(srcId){
    document.getElementById(srcId+'_dsc').className='dsc';
}