// this is the .Net version of the MenuTooggle routine
function mToggle()
{
	var ctlHSLink=document.getElementById("HideShowLink");
	var ctlHSValue=document.getElementById("HideShowValue");
	if (ctlHSValue.value == "1")
	{
		ctlHSValue.value="0";
		document.getElementById("MenuTree").style.display="none";
		ctlHSLink.innerHTML="Show Menu";
    }
	else
	{
		ctlHSValue.value="1";
		document.getElementById("MenuTree").style.display="";
		ctlHSLink.innerHTML="Hide Menu";
	}

}

function newWindow(strURL, strAnonymous)
{
	//
	// opens a popup window
	//
	// strAnonymous dictactes whether the username and login/logout links appear in the heading. The
    // default is yes.

    var strAnon="N";
	if (typeof(strAnonymous) != "undefined")
        strAnon = strAnonymous;
    if (strAnon!="Y")
        strAnon="N";
    var targetURL = strURL;
    if (targetURL.search("popup") == -1)
    {
		if (targetURL.indexOf("?") != -1)
			targetURL+="&";
		else
			targetURL+="?";
        targetURL+="popup=true";
     }
    targetURL+="&anon=" + strAnon;
    
    window.open(targetURL,(Math.round(Math.random() * 10000)).toString(),'toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=yes, resizable=yes,top=0,left=' + (screen.width * .10) + ',height=' + (screen.height * .90) + ',width=' + (screen.width*.80) );
}

function newPopup(strURL)
{
	//
	// opens a small popup window
	//

    var targetURL = strURL;
    if (targetURL.indexOf("?") != -1)
        targetURL+="&";
    else
        targetURL+="?";
    if (targetURL.search("popup") == -1)
        targetURL+="popup=true";
    
    window.open(targetURL,'secview','toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no, resizable=yes,top=' + (screen.height * .30) + ',left=' + (screen.width * .30) + ',height=' + (screen.height * .25) + ',width=' + (screen.width*.50) );
    return false;
}

