if (window.attachEvent)
{
    // IE
    window.attachEvent("onload", ie6hover);
}
else
{
    // OTHER BROWSERS, FF seems to need a delay until hd_menu is in the dom
    init_mozilla();
}

// MOZILLA NEEDS DOM LOADED EVENT FOR MENU CLICK EVENTS
function init_mozilla()
{
    if (document.addEventListener)
    {   
      document.addEventListener("DOMContentLoaded", mozillahover, false);
    }
}

// SET MENU HOVER / CLICK EVENTS
function mozillahover()
{
    if (document.getElementById("hd_menu") != null) {
        var sfEls = document.getElementById("hd_menu").getElementsByTagName("li");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onclick = li_onclick;
        }
    }
    try
    {
        var url = location.href;
        var pos = url.indexOf("j=",1);
        var pos2 = url.indexOf("&",pos);
        if (pos > -1)
        {
            if (pos2 == -1)
            {
                pos2=(url.length-pos)-1;
            }
            else
            {
                pos2=(pos2-pos)-2;
            }
            var anchor = url.substr(pos+2, pos2);
            scrollToId(anchor);
        }
    }
    catch(no)
    {
       // no
    }
}

// SET MENU HOVER / CLICK EVENTS
function ie6hover() {
    if (document.getElementById("hd_menu") != null) {
        var sfEls = document.getElementById("hd_menu").getElementsByTagName("li");
        for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                this.className+=" ie6hover";
            }
            sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp(" ie6hover\\b"), "");
            }
            sfEls[i].onclick = li_onclick;
        }
    }
    try
    {
        var url = location.href;
        var pos = url.indexOf("j=",1);
        var pos2 = url.indexOf("&",pos);
        if (pos > -1)
        {
            if (pos2 == -1)
            {
                pos2=(url.length-pos)-1;
            }
            else
            {
                pos2=(pos2-pos)-2;
            }
            var anchor = url.substr(pos+2, pos2);
            scrollToId(anchor);
        }
    }
    catch(no)
    {
       // no
    }
}

// ACTUAL JS REDIRECT, MAKE SURE TO KILL EVENT BUBBLING
li_onclick = function(e) 
{ 
    //alert(this.attributes.getNamedItem("id").nodeValue); 
    newurl=this.attributes.getNamedItem("id").nodeValue;
    e = e||event;
    e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
    document.location=newurl;    
}






function checkRadioRelevence() {
    window.print('checkRadioRelevence is invoked');
}

function solution_highlight(li)
{
    li.style.cursor="pointer";
    link = li.firstChild;
    link.style.color="#ffffff";
    // IE6 needs these:
    li.style.backgroundImage="url(/www/img/bullet_hover.gif)";
    li.style.backgroundColor="#002a66";
}

function solution_lowlight(li)
{

    li.style.cursor="default";
    link = li.firstChild;
    link.style.color="#002a66";
    // IE6 needs these:
    li.style.backgroundImage="url(/www/img/bullet.gif)";
    li.style.backgroundColor="#ffffff";
}

function openWindow(url) {
       var fenster = window.open(url,'window','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,screenX=20,screenY=20,width=600,height=400');
       if(navigator.appName.substring(0,8)=="Netscape" ) {
                       fenster.location=URL;
       }
       fenster.focus();
 }