// ********************
// Topmenu hover function (for IE - make hover available for other than a-tag)
// ********************
sfHover = function() {
 if (document.getElementById("cntmenutop")){
  var sfEls = document.getElementById("cntmenutop").getElementsByTagName("LI");
  for (var i=0; i<sfEls.length; i++) {
   sfEls[i].onmouseover=function() {
    this.className+=" sfhover";
   }
   sfEls[i].onmouseout=function() {
    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
   }
  }
 }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//
// ******************** END
//
// ********************
// Build Submenu
// ********************
var strSubnav= ""; //output string for left menu
var menuArray = new Array();
function makeSubnav(myFilename,myGUID){
//menuArray: written via xsl, parameter: (node[0-4], show/hide[0,1], highlight[0,1], Headline, url)
 var startEntry=1000; // first entry to show (must be node0)
 var stopEntry=1000; // last entry to show (before next node0 or fin)
 var highlightEntry=1000; //entrynum to highlight
 var activeBlock=1000; // active node1-block
 var tmpBlock=1000; // tmp-block to handle active block
 var mySelf=""; // string to check where current page is in menuarray
//in RedDot (and preview) check via GUID, after publication via filename
 if (menuArray.length!=0) {mySelf = ( menuArray[0][4].indexOf("pageguid")!= -1 ) ? myGUID : ("/" + myFilename);}
//look for current filename in array, set startEntry, activeBlock, highlightentry
for (i=0;i<menuArray.length;i++){
 if (menuArray[i][4].indexOf(mySelf)!= -1){
  if (menuArray[i][0]==0 || menuArray[i][0]==1 || menuArray[i][0]==2) {highlightEntry = i;}
  if (menuArray[i][0] == 1){activeBlock=i;}
  if (menuArray[i][0] == 0){
   startEntry= i;
  }
  else {
    for (j=i-1;j>=0;j--){
     if (activeBlock==1000 && menuArray[j][0]==1) {activeBlock=j;}
     if (highlightEntry==1000 && menuArray[j][0]==2) {highlightEntry=j;}
     if (menuArray[j][0] == 0){
      startEntry= j;
      break;
     }
    }
  }
 }
}
// next should be set, otherwise something's wrong
if (startEntry==1000 || highlightEntry==1000) return false;
//set stopEntry, entries to show
stopEntry = startEntry;
tmpBlock = activeBlock;
for (i=startEntry;i<menuArray.length;i++){
 if ( i!=startEntry && menuArray[i][0]==0 ) {
  break;
 }
 stopEntry = i;
 if (menuArray[i][0]==1) {tmpBlock=i;}
 if (menuArray[i][0]==2 && tmpBlock!=activeBlock){
  menuArray[i][1] = 0;
 }
 else {menuArray[i][1] = 1;}
 if (i==highlightEntry){
  menuArray[i][2] = 1;
 }
}
//look what entries (node 0-2) should be shown, node 2 only if in activeblock, give them styles, write in string strSubnav
for (i=startEntry;i<=stopEntry;i++){
 if (menuArray[i][0]==0){
  strSubnav += "<h4>" +menuArray[i][3]+ "</h4>\n";
 }
 else {
  if (menuArray[i][0]==1){
   strSubnav += "<a href='" +menuArray[i][4]+ "' class='L1";
   if (menuArray[i][2]==1) {strSubnav += " active";}
   strSubnav += "'>" +menuArray[i][3]+ "</a>\n";
  }
  else {
   if (menuArray[i][0]==2 && menuArray[i][1]==1){
    strSubnav += "<a href='" +menuArray[i][4]+ "' class='L2";
    if (menuArray[i][2]==1) {strSubnav += " active";}
    strSubnav += "'>" +menuArray[i][3]+ "</a>\n";
   }
  }
 }
}
return false;
}
function writeSubnav(){
 //alert(strSubnav);
 document.write(strSubnav);
 return false;
}
//
// ******************** END
//
function XopenWin(Xlink,Xwidth,Xheight,Xscrollbars,Xstatus,Xresizable,Xtoolbar,Xmenubar,Xlocation,Xname) {
 var PopUp;
 var werte = 'width='+Xwidth+',height='+Xheight+',scrollbars='+Xscrollbars+',status='+Xstatus+',resizable='+Xresizable+',toolbar='+Xtoolbar+',menubar='+Xmenubar+',location='+Xlocation;
 if (!Xname){ var Xname="PCB"; }
 PopUp = window.open(Xlink,Xname,werte);
 PopUp.focus();
 return false;
}
// ********** efa cookie
function Cookiemanager(name,defaultExpiration,expirationUnits,defaultDomain,defaultPath){
 this.name=name;
 this.defaultExpiration=this.getExpiration(defaultExpiration,expirationUnits);
 this.defaultDomain = 'db.com';
 this.defaultPath=(defaultPath)?defaultPath:'/';
 this.cookies=new Object();
 this.expiration=new Object();
 this.domain=new Object();
 this.path=new Object();
 window.onunload=new Function(this.name+'.setDocumentCookies();');
 this.getDocumentCookies();
};
Cookiemanager.prototype.getExpiration=function(expiration,units){
 expiration=(expiration)?expiration:7;
 units=(units)?units:'days';
 var date=new Date();
 switch(units){
  case'years':
  date.setFullYear(date.getFullYear()+expiration);
  break;
  case'months':
  date.setMonth(date.getMonth()+expiration);
  break;
  case'days':
  date.setTime(date.getTime()+(expiration*24*60*60*1000));
  break;
  case'hours':
  date.setTime(date.getTime()+(expiration*60*60*1000));
  break;
  case'minutes':
  date.setTime(date.getTime()+(expiration*60*1000));
  break;
  case'seconds':
  date.setTime(date.getTime()+(expiration*1000));
  break;
  default:
  date.setTime(date.getTime()+expiration);
  break;
 };
 return date.toGMTString();
};
Cookiemanager.prototype.getDocumentCookies=function(){
 var cookie,pair;
 var cookies=document.cookie.split(';');
 var len=cookies.length;
 for(var i=0;i<len;i++){cookie=cookies[i];
 while(cookie.charAt(0)==' ')cookie=cookie.substring(1,cookie.length);pair=cookie.split('=');
 this.cookies[pair[0]]=pair[1];
 };
};
Cookiemanager.prototype.setDocumentCookies=function(){
 var expires='';
 var cookies='';
 var domain='';
 var path='';
 var name = 'efaSizePCB';
 expires=(this.expiration[name])?this.expiration[name]:this.defaultExpiration;
 path=(this.path[name])?this.path[name]:this.defaultPath;
 domain=(this.domain[name])?this.domain[name]:this.defaultDomain;
 cookies=name+'='+this.cookies[name]+'; expires='+expires+'; path='+path+'; domain='+domain;
 document.cookie=cookies;
 return true;
};
Cookiemanager.prototype.getCookie=function(cookieName){
 var cookie=this.cookies[cookieName];
 return(cookie)?cookie:false;
};
 
Cookiemanager.prototype.setCookie=function(cookieName,cookieValue,expiration,expirationUnits,domain,path){
 this.cookies[cookieName]=cookieValue;
 if(expiration)this.expiration[cookieName]=this.getExpiration(expiration,expirationUnits);
 if(domain)this.domain[cookieName]=domain;
 if(path)this.path[cookieName]=path;
 return true;
};
var cookieManager=new Cookiemanager('cookieManager',1,'years');
 
// ********** /efa cookie
// ********** efa fontsize
var efa_default=68.75;
var efa_increment=10;
var efa_bigger=['',
    '<img src="/de/img/schriftgroesse_gr.gif" alt="increase font-size" border="0" width="16" height="17" title="increase font-size"><span>increase font-size</span>',
    'increase font-size',
    '',
    'increase_font-size',
    '',
    '',
    '',
    '',
    '',
    ''];
var efa_reset=['',
      '<img src="/de/img/schriftgroesse_mi.gif" alt="default font-size" border="0" width="17" height="17" title="default font-size"><span>default font-size</span>',
      'default font-size',
      '',
      'default_font-size',
      '',
      '',
      '',
      '',
      '',
      ''];
var efa_smaller=['',
     '<img src="/de/img/schriftgroesse_kl.gif" alt="decrease font-size" border="0" width="16" height="17" title="decrease font-size"><span>decrease font-size</span>','decrease font-size',
     '',
     'decrease_font-size',
     '',
     '',
     '',
     '',
     '',
     ''];
function Efa_Fontsize(increment,bigger,reset,smaller,def){
 this.w3c=(document.getElementById);
 this.ms=(document.all);
 this.userAgent=navigator.userAgent.toLowerCase();
 this.isOldOp=((this.userAgent.indexOf('opera')!=-1)&&(parseFloat(this.userAgent.substr(this.userAgent.indexOf('opera')+5))<=7));
 if((this.w3c||this.ms)&&!this.isOldOp&&!this.isMacIE){
  this.name="efa_fontSize";
  this.cookieName='efaSizePCB';
  this.increment=increment;
  this.def=def;this.defPx=Math.round(16*(def/100));
  this.base=1;this.pref=this.getPref();
  this.testHTML='<div id="efaTest" style="position:absolute;visibility:hidden;line-height:1em;">&nbsp;</div>';
  this.biggerLink=this.getLinkHtml(1,bigger);
  this.resetLink=this.getLinkHtml(0,reset);
  this.smallerLink=this.getLinkHtml(-1,smaller);
 } else {
  this.biggerLink='';
  this.resetLink='';
  this.smallerLink='';
  this.efaInit=new Function('return true;');
 }
 this.allLinks=this.smallerLink+this.resetLink+this.biggerLink;
}
Efa_Fontsize.prototype.efaInit=function(){
 document.writeln(this.testHTML);
 this.body=(this.w3c)?document.getElementsByTagName('body')[0].style:document.all.tags('body')[0].style;
 this.efaTest=(this.w3c)?document.getElementById('efaTest'):document.all['efaTest'];
 var h=(this.efaTest.clientHeight)?parseInt(this.efaTest.clientHeight):(this.efaTest.offsetHeight)?parseInt(this.efaTest.offsetHeight):999;
 if(h<this.defPx)this.base=this.defPx/h;
 this.body.fontSize=Math.round(this.pref*this.base)+'%';
}
Efa_Fontsize.prototype.getLinkHtml=function(direction,properties){
 var html=properties[0]+'<a href="#" onclick="efa_fontSize.setSize('+direction+'); return false;"';
  html+=(properties[2])?'title="'+properties[2]+'"':'';
  html+=(properties[3])?'class="'+properties[3]+'"':'';
  html+=(properties[4])?'id="'+properties[4]+'"':'';
  html+=(properties[5])?'name="'+properties[5]+'"':'';
  html+=(properties[6])?'accesskey="'+properties[6]+'"':'';
  html+=(properties[7])?'onmouseover="'+properties[7]+'"':'';
  html+=(properties[8])?'onmouseout="'+properties[8]+'"':'';
  html+=(properties[9])?'onfocus="'+properties[9]+'"':'';
  return html+='>'+properties[1]+'<'+'/a>'+properties[10];
}
Efa_Fontsize.prototype.getPref=function(){
 var pref=this.getCookie(this.cookieName);
 if(pref)return parseInt(pref);
 else return this.def;
}
Efa_Fontsize.prototype.setSize=function(direction){
 this.pref=(direction)?this.pref+(direction*this.increment):this.def;
 this.setCookie(this.cookieName,this.pref);
 this.body.fontSize=Math.round(this.pref*this.base)+'%';
}
 
Efa_Fontsize.prototype.getCookie=function(cookieName){
 var cookie=cookieManager.getCookie(cookieName);
 return(cookie && (cookie!="undefined"))?cookie:false;
}
 
Efa_Fontsize.prototype.setCookie=function(cookieName,cookieValue){
 return cookieManager.setCookie(cookieName,cookieValue);
}
var efa_fontSize=new Efa_Fontsize(efa_increment,efa_bigger,efa_reset,efa_smaller,efa_default);
 
// ********** /efa fontsize