
/** Styles */
function menuRowStyleOver(row) {
   row.style.textDecoration = 'underline';
    /*
    row.style.color = 'white';
    row.style.borderTop = '1px dotted white';
    row.style.borderBottom = '1px dotted white';
    */
}

function menuRowStyleOut(row) {
   row.style.textDecoration = 'none';
   /*
   row.style.color = '';
   row.style.borderTop = '1px solid #0066CC';
   row.style.borderBottom = '1px solid #0066CC';
   */
}

function menuAnchorStyleOver(col) {
   col.style.color= 'white';
}

function menuAnchorStyleOut(col) {
   col.style.color= '';
}

/** Menu toggling */
var menuArray = new Array("informationMenu","newsMenu","FAQMenu","contactMenu","feedbackMenu");

function displayMenu(menuId) {
   hideAllMenus();
   var menuWrapper = document.getElementById(menuId);
   menuWrapper.style.display = "block";
}

function hideMenu(menuId) {
   var menuWrapper = document.getElementById(menuId);
   menuWrapper.style.display = "none";
}

function hideAllMenus() {
   for (var i = 0; i < menuArray.length; i++) {
      hideMenu(menuArray[i]);
   }
}

/**
* Collection of functions to position a div (lyr) on top of element (obj)
* I have hard coded an offset tso the div appears 18 pixels below and 1 pixel to the left
*/
function setLyr(obj,lyr) {
    var newX = findPosX(obj) - 1;
    var newY = findPosY(obj) + 19;
    if (lyr == 'testP') newY -= 50;
    var x = new getObj(lyr);
    x.style.top = newY + 'px';
    x.style.left = newX + 'px';
}

function findPosX(obj) {
    var curleft = 0;
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}

function findPosY(obj) {
    var curtop = 0;
    var printstring = '';
    if (obj.offsetParent)
    {
        while (obj.offsetParent)
        {
            printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    //window.status = printstring;
    return curtop;
}

function getObj(name) {
 if (document.getElementById)
 {
       this.obj = document.getElementById(name);
       this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
       this.obj = document.all[name];
       this.style = document.all[name].style;
 }
 else if (document.layers)
 {
       if (document.layers[name])
       {
        this.obj = document.layers[name];
        this.style = document.layers[name];
       }
       else
       {
        this.obj = document.layers.testP.layers[name];
        this.style = document.layers.testP.layers[name];
       }
 }
}
/** End div positioning functions */

/** Go functions */
function relocate(whereTo) {
    top.location = whereTo;
}

