curPageFolder = document.location.href;
curPageFolder = curPageFolder.substr(0,curPageFolder.lastIndexOf("/"));
curPageFolder = curPageFolder.substr(curPageFolder.lastIndexOf("/")+1);

function init ()
{	
	//insert return-Button
	if(curPageFolder != "site" && curPageFolder != "album"){
		var lastRow = document.createElement("TR");
		
		var lastColumn = document.createElement("TD");
		lastColumn.setAttributeNode(createAttribute("colspan=2"));
		lastColumn.setAttributeNode(createAttribute("align=center"));
		
		var pageReturn = document.createElement("A");
		pageReturn.setAttributeNode(createAttribute("class=textbutton"));
		pageReturn.setAttributeNode(createAttribute("href=javascript:history.go(-1)"));
		var text = document.createTextNode("zurück blättern");
		pageReturn.appendChild(text);
		
		var pageUp = document.createElement("A");
		pageUp.setAttributeNode(createAttribute("class=textbutton"));
		pageUp.setAttributeNode(createAttribute("href=#"));
		var text = document.createTextNode("Seitenanfang");
		pageUp.appendChild(text);
		
		lastColumn.appendChild(pageReturn)
		lastColumn.appendChild(pageUp)
		lastRow.appendChild(lastColumn)
		
		myBody = document.getElementsByTagName("body")[0].firstChild.lastChild
		myBody.appendChild(lastRow);
		myBody = document.getElementsByTagName("body")[0].firstChild.firstChild
		myBody.appendChild(lastRow);
	}
	
	//insert lastmodified date
	var lastMod = document.createElement("DIV");
	lastMod.setAttributeNode(createAttribute("class=lastmodified"));
	tmpString = document.lastModified
	tmpString = tmpString.substr(0,tmpString.lastIndexOf(" "));
	tmpString = tmpString.split("/");
	var text = document.createTextNode("zuletzt aktualisiert: "+tmpString[1]+"."+tmpString[0]+"."+tmpString[2]);
	lastMod.appendChild(text);
	myBody = document.getElementsByTagName("body")[0]
	myBody.insertBefore(lastMod, myBody.firstChild);

	//insert end
	
	updateHighlight()
}

function updateHighlight(){
	if (top.frames.highlight){
		highlightPath = top.frames.highlight.location.href;
		curHighlightName = highlightPath.substr(0,highlightPath.lastIndexOf("."));
		curHighlightName = curHighlightName.substr(curHighlightName.lastIndexOf("/")+1);
		highlightPath = highlightPath.substr(0,highlightPath.lastIndexOf("v1/frameset/highlight/")+1)
		if (curPageFolder != "site" && curPageFolder != "newsinfo" && curPageFolder != "termine"){
			highlightPath += "news.html";
		} else {
			highlightPath += "home.php";
		}
		if (top.frames.highlight.location.href != highlightPath) top.frames.highlight.location.replace(highlightPath)
	}
}

