


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

function sound_cookie(action){
	var datum = new Date();
	datum = new Date(datum.getTime() +1000*60*60*2);
	document.cookie = 'sound='+action+'; expires='+ datum.toGMTString()+'; path=/;'; 
}

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(linkimage){
	var clinks = document.getElementById("container");
	var links = clinks.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://'){
				links[i].setAttribute("target", "_blank");
				if(linkimage=="true"){
					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
}


