
if(self!=top){
	top.location.replace(window.location.href);
}
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);
}

function getThePopup(id){
	window.open('Popup-'+id+'.etc','grundrisspopup','width=725,height=580,tollbar=no,menubar=no,scrollbars=yes');
}
function linkETC(){
	document.getElementById('etclink').setAttribute("target", "_blank");
}
function contentLinks(target){
	var contentlinks = document.getElementById(target);
	var links = contentlinks.getElementsByTagName("a");
	for (var i = 0; i < links.length; i++){
		if(links[i].getAttribute('rev')){
			if(links[i].getAttribute('rev').toString()=="external" && links[i].getAttribute('href')){
				var thislink = links[i].getAttribute('href').toString();
				if(thislink.substring(0, 7) == 'http://'){
					links[i].setAttribute("target", "_blank");
					if (typeof document.createElementNS != 'undefined') {
						var img = document.createElementNS('http://www.w3.org/1999/xhtml', 'img');
					}
					if (typeof document.createElement != 'undefined') {
						var img = document.createElement('img');
					}
					var linkname = links[i].childNodes[0];
					var linkkomplett = linkname.nodeValue + ' ';
					linkname.nodeValue = linkkomplett;
					img.setAttribute("src", "/docs/_img/externerlink.gif");
					img.setAttribute("style", "display:inline; width:8px; height:8px; padding:0px; margin:0px; border:0px none #fff;");
					img.className="externallink";
					img.setAttribute("border", "0");
					img.setAttribute("alt", "Externer Link");
					img.setAttribute("title", "Externer Link");
					links[i].appendChild(img);
				}
			}
		}
	}
}
