// JavaScript Document

function PositionedElement(obj,anchorObj,offsetX,offsetY){
	this.obj = obj;
	this.anchorObj = anchorObj;
	this.offsetX = offsetX;
	this.offsetY = offsetY;
	this.position = PositionedElementPosition;
}


function PositionedElementPosition(){
	var pos = Position.cumulativeOffset(this.anchorObj);
	this.obj.style.top = eval(parseInt((pos[1]))+parseInt(this.offsetY)) + "px";
	this.obj.style.left = eval(parseInt((pos[0]))+parseInt(this.offsetX)) + "px";

}

function RegistrarInitialize(){
	var _this = this;
	window.onresize = function(){
		_this.positionAllElements();
		return false;
	}
}

function Registrar(){
	this.positionedElements = new Array();
	this.register = RegistrarRegisterPositionedElement;
	this.positionAllElements = RegistrarPositionAllElements;
	this.init = RegistrarInitialize;
}

function RegistrarRegisterPositionedElement(p){
	this.positionedElements.push(p);
}

function RegistrarPositionAllElements(){
	for (var i = 0; i < this.positionedElements.length; i++){
		this.positionedElements[i].position();
	}
}