function change_submenu(id) {

	if (id.substr(0,3)=="sub"){
	var cont = document.getElementById('script_cont');
	elem = cont.getElementsByTagName('div');
	for(var i = 0;i < elem.length; ++i){
		if (elem[i].className == "subnav") {
			elem[i].style.display="none";
		}
	}
	document.getElementById(id).style.display="block";
	} else {

	var cont = document.getElementById('script_cont_pin');
	elem = cont.getElementsByTagName('div');
	for(var i = 0;i < elem.length; ++i){
		if (elem[i].className == "subnav") {
			elem[i].style.display="none";
		}
	}

	document.getElementById(id).style.display="block";

	}
}
/*
function set_home(id){
	if (id == 'sub_home'){
		var children = document.getElementById('script_cont').childNodes;
		children[1].style.display="block;"
		}
} 

 
$(document).ready(function () {
  if(pindown_tab == '') {
   $children = $("#script_cont").children(".subnav");
    $children[1].style.display="block";
  }

});

**/

function set_menu_nav(s) {
  if(pindown_tab == '' ||pindown_tab < 10 ) {
    if(document.getElementById(s))  { 	 document.getElementById(s).className="rasterized";    }
    if(document.getElementById("sub_"+s))  {	 document.getElementById("sub_"+s).style.display="block"; pindown_tab = -s; }
    if(document.getElementById("pin_"+s))  { 	 document.getElementById("pin_"+s).style.display="block"; pindown_tab = -s;   }
  } else {

  }
}

var timeout = null;

function login_mouseout () {
timeout = window.setTimeout('ausblenden()', 100);
}

function mousein () {
document.getElementById("flyout").style.display = "block";
/*MODERNE BROWSER*/
document.getElementById("login_button").setAttribute("class","hover");
/*IE*/
document.getElementById("login_button").setAttribute("className","hover");
window.clearTimeout(timeout);
}

function ausblenden () {

document.getElementById("flyout").style.display = "none";
/*MODERNE BROWSER*/
document.getElementById("login_button").setAttribute("class","");
/*IE*/
document.getElementById("login_button").setAttribute("className","");

}

$(document).ready(function() {
	$(window).scroll(function () {
	   if($(window).scrollTop() >= 170) {

			$("#pin").fadeIn("fast");
		}
		else {
			$("#pin").fadeOut("fast");
		}
	});
});

////////////////


var nav_a = new Array(19);
var menu = 20;
var aktiv;

function startList() {
  if (document.all&&document.getElementById) {
    for (k=1; k<menu; k++) {
      id = 'nav'+k;
      navRoot = document.getElementById(id);
      if (navRoot != null) {
        for (i=0; i<navRoot.childNodes.length; i++) {
          node = navRoot.childNodes[i];
          if (node.nodeName=="LI") {
            node.onmouseover=function() {
              tmp = this.parentNode.id.slice(3,5);
              disableAllBut(tmp);
              if (!nav_a[tmp]) {
                nav_a[tmp] = true;
                this.className+=" over";
              }
            }
          }
        }
      }
    }
  }
  aktiv = window.setTimeout("disableAllBut(99)", 1);
}



// Deaktiviert alle Submenues
disableAllBut = function(not) {
  if (document.all&&document.getElementById) {
    for (k=1; k<menu; k++) {
      id = 'nav'+k;
      na = document.getElementById(id);
      if (na != null) {
        for (i=0; i<na.childNodes.length; i++) {
          n = na.childNodes[i];
            if (n.nodeName=="LI") {
              t = n.parentNode.id.slice(3,4);
              if (t != not) {
                nav_a[t] = false;
                n.className=n.className.replace(" over", "");
              }
            }
         }
       }
     }
   }
}

function zeit() {
  window.clearTimeout(aktiv);
  aktiv = window.setTimeout("disableAllBut(99)", 2000);
}

