/* Last Update: 1/19/2007 3:05:00 PM */
/* Updated By: Asa (Lost Boys) */ 

/* get_offset(object)
Returns a coordinate based on the object passed to it:
*/

function get_offset(obj) {
	// Does not get the offset if the object is in an unfinished element (table
	// for instance)
	var passed_obj = obj;
	var offset;

	if (typeof obj != 'undefined') {
		if (typeof obj.x != 'undefined') {
			offset = {x: obj.x, y: obj.y};
		}
		else {
			var offset = {x: obj.offsetLeft, y: obj.offsetTop};
			while (obj.offsetParent != null) {
				obj = obj.offsetParent;
				offset['x'] += obj.offsetLeft;
				offset['y'] += obj.offsetTop;
			}
		}
	}
	return offset;
}