if (typeof(AJ4)!='undefined') {
	// Definiert, was bei einem fehlgeschlagenen AJAX Request der Richfaces passieren soll.
	// Natürlich nur wenn die Richfaces (aka A4J) aktiv sind.
	A4J.AJAX.onError = function(req,status,message) { 
		alert(message); 
	};
}

function showAboutBox(){
	var width = 700;
	var height = 293;
	var left = Math.floor((screen.width - width) / 2);
	var top = Math.floor((screen.height - height) / 2);
	window.open("about.xhtml", "about", 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=no');
}

function showArea(areaId) {
	if (areaId && areaId != "_blank") {
		var a = document.getElementById(areaId);
		if (a)
			a.style.display = "block";
	}
}

function howToRegionalisierung(msg){
	var el = document.getElementById('standortBox');
	if (el) el.className='box highlight-box';
	alert(msg);
}

function showInFrame(url, head_text) {
	var w = $('iframeWindow');
	if (w == null) {
		w = Builder.node('div',{
			id: 'iframeWindow'
		});
		w.setStyle({ 'display': 'none' });
		$("container").appendChild(w);
		new Draggable('iframeWindow', {
			handle: 'iframeHead',
			onStart: function() {
				$('iframeGlassPane').style.display = 'inline';
			},
			onEnd: function() {
				$('iframeGlassPane').style.display = 'none';
			}
		});
		w.setStyle({
			'top': '150px',
			'left': (document.viewport.getWidth() / 2) - (w.getWidth() / 2) + 'px'
		});
	}
	var html = '<div class="iframeHead"><span class="iframeHeadText">' + head_text + '</span><span class="iframeClose" onclick="$(\'iframeWindow\').fade({ duration: 0.3 });"></span></div><div class="iframeContent"><iframe id="iframeMain" scrolling="auto" frameborder="0">Ihr Browser unterstützt keine Frames. Bitte verwenden Sie Mozilla Firefox.<br /><a href=" + url + ">' + url.escapeHTML() + '</a></iframe><div class="iframeGlassPane" id="iframeGlassPane"></div></div>';
	Element.update(w, html);
	$('iframeMain').src = url;
	w.appear({ duration: 0.3 });
}

