var please_wait = null;

function open_url(url, target) {
 	if ( ! document.getElementById) {
  		return false;
 	}

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
 	}

 	if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest();
 	}

 	if (link == undefined) {
  		return false;
 	}
 	link.onreadystatechange = function() { response(url, target); }
 	link.open("GET", url, true);
 	link.send(null);
}

function response(url, target) {
 	if (link.readyState == 4) {
 	 	document.getElementById(target).innerHTML = (link.status == 200) ? link.responseText : "<center><table style='margin-top: 175px;'><tr><td style='white-space: nowrap; text-align: left;'>Hmmm... that link appears to be broken!<br />Please contact support ASAP and provide this errorcode: <span style='color: #CC0000;'>" + link.status + "</span><br /><br />&raquo; inform<a href='../support_info.php' target='_blank' style='color:#336699; text-decoration:none;'>&nbsp;SUPPORT&nbsp;</a><br />&raquo; return to<a href='' style='color:#336699; text-decoration:none;'>&nbsp;HOMEPAGE&nbsp;</a></td></tr></table></center";
	}
}

function set_loading_message(msg) {
 	please_wait = msg;
}
