// global variables
var isStandard = (document.getElementById) ? true : false;
var isIe5 = (document.all) ? true : false;

function openWindow(uri, winName)
{
	var winFeatures = "menubar,toolbar,location,scrollbar,status,";
	winFeatures += "resizable,width=640,height=480,";
	winFeatures += "top=24,left=24";

	return window.open(uri, winName, winFeatures, true);
}

/*
**	changes made to external variables of calling document if they exist
**		tocCookieName
**		tocCookieValue
*/

function toggle(id)
{
	var element;
	var whichImg;

	if (isStandard) {
		element = document.getElementById(id);
		whichImg = document.getElementById("img_" + id);

		if(element.style.display == "none") {
			element.style.display = "block";
			whichImg.setAttribute("src", "graphics/minus.gif");
			whichImg.setAttribute("alt", "Shrink list");
			tocCookieValue[id] = 1;
		}
		else {
			element.style.display = "none";
			whichImg.setAttribute("src", "graphics/plus.gif");
			whichImg.setAttribute("alt", "Expand list");
			tocCookieValue[id] = 0;
		}
	}
	else if (isIe5) {
		element = document.all[id];
		whichImg = event.srcElement;

		if (element.style.display == "none") {
			element.style.display = "";
			whichImg.src = "graphics/minus.gif";
			whichImg.alt = "Shrink list";
			tocCookieValue[id] = 1;
		}
		else {
			element.style.display = "none";
			whichImg.src = "graphics/plus.gif";
			whichImg.alt = "Expand list";
			tocCookieValue[id] = 0;
		}
	}
	if (typeof tocCookieName != "undefined") {
		writeCookie(tocCookieName, tocCookieValue);
	}
}
