
if(self!=top){
	top.location.replace('www.fi-hunsrueck.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);
}

var etcToolTip = null;// ToolTipEvent nicht unnötig ausführen
document.onmousemove = ToolTipEvent;

function ToolTipEvent(e) {
	if (etcToolTip != null) {
	//document.documentMode
		var ttx	= (document.all) ? window.event.x + etcToolTip.offsetParent.scrollLeft : e.pageX;
		var tty	= (document.all) ? window.event.y + etcToolTip.offsetParent.scrollTop  : e.pageY;
		var ttw	= etcToolTip.offsetWidth;
		var tth	= etcToolTip.offsetHeight;
		var tcx	= (document.all) ? window.event.x : e.clientX;
		var tcy	= (document.all) ? window.event.y : e.clientY;
		var clw	= (document.all) ? document.documentElement.clientWidth : document.body.clientWidth;
		var clh	= (document.all) ? document.documentElement.clientHeight : document.body.clientHeight;
		var max	= (clw-ttw);
		var may	= (clh-tth);
		//x und y vom Cursor wird auf den Style des ToolTips übertragen
		if(tcx>=max){
			etcToolTip.style.left = (ttx - ttw - 15) + "px"
		}else{
			etcToolTip.style.left = (ttx + 15) + "px";
		}
		if(tcy>=may){
			etcToolTip.style.top = (tty - (tcy-may) - 5) + "px"
		}else{
			etcToolTip.style.top = (tty - 5) + "px";
		}
	}
}

function ToolTipShow(id) {
	etcToolTip = document.getElementById(id);
	ToolTipEvent;
	etcToolTip.style.display = "block"//ToolTip wird sichtbar
	//etcToolTiph = document.getElementById(id+"_1");
}

function ToolTipHide() {
	etcToolTip.style.display = "none";//ToolTip wird unsichtbar
}

function clipbox(id){
	if(document.getElementById('clipbox'+id).className == "clipboxoff"){
		document.getElementById('clipbox'+id).className = "clipboxon";
		document.getElementById('teaser'+id).className = "teaseroff";
	}else{
		document.getElementById('clipbox'+id).className = "clipboxoff";
		document.getElementById('teaser'+id).className = "teaseron";
	}
}

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", "/htdocs/_images/externallink.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");
					links[i].appendChild(img);
					*/
				}
			}
		}
	}
}

