var IE;

function getUA()
{
        if (navigator.appName.indexOf("Explorer") >= 0)
        {
            IE = true;
        }
}

function showHide( subNum )
{	
    getUA();
    if ((getIdProperty( "sub" + subNum, "display") == "block") || (!getIdProperty( "sub" + subNum, "display")))
    
    {
        setIdProperty("sub" + subNum, "display", "none");
//	      setIdProperty("h3-" + subNum, "background", "none");
    }
    else
    {
        setIdProperty("sub" + subNum, "display", "block");
//        setIdProperty("h3-" + subNum, "background", "none");
    }
}

function getStyleBySelector( selector )
{
    if (IE)
    {
        return null;
    }
    var sheetList = document.styleSheets;
    var ruleList;
    var i, j;
    for (i=sheetList.length-1; i >= 0; i--)
    {
        ruleList = sheetList[i].cssRules;
        for (j=0; j<ruleList.length; j++)
        {
            if (ruleList[j].type == CSSRule.STYLE_RULE &&
                ruleList[j].selectorText == selector)
            {
                return ruleList[j].style;
            }   
        }
    }
    return null;
}

function getIdProperty( id, property )
{
    if (!IE)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            if (styleObject[property])
            {
                return styleObject[ property ];
            }
        }
        styleObject = getStyleBySelector( "#" + id );
        return (styleObject != null) ?
            styleObject[property] :
            null;
    }
    else
    {
        return document.all[id].style[property];
    }
}

function setIdProperty( id, property, value )
{
    if (!IE)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            styleObject[ property ] = value;
        }
    }
    else
    {
         document.all[id].style[property] = value;
    }
}
