// START NAVIGATION CODE INTEGRATION -->
// menuing js init begin
 var NS4 = (document.layers)?true:false;
 var IE4 = (document.all)?true:false;
 var ver4 = (NS4 || IE4)?true:false;
 var DHTML = (IE4 || DOM || IE)?true:false;
 var globalContext = "";

function popUp(){return};
function popDown(){return};
function startIt(){return};

var NN = document.layers? true : false;
var IE = document.all? true : false;
var DOM = document.getElementById? true : false;

var menutimeout;
var closeTime=1500;
var hideMenu=false;
var shiftTop=-1;
var shiftWidth=0;
var arrMenuName = new Array ();

function sethide() {
  if (DOM) { return "hidden"; }
  else if (NN) { return "hide"; }
  else { return "hidden"; }
}

function setshow() {
  if (DOM) { return "visible";
  } else if (NN) { return "show";
  } else { return "visible";}
}

function getelement(id) {
  if (DOM) { return document.getElementById(id) }
  else if (NN) { return document.layers[id] }
  else { return document.all[id] };
}

function getelementstyle(id) {
    if (DOM) { return document.getElementById(id).style }
    else if (NN) { return document.layers[id] }
    else { return document.all[id].style };
}

function getleft(obj) {
  if (DOM || IE) {
    for (var lx=0; obj!=null; lx+=obj.offsetLeft, obj=obj.offsetParent);
    return lx;
  } else { return obj.top;}
}

function gettop(obj) {
  if (DOM || IE) {
    for (var ly=0; obj!=null; ly+=obj.offsetTop, obj=obj.offsetParent);
    return ly;
  } else { return obj.top; }
}

function getwidth(obj) {
  if (DOM) {return obj.offsetWidth }
  else if (NN)  { return obj.clip.width }
  else { return obj.clientWidth }
}

function getheight(obj) {
  if (DOM) {return obj.offsetHeight }
  else if (NN)  { return obj.clip.height }
  else { return obj.clientHeight }
}

function shiftto(obj, x, y) {
  if (DOM) {
    obj.style.left = x;
    obj.style.top = y;
  } else if (NN) { obj.moveTo(x,y);
  } else {
    obj.style.pixelLeft = x;
    obj.style.pixelTop = y;
  }
}

function menuitemover(from, ulink, Context) {
  if(globalContext!="")
       Context = globalContext;
  if ((from.className == 'popup')) {
    from.style.background = '#DEDECC url(/docroot/pics/arrow-lnav1.gif) top right no-repeat';
  } else if (from.className == 'popup2') {
   from.style.background = '#DEDECC';

  } else if (from.className == 'leftnav1A') {
	  from.style.background = '#DEDECC url(/docroot/pics/pfeil.gif) top right no-repeat';
  }else if (from.className == 'leftnav1') {
    from.style.background = '#DEDECC url(/docroot/pics/pfeil.gif) top right no-repeat';
    elemstyle = getelementstyle(ulink);
    elemstyle.color = '#B64D42';
  }  else if (from.className == 'leftnav2') {
    from.style.background = '#DEDECC url(/docroot/pics/arrow-lnav2-on.gif) top right no-repeat';
  } else if ((from.className == 'leftnav3') || (from.className == 'leftnav3A')) {
    elemstyle = getelementstyle(ulink);
    elemstyle.color = '#EC8026';
  }
}

function menuitemout(from, ulink, Context) {
  if ((from.className == 'popup')) {
    from.style.background = '#EDEDE1 url(/docroot/pics/arrow-lnav1.gif) top right no-repeat';
  } else if (from.className == 'popup2') {
   from.style.background = '#EDEDE1';
  } else if (from.className == 'leftnav1') {
    from.style.background = '#EDEDE1 url(/docroot/pics/pfeil.gif) top right no-repeat';
    elemstyle = getelementstyle(ulink);
    elemstyle.color = '#B64D42';
  } else if (from.className == 'leftnav2') {
    from.style.background = 'white url(/docroot/pics/arrow-lnav2.gif) top right no-repeat';
  } else if ((from.className == 'leftnav3') || (from.className == 'leftnav3A')) {
    elemstyle = getelementstyle(ulink);
    elemstyle.color = '#836955';
  } else if (from.className == 'leftnav1A') {
	from.style.background = '#EDEDE1 url(/docroot/pics/pfeil.gif) top right no-repeat';
  }
}

