/* left menu functions */
function collapseItems(parentId)
{
    var children = document.getElementById(parentId).getElementsByTagName('div');
    if (children) {
      for (var i = 0; i < children.length; i++) {
        if ((children[i].className == "subMenu") || (children[i].className == "subMenuRes")) {
          children[i].style.display = 'none';
        } else if (children[i].className == 'menuAccordion orange_12') {
          nestedTriggers = children[i].getElementsByTagName('var');
          if (nestedTriggers && (nestedTriggers.length > 0)) {
            nestedTriggers[0].innerHTML='[+]';
          }
        }
      }
    }
}

//based on main solutions pages
function collapseItems(parentId)
{
    var children = document.getElementById(parentId).getElementsByTagName('div');
    if (children) {
      for (var i = 0; i < children.length; i++) {
        if (children[i].className == "subMenu") {
          children[i].style.display = 'none';
        } else if (children[i].className == 'menuAccordion') {
            children[i].style.backgroundImage="url(/clipart/misc/blueAccordion_r.gif)";
        }
      }
    }
}

function gotoInnerAnchor(theAnchor, bOpen)
{  
    if (bOpen) {
       document.location=theAnchor.href;
    }
}

function backToTop(childId, containerId)
{
    switchAccordion(childId, containerId);
}

function switchAccordion(childId, containerId)
{
    var currChild = document.getElementById(childId);
    var currId;
    var switchDIV;
    //ugly fix - Features instance of menu has accordions with CSS classes set: menuAccordion orange_12
    var bFeatures = (currChild.id.indexOf("feat") >= 0);
    if (bFeatures) {
        currId = parseInt(childId.substring(4, childId.length)); //another ugly fixy
        switchDIV = document.getElementById('swt'+currId);
    }

    var children = document.getElementById(containerId).getElementsByTagName('div');
    if (currChild.style.display != 'block') {
        for (var i = 0; i < children.length; i++) {
            if (children[i].className == "subMenu") {
                children[i].style.display = 'none';
            } else if (children[i].className == 'menuAccordion') {
                children[i].style.backgroundImage="url(/clipart/misc/blueAccordion_r.gif)";
            }
        }
        currChild.style.display = 'block';
        if (switchDIV) {
            switchDIV.style.backgroundImage="url(/clipart/misc/blueAccordion_d.gif)";
        }
        return true;
    } else {
        currChild.style.display = 'none';
        if (switchDIV) {
            switchDIV.style.backgroundImage="url(/clipart/misc/blueAccordion_r.gif)";
        }
        return false;
    }
    
}

/* left menu end */

function openPopupWindow(theLink)
{
    openNamedPopupWindow(theLink, "");
}

function openNamedPopupWindow(theLink, windowName)
{
    openNamedPopupWindowWithParams(theLink, windowName, "HEIGHT=470,WIDTH=400,scrollbars,menubar=no,toolbar=no,titlebar=no");
}

function openPopupWindowWithParams(theLink, windowParams)
{
    openNamedPopupWindowWithParams(theLink, "", windowParams);
}

function openNamedPopupWindowWithParams(theLink, windowName, windowParams)
{
    popupWindow = self.open(theLink, windowName, windowParams);
    popupWindow.focus();
}
