// JavaScript Document
//Open a popup window with a specified URL
var popwin
function openPopupWindow(URL, scrollBar, resizable, winWidth, winHeight) {
    closePopupWindow();
    var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=' + scrollBar + ',resizable=' + resizable + ',width=' + winWidth + ',height=' + winHeight;
    popwin = window.open(URL, 'popwin', winOptions);
    if (popwin) {
        popwin.focus();
    }
}

function openPopupHelp(URL, winHeight) {
    closePopupWindow();
    var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=650,height=' + winHeight;
    popwin = window.open(URL, 'popwin', winOptions);
    if (popwin) {
        popwin.focus();
    }
}

function closePopupWindow() {
    if (popwin && popwin.open && !popwin.closed && self!=popwin) popwin.close();
}

function toggleLayer(whichLayer){
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display ? "" : "block";
	}
	else 
	if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display ? "" : "block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display ? "" : "block";
	}
}

function hidediv(whichLayer) 
{ 
	if (document.getElementById) 
	{ 
		// DOM3 = IE5, NS6 
		document.getElementById(whichLayer).style.visibility = 'hidden'; 
	} 
	else 
	if (document.layers) 
	{ 
		// Netscape 4 
		document.layers[whichLayer].visibility = 'hidden'; 
	}
	else 
	{ 
		// IE 4 
		document.all[whichLayer].style.visibility = 'hidden'; 
	} 
} 

function showdiv(whichLayer) 
{ 
	if (document.getElementById) 
	{ 
		// DOM3 = IE5, NS6 
		document.getElementById(whichLayer).style.visibility = 'visible'; 
	} 
	else 
	if (document.layers) 
	{ 
		// Netscape 4 
		document.layers[whichLayer].visibility = 'visible'; 
	}
	else 
	{ 
		// IE 4 
		document.all[whichLayer].style.visibility = 'visible'; 
	} 
} 
