/* "adapted" from ala's domtricks2 */

var IE;

function getUA()
{
        if (navigator.appName.indexOf("Explorer") >= 0)
        {
            IE = true;
        }

}

function showHide( subNum )
{	
    if (getIdProperty( "sub" + subNum, "display") == "block" )
    
    {
        setIdProperty("sub" + subNum, "display", "none");
	   setIdProperty("h3-" + subNum, "background", "url(http://i.i.com.com/cnwk.1d/i/z/0704/plus.gif) 0 50% no-repeat");
    }
    else
    {
        setIdProperty("sub" + subNum, "display", "block");
        setIdProperty("h3-" + subNum, "background", "url(http://i.i.com.com/cnwk.1d/i/z/0704/minus.gif) 0 50% no-repeat");
    }
}


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;
    }
}

/* call user engagement gif */
function usrActionReg(which,action) 
{
   which.innerHTML += '<img src="http://dw.com.com/redir?destUrl=http%3A%2F%2Fi.i.com.com%2Fcnwk.1d%2Fi%2Fb.jpg' + dwInfo + '&usraction=' + action + '" width="1" height="1" border="0">';
   window.print ();  
}





