var isIE = navigator.appName == "Microsoft Internet Explorer";
var isNN = navigator.appName == "Netscape";

function element(_name) {
	return document.getElementById(_name);
}

function flipList(_marker,_list) {
	if (element(_marker).className == "category_list_item_closed") {
		element(_marker).className = "category_list_item_open";
		element(_list).className = "";
	} else {
		element(_marker).className = "category_list_item_closed";
		element(_list).className = "hidden";
	}
}

function popupWindow(_URL, _width, _height) {
	window.open(_URL, "", "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+_width+",height="+_height);
}

function popupNamedWindow(_name, _URL, _width, _height) {
	window.open(_URL, _name, "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+_width+",height="+_height);
}

function popupImage(Name, URL, width, height) {
	newWin = window.open("", "", "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+width+",height="+height);
	var doc = newWin.document;
	doc.open();
	doc.write("<head><title>" + Name + "</title><style>body {margin:0; padding:0; background-color: #000000};</style></head><body><img src='" + URL + "' width='" + width + "' height='" + height + "'></body>");
	doc.close();
	doc.title = Name;
}

function in_array(_val, _array) {
	for (var i = 0; i < _array.length; i++)
		if (_array[i] == _val)
			return i;
	return -1;
}

function extractSelection() {
	if (window.getSelection)
		return window.getSelection();
	else if (document.selection)
		return document.selection;
	else if (document.getSelection)
		return document.getSelection();
	else
		return null;
}

