function displayInfobox() {

	var infobox = document.getElementById('infobox');
	var title = (arguments.length > 1 && arguments[1] != '')? arguments[1] : 'Information';
	var style = (arguments.length > 2 && arguments[2] != '')? arguments[2] : 'message_ok';
	var text = (arguments.length > 0 && arguments[0] != '')? arguments[0] : '';
	
	var old_box = document.getElementById('infobox');

	if (old_box) hideInfobox(old_box);

	// infobox erzeugen
	var infobox = document.createElement("div");
	infobox.id = 'infobox';
	infobox.className = style;
	document.body.appendChild(infobox);
	
	// Titel erzeugen
	var infobox_title = document.createElement("div");
	infobox_title.id = 'infobox_title';

	infobox_title.onmousedown = (function (infobox) {
	return function() {
	startStopDrag(infobox);
	};
	})(infobox);
	
	infobox_title.onmouseup = (function (infobox) {
	return function() {
	startStopDrag(infobox);
	};
	})(infobox);

	infobox.appendChild(infobox_title);
	infobox_title.innerHTML = title;
	

	// Content erzeugen
	var infobox_content = document.createElement("div");
	infobox_content.id = 'infobox_content';
	infobox.appendChild(infobox_content);
	infobox_content.innerHTML = text;
	
	// Close button erzeugen
	var infobox_close = document.createElement("div");
	infobox_close.id = 'infobox_close';
	infobox_close.onclick = (function (infobox) {
	return function() {
	hideInfobox(infobox);
	};
	})(infobox);
	infobox.appendChild(infobox_close);
	infobox_close.innerHTML = '<span onmouseover="this.style.backgroundColor=\'#C3CFDF\'" onmouseout="this.style.backgroundColor=\'#9BAABF\'">Close</span>';

	infobox.style.display = 'block';
	infobox.style.left = (Math.round((document.body.offsetWidth-infobox.offsetWidth)/2))+'px';
	if (mouse_pos_y-infobox.offsetHeight > 0) infobox.style.top = (getScrollPos3()+10 )+'px';
}

function hideInfobox(infobox) {
		document.body.removeChild(infobox);

}

function getScrollPos3() {
	if ( document.documentElement && document.documentElement.scrollTop) posy = document.documentElement.scrollTop;
	else if (document.body.scrollTop) posy = document.body.scrollTop;
	else posy = document.body.scrollTop;
	return posy;
}
