//<!-- ============================== SCRIPTS START (INSIDE HEAD TAG INSERT AFTER STYLE CLOSE)============================ -->
//<script type="text/javascript">//<![CDATA[



//----------------------------------------------------------------------------
// Code for handling the me_top_nu bar and active but_top_ton.
//----------------------------------------------------------------------------
var activebut_top_ton = null;
function but_top_tonClick(event, me_top_nuId) {
  var but_top_ton;
  // Get the target but_top_ton element.
  if (browser.isIE)
    but_top_ton = window.event.srcElement;
  else
    but_top_ton = event.currentTarget;
  but_top_ton.blur();
  if (but_top_ton.me_top_nu == null) {
    but_top_ton.me_top_nu = document.getElementById(me_top_nuId);
    if (but_top_ton.me_top_nu.isInitialized == null)
      me_top_nuInit(but_top_ton.me_top_nu);
  }
  if (but_top_ton.onmouseout == null)
    but_top_ton.onmouseout = but_top_tonOrme_top_nuMouseout;
  if (but_top_ton == activebut_top_ton)
    return false;
  if (activebut_top_ton != null)
    resetbut_top_ton(activebut_top_ton);
  if (but_top_ton != activebut_top_ton) {
    depressbut_top_ton(but_top_ton);
    activebut_top_ton = but_top_ton;
  }
  else
    activebut_top_ton = null;
  return false;
}
function but_top_tonMouseover(event, me_top_nuId) {
  var but_top_ton;
  if (activebut_top_ton == null) {
    but_top_tonClick(event, me_top_nuId);
    return;
  }
  if (browser.isIE)
    but_top_ton = window.event.srcElement;
  else
    but_top_ton = event.currentTarget;
  if (activebut_top_ton != null && activebut_top_ton != but_top_ton)
    but_top_tonClick(event, me_top_nuId);
}
function depressbut_top_ton(but_top_ton) {
  var x, y;
  but_top_ton.className += " me_top_nubut_top_tonActive";
  if (but_top_ton.onmouseout == null)
    but_top_ton.onmouseout = but_top_tonOrme_top_nuMouseout;
  if (but_top_ton.me_top_nu.onmouseout == null)
    but_top_ton.me_top_nu.onmouseout = but_top_tonOrme_top_nuMouseout;
  x = getPageOffsetLeft(but_top_ton);
  y = getPageOffsetTop(but_top_ton) + but_top_ton.offsetHeight;
  if (browser.isIE) {
    x += but_top_ton.offsetParent.clientLeft;
    y += but_top_ton.offsetParent.clientTop;
  }
  //--new code for the Y axis!!!!-------------------------------------------button sb but_top_ton menu sb me_top_nu
  var maxY;
  if (browser.isIE) {
    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
    maxY += 12;
  }
  if (browser.isOP) {
    maxY = document.documentElement.scrollTop  + window.innerHeight;
  }
  if (browser.isNS) {
    maxY = window.scrollY + window.innerHeight;
  }
  // window.alert( '1) ns maxY: ' + maxY + ' Y: ' + y );
  maxY -= but_top_ton.me_top_nu.offsetHeight;
  // window.alert( '2) ns maxY: ' + maxY + ' Y: ' + y );
  y = Math.max(0, Math.min(y, maxY));
  // window.alert( '3) ns maxY: ' + maxY + ' Y: ' + y );
  // Position and show the sub menu.   MAXx
  //------------------------------------------------------------------------button sb but_top_ton menu sb me_top_nu
  but_top_ton.me_top_nu.style.left = x + "px";
  but_top_ton.me_top_nu.style.top  = y - 6 + "px";  // raise it up
  but_top_ton.me_top_nu.style.visibility = "visible";
}
function resetbut_top_ton(but_top_ton) {
  removeClassName(but_top_ton, "me_top_nubut_top_tonActive");
  if (but_top_ton.me_top_nu != null) {
    closeSubme_top_nu(but_top_ton.me_top_nu);
    but_top_ton.me_top_nu.style.visibility = "hidden";
  }
}
//----------------------------------------------------------------------------
// Code to handle the me_top_nus and sub me_top_nus.
//----------------------------------------------------------------------------
function me_top_nuMouseover(event) {
  var me_top_nu;
  if (browser.isIE)
    me_top_nu = getContainerWith(window.event.srcElement, "DIV", "me_top_nu");
  else
    me_top_nu = event.currentTarget;
  if (me_top_nu.activeItem != null)
    closeSubme_top_nu(me_top_nu);
}
function me_top_nuItemMouseover(event, me_top_nuId) {
  var item, me_top_nu, x, y;
  if (browser.isIE)
    item = getContainerWith(window.event.srcElement, "A", "me_top_nuItem");
  else
    item = event.currentTarget;
  me_top_nu = getContainerWith(item, "DIV", "me_top_nu");
  if (me_top_nu.activeItem != null)
    closeSubme_top_nu(me_top_nu);
  me_top_nu.activeItem = item;
  item.className += " me_top_nuItemHighlight";
  if (item.subme_top_nu == null) {
    item.subme_top_nu = document.getElementById(me_top_nuId);
    if (item.subme_top_nu.isInitialized == null)
      me_top_nuInit(item.subme_top_nu);
  }
  if (item.subme_top_nu.onmouseout == null)
    item.subme_top_nu.onmouseout = but_top_tonOrme_top_nuMouseout;
  x = getPageOffsetLeft(item) + item.offsetWidth;
  y = getPageOffsetTop(item);
  var maxX, maxY;
  if (browser.isIE) {
    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
  }
  if (browser.isOP) {
    maxX = document.documentElement.scrollLeft + window.innerWidth;
    maxY = document.documentElement.scrollTop  + window.innerHeight;
  }
  if (browser.isNS) {
    maxX = window.scrollX + window.innerWidth;
    maxY = window.scrollY + window.innerHeight;
  }
  maxX -= item.subme_top_nu.offsetWidth;
  maxY -= item.subme_top_nu.offsetHeight;
  if (x > maxX)
    x = Math.max(0, x - item.offsetWidth - item.subme_top_nu.offsetWidth
      + (me_top_nu.offsetWidth - item.offsetWidth));
  y = Math.max(0, Math.min(y, maxY));
  // Position and show the sub me_top_nu.
  item.subme_top_nu.style.left = x + "px";
  item.subme_top_nu.style.top  = y + "px";
  item.subme_top_nu.style.visibility = "visible";
  // Stop the event from bubbling.
  if (browser.isIE)
    window.event.cancelBubble = true;
  else
    event.stopPropagation();
}
function closeSubme_top_nu(me_top_nu) {
  if (me_top_nu == null || me_top_nu.activeItem == null)
    return;
  if (me_top_nu.activeItem.subme_top_nu != null) {
    closeSubme_top_nu(me_top_nu.activeItem.subme_top_nu);
    me_top_nu.activeItem.subme_top_nu.style.visibility = "hidden";
    me_top_nu.activeItem.subme_top_nu = null;
  }
  removeClassName(me_top_nu.activeItem, "me_top_nuItemHighlight");
  me_top_nu.activeItem = null;
}
function but_top_tonOrme_top_nuMouseout(event) {
  var el;
  if (activebut_top_ton == null)
    return;
  if (browser.isIE)
    el = window.event.toElement;
  else if (event.relatedTarget != null)
      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
  if (getContainerWith(el, "DIV", "me_top_nu") == null) {
    resetbut_top_ton(activebut_top_ton);
    activebut_top_ton = null;
  }
}
//----------------------------------------------------------------------------
// Code to initialize me_top_nus.
//----------------------------------------------------------------------------
function me_top_nuInit(me_top_nu) {
  var itemList, spanList;
  var textEl, arrowEl;
  var itemWidth;
  var w, dw;
  var i, j;
  if (browser.isIE) {
    me_top_nu.style.lineHeight = "2.5ex";
    spanList = me_top_nu.getElementsByTagName("SPAN");
    for (i = 0; i < spanList.length; i++)
      if (hasClassName(spanList[i], "me_top_nuItemArrow")) {
        spanList[i].style.fontFamily = "Webdings";
        spanList[i].firstChild.nodeValue = "4";
      }
  }
  itemList = me_top_nu.getElementsByTagName("A");
  if (itemList.length > 0)
    itemWidth = itemList[0].offsetWidth;
  else
    return;
  for (i = 0; i < itemList.length; i++) {
    spanList = itemList[i].getElementsByTagName("SPAN");
    textEl  = null;
    arrowEl = null;
    for (j = 0; j < spanList.length; j++) {
      if (hasClassName(spanList[j], "me_top_nuItemText"))
        textEl = spanList[j];
      if (hasClassName(spanList[j], "me_top_nuItemArrow"))
        arrowEl = spanList[j];
    }
    if (textEl != null && arrowEl != null) {
      textEl.style.paddingRight = (itemWidth 
        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
      // For Opera, remove the negative right margin to fix a display bug.
      if (browser.isOP)
        arrowEl.style.marginRight = "0px";
    }
  }
  if (browser.isIE) {
    w = itemList[0].offsetWidth;
    itemList[0].style.width = w + "px";
    dw = itemList[0].offsetWidth - w;
    w -= dw;
    itemList[0].style.width = w + "px";
  }
  me_top_nu.isInitialized = true;
}




//</script>
//<!-- ============================= SCRIPTS END ========================================================================= -->

