//

printPageURL="/content/printpPopup.html";
function buildToolBox(boxPosition,printOpt,sendafriendOpt,bookmarkOpt,feedbackOpt,trckPrefix) {
 if("ON"=="ON") {
    clearToolbarNote =function(e) {
        showNote("ToolBarNote_"+boxPosition,"")
    };
    document.write("<span id='toolBarArea_"+boxPosition+"'></span>");
    toolBarOuter=document.createElement("div");
    toolBarOuter.id="ToolBar_"+boxPosition;
    toolBarOuter.className="toolBarOuter";
    
        
    
    boxPosition=="bottom" ? toolBarOuter.style.paddingTop="10px" : "";
    toolBarNote=document.createElement("span");
    toolBarNote.id="ToolBarNote_"+boxPosition;
    toolBarNote.className="ToolBarNote";
    toolBarNote.innerHTML="&nbsp;";
    toolBarInner=document.createElement("div");
    toolBarInner.className="toolBarInner";
    document.getElementById("toolBarArea_"+boxPosition).appendChild(toolBarOuter);//
    toolBarOuter.appendChild(toolBarNote);
    toolBarOuter.appendChild(toolBarInner);
    buttonMargin=6;
    if ("ON"!="OFF" && printOpt!="OFF") {
        toolBarPrintOuter=document.createElement("span");
        toolBarPrintOuter.id="";
        toolBarPrint=document.createElement("a");
        toolBarPrint.title="Seite drucken";
        toolBarPrint.className="toolBarPrint";
        toolBarPrint.onclick=function(e) {
            printPopup=window.open('/content/printpPopup.html','trgpopup','width=620,height=600,scrollbars=yes,resizable=no'); printPopup.focus();
        };
        toolBarPrint.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Druckversion");
        };
        toolBarPrint.onmouseout=clearToolbarNote;
        toolBarInner.appendChild(toolBarPrintOuter);
        toolBarPrintOuter.appendChild(toolBarPrint);
        buttonMargin=10;
    }
    if ("ON"!="OFF" && sendafriendOpt!="OFF" && "https://secure.deutsche-bank.de/pbc/seiteweiterempfehlen/index.jsp"!="") {
        toolBarSendafriend=document.createElement("a");
        toolBarSendafriend.title="Diese Seite empfehlen";
        toolBarSendafriend.className="toolBarSendafriend";
        toolBarSendafriend.style.marginLeft=buttonMargin+"px";
        toolBarSendafriend.onclick=function(e) {
            uriAnnex=encodeURIComponent(document.title);
            loadToolBoxIFrame("https://secure.deutsche-bank.de/pbc/seiteweiterempfehlen/index.jsp?lang=de&decorator=dbag&url="+window.location.href+"&description="+uriAnnex,"736","490");
        };
        toolBarSendafriend.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Seite empfehlen");
        };
        toolBarSendafriend.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarSendafriend);
    }
    if ("ON"!="OFF" && bookmarkOpt!="OFF") {
        toolBarBookmark=document.createElement("a");
        toolBarBookmark.title="Lesezeichen hinzufügen ";
        toolBarBookmark.style.marginLeft=buttonMargin+"px";
        toolBarBookmark.className="toolBarBookmark";
        toolBarBookmark.onclick=function(e) {
            setBookmark();
        };
        toolBarBookmark.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Lesezeichen");
        };
        toolBarBookmark.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarBookmark);
    }

    if ("OFF"!="OFF" && feedbackOpt!="OFF" && "https://secure.deutsche-bank.de/feedbackmanager/"!="") {
        toolBarFeedback=document.createElement("a");
        toolBarFeedback.title="Vote this page";
        toolBarFeedback.style.marginLeft=buttonMargin+"px";
        toolBarFeedback.className="toolBarFeedback";
        toolBarFeedback.onclick=function(e) {
            loadToolBoxIFrame("https://secure.deutsche-bank.de/feedbackmanager/?lang=de&decorator=dbag&","736","700");
        };
        toolBarFeedback.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Feedback");
        };
        toolBarFeedback.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarFeedback);
    }

  }
}
/* handle >bookmark< klick */
function setBookmark() {
    ap=navigator.appName;
    url=location.href;
    t=document.getElementsByTagName("title")[0].innerHTML;
    if (window.sidebar) {
        window.sidebar.addPanel(t,url,'');
    } else if (window.external) {
        window.external.AddFavorite(url,t);
    } else if (window.addNet) {
        addNet(url,t);
    } else {
        alert("Ihr Browser unterst&uuml;tzt diese Funktion nicht.\nBitte Legen Sie das Lesezeichen manuell an.");
    }
}
var toolBoxParent;
function loadToolBoxIFrame(boxSrc,boxWidth,boxHeight) {
    document.getElementById("toolBoxParent") ? document.body.removeChild(document.getElementById("toolBoxParent")) : "";
    toolBoxParent=document.createElement("div");
    toolBoxParent.id="toolBoxParent";
    toolBox=document.createElement("div");
    toolBox.className="toolBox";
    toolBox.id="toolBox";
    toolBoxClose=document.createElement("a");
    toolBoxClose.className="toolBoxClose icon close";
    toolBoxClose.id="closeButton";
    toolBoxClose.href="javascript:void(0)";
    toolBoxClose.onclick= function() {
        toolBox.removeChild(toolBoxIFrame);
        lightboxx('toolBoxParent','self');
    };
    toolBoxClose.innerHTML="Fenster schlie&szlig;en";
    toolBoxIFrame=document.createElement("iframe");
    toolBoxIFrame.className="toolBoxIFrame";
    toolBoxIFrame.id="toolBoxIFrame";
    toolBoxIFrame.setAttribute("scrolling","No");
    toolBoxIFrame.setAttribute("frameBorder","0");
    myfunction= function(e) {document.getElementById("closeButton").style.display="inline";}
    toolBoxIFrame.attachEvent ? toolBoxIFrame.attachEvent("onload", myfunction) : toolBoxIFrame.onload = myfunction;
    toolBoxIFrame.style.width=boxWidth+"px";
    toolBoxIFrame.style.height=boxHeight+"px";
    lightboxx('toolBoxParent','insert',toolBoxParent);
    toolBoxParent.appendChild(toolBox);
    toolBox.appendChild(toolBoxClose);
    toolBox.appendChild(toolBoxIFrame);
    document.getElementById(toolBoxIFrame.id).src=boxSrc;
    window.scrollTo(100, 100);
}
 
