// globals
var win = null;
var lastElement = null;

//-----------------------------------------------------------------------------------------------
// startPicShow
function startImgShow(name,width,height) {

	width += 100;

	if(win && !win.closed) win.close();
	win = window.open("php/imgShow.php?show="+name,"imgShow","width="+width+",height="+height+",left=5,top=5,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no");
	win.myParent = this;
}

//------------------------------------------------------------------
// init
function initHighlight() {

	var href = String(location.href);
	if(href.lastIndexOf("#") == -1) return;
	href = href.substring(href.lastIndexOf("#")+1,href.length);
	lastElement = document.getElementById(href);
	if(!lastElement) return;
	lastElement.style.color = "#C744BA";

	// add back link
	var newANode = document.createElement("a");
	newANode.href = "javascript:history.back()";
	var title = document.createAttribute("title");
	title.nodeValue = "zurück";
	newANode.setAttributeNode(title);

	var newImgNode = document.createElement("img");
	newImgNode.src = "img/back.gif";
	newImgNode.style.paddingRight = "10px";
	var alignment = document.createAttribute("align");
	alignment.nodeValue = "right";
	newImgNode.setAttributeNode(alignment);

	newANode.appendChild(newImgNode);
	lastElement.appendChild(newANode);
	//lastElement.insertBefore(newANode,lastElement.lastChild); 

}

//------------------------------------------------------------------
// highlight
function highlight(element) {
	if(lastElement) {
		lastElement.style.color = "#1B169B";
		lastElement.style.backgroundColor = "#FFFFFF";
	}
	var href = String(element.href);
	href = href.substring(href.lastIndexOf("#")+1,href.length);
	
	lastElement = document.getElementById(href);
	lastElement.style.color = "#FFFFFF";
	lastElement.style.backgroundColor = "#1B169B";
}


