function Browser()
{
	var ua, s, i;
	 
	this.isIE = false; // Internet Explorer
	this.isOP = false; // Opera
	this.isNS = false; // Netscape
	this.version = null;
	 
	ua = navigator.userAgent;
	 
	s = "Opera";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isOP = true;
	this.version = parseFloat(ua.substr(i + s.length));
	return;
	}
	 
	s = "Netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isNS = true;
	this.version = parseFloat(ua.substr(i + s.length));
	return;
	}
	 
	// Treat any other "Gecko" browser as Netscape 6.1.
	 
	s = "Gecko";
	if ((i = ua.indexOf(s)) >= 0) {
	this.isNS = true;
	this.version = 6.1;
	return;
	}
	 
	s = "MSIE";
	if ((i = ua.indexOf(s))) {
	this.isIE = true;
	this.version = parseFloat(ua.substr(i + s.length));
	return;
	}
}
 
function removeClassName(el, name)
{
	var i, curList, newList;
	 
	if (el.className == null)
	return;
	 
	// Remove the given class name from the element's className property.
	 
	newList = new Array();
	curList = el.className.split(" ");
	for (i = 0; i < curList.length; i++)
	if (curList[i] != name)
	newList.push(curList[i]);
	el.className = newList.join(" ");
}

function getButton(event)
{
	var button;
	 
	if (browser.isIE)
	button = window.event.srcElement;
	else
	button = event.currentTarget;
	 
	return button;
}
 
function depressButton(button)
{
	button.className += " menuItemActive";
	 
	return true;
}
 
function resetButton(button)
{
	removeClassName(button, "menuItemActive");
	 
	return true;
}
 
function setDispatchMethod(methodName)
{
  dispatchField = document.getElementById("dispatch");
  
  dispatchField.value = methodName
}

var browser = new Browser()
