function $() {
	var aElems = [];
	for (var i=0; i<arguments.length; i++) {
		var soElem = arguments[i];
		if (typeof soElem == 'string') soElem = document.getElementById(soElem);
		if (arguments.length == 1) return soElem;
		aElems.push(soElem);
	}
	return aElems;
}
function $t(sTag,oObj) {
	oObj = oObj || document;
	return oObj.getElementsByTagName(sTag);
}

function $c(sClass,oObj,sTag) {
	oObj = oObj || document;
	if (!oObj.length) { oObj = [oObj]; }
	var aElements = [];
	for(var i = 0; i<oObj.length; i++) {
		oEl = oObj[i];
		if(oEl.getElementsByTagName) {
			oObj.children = oEl.getElementsByTagName(sTag || '*');
			for (var j = 0; j<oObj.children.length; j++) {
				oObj.child = oObj.children[j];
				if(oObj.child.className&&(new RegExp('\\b'+sClass+'\\b').test(oObj.child.className))) {
					aElements.push(oObj.child);
				}
			}
		}
	}
	return aElements;
}
HTMLObject = function(oEl) {
	//if(!window.attachEvent) {return oEl;}
	for(property in HTMLObject) { oEl[property] = HTMLObject[property]; }
	return oEl;
}

WhizBang = function() { };


Object.extend = function(oDestination,oSource) {
	for(property in oSource) { oDestination[property] = oSource[property]; }
	return oDestination;
}


var Class = function() {
	return function() { this.initialize.apply(this,arguments); }
}


function addEventToObject(oObj,sEvt,fFunc) {
	var oldhandler = oObj[sEvt];
	oObj[sEvt] = (typeof oObj[sEvt] != 'function') ? fFunc : function(){ oldhandler(); fFunc(); };
}

function removeEventFromObject(oObj,sEvt) {
	var oldhandler = oObj[sEvt];
	oObj[sEvt] = null;
}

function stopDefaultAction(ev) {
	if(!ev) { ev = window.event; }
	(ev.stopPropagation) ? ev.stopPropagation() : ev.cancelBubble = true;
	(ev.preventDefault) ? ev.preventDefault() : ev.returnValue = false;
	return false;
}


function getClickedLink(ev) {
	if(!ev) { ev = window.event; }
	var clickedLink = (window.event) ? window.event.srcElement : ev.target;
	while (!clickedLink.tagName || clickedLink.tagName.toLowerCase() != "a") clickedLink = clickedLink.parentNode;
	return clickedLink;
}


Object.extend(HTMLObject, {
	getHeight: function() { return this.offsetHeight; },
	getWidth: function() { return this.offsetWidth; },
	getTop: function() {
		var styleValue = 0;
		var obj = this;
		if(obj.offsetParent) {
			while(obj.offsetParent) {
				styleValue += obj.offsetTop;
				obj = obj.offsetParent;
			}
		} else if(obj.x) { styleValue += obj.y; }
		return styleValue;
	},
	getLeft: function() {
		var styleValue = 0;
		var obj = this;
		if(obj.offsetParent) {
			while(obj.offsetParent) {
				styleValue += obj.offsetLeft;
				obj = obj.offsetParent;
			}
		} else if(obj.x) { styleValue += obj.x; }
		return styleValue;
	},
	getInfo: function(selector) {
		var viewCSS = (typeof document.defaultView == 'function') ? document.defaultView() : document.defaultView;
		if(viewCSS && viewCSS.getComputedStyle) {
			var s = viewCSS.getComputedStyle(this,null);
			return s && s.getPropertyValue(selector);
		}
		return this.currentStyle && (this.currentStyle[selector] || null) || null;
	},
	addClass: function(class_name) {
		if(this.className !== '') { this.className += ' ' + class_name; }
		else { this.className = class_name; }
	},
	removeClass: function(class_name) {
		var oldClass = this.className;
		var re = new RegExp('\\s?'+class_name+'\\b');
		if(oldClass.indexOf(class_name) != -1) { this.className = oldClass.replace(re,''); }
	},
	hasClass: function(class_name) {
		var re = new RegExp('(^|\\s+)'+class_name+'(\\s+|$)');
		if(this.getAttributeNode("class") !== null) { return re.test(this.getAttributeNode("class").value); }
		else if(this.className) { return re.test(this.className); }
		else { return false; }
	},
	addEvent: function(evt,func) { addEventToObject(this,evt,func); },
	removeEvent: function(evt) { removeEventFromObject(this,evt); }
});