activateFontResizing="ON";
function buildFontSizeButtons() {
  if(activateFontResizing=="ON") {
    fontResizingBarOuter=document.createElement("div");
    fontResizingBarOuter.className="toolBarOuter";
    fontResizingBarNote=document.createElement("div");
    fontResizingBarNote.id="fontResizingBarNote";
    fontResizingBarNote.className="ToolBarNote";
    smallFontButton=document.createElement("a");
    smallFontButton.href="#smallfont";
    smallFontButton.accesskey="-";
    smallFontButton.name="smallfont";
    smallFontButton.className="fontSizeButton";
    smallFontButton.id="small";
    smallFontButton.onclick=new Function("change_size('small')");
    smallFontButton.onmouseover=new Function("showNote('fontResizingBarNote','Schriftgröße')");
    smallFontButton.onmouseout=new Function("showNote('fontResizingBarNote','')");
    mediumFontButton=document.createElement("a");
    mediumFontButton.href="#mediumfont";
    mediumFontButton.accesskey="#";
    mediumFontButton.name="mediumfont";
    mediumFontButton.className="fontSizeButton";
    mediumFontButton.id="medium";
    mediumFontButton.onclick=new Function("change_size('medium')");
    mediumFontButton.onmouseover=new Function("showNote('fontResizingBarNote','Schriftgröße')");
    mediumFontButton.onmouseout=new Function("showNote('fontResizingBarNote','')");
    largeFontButton=document.createElement("a");
    largeFontButton.href="#largefont";
    largeFontButton.accesskey="+";
    largeFontButton.name="largefont";
    largeFontButton.className="fontSizeButton";
    largeFontButton.id="large";
    largeFontButton.onclick=new Function("change_size('large')");
    largeFontButton.onmouseover=new Function("showNote('fontResizingBarNote','Schriftgröße')");
    largeFontButton.onmouseout=new Function("showNote('fontResizingBarNote','')");
    contrastButton=document.createElement("a");
    contrastButton.href="#contrast";
    contrastButton.accesskey="K";
    contrastButton.name="contrast";
    contrastButton.className="fontSizeButton";
    contrastButton.id="contrast";
    contrastButton.onclick=new Function("toggleContrast()");
    contrastButton.onmouseover=new Function("showNote('fontResizingBarNote','Kontrast')");
    contrastButton.onmouseout=new Function("showNote('fontResizingBarNote','')");
    document.write("<span id='fontResizingBarArea'></span>");
    fontResizingBarOuter=document.createElement("div");
    fontResizingBarOuter.className="fontResizingBarOuter";
    fontResizingBarNote=document.createElement("span");
    fontResizingBarNote.id="fontResizingBarNote";
    fontResizingBarNote.className="ToolBarNote";
    fontResizingBarNote.innerHTML="&nbsp;";
    fontResizingBarInner=document.createElement("div");
    fontResizingBarInner.className="toolBarInner";
   
    document.getElementById("fontResizingBarArea").appendChild(fontResizingBarOuter);
    fontResizingBarOuter.appendChild(fontResizingBarNote);
    fontResizingBarOuter.appendChild(fontResizingBarInner);
    fontResizingBarInner.appendChild(contrastButton);
    fontResizingBarInner.appendChild(largeFontButton);
    fontResizingBarInner.appendChild(mediumFontButton);
    fontResizingBarInner.appendChild(smallFontButton);
  }
}
cssHref= new Object();
cssHref['small']= "/data/css/font_size.css";
cssHref['medium']= "/content/css_new_fontsizes_medium.css";
cssHref['large']= "/content/css_new_fontsizes_large.css";

