function confirmSubmit() {
	var agree=confirm("Wirklich durchf" + unescape("%FC") + "hren?");
	if (agree) return true ;
	else return false ;
}


// ANFANG AJAX
var http_request = false;
var divid = "";
 
function ajax(url, this_divid, confirmation) {
	if (confirmation == "") really_perform_ajax(url, this_divid, confirmation);
	else if (confirmSubmit()) really_perform_ajax(url, this_divid, confirmation);
}

function really_perform_ajax(url, this_divid, confirmation) {
	divid = this_divid;
	http_request = false;
	var divid_ausgabe = divid;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
		return false;
	}
	http_request.onreadystatechange = alertInhalt;
	http_request.open('GET', url, true);
	http_request.send(null);
}

function alertInhalt() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			var answer = http_request.responseText;
		} else {
			var answer = "Es ist ein Fehler aufgetreten.";
		}
    if(document.getElementById(divid).innerHTML != answer) {
    	document.getElementById(divid).innerHTML = answer;
    } else {
    	document.getElementById(divid).innerHTML = "";
    }
  }
	else { 
		document.getElementById(divid).innerHTML = "lade..."; 
	}
}
 // ENDE AJAX






function overSub()
{
	var w = document.viewport.getWidth();
	if (w == 0) {
		w = document.body.offsetWidth;
	}
	var newW = Math.floor(w/2)-170;
	$('subnavi').style.left = newW;
	$('subnavi').show();
}

function outSub()
{
	$('subnavi').hide();
}

function overSubKontakt()
{
	var w = document.viewport.getWidth();
	if (w == 0) {
		w = document.body.offsetWidth;
	}
	var newW = Math.floor(w/2)+20;
	$('subnaviStandorte').style.left = newW;
	$('subnaviStandorte').show();
}

function outSubKontakt()
{
	$('subnaviStandorte').hide();
}
function doM(s, shift)	{
	location.href="mailto:" + getM(s, shift);
}

function getM(s, shift)
{
	shift = shift;
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(shift)); 
	}
	return r;
}

function showM(s, shift, d)	{
	var d;
	if (d) { d = d; } else { d = s; }
	document.write("<a href=\"javascript:doM('" + s + "', " + shift + ");\">" + getM(d,shift) + "</a>");	
}

function printM(s, shift)
{
	document.write(getM(s,shift));
}