var b_agent=navigator.userAgent; var b_name=navigator.appName; var b_ver=parseInt(navigator.appVersion,10);
if (b_name=='Netscape' && b_ver<=4) N4=1; else N4=0;
if (b_name=='Netscape' && b_ver>4) N6=1; else N6=0;
minus=new Image();
minus.src='/pics/navi/minus.gif';
plus=new Image();
plus.src='/pics/navi/plus.gif';
overhead=0;
overmenu=0;
oversub=0;
showmenu=0;
menu_ok=0;
grauheight=0;
menus=10;
menu_top=100;
var cache1 = new Image();
cache1.src = '/pics/x.gif';
var cache2 = new Image();
cache2.src = '/pics/navi/grau.gif';
var cache3 = new Image();
cache3.src = '/pics/navi/fadeout.gif';

var URL=self.document.location.href; var winx=self.innerWidth; var winy=self.innerHeight;


function initMenu(init) {
  if (!init && (navigator.appName!='Netscape' || parseInt(navigator.appVersion)>4 || winx!=self.innerWidth || winy!=self.innerHeight)) {
    winx=self.innerWidth; winy=self.innerHeight; l=document.location; l.href=URL;
  } else {
    menu_ok=0;
    var width=getWidth();
    var img=getImage('input-position');
    var div=getDiv('input');
    if (img && div) {
      var x=getImageLeft(img);
      var y=getImageTop(img);
      moveDiv(div,x,y-1);
    }
    for (i=1; i<=menus; i++) {
      img=getImage('menu'+i+'-position');
      div=getDiv('menu'+i);
      if (img && div) {
        var x=getImageLeft(img);
        moveDiv(div,x-16,menu_top);
        //resizeDiv(div, 120, '+5');
        //setDivBgImage(div,'/pics/navi/menu_bg.gif');
        //setDivBgColor(div,'#EEEEEE');
        div.onmouseover=overMenu;
        div.onmouseout=outMenu;
      }
    }
    div=getDiv('strich');
    if (div) {
      div.onmouseover=onSubDiv;
      div.onmouseout=offSubDiv;
    }
    div=getDiv('grau');
    if (div) {
      setDivHTML(div,'<img src=/pics/navi/grau.gif width='+width+' height=400>');
      div.onmouseover=overMenu;
      div.onmouseout=outMenu;
    }
    div=getDiv('fader');
    if (div) {
      setDivHTML(div,'<img src=/pics/navi/fadeout.gif width='+width+' height=60>');
      div.onmouseover=overMenu;
      div.onmouseout=outMenu;
    }
    menu_ok=1;
  }
}


function toggle(id) {
  img=getImage('pic'+id);
  if (img) {
    if (img.src==plus.src) img.src=minus.src; else img.src=plus.src;
  }
  toggleDivObj(id);
}

function init() {
  _div_init();
  initMenu(1);
  var S1=getS1();
  var S2=document.S2;
  if (S1 && S2) S1.suchen.value=S2.suchen.value;
  showDiv('input');
  menu_ok=1;
}

function getWidth() {
  var width=getPageWidth();
  if (N4) width=getWindowWidth();
  width-=4; // wegen linkem grünen Rand
  return width;
}

function writeTableHeight(id) {
  var y=getWindowHeight();
  if (!y) y=screen.height-200;
  if (id==1) { y-=66; if (!N4) return; }
  if (id==2) { y-=128; if (N4) return; }
  if (y<200) y=200;
  document.write('<img src=/pics/x.gif width=1 height='+y+' align=right>');
}

function showGrauDiv(menudiv) {
//  var width=getWidth();
//  var height=getDivAttribute( menudiv, 'offsetHeight')-5;
//  if (height<1) height=1;
//  var div = getDiv('grau');
//  initializeDiv( div, 4, menu_top, width, height);
//  showDiv(div);
//  div = getDiv('fader');
//  initializeDiv( div, 4, menu_top+height, width, 40);
//  showDiv(div);
}
function hideGrauDiv() {
//  hideDiv('fader');
//  hideDiv('grau');
}


function overMenu() {
  if (!menu_ok || oversub) return;
  overhead=0;
  overmenu=1;
  div=getDiv('menu'+showmenu);
  showGrauDiv(div);
  showDiv(div);
}
function outMenu() {
  if (overhead || oversub) return;
  overmenu=0;
  setTimeout("_hideMenu()", 20);
}

function showMenu(nr) {
  if (!menu_ok) return;
  overmenu=1;
  overhead=1;
  showmenu=nr;
  hideDiv('strich');
  if (divDOM=='NN4') hideDiv('input'); else showDiv('input');
  for (i=1; i<=menus; i++) if (i!=nr) hideDiv('menu'+i);

  var img = getImage('menu'+nr+'-position');
  var div = getDiv('menu'+nr);
  if (div && img) {
    var x=getImageLeft(img);
    var y=getImageTop(img);
    moveDivTo(div,x,y+2);
    showDiv(div);
    showGrauDiv(div);
  }
}
function hideMenu(nr) {
  overmenu=0;
  setTimeout("_hideMenu()", 10);
}

