function MM_openBrWindowCentered(theURL,winName,width,height) {
     if (isMinNS4||isMinOP4) {
     middleX = Math.round((window.outerWidth/2) - (width/2)) + window.screenX;
     middleY = Math.round((window.outerHeight/2)- (height/2))+ window.screenX;
     str = 'width='+width+',height='+height+',screenX=' + middleX + ',screenY=' + middleY +', scrollbars=yes';

     }
     if (isMinIE4) {
     middleX= Math.round((window.screen.width/2) - (width/2));
     middleY= Math.round((window.screen.height/2) - (height/2));
     str = 'width='+width+',height='+height+',left=' + middleX + ',top=' + middleY + ', scrollbars=yes';
     }
     newWindowWin = window.open(theURL,winName,str);
     newWindowWin.focus();
}
function setStyle(){
	var getName = window.location.pathname.split('/');
	var name = getName[1].split('.');
	var title = name[0];
	if(title){
		document.getElementById(title).style.borderColor = "#990000";
		document.getElementById(title).style.color = "#990000";
		document.getElementById(title).style.cursor = "text";
		if(title == 'spektralanalyse'  || title == 'objekte_im_all' || title == 'unser_universum'){
			document.getElementById("astrophysik").style.borderColor = "#990000";
			document.getElementById("astrophysik").style.color = "#990000";
		}
		if(title == 'optische_effekte' || title == 'berechnungsgrundlagen' || title == 'teleskope' || title == 'entfernungsmessung' || title == 'forschung'){
			document.getElementById("astronomie").style.borderColor = "#990000";
			document.getElementById("astronomie").style.color = "#990000";
		}
		if(title == 'relativitaetstheorie' || title == 'quantenmechanik' || title == 'die_superstringtheorie' || title == 'teilchenphysik' || title == 'sternstunden'){
			document.getElementById("physik").style.borderColor = "#990000";
			document.getElementById("physik").style.color = "#990000";
		}
	}
}
function blendMenu(opacity, id){
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}
function setOver(x) {
	var millisec = 400;
	var speed = Math.round(millisec / 100);
	var timer = 0;
	document.getElementById("astronomieDiv").style.visibility = "hidden";
	document.getElementById("astrophysikDiv").style.visibility = "hidden";
	document.getElementById("physikDiv").style.visibility = "hidden";
	if(x == "astronomieDiv" || x == "astrophysikDiv" || x == "physikDiv"){
		for(i = 0; i <= 100; i++) {
			document.getElementById(x).style.visibility = "visible";
			blendMenu(0, 'astrophysikDiv');
			blendMenu(0, 'astronomieDiv');
			blendMenu(0, 'physikDiv');
			setTimeout("blendMenu(" + i + ",'" + x + "')",(timer * speed));
			timer++;
		}
	}
}
function setAncor() {
  var ancor = window.location.hash;
  if(ancor != 0){
	  newYPosInt = 282;
      setTop("contentDiv", newYPosInt);
	  }
}
	
function scrolling() {
  if (getLayer("naviDiv")) {
    newYPosInt = getPageScrollY() + 145;
    	setTop("naviDiv", newYPosInt);
  }
  if (getLayer("astrophysikDiv")) {
    newYPosInt = getPageScrollY() + 143;
    	setTop("astrophysikDiv", newYPosInt);
  }
  if (getLayer("astronomieDiv")) {
    newYPosInt = getPageScrollY() + 167;
    	setTop("astronomieDiv", newYPosInt);
  }
  if (getLayer("physikDiv")) {
    newYPosInt = getPageScrollY() + 191;
    	setTop("physikDiv", newYPosInt);		
  }
  if (getLayer("bannerDiv")) {
    newYPosInt = getPageScrollY() + 146;
    	setTop("bannerDiv", newYPosInt);		
  }
}

function setScrolling() {
    scrollIv = setInterval("scrolling()", 100);
}

function stop() {
  if (scrollIv)
  {
    clearInterval(scrollIv);	
  }
}

if(document.layers){
        window.captureEvents(Event.MOUSEUP);
        window.onmouseup=setOver;
	} 
else{
        document.onmouseup=setOver;
	}
	
function init(){ 
	setScrolling();	
	setStyle();
}	
window.onload = init;	
