
function getHostname(url) {
	var re = new RegExp('^(?:f|ht)tp(?:s)?\://([^/]+)', 'im');
	return url.match(re)[1].toString();
}
if (getHostname(window.location.href) == 'localhost') dir = 'http://localhost/djvoltmachine/';
else dir = 'http://'+getHostname(window.location.href)+'/';

function get_obj_pos(obj) {
	var x = 0;
	var y = 0;
	while (obj.offsetParent) {
		x += obj.offsetLeft;
		y += obj.offsetTop;
		obj = obj.offsetParent;	}
	return [ x, y ];
}

function Go(x) {parent.location= x; }