function _hideMenu() {
  if (overmenu || oversub) return;
  hideDiv('strich');
  for (i=1; i<=menus; i++) hideDiv('menu'+i);
//  hideGrauDiv();
  showDiv('input');
}


function onSubDiv() { oversub=1; }
function offSubDiv() { oversub=0; }

function onSub(m,s) {
  var img = getImage('sub.'+m+'.'+s);
  var div = getDiv('strich');
  if (div && img) {
    var x=getImageLeft(img);
    var y=getImageTop(img);
    moveDivTo(div,x-8,y);
    showDiv(div);
  }
}

function getS1() {
  var F=document.S1;
  if (!F && divDOM=='NN4') { F=getDiv('input').document.S1 }
  return F;
}
function Suchen() {
  var F=getS1(); if (!F) return;
  var s=F.suchen; if (!s) return;
  var v=s.value.replace(/\s/g,'');
  if (!v) {
    alert(error_form_search);
    s.focus();
    return;
  }
  F.submit();
}

function be_ebusiness() {
  microsite('/be/en/microsites/ebusiness/index.html');
}

function be_rehost() {
  microsite('/cgi-bin/microsites/be_seminars/index.pl?seminar=rehosting');
}



function newsletter(c,l,t) {
  var l1=document.location;
  var width=600;
  var height=400;
  lissy_openWindow('newsletter',width,height,'','/cgi-bin/pageicons/newsletter.pl?l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}

function lissy_openWindow(id,width,height,attribs,url) {
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  var win,win2,x,i;
  if (!url) url='about:blank';
  var F=self;
  if (F.parent && F.parent.topFrame) F=F.parent.topFrame;
  if (!F.windows) F.windows = new Array();
  var win = 0;
  if (F.windows[id]) {
    win = F.windows[id];
    if (win.closed) win=0;
    else win.document.location=url;
  }  if (!win) {
    if (navigator.appName=='Microsoft Internet Explorer') {
      win = window.open(url,id,'left='+left+',top='+top+',width='+width+',height='+height+','+attribs);
    } else {
      win = window.open(url,id,'screenX='+left+',screenY='+top+',width='+width+',height='+height+','+attribs);
    }
    F.windows[id] = win;
  }
  win.focus();
  return win;
}


function subscribe(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/subscribe.pl?l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}


function tellafriend(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/tellafriend.pl?l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}

function rate(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/rate.pl?l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}



function wmtipptn() {
  var l1=document.location;
  micrositewmtipp('/cgi-bin/wmtipp_tn.pl','tn');
}
function wmtipp() {
  var l1=document.location;
  micrositewmtipp('/cgi-bin/wmtipp.pl','tipp');
}



function salesrep(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/salestool.pl?l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}

function salesrep2(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/salestool.pl?type=2&l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}

function salesrep3(c,l,t) {
  var l1=document.location;
  microsite('/cgi-bin/pageicons/salestool.pl?type=3&l='+l+'&c='+c+'&pagetitle='+t+'&url='+escape(l1.href));
}

function micrositewmtipp(t,n) {
  var microsite;
  var width=600;
  var height=400;
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  microsite=window.open(t, n, 'width='+width+',height='+height+',innerWidth='+width+',innerHeight='+height+',top='+top+',left='+left+',screenY='+top+',screenX='+left+',toolbar=no,menubar=no,location=no,resizable=no,scrollbars=auto,directories=no,hotkeys=no');
  microsite.focus();
}

function anmeldung(id) {
  microsite('/cgi-bin/events/anmeldung.pl?id='+id);
}

function microsite(t) {
  var microsite;
  var width=600;
  var height=480;
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  microsite=window.open(t, 'microsite', 'width='+width+',height='+height+',innerWidth='+width+',innerHeight='+height+',top='+top+',left='+left+',screenY='+top+',screenX='+left+',toolbar=no,menubar=no,location=no,resizable=no,scrollbars=auto,directories=no,hotkeys=no');
  microsite.focus();
}

function microsite2(t) {
  var microsite;
  var width=600;
  var height=400;
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  microsite=window.open(t, 'microsite', 'width='+width+',height='+height+',innerWidth='+width+',innerHeight='+height+',top='+top+',left='+left+',screenY='+top+',screenX='+left+',toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,directories=no,hotkeys=no');
  microsite.focus();
}

function cpxpopup(width, height, t) {
  var microsite;
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  microsite=window.open(t, 'microsite', 'width='+width+',height='+height+',innerWidth='+width+',innerHeight='+height+',top='+top+',left='+left+',screenY='+top+',screenX='+left+',toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no,directories=no,hotkeys=no');
  microsite.focus();
}

function openWindow(u,id,p) {
  var microsite1;
  microsite1=window.open(u, id, p);
  microsite1.focus();
}



function breakfast() { l=document.location; microsite('/cgi-bin/breakfast/breakfast.pl'+l.search); }
