/*****************************************************/
/**  ©  2006-2007 by Roland Borsos                  **/
/*****************************************************/
//var imgs = new Array("bilder/submenu_arrow_gray.jpg", "bilder/submenu_arrow_green.jpg", "bilder/box_top_gray.jpg", "bilder/box_top_green.jpg");
var img_1 = new Image();
img_1.src="bilder/layout_blue/submenu_arrow_gray.jpg";
var img_2 = new Image();
img_2.src="bilder/layout_blue/submenu_arrow_green.jpg";
var img_3 = new Image();
img_3.src="bilder/layout_blue/box_top_gray.jpg";
var img_4 = new Image();
img_4.src="bilder/layout_blue/box_top_green.jpg";
/*
onload = function img_preload() {
    for (var i = 0; i < 4; i++){
        img[i] = document.createElement('img');
        img[i].setAttribute('src', imgs[i]);
    }
}*/

function input_select(form_name, input_name, input_value) {
  with(document.forms[form_name+"_form"].elements[form_name+"_"+input_name]) {
    style.borderColor="#32517F";
    if(value==input_value) value="";
  }
}
function input_blur(form_name, input_name, input_value) {
  with(document.forms[form_name+"_form"].elements[form_name+"_"+input_name]) {
    style.borderColor="#32517F";
    if(value=="") value=input_value;
  }
}

function checkbox(form_name, input_name) {
  var input_value="";
  with(document.forms[form_name+"_form"].elements[form_name+"_"+input_name]) {
    value=(value=="0") ? "1" : "0";
    input_value=value;
  }
  if(document.getElementById) {
    with(document.getElementById(form_name+"_"+input_name+"_c"))
      src=(input_value=="1") ? "bilder/layout_blue/layout/checkbox_2.gif" : "bilder/layout_blue/layout/checkbox_1.gif";
  }
  else if(document.all) {
    with(document.all(form_name+"_"+input_name+"_c"))
      src=(input_value=="1") ? "bilder/layout_blue/layout/checkbox_2.gif" : "bilder/layout_blue/layout/checkbox_1.gif";;
  }
}

function radiobox(form_name, input_name, input_value) {
  var input_prevalue="";
  input_prevalue=document.forms[form_name+"_form"].elements[form_name+"_"+input_name].value;
    if(input_value!=document.forms[form_name+"_form"].elements[form_name+"_"+input_name].value) {
      document.forms[form_name+"_form"].elements[form_name+"_"+input_name].value=input_value;
    if(document.getElementById) {
      document.getElementById(form_name+"_"+input_value+"_r").src="bilder/layout_blue/layout/checkbox_2.gif";
      if(input_prevalue!=0)
        document.getElementById(form_name+"_"+input_prevalue+"_r").src="bilder/layout_blue/layout/checkbox_1.gif";
    }
    else if(document.all) {
      document.all(form_name+"_"+input_value+"_r").src="bilder/layout_blue/layout/checkbox_2.gif";
      if(input_prevalue!=0)
        document.all(form_name+"_"+input_prevalue+"_r").src="bilder/layout/checkbox_1.gif";
    }
  }
  else {
    document.forms[form_name+"_form"].elements[form_name+"_"+input_name].value=0;
    if(document.getElementById) document.getElementById(form_name+"_"+input_value+"_r").src="bilder/layout/checkbox_1.gif";
    if(document.all) document.all(form_name+"_"+input_value+"_r").src="bilder/layout/checkbox_1.gif";
  }
}

function openwindow(adresse, fenstertitel, eigenschaften) {
  newwindow = window.open(adresse, fenstertitel, eigenschaften);
  newwindow.focus();
}

dropped_menu = "";
menu_dropped_count = 0;
function dropmenu(menu, menu_dropped) {
  if((menu_dropped!="none")&&menu_dropped_count==0) {
    dropped_menu = menu_dropped;
    menu_dropped_count =1;
  }
  if(dropped_menu!="")
    document.getElementById(dropped_menu).style.display="none";
  if(dropped_menu!=menu) {
    dropped_menu = menu;
    document.getElementById(menu).style.display="block";
  }
  else dropped_menu="";
}

function startmenu() {
  if((navigator.userAgent.search(/MSIE 5.5/)!=-1)||(navigator.userAgent.search(/MSIE 6.0/)!=-1)) {
    for(i=0; i<document.getElementsByTagName("ul").length; i++) {
      if(document.getElementsByTagName("ul")[i].className=="subsub_menu") document.getElementsByTagName("ul")[i].style.left="146px";
    }
  }
  if ((document.getElementById)&&(navigator.userAgent.search(/Netscape/)==-1)&&(navigator.userAgent.search(/MSIE 5.01/)==-1)) {
    var main_menu_over = 0; 
    var sub_menu_over = 0; 
    for(i=0; i<document.getElementsByTagName("li").length; i++) {
      if(document.getElementsByTagName("li")[i].className=="sub_point") {
        document.getElementsByTagName("li")[i].onmouseover=function() {
          this.style.background="url(bilder/layout_blue/box_top_green.jpg)";
          this.childNodes[0].style.color="#ffffff";
        }
        document.getElementsByTagName("li")[i].onmouseout=function() {
          this.style.background="url(bilder/layout_blue/box_top_gray.jpg)";
          this.childNodes[0].style.color="#32517F";
        }
      }
      if(document.getElementsByTagName("li")[i].className=="sub_point2") {
        document.getElementsByTagName("li")[i].onmouseover=function() {
          this.style.background="url(bilder/layout_blue/submenu_arrow_green.jpg)";
          this.style.color="#ffffff";
          if(sub_menu_over==0) {
            sub_menu_over=1;
            for(j=0; j<this.childNodes.length; j++) {
              if(this.childNodes[j].tagName=="UL") this.childNodes[j].style.display='block';
            }
          }
        }
        document.getElementsByTagName("li")[i].onmouseout=function() {
          this.style.background="url(bilder/layout_blue/submenu_arrow_gray.jpg)";
          this.style.color="#32517F";
          if(sub_menu_over==1) {
            sub_menu_over=0;
            for(j=0; j<this.childNodes.length; j++) {
              if(this.childNodes[j].tagName=="UL") this.childNodes[j].style.display='none';
            }
          }
        }
      }
      else if(document.getElementsByTagName("li")[i].className=="main_menu") {
        document.getElementsByTagName("li")[i].onmouseover=function() {
          if(main_menu_over==0) {
            main_menu_over=1;
            for(j=0; j<this.childNodes.length; j++) {
              if(this.childNodes[j].tagName=="UL") this.childNodes[j].style.display='block';
            }
          }
        }
        document.getElementsByTagName("li")[i].onmouseout=function() {
          if(main_menu_over==1) {
            main_menu_over=0;
            for(j=0; j<this.childNodes.length; j++) {
              if(this.childNodes[j].tagName=="UL") this.childNodes[j].style.display='none';
            }
          }
        }
      }    
    }
  }
}

dropped_dlmenu = 0;
function dropdlmenu(dlmenu) {
  if(dropped_dlmenu==dlmenu) {
    document.getElementById(dropped_dlmenu).style.display="none";
    dropped_dlmenu=0;
  }
  else if(dropped_dlmenu!=0) {
    document.getElementById(dropped_dlmenu).style.display="none";
    dropped_dlmenu=dlmenu;
    document.getElementById(dropped_dlmenu).style.display="block";   
  }
  else {
    dropped_dlmenu=dlmenu;
    document.getElementById(dropped_dlmenu).style.display="block";
  }
}

window.onload=startmenu;