function $() {
	var elements = new Array();

	for(var x = 0; x < arguments.length; x++) {
		var e = arguments[x];

		if(typeof e == 'string') {
			e = document.getElementById(e);
		}

		if (arguments.length == 1) {
			return e;
		}

		elements.push(e);
	}

	return elements;
}

//returns the current x coordinate of an element
function getPosX(element) {
	var left = 0;
	
	if(typeof element.offsetParent != 'undefined') {
		while(element && element.offsetParent) {
			left += element.offsetLeft
			element = element.offsetParent;
		}
	}

	return left;
}

//returns the current y coordinate of an element
function getPosY(element) {
	var top = 0;
	
	if(typeof element.offsetParent != 'undefined') {
		while(element && element.offsetParent) {
			top += element.offsetTop			
			element = element.offsetParent;
		}
	}

	return top;
}

function init(id, callbackFunction, seconds) {
	seconds = (seconds == null) ? 30 : seconds;

	if(seconds == 0) {
		return false;
	}

	if(!$(id)) {
		seconds -= 1/20;
		setTimeout(function() { init(id, callbackFunction, seconds); }, 50);
		return false;
	}

	callbackFunction();
}