function getDomObject(domid)
{
    if (document.getElementById)
    {
        return((document.getElementById(domid)) ? document.getElementById(domid).style : null);
    }
    else if (document.all)
    {
        return((document.all[domid]) ? document.all[domid].style : null);
    }
    else if (document.layers)
    {
        return((document.layers[domid]) ? document.layers[domid] : null);
    }
    else
    {
        return(null);
    }
}

function showDomObject(domid)
{
    var obj = getDomObject(domid);
    obj.visibility = "visible";
}

function hideDomObject(domid)
{
    var obj = getDomObject(domid);
    obj.visibility = "hidden";
}

function swapImage(imgid, imgsrc)
{
    if (document.images)
    {
        document.images[imgid].src = imgsrc;
    }
}

function swapBackground(domid, imgsrc)
{
    var obj = getDomObject(domid);
    obj.backgroundImage = "url('" + imgsrc + "')";
}

function swapTextColor(domid, color)
{
    var obj = getDomObject(domid);
    obj.color = color;
}

var popupWin = null;

function popup(url, w, h)
{
    if (popupWin != null)
    {
        popupWin.close();
    }

    popupWin = window.open(url, "popup", "HEIGHT=" + h + ",WIDTH=" + w + ",status=no,toolbar=no,directories=no,menubar=yes,location=no,scrollbars=yes");
    popupWin.focus();
}

