/*----------------------------------------------------------------------
 * setFocus( [Object o] )
 *   Sets the focus on the specified object, by 
 *   default the first element of the first form on
 *   the page is selected. Ignores hidden fields.
 *
 * author:    Arkadiusz Gruszowski, Oct 11 2005
 * modified:  Arkadiusz Gruszowski, Oct 01 2007
 */
function setFocus( o ) {
    
    if( o != undefined )
    {                                                    // If object has been specified.
        try {                                            // Try the function in case object cannot be focused
            o.focus();
            o.select();
        } catch(e) {}
    } 
    else if( document.forms.length > 0)                  // If at least 1 form is present.
    {
        var l = document.forms[0].elements.length;       // Store length for faster loop execution.
        for(var i=0; i < l; i++) {
            var element = document.forms[0].elements[i];
            if( element.type != "hidden" ) {             // If the element is of type hidden ignore.
                try {
                    element.focus();
                    element.select();
                } catch(e) {}
                break;                                   // Break if first focusable field is found.
            }
        }
    }
    
}


function toggleFAQ(subMenu) {
    // toggles the answer section of the FAQ

    var subDivs = document.getElementById(subMenu).getElementsByTagName('div');
    var divImg = subDivs[0].getElementsByTagName('img');
                
    if (subDivs[1].style.display == "block") {
        subDivs[1].style.display = "none";
        divImg[0].src = "/images/interface/FAQPlus.gif";
    }
    else {
        subDivs[1].style.display = "block";
        divImg[0].src = "/images/interface/FAQMinus.gif";
    }
}



sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);