var topLevel = 100;
function toggleBox(szDivID, iState)
{
    if(document.layers)	   //NN4+
    {
        if(document.layers[szDivID].visibility == "visible")
        {
            document.layers[szDivID].visibility = "hidden";
        }
        else
        {
            document.layers[szDivID].zIndex = topLevel++;
            document.layers[szDivID].visibility = "visible";
        }

    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);		

        if(obj.style.visibility == "visible")
        {			
			deleteCookie(szDivID);			
            obj.style.visibility = "hidden";
        }
        else
        {
			setCookie(szDivID, 'opened');			
            obj.style.zIndex = topLevel++;
            obj.style.visibility = "visible";
        }
    }
    else if(document.all)	// IE 4
    {
        if(document.all[szDivID].style.visibility == "visible")
        {
            document.all[szDivID].style.visibility = "hidden";
        }
        else
        {
            document.all[szDivID].style.zIndex = topLevel++;
            document.all[szDivID].style.visibility = "visible";
        }
    }

    if(topLevel > 32000)
    {
        topLevel = 10;
    }
}


function onLine()
{
    window.frames["_ONLINE"].location.href='online.php';
}


function show_MENU()
{
    //find the height of the internal page
    var the_height=
    document.getElementById('_MENU').contentWindow.
    document.body.scrollHeight;

    //change the height of the iframe
    document.getElementById('_MENU').height=
    the_height;
}

function show_ONLINE()
{
    //find the height of the internal page
    var the_height=
    document.getElementById('_ONLINE').contentWindow.
    document.body.scrollHeight;

    //change the height of the iframe
    document.getElementById('_ONLINE').height=
    the_height;
}

function show_STATUS()
{
    //find the height of the internal page
    var the_height = document.getElementById('_STATUS').contentWindow.
    document.body.scrollHeight;

    //change the height of the iframe
    document.getElementById('_STATUS').height = the_height;
}

var today = new Date(); var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000); // plus 30 days
function setCookie(name, value)
{
	document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
}

function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;

	return unescape( document.cookie.substring( len, end ) );
}

function deleteCookie(name)
{
	var value='';
	cook_exp=expiry.toGMTString()*(-1);
	document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
}
//End
