
if(self!=top){
	top.location.replace(window.location.href);
}

function confirmation(msg){
	var answer = confirm(msg);
	if(answer==true){
		return true;
	}else{
		return false;
	}
}
function clipbox(id) { 
	var boxlink = "cb_";
	if(document.getElementById(boxlink+id).className == "clipbox") {
		document.getElementById(boxlink+id).className = "clipboxon";
	} else {
		document.getElementById(boxlink+id).className = "clipbox";
	}
}

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 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('href')){
			var thislink = links[i].getAttribute('href').toString();
			if(thislink.substring(0, 7) == 'http://' && thislink.substring(0, 14) != 'http://preview' && thislink.substring(0, 15) != 'http://rekardio' && thislink.substring(0, 19) != 'http://www.rekardio'){
				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];
				if(linkname.nodeValue){
					var linkkomplett = linkname.nodeValue + ' ';
					linkname.nodeValue = linkkomplett;
					img.setAttribute("src", "/htdocs/_images/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");
					links[i].appendChild(img);
				}
			}
		}
	}
}
function ae_gallery(dir,nr,maxnr){
	for(var i = 0; i<maxnr; i++){
		document.getElementById('pic_'+dir+'_'+i).setAttribute("style", "display:none;");
		document.getElementById('btn_'+dir+'_'+i).setAttribute("class", "");
	}
	document.getElementById('pic_'+dir+'_'+nr).setAttribute("style", "display:block;");
	document.getElementById('btn_'+dir+'_'+nr).setAttribute("class", "on");
}

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 tth	= etcToolTip.offsetHeight;
		var ttc	= (document.all) ? window.event.y : e.clientY;
		var clh	= (document.all) ? document.documentElement.clientHeight : document.body.clientHeight;
		var may	= (clh-tth);
		//x und y vom Cursor wird auf den Style des ToolTips übertragen
		etcToolTip.style.left	= (ttx + 15) + "px";
		
		if(ttc>=may){
			etcToolTip.style.top= (tty - (ttc-may) - 5) + "px"
		}else{
			etcToolTip.style.top= (tty - 5) + "px";
		}
	}
}

function ToolTipShow(id) {
	etcToolTip = document.getElementById(id);
	ToolTipEvent;
	document.getElementById('teaser').appendChild(etcToolTip);
	etcToolTip.style.display = "block"//ToolTip wird sichtbar
}

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


