
if(self!=top){
	top.location.replace('www.seniorenheim-ursula.de');
}

// E-Mail Spamschutz
function UnCryptMailto(string) {
	var ckey=7;
	var num=0;
	var rebuild="";
	for(var i=0; i < string.length; i++) {
		num=string.charCodeAt(i);
		if (num>=8364) {num = 128;}
		rebuild += String.fromCharCode(num-(ckey));
	}
	return rebuild;
}
function linkTo_UnCryptMailto(string)	{
	location.href=UnCryptMailto(string);
}
	
// AJAX für ImpressionenGalerie

var	i = 0, url = "/htdocs/xml.galerie.php", httpRequest = false;

function menuColor(key,menge){
	for(i=1;i<=menge;i++){
		document.getElementById('button'+(i-1)).className='off';
	}
	document.getElementById('button'+key).className='on';
	return true;
}
function sendRequest(key,galerie) {
	httpRequest = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		httpRequest = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
		try {
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (httpRequest.overrideMimeType) {
		httpRequest.overrideMimeType('text/xml');
		// zu dieser Zeile siehe weiter unten
	}
	if (!httpRequest) {
		alert('XML nicht verf&uuml;gbar');
		return false;
	}
	httpRequest.onreadystatechange = responseInhalt;
	httpRequest.open('GET', url+'?galerie='+galerie+'&key='+key, true);
	httpRequest.send(null);
}
function responseInhalt() {
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) {
			var xmldoc = httpRequest.responseXML;
			var root_node = xmldoc.getElementsByTagName('impressionen').item(0);
			var key = root_node.getElementsByTagName('keynow').item(0).firstChild.data;
			var menge = root_node.getElementsByTagName('menge').item(0).firstChild.data;
			var galerie = root_node.getElementsByTagName('galerie').item(key).firstChild.data;
			var bild = root_node.getElementsByTagName('value').item(key).firstChild.data;
			menuColor(key,menge);
			document.getElementById('impict').innerHTML = '<img src="/Picture-'+bild+'-320-220.pht" alt="Galerie Ansicht | '+galerie+' Bild'+key+'" />';
			document.getElementById('loaded').value = key;
			document.getElementById('menge').value = (menge-1);
		}
	}
}
function pfeil(action,galerie){
	if(action=="next"){
		var key = document.getElementById('loaded').value;
		var menge = document.getElementById('menge').value;
		key++;
		if(key<=menge){
			sendRequest(key,galerie);
		}else{
			sendRequest(0,galerie);
		}
	}else{
		var key = document.getElementById('loaded').value;
		var menge = document.getElementById('menge').value;
		key--;
		if(key>=0){
			sendRequest(key,galerie);
		}else{
			sendRequest(menge,galerie);
		}
	}
}

// Ajax für Seiten-Galerie
function picture_high(dir,id,zahl){
	BigBild = '<img src="/htdocs/_img/_'+dir+'/'+id+'.jpg" alt="Popup Bild" /><ul>';
	if(zahl>=1) BigBild += '<li><a href="javascript:picture_high(\''+dir+'\',1,\''+zahl+'\');void(0);"';
	if(id==1) BigBild += ' class="on"';
	if(zahl>=1) BigBild += '></a></li>';
	if(zahl>=2) BigBild += '<li><a href="javascript:picture_high(\''+dir+'\',2,\''+zahl+'\');void(0);"';
	if(id==2) BigBild += ' class="on"';
	if(zahl>=2) BigBild += '></a></li>';
	if(zahl==3) BigBild += '<li><a href="javascript:picture_high(\''+dir+'\',3,\''+zahl+'\');void(0);"';
	if(id==3) BigBild += ' class="on"';
	if(zahl==3) BigBild += '></a></li>';
	BigBild += '</ul><p><a href="javascript:picture_low();void(0);">schließen</a></p><div class="clear"></div>';
	document.getElementById('highimg').innerHTML = BigBild;
	document.getElementById('fullscreen').style.top="0px";
	document.getElementById('tfullscreen').style.top="0px";
	document.getElementById('mfullscreen').style.top="0px";
	document.getElementById('tfullscreen').style.position="fixed";
}
function picture_low(){
	document.getElementById('fullscreen').style.top="-5000px";
	document.getElementById('tfullscreen').style.top="-5000px";
	document.getElementById('mfullscreen').style.top="-5000px";
	document.getElementById('tfullscreen').style.position="absolute";
}

