var please_wait = null;

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

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
		if (target2 != null)
		{
			document.getElementById(target2).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, target2); }
 	link.open("GET", url, true);
 	link.send(null);
}

function response(url, target, target2) {
 	if (link.readyState == 4) {
		if (link.status == 200)
		{
			document.getElementById(target).innerHTML = link.responseText ;
			if (target2 != null)
			{
				document.getElementById(target2).innerHTML = ' ' ;
			}
			
		}else{
			"Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;
		}	 	  
	}
}

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

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
		if (target2 != null)
		{
			document.getElementById(target2).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_clean(url, target, target2); }
 	link.open("GET", url, true);
 	link.send(null);
}

function response_clean(url, target, target2) {
 	if (link.readyState == 4) {
		if (link.status == 200)
		{
			document.getElementById(target).innerHTML = ' ' ;
			if (target2 != null)
			{
				document.getElementById(target2).innerHTML = ' ' ;
			}
			
		}else{
			"Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;
		}	 	  
	}
}

function set_loading_message(msg) {
 	please_wait = msg;
}

