<!--

function fopen(id)
{
    x = document.getElementById(id);

    if (x.style.display != 'block')
    {
        x.style.display = 'block';
    }
    else
    {
        x.style.display = 'none';
    }
}

function getWindowHeight()
{
    var x, y
    if (self.innerHeight) // all except Explorer
    {
        x = self.innerWidth;
        y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
        // Explorer 6 Strict Mode
    {
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
        x = document.body.clientWidth;
        y = document.body.clientHeight;
    }

    return y;
}



function popen(id)
{
    x = document.getElementById(id);

    if (x.style.display != 'block')
    {
        x.style.display = 'block';
    }
    else
    {
        x.style.display = 'none';
    }

    // center
    if (x.offsetHeight > getWindowHeight())
    {
        iValue = 0;
        iPercent = -1;
    }
    else
    {
        iPercent = getWindowHeight() / 100;
        iValue = Math.round((getWindowHeight()  - x.offsetHeight) / iPercent) /2;
    }

    x.style.top = iValue + "%";
    x.style.position = 'fixed';
    x.style.marginLeft = "-" + Math.round(x.offsetWidth / 2) + "px";
    x.style.left = "50%";
}

// make the specified div a windowed control in IE6
// this masks an iframe (which is a windowed control) onto the div,
// turning the div into a windowed control itself
function ie6SelectIFrameFix(p_div)
{
    o_div = document.getElementById(p_div);

    if (o_div)
    {
        var is_ie6 = document.all && (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1);

        if (is_ie6)
        {
            var html = "<iframe style=\"position: absolute; display: block; " +
                       "z-index: -1; width: 100%; height: 100%; top: 0; left: 0;" +
                       "filter: mask(); background-color: #ffffff; \"></iframe>";
            if (o_div) o_div.innerHTML += html;
    
            // force refresh of div
            var olddisplay = o_div.style.display;
            o_div.style.display = 'none';
            o_div.style.display = olddisplay;
        };
    }
}

function tMenu(inp)
{
    document.getElementById("menuopt" + curMenu).style.display = 'none';
    document.getElementById("menuopt" + inp).style.display = 'block';

    curMenu = inp;

}

var curMenu = '';

function showImage(imagename, x, y) 
{
    lrgewin = window.open("about:blank","","height=" + x + ",width=" + y)

    doc = lrgewin.document;
    doc.open('text/html');
    doc.write('<HTML><HEAD><TITLE>Enlarged Image<\/TITLE><\/HEAD><BODY bgcolor="white" topmargin="0" leftmargin="0">');
    doc.write('<IMG SRC="/' + imagename + '">');
    doc.write('<\/BODY><\/HTML>');
    doc.close();
}

//-->
