var xml_req = xmlReqObject();
function xmlReqObject(){
	try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {};
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {};
	try { return new XMLHttpRequest(); } catch (e) {};
	alert('Ajax not supported/working. Your server may be down! Make sure it is up and running. If this doesn\'t fix your problem, please contact Calvin K. Cox @ ccox@apple.com');
	return null;
};

function $(id){return document.getElementById(id);};

var Item = (typeof(Item) == 'undefined') ? {} : Item;

Item.listen = function(elem, evnt, func) {
	if (elem.addEventListener)
		// W3C DOM
		elem.addEventListener(evnt,func,false);
	else if (elem.attachEvent) {
		// IE DOM
		var r = elem.attachEvent("on"+evnt, func);
		return r;
	}
};

Item.setAttribute = function(e, k, v) {
	if (k == "class") {
		e.setAttribute("className", v);
		// set both "class" and "className"
		}
	return e.setAttribute(k, v);
};

Item.createElement = function(e, attrs) {
	var el = document.createElement(e);
	for (var k in attrs) {
		if (k == "text") {
			el.appendChild(document.createTextNode(attrs[k])); }
		else {
			Item.setAttribute(el, k, attrs[k]); }
		}
	return el;
};