Element.prototype.setPosition = function(x, y) {
	
	this.style.left = x+"px";
	this.style.top = y+"px";

}

Element.prototype.getPosition = function() { //for non images

	var pos = {
		x:parseInt(this.style.left),
		y:parseInt(this.style.top)
	};
	return pos;

}

Element.prototype.setSize = function(width, height) { //for non images

	this.style.width = width+"px";
	this.style.height = height+"px";

}

Element.prototype.getSize = function() { //for non images

	var size = {
		width:parseInt(this.style.width), 
		height:parseInt(this.style.height)
	};
	return size;

}

Element.prototype.setOpacity = function(opacity) {

	this.style.opacity = opacity;
	this.style.filter = "alpha(opacity="+opacity*100+")";

}

Event.prototype.getCaller = function() {

	var caller = this.target || this.srcElement;
	return caller;

}

UtilityCore = (function() {

	var public = {};
	
	public.addListener = function(object, type, functionCall) {
	
		if (object.addEventListener) {
			object.addEventListener(type, functionCall, false);
		} else if (object.attachEvent) {
			object.attachEvent("on"+type, functionCall);
		} else {
			object["on"+type] = functionCall;
		}
	
	}

	public.deferFunctionCall = function(functionCall) {
	
		if (window.addEventListener) {
			window.addEventListener("load", functionCall, false);
		} else if (window.attachEvent) {
			window.attachEvent("onload", functionCall);
		} else {
			window.onload = functionCall;
		}
	
	}
	
	return public;

}());