var tNav = 0;

function popup(menulevel,id, from, Context) {
  if(globalContext!="")
      menuitemover(from, globalContext);
 else 
      menuitemover(from, Context);
  elem = getelement(id);
  hideMenu=false;
  window.clearTimeout(menutimeout);
  if (menulevel < arrMenuName.length) {
    var arrCnt = arrMenuName.length-1;
    while (arrCnt > menulevel) {
      if (getelement(arrMenuName[arrCnt]) != null) {
        elemstyle = getelementstyle(arrMenuName[arrCnt]);
        elemstyle.visibility=sethide();
        arrMenuName[arrCnt] = "";
      }
      arrCnt--;
    }
  }
  if (id != null) {
    if (arrMenuName[menulevel] != id) {
      if (getelement(arrMenuName[arrCnt]) != null) {
        elemstyle = getelementstyle(arrMenuName[arrCnt]);
        elemstyle.visibility=sethide();
      }
    }
    arrMenuName[menulevel] = id;
    if (from.className == 'horiznav') {
      shiftto(elem, getleft(from)-4, gettop(from)+getheight(from)+shiftTop+10);
    } else {
      shiftto(elem, getleft(from)+getwidth(from)+1+shiftWidth, gettop(from)+shiftTop);
    }
    elemstyle = getelementstyle(id);
    elemstyle.visibility=setshow();
  } else {
    if (getelement(arrMenuName[arrCnt]) != null) {
      elemstyle = getelementstyle(arrMenuName[arrCnt]);
      elemstyle.visibility=sethide();
    }
  }
}

function first_popup(menulevel,id, from, ulink, Context) {
    globalContext = Context;
  menuitemover(from, ulink, globalContext);
  elem = getelement(id);
  hideMenu=false;
  window.clearTimeout(menutimeout);
  var arrCnt = arrMenuName.length-1;
  while (arrCnt >= 0) {
    if (getelement(arrMenuName[arrCnt]) != null) {
      elemstyle = getelementstyle(arrMenuName[arrCnt]);
      elemstyle.visibility=sethide();
      arrMenuName[arrCnt] = "";
    }
    arrCnt--;
  }
  if (id != null) {
    arrMenuName[menulevel] = id;
    shiftto(elem, getleft(from)+getwidth(from)+1+shiftWidth, gettop(from)+shiftTop);
    elemstyle = getelementstyle(id);
    elemstyle.visibility=setshow();
  }
}

function popdown(menulevel, from, ulink, Context) {
  if(globalContext!="")
      menuitemout(from, ulink, globalContext);
 else 
    menuitemout(from, ulink, Context);
  hideMenu=true;
  menutimeout = window.setTimeout("hidemenu("+menulevel+")", closeTime);
}

function hidemenu(menulevel) {
  if (hideMenu) {
    var arrCnt = arrMenuName.length-1;
    while (arrCnt >= 0) {
      if (getelement(arrMenuName[arrCnt]) != null) {
        elemstyle = getelementstyle(arrMenuName[arrCnt]);
        elemstyle.visibility=sethide();
        arrMenuName[arrCnt] = "";
      }
      arrCnt--;
    }
  }
}

//image popup functions

function displayLayerPic(Context,img1,widthPic,heightPic){
 //   alert("img1:"+Context+img1);
 //return overlib("<iframe src='+Context+img1 +' scrolling=no marginheight=0 marginwidth=0 frameborder=0 style=\'border:1px solid black\'></iframe>",FULLHTML, SNAPX,20,SNAPY,20);
 return overlib('<iframe src='+Context+img1 +' width='+widthPic+' height='+heightPic+' scrolling=no marginheight=0 marginwidth=0 frameborder=0 style=\'border:2px solid #C44B3E\'></iframe>',FULLHTML, SNAPX,20,SNAPY,20);
}
