function find_pos_x(obj) {
	var curleft = 0;
	if (obj.offsetParent)	{
		while (obj.offsetParent) {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x) {
		curleft += obj.x;
  }
	return curleft;
}

function find_pos_y(obj) {
	var curtop = 0;
	if (obj.offsetParent)	{
		while (obj.offsetParent) {      
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y) {
		curtop += obj.y;
  }
	return curtop;
}

function get_width(obj){
	if (typeof obj.clip !== "undefined") {
		return obj.clip.width;
	} else {
		if (obj.style.pixelWidth) {
			return obj.style.pixelWidth;
		} else {
			return obj.offsetWidth;
		}
	}
}

function get_height(obj){
	if (typeof obj.clip !== "undefined") {
		return obj.clip.height;
	} else {
		if (obj.style.pixelHeight) {
			return obj.style.pixelHeight;
		} else {
			return obj.offsetHeight;
		}
	}
}
