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","");

}

var test4banner = {
  c: [],  
  st: [], 
  add: function (id) {
    this.c[this.c.length] = id;  
  }, 
  getIndex: function(idx) {
  	
  }, 
  check: function() {
  	for(var i = 0; i < this.c.length; i++) {
  		var id = this.c[i]; 
  		var show = false; 
  		if(document.getElementById("ban"+id)) {
  			for (ii=0; ii<document.getElementById("ban"+id).childNodes.length; ii++){
  				var n = document.getElementById("ban"+id).childNodes[ii]; 
  				if(n.nodeType == 1) {
  					if(n.tagName != "SCRIPT" && n.tagName != "NOSCRIPT") {
  							show = true; 
					}
	  			}
  			}
	  		if(document.getElementById("banbl"+id)) {
  			   if(show) {
		  			document.getElementById("banbl"+id).style.display = "block"; 
  			   } else {
		  			document.getElementById("banbl"+id).style.display = "none"; 
  			   }
  			}
  			this.st[i] = show; 
  		} 
  	}
  }
}

$(document).ready(function() {
      test4banner.check(); 
	$(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);
}


function gl_tester() {
	if(document.getElementById(":1.targetLanguage")) {
		var x = document.getElementById(":1.targetLanguage"); 
		if(x.childNodes.length == 2) {
			var k = x.firstChild;
			x.removeChild(k); 
			// window.clearInterval(gl_tester_i)
		} 
		var k = x.firstChild;
		if(k.tagName == 'SELECT' ) {
			if(k.options[1]) {
				k.options[1].value = 'de'; 
				k.options[1].text = 'Deutsch'; 
				k.options[0].text = 'Übersetzung'; 
				// window.clearInterval(gl_tester_i); 
			}
		}
//	} else {
//		window.setTimeout("gl_tester()",100); 
	}

}

var gl_tester_i = window.setInterval("gl_tester()",100); 