function change_size(fontSize) {
    document.getElementById("fontSizeCSS").href=cssHref[fontSize];
    eraseCookie('resize_fontsize');
    createCookie('resize_fontsize',fontSize,'2160');
}
if (readCookie('resize_fontsize') && activateFontResizing=="ON") {
    change_size(readCookie('resize_fontsize'));    
}
function toggleContrast() {
 if (document.getElementById('contrastCSS')) {
    document.getElementById('contrastCSS').href="";
    document.getElementsByTagName('head')[0].removeChild(document.getElementById('contrastCSS'));
    eraseCookie('contrastToggle');
  } else {
    contrastCSS  = document.createElement('link');
    contrastCSS.rel  = "stylesheet";
    contrastCSS.type = "text/css";
    contrastCSS.href = "/content/css_contrast.css";
    contrastCSS.id = "contrastCSS";
    document.getElementsByTagName('head')[0].appendChild(contrastCSS);
    createCookie('contrastToggle','ON','2160');
  }
}
if (readCookie('contrastToggle') && activateFontResizing=="ON") {
    toggleContrast();    
}
 
// Cookie handling
function createCookie(name,value,hours)
{
 if (hours)
 {
  var date = new Date();
  date.setTime(date.getTime()+(hours*60*60*1000));
  var expires = "; expires="+date.toGMTString();
 }
 else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name)
{
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for(var i=0;i < ca.length;i++)
 {
  var c = ca[i];
  while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 }
 return null;
}
function eraseCookie(name)
{
 createCookie(name,"",-1);
}
