$(document).ready(function() {
	if (self != top) top.location.href=self.location.href;
	if(isIE && !isIE7) {
		var menu = document.getElementById('menu').getElementsByTagName('ul');
		for (i=0;i<menu.length;i++) {
			menu[i].setAttribute("id","menu"+i);
			if (menu[i].parentNode.nodeName == "LI") {
				menu[i].parentNode.onmouseover = function () {
					this.lastChild.style.display = "block";
				}
				menu[i].parentNode.onmouseout = function () {
					this.lastChild.style.display = "none";
	}	}	}	}
	if (document.getElementsByTagName("h3")[0]) {
		var header = document.getElementsByTagName("h4");
		document.getElementsByTagName("h3")[0].setAttribute("id","header");
		var toc = document.createElement("ul");
		toc.setAttribute("class","toc");
		var filename = document.URL.split("/")
		if (filename[filename.length])	var file = filename[filename.length];
		else							var file = filename[filename.length-1];
		if (document.URL == "http://"+window.location.host+"/") {
			makeli(toc,"text-decoration:none;","./","Auf den weiteren Seiten finden Sie an dieser Stelle Links, um zu den Überschriften auf der Seite zu springen, oder die Verzeichnisebene zu wechseln:");
		}
		maketoc(header,toc);
	}
	$('.menu a, .tooltip').tooltip({track: true, delay: 150, showURL: false, showBody: "  ", fade: 150,top: 20 });
});
function maketoc(header,toc){
	if (header.length > 1) {
		makeli(toc,"padding-bottom:15px","#top","Seitenanfang");
		for ( var i=0; i < header.length; i++ ) {
			header[i].setAttribute("id","header"+i);
			header[i].setAttribute("name","header"+i);
			if (!(toclink = header[i].firstChild.innerHTML))
				toclink = header[i].innerHTML;
			makeli(toc,"","#header"+i,toclink);
		}
	}
	document.getElementById("toc").appendChild(toc);
}
function makeli(toc,style,href,text){
	var lielement = document.createElement("li");
	var innerelement = document.createElement("a");
	var elementtext = document.createTextNode(text.replace("Suchmaschinenoptimierung","Suchmaschinen-\noptimierung"));
	innerelement.setAttribute("href",href);
	innerelement.appendChild(elementtext);
	if (style!="")
		lielement.setAttribute("style",style);
	lielement.appendChild(innerelement);
	toc.appendChild(lielement);
}