if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) type="OP";
if (document.all) type="IE";
if (!document.all && document.getElementById) type="MO";

function mv(id) {
    if (type=="IE")
    {
        document.all[id].style.cursor='pointer';
    }
    if (type=="MO" || type=="OP")
    {
        document.getElementById(id).style.cursor='pointer';
    }
}

function mo(id) {
    if (type=="IE")
    {
        document.all[id].style.cursor='default';
    }
    if (type=="MO" || type=="OP")
    {
        document.getElementById(id).style.cursor='default';
    }
}

function openurl(url) {
    window.location.href=url;
}

/*
    Functions for expanding/collapsing divs.
*/
function expandCollapse (level, levelCount) 
{
    var theDiv = document.getElementById(level + '_' + levelCount);
    var theImage = document.getElementById('img_' +  level + '_' + levelCount);
    
    if (theDiv.style.display == 'none')
    {
        theDiv.style.display = '';
        theImage.src = '/images/tree_collapse.gif';
    } else {
        theDiv.style.display = 'none';
        theImage.src = '/images/tree_expand.gif';
    }
}

function expandCollapseAll (theWhat, theCommand)
{
    if (theCommand == 'collapse')
    {
        for (var i=0; document.getElementById(theWhat + '_' + i); i++)
        {
            document.getElementById(theWhat + '_' + i).style.display = 'none';
            document.getElementById('img_'+ theWhat + '_' + i).src = '/images/tree_expand.gif';
        }
    } else {
        for (var i=0; document.getElementById(theWhat + '_' + i); i++)
        {
            document.getElementById(theWhat + '_' + i).style.display = '';
            document.getElementById('img_'+ theWhat + '_' + i).src = '/images/tree_collapse.gif';
        }
    }
}
