boxBuilder=0;
if ("dbes"!="") {
    decoratorValue="dbes";
} else {
    decoratorValue="dbag";
}

function buildToolBox(boxPosition,printOpt,sendafriendOpt,bookmarkOpt,feedbackOpt) {
// if (boxPosition!="bottom") {
 if (boxBuilder==0) {
   boxBuilder++;
  document.writeln("<iframe src='/spain/images/shared/tp.gif' id='primerToolBoxJS' frameborder=0 style='position:absolute; display:none; left:100px; top:100px; background-color:white; z-index:999999;'></iframe>");
  document.writeln("<div style='position:absolute; left:100px; top:100px; display:none; background-color:white; border:1px solid #003399; z-index:99999999;' id='ToolBoxJS'>");
  document.writeln("   <a style='position:absolute; right:95px; top:115px; display:none' id='closeButton' class='anchorClose' href='javascript:pageActiveSwitch(\"OFF\",\"ToolBoxJS\",\"others\")'>Cerrar ventana</a>");
  document.writeln("   <iframe id='toolBoxIFrameToolBoxJS' src='/spain/images/shared/tp.gif' style='background-color:#E1E8F3;' frameborder=NO scrolling=NO onload='document.getElementById(\"closeButton\").style.display=\"inline\";'></iframe>");
  document.writeln("</div>");
 }
 extraPadding="";
 if (boxPosition=="bottom") extraPadding=" padding-top:10px;";
 document.writeln("<div style='width:190px; float:right; margin-bottom:-20px; "+extraPadding+"'>");
// document.writeln("<div style='position:relative; height:1px;'>");
// document.write("<div class='toolBoxOuter' id='pageToolBox_"+boxPosition+"'>");
 document.write("<div id='ToolBarNote_"+boxPosition+"' class='ToolBarNote'>&nbsp;</div>");
 document.write("<div style='float:right'>");
 buttonMargin=6; 
 if (printOpt!="OFF") {
    document.write("<span id='tlbxPrint"+boxPosition+"'>");
    document.write("<a href='javascript:openPrintPopup()' onMouseOver='showNote(\"ToolBarNote_"+boxPosition+"\",\"Imprimir\");' onMouseOut='showNote(\"ToolBarNote_"+boxPosition+"\",\"\")'><img src='/spain/images/shared/icon_print_new.gif' border='0' alt='Imprimir esta p&aacute;gina'></a>");
    buttonMargin=10; 
    document.write("</span>");
}
  if ("ON"!="OFF" && sendafriendOpt!="OFF") {

//https://secure.deutsche-bank.de/pbc/seiteweiterempfehlen/index.jsp
 document.write("<a href='javascript:doSendAFriend(\"ToolBoxJS\")' onMouseOver='showNote(\"ToolBarNote_"+boxPosition+"\",\"Email\");' onMouseOut='showNote(\"ToolBarNote_"+boxPosition+"\",\"\")'><img src='/spain/images/shared/icon_sendafriend.gif' style='margin-left:"+buttonMargin+"px' border='0' alt='Recomendar esta página'></a>");
 buttonMargin=6; 

 }
  if ("ON"!="OFF" && bookmarkOpt!="OFF") {
 document.write("<a href='javascript:doBookmark();' onMouseOver='showNote(\"ToolBarNote_"+boxPosition+"\",\"Favoritos\");' onMouseOut='showNote(\"ToolBarNote_"+boxPosition+"\",\"\")'><img src='/spain/images/shared/icon_bookmark.gif' style='margin-left:"+buttonMargin+"px' border='0' alt='Añadir a Favoritos'></a>");
 buttonMargin=6; 
  }
  if ("ON"!="OFF" && feedbackOpt!="OFF") {

//https://secure.deutsche-bank.de/feedbackmanager/
 document.write("<a href='javascript:doFeedback(\"ToolBoxJS\")' onMouseOver='showNote(\"ToolBarNote_"+boxPosition+"\",\"Su opini&oacute;n\");' onMouseOut='showNote(\"ToolBarNote_"+boxPosition+"\",\"\")'><img src='/spain/images/shared/icon_feedback.gif' style='margin-left:"+buttonMargin+"px' border='0' alt='Votar esta página'></a>");
 buttonMargin=6; 

  }
 document.write("</div>");
// document.write("</div>");
 document.write("</div>");
}
/* handle print click */
function openPrintPopup() {
    printPopup=window.open('/spain/content/es/print_version.htm','trgpopup','width=635,height=600,scrollbars=yes,resizable=no'); printPopup.focus();
}
/* handle >send a friend< klick */
function doSendAFriend() {
uriAnnex=encodeURIComponent(document.title);
    loadToolBoxIFrame("https://secure.deutsche-bank.de/pbc/seiteweiterempfehlen/index.jsp?lang=es&decorator="+decoratorValue+"&url="+encodeURIComponent(window.location.href)+"&description="+uriAnnex,"ToolBoxJS","736","490");
//    loadToolBoxIFrame("https://secure.deutsche-bank.de/pbc/seiteweiterempfehlen/index.jsp"+window.location.href+uriAnnex,"ToolBoxJS","736","490");
}
/* handle >feedback< klick */
function doFeedback() {
    loadToolBoxIFrame("https://secure.deutsche-bank.de/feedbackmanager/?id=89&lang=es&decorator="+decoratorValue+"&","ToolBoxJS","736","700");
//    loadToolBoxIFrame("https://secure.deutsche-bank.de/feedbackmanager/","ToolBoxJS","736","700");
}
/* handle >bookmark< klick */
function doBookmark() {
    ap=navigator.appName;
    url=location.href;
    t=document.getElementById("pageTitle").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("Su navegador no permite esta funcionalidad\nPor favor, a&ntilde;ada la p&aacute;gina web a Favoritos de forma manual");
    }
}
function loadToolBoxIFrame(boxSrc,boxID,boxWidth,boxHeight) {
   document.getElementById("closeButton").style.display="none";
   document.getElementById("primer"+boxID).style.width="0px";
   document.getElementById("primer"+boxID).style.height="0px";
   document.getElementById("toolBoxIFrame"+boxID).style.width="0px";
   document.getElementById("toolBoxIFrame"+boxID).style.height="0px";
   document.getElementById("toolBoxIFrame"+boxID).src=boxSrc;
   document.getElementById("toolBoxIFrame"+boxID).style.width=boxWidth+"px";
   document.getElementById("toolBoxIFrame"+boxID).style.height=boxHeight+"px";
   document.getElementById("primer"+boxID).style.width=boxWidth+"px";
   document.getElementById("primer"+boxID).style.height=boxHeight+"px";
   window.scrollTo(100, 100);
   pageActiveSwitch('ON',boxID,'others');
}