// JavaScript Documentvar IE = false;var IE6 = false;var NS = false;var browser_version = parseInt(navigator.appVersion);var browser_type = navigator.appName;if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) { IE = true; } if (browser_type == "Microsoft Internet Explorer" && (browser_version <= 6)) { IE6 = true; } else if (browser_type == "Netscape" && (browser_version >= 4) && (browser_version < 5)) { NS = true; }else if (browser_type == "Netscape" && (browser_version >= 5)) { NS = true; }/* * Fadet das Popup & den BG aus * @author: DKL*/function closePopup(id,effect) {  if(effect)  {    Effect.Fade(id, { duration: 0.5 });    Effect.Fade('popupbg', { duration: 0.5 });    setTimeout("doclosePopup('"+id+"')", 500);  }  else  {    doclosePopup(id);  }}// --------------------------------------------------------------------------------/* * Loescht das Popup & den BG aus der DOM * @author: DKL*/function doclosePopup(id){  deleteLayer(id,false);  deleteLayer('popupbg',true);}// --------------------------------------------------------------------------------/* * Fadet das Popup aus * @author: DKL*/function closePopupOnly(id,effect){  if(effect)  {    Effect.Fade(id, { duration: 0.5 });    setTimeout("doclosePopupOnly('"+id+"')", 500);  }  else  {    doclosePopupOnly(id);  }}// --------------------------------------------------------------------------------/* * Loescht das Popup aus der DOM * @author: DKL*/function doclosePopupOnly(id){  deleteLayer(id);}// --------------------------------------------------------------------------------/* * Erstellt ein Popup welches einen iFrame fuer den Inhalt enthaelt * @param: src=Seite die angezeigt werden soll  * @author: DKL*/function createPopupFrame(src,W,H,scroll,lang,effect){  if(H == 0)    H = document.documentElement.clientHeight - 100;  if(W == 0)    W = document.documentElement.clientWidth - 100;    importStyle('Popup');    makeBGLayer('popupbg','popupframe','7','900',effect);  makeLayer('popupframe',W,H,'10','1000',effect);    height = H - 46;  if(IE) height = H - 14;  width = W;  widthPopup = W;  if(IE) widthPopup = W + 24;    title="Schlie&szlig;en";  if (lang=="en") title ="Close";    var html =  '<div class="popuptop" id="popuptop"><a href="javascript:closePopup(\'popupframe\','+effect+');" title="'+title+'">'+title+'&nbsp;<img src="/html/js/khlib/img/btn_close.gif" border="0" align="top" style="position:relative; top:0px;" alt="" title="'+title+'" /></a></div>'+              '<div class="popupcontent" id="popupcontent">'+              '<iframe src="'+src+'" name="puframe" id="puframe" width="'+width+'" height="'+height+'" vspace="0" hspace="0" marginwidth="0" marginheight="0" style="overflow:visible; display:block;" allowtransparency="true" frameborder="0" scrolling="'+scroll+'" align="left"></iframe>'+              '</div>'+              '<div class="popupbottom" id="popupbottom">&nbsp;</div>';    document.getElementById('popupframe').innerHTML = html;  document.getElementById('popuptop').style.width = widthPopup+"px";  document.getElementById('popuptop').style.height = 25+"px";  document.getElementById('popupcontent').style.width = W+"px";  document.getElementById('popupcontent').style.height = height+"px";  document.getElementById('popupbottom').style.width = widthPopup+"px";  document.getElementById('popupbottom').style.height = 10+"px";}// --------------------------------------------------------------------------------/* * Hinweis Popup anzeigen * @author: DKL*/function createNotification(text, width, height,effect){  makeBGLayer('popupbg','popup','5','60',effect);  makeLayer('popup',width,height,'10','70',effect);  importStyle('Popup');    var html =  '<div class="popuptop" id="popuptop"><a href="javascript:closePopup(\'popup\','+effect+');" title="Fenster schlie&szlig;en">schlie&szlig;en&nbsp;<img src="/html/js/khlib/img/btn_close.gif" border="0" align="top" style="position:relative; top:0px;" alt="" title="Fenster schlie&szlig;en" /></a></div>'+              '<div class="popupcontent" id="popupcontent" style="text-align:center;">'+              text+'<br/><br/>'+              '<div id="ok" style="width:100%; text-align:center;"></div>'+              '</div>'+              '<div class="popupbottom" id="popupbottom">&nbsp;</div>';    document.getElementById('popup').innerHTML = html;    okb=document.createElement('input');  okb.type = 'image';  okb.src = './img/btn_ok.gif';  document.getElementById('ok').appendChild(okb);  okb.onclick = function() { closePopup('popup',effect); };}// --------------------------------------------------------------------------------/* * SWF Popup anzeigen * @author: BBL*/function createSwfPopup(swf, version, width, height, lang, effect){  makeBGLayer('popupbg','popup','5','60',effect);  makeLayer('popup',width+24,height+20,'10','70',effect);  importStyle('Popup');    title="Schlie&szlig;en";  if (lang=="en") title ="Close";    var html =  '<div class="popuptop" id="popuptop"><a href="javascript:closePopup(\'popup\','+effect+');" title="'+title+'">'+title+'&nbsp;<img src="/html/js/khlib/img/btn_close.gif" border="0" align="top" style="position:relative; top:0px;" alt="" title="'+title+'" /></a></div>'+              '<div class="popupcontent" id="popupcontent" style="text-align:center;">'+'<div id="myContent">'+'<b>Alternative content</b><br /><br />'+'<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" border="0" /></a>'+'</div>'+              '</div>'+              '<div class="popupbottom" id="popupbottom">&nbsp;</div>';    document.getElementById('popup').innerHTML = html;  swfobject.embedSWF(swf, "myContent", width, height, version, "expressInstall.swf");}// --------------------------------------------------------------------------------/* * Erstellt den Layer fuer den Hintergrund * @author: DKL*/function makeBGLayer(id,pid,opacity,zIndex,effect) {  if (!document.createElement) return;  if (document.getElementById(id)) return;    if(NS)    document.body.style.overflow = 'hidden';  if(IE)  {    if(!document.documentElement.clientHeight)      document.body.style.overflow = 'hidden';    else      document.documentElement.style.overflow = 'hidden';  }    if(NS)  {    var top = window.pageYOffset+'px';  }  if(IE)  {    if(!document.documentElement.clientHeight)      var top = document.body.scrollTop+'px';    else      var top = document.documentElement.scrollTop+'px';  }    d = document.createElement('div');  d.id = id;  if(effect)    d.style.display = 'none';  else    d.style.display = 'block';  d.style.left = '0px';  d.style.top = top;  d.style.width = '4000px'; // Scroll Fix  d.style.height = '4000px'; // IE6 Fix  d.style.backgroundColor = '#000000';  d.style.position = 'absolute';  d.style.zIndex = zIndex;  d.style.opacity = opacity/10;d.style.filter = 'alpha(opacity=' + opacity*10 + ')';d.onclick = function(){closePopup(pid,effect);}  document.body.appendChild(d);  if(effect)    Effect.Appear(d, { duration: 0.5, to: opacity/10 });}// --------------------------------------------------------------------------------/* * Erstellt den Layer fuer das Popup * @author: DKL*/function makeLayer(id,W,H,opacity,zIndex,effect) {  if (!document.createElement) return;  if (document.getElementById(id)) return;    if(NS)  {    var top = window.pageYOffset+(window.innerHeight/2)-(H/2);    var left = window.pageXOffset+(window.innerWidth/2)-(W/2);  }  if(IE)  {    if(!document.documentElement.clientHeight)    {      var top = document.body.scrollTop+(document.body.clientHeight/2)-(H/2);      var left = document.body.scrollLeft+(document.body.clientWidth/2)-(W/2);    }    else    {      var top = document.documentElement.scrollTop+(document.documentElement.clientHeight/2)-(H/2);      var left = document.documentElement.scrollLeft+(document.documentElement.clientWidth/2)-(W/2);    }  }    var mh = -1*(W/2);  var mv = -1*(H/2);    ih = H;  W += 'px';  H += 'px';      left = Math.floor(left)+'px';  tm = '-'+ih/2+'px';  top = Math.floor(top)+'px';    d = document.createElement('div');  d.id = id;  d.style.position = 'absolute';  d.style.zIndex = zIndex;  if(effect)    d.style.display = 'none';  else    d.style.display = 'block';  if(W != 0)    d.style.width = W;  if(H != 0)    d.style.height = H;  if(W != 0 && H != 0)    d.style.margin = '0 0 0 '+mh+'px';  d.style.left = '50%';  d.style.top = top;  //d.style.top = '50%';  /* Verursacht Probleme bei Fade Effekten im IE -----------------  d.style.opacity = opacity/10;  d.style.filter = 'alpha(opacity=' + opacity*10 + ')';  */  document.body.appendChild(d);  if(effect)    Effect.Appear(d, { duration: 0.5, to: opacity/10 });}// --------------------------------------------------------------------------------/* * Wechsel zwischen Popups * @author: DKL*/function changePopup(id,newsrc,W,H,scroll){  if(H == 0)    H = document.documentElement.clientHeight - 100;  if(W == 0)    W = document.documentElement.clientWidth - 100;    iframe = document.getElementById('puframe');  new Effect.Opacity(iframe, { from: 1.0, to: 0, duration: 0.1 });  morphPopup('popupframe',W,H,'');  document.getElementById('puframe').src = newsrc;  new Effect.Opacity(iframe, { from: 0, to: 1.0, duration: 2.0 });}// --------------------------------------------------------------------------------/* * Tauscht den Inhalt des iFrames im Popup aus * @author: DKL*/function changePopupSrc(newsrc){  document.getElementById('puframe').src = newsrc;}// --------------------------------------------------------------------------------/* * Loescht einen Layer aus dem DOM * @author: DKL*/function deleteLayer(id,scroll){  if(scroll == true)  {    if(NS)      document.body.style.overflow = 'auto';    if(IE)    {      if(!document.documentElement.clientHeight)      {        document.body.style.overflow = 'auto';      }      else      {        document.documentElement.style.overflow = 'auto';      }    }  }  if (!document.createElement) return;  d = document.getElementById(id);  if (!d) return;  document.body.removeChild(d);}// --------------------------------------------------------------------------------/* * Animiert das Popup (skalieren) * @author: DKL*/function morphPopup(id,W,H,style) {  if(NS)  {    var top = window.pageYOffset+(window.innerHeight/2)-(H/2);    var left = window.pageXOffset+(window.innerWidth/2)-(W/2);  }  if(IE)  {    if(!document.documentElement.clientHeight)    {      var top = document.body.scrollTop+(document.body.clientHeight/2)-(H/2);      var left = document.body.scrollLeft+(document.body.clientWidth/2)-(W/2);    }    else    {      var top = document.documentElement.scrollTop+(document.documentElement.clientHeight/2)-(H/2);      var left = document.documentElement.scrollLeft+(document.documentElement.clientWidth/2)-(W/2);    }  }    popup = document.getElementById(id);  ch = getHeightWithoutPadding(popup);  cw = getWidthWithoutPadding(popup);  wfac = W/cw;  hfac = H/ch;  var mh = -1*(W/2);  tm = '-'+H/2+'px';  if(document.getElementById('puframe'))  {    iframe = document.getElementById('puframe');    nh = getIFrameHeight(iframe)*hfac;    wf = W - 20 - 4;    new Effect.Parallel([      new Effect.Morph(iframe, {style: 'width:'+wf+'px; height:'+nh+'px;'})    ]);   }  topb = document.getElementById('popuptop');  content = document.getElementById('popupcontent');  bottom = document.getElementById('popupbottom');  hc = getHeightWithoutPadding(content)*hfac;    new Effect.Parallel([    new Effect.Morph(topb, {style: 'width:'+W+'px;'}),    new Effect.Morph(content, {style: 'width:'+W+'px; height:'+hc+'px;'}),    new Effect.Morph(bottom, {style: 'width:'+W+'px;'}),    new Effect.Morph(popup, {style: 'width:'+W+'px; height:'+H+'px; margin:'+tm+' 0 0 '+mh+'px'})  ]); }// --------------------------------------------------------------------------------/* * Gibt die Hoehe eines El. ohne Padding zurueck * @author: DKL*/function getHeightWithoutPadding(element) {  if(NS)    return parseFloat(element.getStyle('height'));  if(IE)  {    str = element.style.height;    wo = str.split("px");    n = wo[0];    return n;  }} // --------------------------------------------------------------------------------/* * Gibt die Breite eines El. ohne Padding zurueck * @author: DKL*/function getWidthWithoutPadding(element) {  if(NS)    return parseFloat(element.getStyle('width'));  if(IE)    return parseFloat(element.style.width);} // --------------------------------------------------------------------------------/* * Gibt die Hoehe eines El. zurueck * @author: DKL*/function getIFrameHeight(element){  return element.height;}// --------------------------------------------------------------------------------/* * Gibt die Breite eines El. zurueck * @author: DKL*/function getIFrameWidth(element){  return element.width;}// --------------------------------------------------------------------------------