function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;

  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";

  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function getElementsByClassName(class_name){
	var all_obj,ret_obj=new Array(),j=0,teststr;
	if(document.all){
		all_obj=document.all;
	}else{
		if(document.getElementsByTagName && !document.all){
			all_obj=document.getElementsByTagName("*");
		}
	}
	for(i=0;i<all_obj.length;i++){
		if(all_obj[i].className.indexOf(class_name)!=-1){
			teststr=","+all_obj[i].className.split(" ").join(",")+",";
			if(teststr.indexOf(","+class_name+",")!=-1){
				ret_obj[j]=all_obj[i];
				j++;
			}
		}
	}
	return ret_obj;
}

function positionWorld(){
	if( screen.availWidth < 1000){
		var obj= findObj("world");
		obj.style.left=0;
		obj=findObj("alles");
		obj.style.left=0;
	}
	if( screen.availHeight < 670){
		var obj= findObj("world");
		obj.style.top=0;
		obj=findObj("alles");
		obj.style.top=0;
	}
}

function freshLinks(){
	var linky = "javascript: void(0);" ;
	if( obj = document.getElementById("menu6"))
		obj.href = linky;
	if( obj = document.getElementById("menu27"))
		obj.href = linky;
}


function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function hide(ind){
	obj = findObj(ind);
	obj.style.visibility= "hidden";
	obj.style.display= "none";
}

function hideObj(obj){
	obj.style.visibility= "hidden";
	obj.style.display= "none";
}


function hideMenus(){
	var aSubs = getElementsByClassName("submenu");
	for( var i=0; i < aSubs.length; i++){
		aSubs[i].style.visibility= "hidden";
		aSubs[i].style.display= "none";
	}
}

function showMenu(subm){
	if( obj = findObj(subm)){
		obj.style.visibility="visible";
		obj.style.display="block";
	}
}

function activateMenu(subm){
	if(document.meintimeout){
		clearTimeout(document.meintimeout);
	}
	hideMenus();
	showMenu(subm);
	document.meintimeout = setTimeout('hideMenus()',2000);
}

function deactivateMenu(subm){
	if(document.meintimeout){
		clearTimeout(document.meintimeout);
	}
	document.meintimeout = setTimeout('hideMenus()',2000);
}

function keepOnRunning(subm){
	if(document.meintimeout){
		clearTimeout(document.meintimeout);
	}
}

function stopRunning(subm){
	if(document.meintimeout){
		clearTimeout(document.meintimeout);
	}
	document.meintimeout = setTimeout('hideMenus()',2000);
}


function showLayers() {
  if ( document.getElementById ) {
    var lyr, i;
    for (i=0; arguments[i]; i++) {
      lyr = document.getElementById( arguments[i] );
      lyr.style.visibility = "visible";
    }
  }
}

