/**
 * In The Name of Allah, The Most Gracious, The Most Merciful
 */
 /*
var Layer = new Class({
	Extends: Element,
	initialize: function(Options){
		var lLayer = document.createElement('div');
		lLayer.addClass('Draggable');
		var MovableLayer = new Drag(lLayer)
		this.adopt([lLayer]);

		if (Options.Parent){
			Options.Parent.adopt(this);
		}
	}
});
*/
// --- ^ Object Oriented!

function centeralizeLayer(Layer)
{
	return CenteralizeDivLayer(Layer);
}

function CenteralizeLayer(DivID)
{
	DivID = $(DivID);

	var Coordination = DivID.getCoordinates(),
	Scroll = {x: window.getScrollLeft(), y: window.getScrollTop()},
	clientWidth = document.documentElement.clientWidth || 800,
	clientHeight = document.documentElement.clientHeight || 600,
	DivWidth = parseInt(Coordination.width || 300),
	DivHeight = parseInt(Coordination.height || 50),
	xpos1 = Scroll.x + Math.floor(clientWidth / 2) - Math.floor(DivWidth / 2),
	ypos1 = Scroll.y + Math.floor(clientHeight / 2) - Math.floor(DivHeight / 2);

	DivID.setStyles({top: ypos1 + 'px', left: xpos1 + 'px'});
}

