/*

	(c) Glimworm IT BV 2006.

	Do not reuse without permission.
	Questions? Please contact Glimworm IT BV, www.glimworm.com.

*/

gwxy = function (objname,calcnow) {
	this.x		= 0;
	this.y		= 0;

	if (objname) this.obj = document.getElementById(objname);
	if (calcnow) this.getxy();
}
gwxy.prototype.NONE = 0;
gwxy.prototype.getxy = function(objname) {
	if (objname) this.obj = document.getElementById(objname);
	this.x	= this.calcx(this.obj);
	this.y	= this.calcy(this.obj);
}
gwxy.prototype.getx = function(objname) {
	if (objname) this.obj = document.getElementById(objname);
	this.x	= this.calcx(this.obj);
}
gwxy.prototype.gety = function(objname) {
	if (objname) this.obj = document.getElementById(objname);
	this.y	= this.calcy(this.obj);
}
gwxy.prototype.calcx = function(object) {
	if (object) return object.offsetLeft + this.calcx(object.offsetParent); 
	else return 0;
}
gwxy.prototype.calcy = function(object) {
	if (object) return object.offsetTop + this.calcy(object.offsetParent); 
	else return 0;
}
