function browserCheck() {
	this.ns4 = (document.layers)? true:false;
	this.ie = (document.all && !window.opera)? true:false;
	this.ie4 = (document.all && !document.getElementById)? true:false;
	this.iewin = (window.ActiveXObject)? true:false;
	this.dom = (document.getElementById)? true:false;
	this.moz = (window.sidebar)? true:false;
	this.ns6 = (window.sidebar&&navigator.userAgent.indexOf('Netscape')!=-1)? true:false;
	this.opera = (window.opera)? true:false;
	this.mac = (navigator.userAgent.indexOf('Mac')!=-1)? true:false;
	this.iemac = ((navigator.userAgent.indexOf('Mac')!=-1) && (document.all&&(!window.opera)) )? true:false;
}
is = new browserCheck()


if (is.dom && !is.opera) {
	document.write('<link rel="stylesheet" media="screen" href="http://www.suttercourts.com/themed_files/dhtml_css.css">')
}

function dhtml_menu_init(){
	cssName = getActiveStyleSheet();
	// preload the images:
	var openImage = new Image();
	var closedImage = new Image();
	openImage.src = "http://www.suttercourts.com/themed_files/_open.gif";
	closedImage.src = "http://www.suttercourts.com/themed_files/_closed.gif";
	if (is.dom && !is.opera) {
		var leftMenu = document.getElementById('left_menu');
		var h4Arr = leftMenu.getElementsByTagName('h4');
		for (var i = 0; i < h4Arr.length; i++) {
			h4Arr[i].title = "Click to show";
			if (is.ie) h4Arr[i].onselectstart = function() {return false};
			h4Arr[i].onclick = menuItemToggle;
			h4Arr[i].style.background = "url(http://www.suttercourts.com/themed_files/_closed.gif) center right no-repeat";
		}
	}
}

function menuItemToggle() {
	if (this.nextSibling.style.display != "block") {
		this.nextSibling.style.display = "block";
		this.title = "Click to hide";
		this.style.background = "url(http://www.suttercourts.com/themed_files/_open.gif) center right no-repeat";
	} else {
		this.nextSibling.style.display = "none";
		this.title = "Click to show";
		this.style.background = "url(http://www.suttercourts.com/themed_files/_closed.gif) center right no-repeat";
	}
}
