
// JavaScript Document

     function topNavShow(element){
	
           element.className += "over";
	
           }



   function topNavHide(element){

           element.className = element.className = "";

     }
	 /*
	 function hideSecondLayer() {
	
		 if(document.getElementById('popup_e1')){
			document.getElementById('popup_e1').style.display= "none";
				// alert("eeee");
		
		 }
		 
	 }
	 */
// Popup Menue in Headerleiste

startList = function() {

if (document.all&&document.getElementById) {
if(document.getElementById("nav")){
navRoot = document.getElementById("nav");

for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];

if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
 
}
window.onload=startList;




// REF Slideshow
var info_popup=false;

var currentXpos = 0;
var newXpos;
var allBoxesWidth;
var slideBoxWidth;
var newLeftLink;
var newRightLink;

function goRight(boxPosition, boxWidth, boxWidthAll){
	currentXpos=boxPosition;
	newXpos=boxPosition-boxWidth;
	allBoxesWidth=boxWidthAll;
	slideBoxWidth=boxWidth;
	moveIt();
}

function goLeft(boxPosition, boxWidth, boxWidthAll){
	currentXpos=boxPosition;
	newXpos=boxPosition+boxWidth;
	allBoxesWidth=boxWidthAll;
	slideBoxWidth=boxWidth;
	moveIt();
}


function setNewPosition(){
			window.clearTimeout(doo);
			if((-1*(newXpos)+1)>(allBoxesWidth-slideBoxWidth) ){
				document.getElementById('slider').style.left=(-(slideBoxWidth))+'px';
				newLeftLink='javascript:goLeft('+(-(slideBoxWidth))+', '+slideBoxWidth+', '+allBoxesWidth+');';
				newRightLink='javascript:goRight('+(-(slideBoxWidth))+', '+slideBoxWidth+', '+allBoxesWidth+');';
			} else if((-1*(newXpos))<slideBoxWidth ){
				document.getElementById('slider').style.left=(-(allBoxesWidth-(2*slideBoxWidth)))+'px';
				newLeftLink='javascript:goLeft('+(-(allBoxesWidth-(2*slideBoxWidth)))+', '+slideBoxWidth+', '+allBoxesWidth+');';
				newRightLink='javascript:goRight('+(-(allBoxesWidth-(2*slideBoxWidth)))+', '+slideBoxWidth+', '+allBoxesWidth+');';
			} else {
				document.getElementById('slider').style.left=newXpos+'px';
			}
			
			document.getElementById('goleftLink').setAttribute('href', newLeftLink);
			document.getElementById('gorightLink').setAttribute('href', newRightLink);
}

function moveIt(){
	
	document.getElementById('slider').style.left=currentXpos+'px';
	doo=window.setTimeout('moveIt()', 10);
	newLeftLink='javascript:goLeft('+newXpos+', '+slideBoxWidth+', '+allBoxesWidth+');';
	newRightLink='javascript:goRight('+newXpos+', '+slideBoxWidth+', '+allBoxesWidth+');';
	if(currentXpos > newXpos){
			
		currentXpos=currentXpos-40;
		if(currentXpos<=newXpos){
			setNewPosition()
		}
	}
	if(currentXpos < newXpos){
		currentXpos=currentXpos+40;
		if(currentXpos>=newXpos){
			setNewPosition();
		}
	}

}


function setBackgroundcolor (layerID){
	var refTD='ref_'+layerID;
	document.getElementById(refTD).style.backgroundImage='url(fileadmin/image/nav_left_sub_bg.gif)';
	document.getElementById("outinfo").style.display="block";
	info_popup=true;


}

function hideBackgroundcolor (layerID){
	var refTD='ref_'+layerID;
	document.getElementById(refTD).style.backgroundImage='url(fileadmin/image/contnet_bg.gif)';
	document.getElementById("outinfo").style.display="none";
	info_popup=false;
}

function getSingleView(siteID, refID, lID){

	var refLink = "/index.php?id="+siteID+"&L="+lID+"&mode=single&refid="+refID ;

	window.location.href = refLink;

}



// ###############################################################################
// Infobox


var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;

function getMouseXY(e) {
		if(info_popup){
				var scrollPosX;
				var scrollPosY;
				
			
						if (typeof window.pageYOffset != 'undefined') {
							scrollPosY = window.pageYOffset;
							scrollPosX = window.pageXOffset;
						}
						else if (typeof document.compatMode != 'undefined' &&
							 document.compatMode != 'BackCompat') {
						   scrollPosY = document.documentElement.scrollTop;
						   scrollPosX = document.documentElement.scrollLeft;
						}
						else if (typeof document.body != 'undefined') {
						   scrollPosY = document.body.scrollTop;
						   scrollPosX = document.body.scrollLeft;
						}
				
				
				
				
				if (IE) { // grab the x-y pos.s if browser is IE
				
				tempX = event.clientX + scrollPosX;
				tempY = event.clientY + scrollPosY ;
				}
				else {  // grab the x-y pos.s if browser is NS
				tempX = e.pageX;
				tempY = e.pageY;
				}  
				if (tempX < 0){tempX = 0;}
				if (tempY < 0){tempY = 0;}  
				// document.Show.MouseX.value = tempX;
				// document.Show.MouseY.value = tempY;
				document.getElementById("outinfo").innerHTML = "&raquo; Info";
				document.getElementById("outinfo").style.left=(tempX+8)+'px';
				document.getElementById("outinfo").style.top=(tempY+8)+'px';
		
		
		}
return true;

}











