/* ################# admin/developer methods - infobox ############### */
popupWindow_style = new Array();

function hideOverLayer (eleme) {
	setTimeout(function() {
		eleme.style.visibility="hidden";
	} , 100);
}
function selectDTreeNode(t) {
	//document.getElementById('div_overLayer3').style.visibility='hidden';
	t = t.replace(/sd/,'');
	d.s(t);
}
function handleOnResize() {
	if (document.getElementById('div_navigationDtree')) {
		document.getElementById('div_navigationDtree').style.display="none";
		document.getElementById('div_navigationDtree').style.visibility="hidden";
		dTreeWidth = document.getElementById('div_navigationDtree_widthDetector').offsetWidth;
		dTreeWidth=dTreeWidth-6;
		document.getElementById('div_navigationDtree').style.display="block";
		document.getElementById('div_navigationDtree').style.visibility="visible";
		document.getElementById('div_navigationDtree').style.width=dTreeWidth+"px";
		//refreshNaviHint();
	}
}
function handleOnLoad() {
	if (document.getElementById('div_navigationDtree')) { //correct width of dtree
		var dTreeWidth = document.getElementById('div_navigationDtree_widthDetector').offsetWidth;
		document.getElementById('div_navigationDtree').style.display="block";
		document.getElementById('div_navigationDtree').style.visibility="visible";
		document.getElementById('div_navigationDtree').style.width=dTreeWidth+"px";
		
		var elementTypes=new Array("a") // set title tag for dtree
		
		xOff=document.getElementById('div_navigationDtree').offsetLeft+document.getElementById('table_0').offsetLeft+document.getElementById('td_1').offsetLeft+document.getElementById('table_1').offsetLeft+document.getElementById('td_2').offsetLeft;
		yOff=document.getElementById('div_navigationDtree').offsetTop+document.getElementById('table_0').offsetTop+document.getElementById('td_1').offsetTop+document.getElementById('table_1').offsetTop+document.getElementById('td_2').offsetTop;
		
		for(var i = 0; i < elementTypes.length; i++) {
			var elements = document.getElementsByTagName(elementTypes[i]);
			for(var j = 0; j < elements.length; j++) {
				if (elements[j].className == 'node' || elements[j].className == 'nodeSel') {
					elements[j].onmouseover=function (evt) {
						if (this.offsetLeft+this.offsetWidth-document.getElementById('div_navigationDtree').scrollLeft+10 > document.getElementById('div_navigationDtree_widthDetector').offsetWidth) {
							document.getElementById('div_overLayer3').style.visibility='visible';
							document.getElementById('div_overLayer3').innerHTML='<a onMouseOut="hideOverLayer(this);" href="'+this.href+'" class="nodeOver" style="border:1px solid #33331E;">'+this.innerHTML+'</a>';
							document.getElementById('div_overLayer3').style.top=(this.offsetTop+yOff+1-document.getElementById('div_navigationDtree').scrollTop)+'px';
							document.getElementById('div_overLayer3').style.left=(this.offsetLeft+xOff+0-document.getElementById('div_navigationDtree').scrollLeft)+'px';
							var hugo = this;
							document.getElementById('div_overLayer3').onclick=function (evt) {selectDTreeNode(hugo.id); document.getElementsByTagName('body')[0].style.cursor='wait'; this.style.cursor='wait';}
						} else {document.getElementById('div_overLayer3').style.visibility='hidden';}
					}
				}
			}
		}
		try {
			// scroll down when selected node not visible
			var elements = document.getElementsByTagName('a');
			for (var i=0; i<elements.length; i++) {
				if (elements[i].className && elements[i].className == 'nodeSel') {
					//alert(document.getElementById('div_navigationDtree').offsetHeight);
					//alert(elements[i].offsetTop);
					
					if (elements[i].offsetTop > (document.getElementById('div_navigationDtree').offsetHeight-40)) {
						document.getElementById('div_navigationDtree').scrollTop = elements[i].offsetTop - (document.getElementById('div_navigationDtree').offsetHeight-40);
					}
				}
			}
		} catch (e) {
			//
		}
	}
	handleOnResize();
}
/* ################# end of admin/developer methods - infobox ############### */

/*
this method opens a pop-up window and supress scrollbars
-> method call: 
   <a href="JavaScript:NewWindow('url','Example name',width,height,xpos,ypos,scrolling)" class="smaller">Link</a>
-> example for method call: 
   <a href="JavaScript:NewWindow('/imprint.html','Imprint',450,610,150,10)" class="smaller">[Imprint]</a>
*/
var isNav4, isNav6, isIE4;
function NewWindow(FileURL,WindowName,WindowWidth,WindowHeight,XPos,YPos,scrolling) {
	if (isNav6) {
		fWindowWidth = WindowWidth +  8; fWindowHeight = WindowHeight + 27;
	} else if (isNav4) {
		fWindowWidth = WindowWidth + 15; fWindowHeight = WindowHeight + 15;
	} else {
		fWindowWidth = WindowWidth + 12; fWindowHeight = WindowHeight + 31;
	}
	Fenster = window.open(FileURL,WindowName,'width='+fWindowWidth+',height='+fWindowHeight+',screenX='+XPos+',screenY='+YPos+',dependent=yes,menubar=no,status=no,toolbar=no,scrollbars='+scrolling+',resizable=yes');
	Fenster.moveTo(XPos,YPos);
	Fenster.resizeTo(fWindowWidth,fWindowHeight);
}

/*
this method opens a window with specified url in <option> tag
*/
function dropdown(mySel) {
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
	if(myVal) {
		if(mySel.gourl.target){
			myWin = parent[mySel.gourl.target];
		} else {
			myWin = window;
		}
		if (! myWin) {
			return true;
		}
			myWin.location = myVal;
	}
return false;
}