﻿



// 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);
}


function showNote(posId,msg) {
    toolDisplayObj = document.getElementById(posId);
    if (toolDisplayObj) {
     toolDisplayObj.innerHTML = msg;
    } 
}
  
function clearInput(obj) {
    obj.value="";
    obj.onclick="";
}

function openPopup(anch) {

    ppup=window.open(anch.href,anch.target,"width=612, height=612, resizable=yes, scrollbars=yes"); ppup.focus();
    ppup.focus();


}

function openLightbox(anch) {

    loadToolBoxIFrame(anch.href,612,612,"off");


}

function lightboxx(objID,mode,obj) {
    if(!document.getElementById("lightbox")) {
        lightboxOuter=document.createElement("span");
        lightboxOuter.id="lightboxOuter";
        lightbox=document.createElement("a");
        lightbox.href= "javascript:lightboxx('"+objID+"','self')";
        lightbox.title="close window";
        lightbox.className="lightbox";
        lightbox.id="lightbox";
        resizeLightBox();
        window.onresize= function() {
            resizeLightBox();
        };
        for(i=0; i<document.getElementsByTagName("select").length; i++) {
            document.getElementsByTagName("select")[i].style.visibility="hidden";
        }
        if (obj) {
            document.body.insertBefore(obj,document.body.firstChild);
        }
        document.body.insertBefore(lightboxOuter,document.body.firstChild);
        lightboxOuter.appendChild(lightbox);
    } else {
        window.onresize= "";
        for(i=0; i<document.getElementsByTagName("select").length; i++) {
            document.getElementsByTagName("select")[i].style.visibility="visible";
        }
        document.body.removeChild(document.getElementById('lightboxOuter'));
        if (mode=="self" && flashVars[objID]) { // ONLY FOR MOVIE PLAYER
            closeMovie(objID,"internal");
        } else if (obj) {
            document.body.removeChild(obj);
        } else if (mode=="self" && document.getElementById(objID)) {
            document.body.removeChild(document.getElementById(objID));
        }
    }
}
function resizeLightBox() {
    lightbox.style.height="0px";
    if (document.documentElement.scrollHeight>document.body.scrollHeight) {
        lightbox.style.height=document.documentElement.scrollHeight+"px"
    } else {
        lightbox.style.height=(document.body.scrollHeight)+"px";
    }
}

try {if(flashVars){}}catch (e){flashVars= new Array();}

flashBuilderSRC="/careers/data/js/en/flashbuilder.js"

generateFlashScript = function() {
    if (!document.getElementById("generatedFlashScript")) {
        var generatedFlashScript=document.createElement('script');
        generatedFlashScript.src="/careers/data/js/en/flashbuilder.js";
        generatedFlashScript.id="generatedFlashScript";
        generatedFlashScript.type="text/javascript";
        document.getElementsByTagName('head')[0].appendChild(generatedFlashScript);
    }
};

// the following function will strip the local project domain from published external navigation urls if they match (=relative urls)
// function will only work if Js_new references to ASP Include 
stripLocalDomainFromExternalURL = function(URLToCheck) {
  var localDomain1="";
  var localDomain2="";
  previewOrPublish="";
  rgxp= new RegExp(localDomain1);
  if (previewOrPublish=="publish"  && localDomain1!="" && URLToCheck.search(rgxp)==0) { // published and url to check starts with localdomain 1
      URLToCheck=URLToCheck.replace(rgxp,"")
  }
  rgxp= new RegExp(localDomain2);
  if (previewOrPublish=="publish"  && localDomain2!="" && URLToCheck.search(rgxp)==0) { // published and url to check starts with localdomain 1
      URLToCheck=URLToCheck.replace(rgxp,"")
  }
  return URLToCheck;
}


function buildToolBox() {}
function buildFontSizeButtons() {}


//right column box display toggling
lastBoxToggleState = new Object();
toggleBox = function(id,defaultState) {
    var thisBox=document.getElementById("box"+id);
    var cookieName="toggleBox_"+id+"__"
// Check if a cookie has been set already for the display mode
    if (lastBoxToggleState[id]) {
        var toggleState =  lastBoxToggleState[id];
    }  
    else if (readCookie(cookieName)) {
        var toggleState =  readCookie(cookieName);
    } else {
        var toggleState =  defaultState;
    };   
// create object with values 
    var values = {
        ON: {
            reverseValue:"OFF",
            title:"hide box content"
        },
        OFF: {
            reverseValue:"ON",
            title:"show box content"
        }
    };
// check if the anchor for toggling exists, if not, add to DOM
    if (!document.getElementById("box"+id+"toggle")) {
        thisBox.className=thisBox.className+" snippetDisplay"+toggleState;
        var toggleSwitch=document.createElement("A");
        toggleSwitch.id="box"+id+"toggle";
        toggleSwitch.onclick = function() {
            toggleBox(id); 
        };
        toggleSwitch.href="javascript:void(0)";
        toggleSwitch.className="snippetDisplayToggle";
        thisBox.appendChild(toggleSwitch);
        var toggleValue= toggleState;
    } else {
        replaceClass = new RegExp("snippetDisplay"+toggleState);
        thisBox.className=thisBox.className.replace(replaceClass,"snippetDisplay"+values[toggleState].reverseValue);
        createCookie(cookieName,values[toggleState].reverseValue,1000)
        var toggleValue= values[toggleState].reverseValue;
    }
    lastBoxToggleState[id]= toggleValue;
    document.getElementById("box"+id+"toggle").title=values[toggleValue].title;
};


/**
 * **********************************************************************
 * **********************************************************************
 * HR Preferences: Select
 *
 * @author stefan kloiber, zeros+ones
 * @date 2009-07
 *
 * @version 0.0.1
 *
 *
 * @tested Firefox 3, IE6-7-8, WebKit
 * **********************************************************************
 * **********************************************************************
 */
/* define namespace */

function addEvt(obj,handler,func) {
        try { obj.attachEvent("on"+handler, func); }
        catch(err) {obj.addEventListener(handler, func, false); }
}

var layerOpen =0;
var zo; // declares a global symbol
if (!zo) zo = {};
    else if (typeof zo != 'object')
        throw new Error('zo exists, but is not an object!');
zo.selPref = 
{
    init: function() {
        var prefBox = jQuery('<div></div>')
                .attr('id', 'prefBox')
                .addClass('font2')
                .insertAfter('div#level1Navi'),
            xmlFilePath = "/careers/content/en/tgc.xml",
            catNode = "cat";
        this.cookieName = "tGCpref";
        this.data.setXML(xmlFilePath, catNode);

        /*** handling privieges Setting, given by URL ***/
        searchPattern = /[\?&]privileges=[\w,]*/;
        var priv = location.search.match(searchPattern);
        if (priv != null) {
            var toCookie = priv[0].replace(/[\?&]privileges=/,"");
            //alert(toCookie);
            zo.selPref.setCookie(zo.selPref.cookieName,toCookie);
            newLocation= location.href.replace(searchPattern,"");
            //alert(newLocation);
            location.replace(newLocation);
        }


    },
    data: {
        // xml fragments
        setXML: function(file, catNode) {
            jQuery.ajax({
                async:false,
                url:file,
                dataType:'html',
                success: function(xml) {
                    var vXML = xml.substring(xml.indexOf('?>')+2,xml.length),
                        pXML;
                    try {
                        pXML = (new DOMParser).parseFromString(vXML, "text/xml");
                    }
                    catch(e) {
                        try {
                            pXML = new ActiveXObject('Microsoft.XMLDOM');
                            pXML.async = false;
                            pXML.loadXML(vXML);
                        } catch(e) {}
                    }
                    zo.selPref.crtPrefBox(jQuery(catNode, pXML), catNode);
                },
                error: function(xhr, txtStatus, errThrown) {}
            });
        }
    },
    crtPrefBox: function(xml, catNode) {
        var prefBox = jQuery('div#prefBox'),
            prefBoxContent = "",
            cookieVal,
            cSelVal
        ;
        if (cookieVal = this.getCookie(this.cookieName)) {
            cSelVal = cookieVal.split(',');
            jQuery.each(cSelVal, function(i) {
                prefBoxContent += (prefBoxContent === "" ? "" : ", ");
                jQuery('elementid', xml).each(function() {
                    if (jQuery(this).find('id').text() === cSelVal[i]) {
                        prefBoxContent += jQuery(this).find('name').text();
                    }
                });
            });
        } else {
            prefBoxContent = "---";
        }
        prefBox
            .html('Your preferences:')
            .append(jQuery('<span></span>')
                .addClass('prefBoxContent')
                .html(prefBoxContent)
            )
            .append(jQuery('<span></span>')
                .addClass('prefBoxChange')
                .attr('id', 'prefBoxChange')
                .html('Change your preferences')
                .hover(
                    function() {
                        jQuery(this).css('text-decoration', 'underline');
                    },
                    function() {
                        jQuery(this).css('text-decoration', 'none');
                    }
                )
                .bind('click', function(ev) {
                    if (cookieVal = zo.selPref.getCookie(zo.selPref.cookieName)) {
                        cSelVal = cookieVal.split(',');
                    }
                    var content = zo.selPref.crtSel(xml, catNode, cSelVal);
                    if (layerOpen == 0) { zo.selPref.openLightBox(content); layerOpen = 1;}
                })
            )
        ;
    },


    crtSel: function(xml, catNode, cSelVal) {
        var prefForm = jQuery('<form></form>')
                .attr('id', 'selPrefForm')
                .append('<div></div>'),
            cookieVal = this.getCookie(this.cookieName),
            labelGroup = "Who are you?",
            labelCountry = "Which country are you looking for opportunities in?"
        ;
        xml.each(function(i) {
            var node = jQuery(this),
                items = node.children(),
                selBox = jQuery('<select></select>')
                    .attr('id', node.attr('name').replace(/\s/g, ''))
            ;
            if (node.attr('name') === "Target Groups") {
                // countries filtered by target group options
                selBox.bind('change', function(ev) {
                    var priv = jQuery(this).val();
                    jQuery(jQuery('form#selPrefForm select')[1]).children().remove();

                    xml.filter('[name=Countries]').children().each(function(key, value) {
                        if (jQuery(this).find('privileges').text().indexOf(priv) > -1) {
                            jQuery(jQuery('form#selPrefForm select')[1])
                                .append(jQuery('<option></option>')
                                    .val(jQuery(this).find('id').text())
                                    .html(jQuery(this).find('name').text())
                                )
                            ;
                        }
                    });
                });
            }

            if (node.attr('name') === "Countries") {
                if (cookieVal) {
                    var priv = cSelVal[0];
                    items.each(function() {
                        if (jQuery(this).find('privileges').text().indexOf(priv) > -1) {
                            selBox
                                .append(jQuery('<option></option>')
                                    .val(jQuery(this).find('id').text())
                                    .html(jQuery(this).find('name').text())
                                )
                            ;
                        }
                    });
                }
                else {
                    var priv = jQuery(prefForm.find('select')[0]).val();
                    items.each(function() {
                        if (jQuery(this).find('privileges').text().indexOf(priv) > -1) {
                            selBox
                                .append(jQuery('<option></option>')
                                    .val(jQuery(this).find('id').text())
                                    .html(jQuery(this).find('name').text())
                                )
                            ;
                        }
                    });


                }
            }
            else {
                items.each(function() {
                    selBox
                        .append(jQuery('<option></option>')
                            .val(jQuery(this).find('id').text())
                            .html(jQuery(this).find('name').text())
                        )
                    ;
                });
            }

            prefForm
                .find('div')
                .append(jQuery('<label></label>')
                    .attr('id', node.attr('name').replace(/\s/g, ''))
                    .html(i === 0 ? labelGroup : labelCountry)
                )
                .append(selBox)
            ;
        });

        prefForm
            .find('div')
            .append(jQuery('<input />')
                .attr({
                    type: 'submit',
                    value: 'Enter'
                })
                .css({'border':'1px solid #fff'})
                .bind('click', function(ev) {
                    ev.preventDefault();
                    var prefs = "",
                        prefsText = ""
                    ;
                    prefForm
                        .find('select option:selected')
                        .each(function() {
                            prefs += (prefs === "" ? "" : ",") +jQuery(this).val();
                            prefsText += (prefsText === "" ? "" : ", ") +jQuery(this).html();
                        })
                    ;
                    zo.selPref.setCookie(zo.selPref.cookieName, prefs);
                    jQuery('div#prefBox span.prefBoxContent').html(prefsText);

                    //remove white layer
                    jQuery('div#whitelayer').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#whitelayer').remove(); },500);
                    //remove zoLightBox
                    jQuery('div#zoLightBox').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#zoLightBox').remove(); },500);
                    //show select boxes                  
                    jQuery('div#contentArea select')
                         .css({'visibility':'visible'})
                     ;
                    jQuery(document).unbind('keydown');
                    layerOpen = 0;
                    location.reload();

                })
            )
        ;
        if (cSelVal) {
            jQuery.each(cSelVal, function() {
                prefForm.find('option[value=' +this+ ']').attr('selected', 'selected');
            });
        }
        return prefForm;
    },
    /**
     * create the lightbox
     *
     * @attribute   (Object)     content     lightbox content
     */
    openLightBox: function(content) {

        //create white layer 
        if ((typeof isHomePage) == 'undefined') {
     
                    var dh = $(document).height();
                    var wh = $(window).height();
                    var layerHeight = dh > wh ? dh : wh
                   
                    jQuery('<div></div>')
                        .attr('id', 'whitelayer')
                        .css({'position':'absolute',
                              'display':'block',
                              'top': (jQuery('div#prefBox').offset().top + 34) +'px',
                              'left':'0px',
                              'background-color': '#fff',
                              'filter': 'alpha(opacity=60)',
                              'opacity': '0.60',
                              'z-index': '90',
                              'width': $('body').width()+'px',
                              'height' : (layerHeight - (jQuery('div#prefBox').offset().top + 34))+'px'
                              })                
                        .appendTo('body')                   
                    ;
         }

        //remove all select items for the great IE6, i love it *kissing* , the best browser ever!
        jQuery('div#contentArea select')
             .css({'visibility':'hidden'})
        ;

        // create the lightbox and append the content
        jQuery('<div></div>')
            .attr('id', 'zoLightBox')
            .addClass('zoLightBoxContainer')
            .css({
                'position': 'absolute',
                'top': (jQuery('div#prefBox').offset().top + 34) +'px',
                //'left': (jQuery('div#prefBox span.prefBoxChange').offset().left + jQuery('div#prefBox span.prefBoxChange').width() - 455) +'px',
                'left': '492px',
                'z-index': '91',
                'opacity': 0.0
            })
            .append(jQuery('<div></div>')
                .addClass('zoLightBoxTitleBar')
                .append(jQuery('<h1></h1>').html('Change your preferences:'))
             )
            //.append(content)
            .animate({opacity:1.0}, 500)
            .appendTo(jQuery('body'))
        ;
        // ESC: escape key pressed quits the lightbox
        jQuery(document)
            .bind('keydown', function(ev) {
                if (ev.keyCode === 27) {
                    jQuery('div#whitelayer').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#whitelayer').remove(); },500);
                    jQuery('div#zoLightBox').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#zoLightBox').remove(); },500);
                    //show select boxes                  
                    jQuery('div#contentArea select')
                         .css({'visibility':'visible'})
                     ;
                    layerOpen = 0;
                    jQuery(this).unbind('keydown');
                }
            })
        ;
        // create the cancel button and append it to the titlebar of the lightbox
//                 .html('Close layer')

        jQuery('<div></div>')
            .addClass('zoLightBoxCancelButton')
            .append(jQuery('<a></a>')
                .attr({
                    href: '#close',
                    title: 'Close layer'
                })
                .html('<img src="/careers/img/icon_close.gif">')
                .bind('click', function(ev) {
                    ev.preventDefault();
                    jQuery('div#whitelayer').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#whitelayer').remove(); },500);
                    jQuery('div#zoLightBox').animate({opacity:0.0},400);
                    setTimeout(function() { jQuery('div#zoLightBox').remove(); },500);
                    //show select boxes                  
                    jQuery('div#contentArea select')
                         .css({'visibility':'visible'})
                     ;
                    layerOpen = 0;
                    jQuery(document).unbind('keydown');
                })
            )
            .appendTo(jQuery('div#zoLightBox div.zoLightBoxTitleBar'))
        ;

        jQuery('<span></span>')
            .attr('id', 'zoLightBoxTitleText')
            .html('<P>Before you start exploring the Deutsche Bank careers website,<BR>please answer the following questions</P>')
            .css({'clear':'both'})                
            .appendTo(jQuery('div#zoLightBox div.zoLightBoxTitleBar'))
        ;

        jQuery('<div></div>')
            .attr('id', 'zoLightBoxCnt')
            .css({'margin':'16px 0px 0px 0px'})
                 .append(jQuery('<div></div>')
                    .attr('id', 'zoLightBoxCntLeft')
                    .append(content)
                 )
                 .append(jQuery('<div></div>')
                    .attr('id', 'zoLightBoxCntRight')
                    .html('<P>You can change either of these two preferences at any time during your visit to the site.<BR><BR>Access to this feature is located under the main navigation bar.</P>')
                 )
           .appendTo(jQuery('div#zoLightBox'))
        ;

    },

    forceLayer: function() {
          if (allowedPrivilegesTargetGroup == "" || allowedPrivilegesCountry == "" || zo.selPref.getCookie(zo.selPref.cookieName).indexOf(',')==-1) {
              //no cookie
                 if ( (typeof isHomePage) != 'undefined' || filterExists == 1) {
                    jQuery('span#prefBoxChange').trigger('click');
                 }
          }
        /* FS 2009-10-02 language link START */
        

        if (!(cookieVal = zo.selPref.getCookie(zo.selPref.cookieName))) cookieVal = "";        
        targetGroupCookie = "";

        if (cookieVal.length>0) {
            cSelVal = cookieVal.split(',');
            if (cSelVal[0].substr(0,1) == "t") targetGroupCookie = cSelVal[0];
        }  


        meta_obj = document.getElementById("list_meta1");
        
        for (var i=0; i<meta_obj.childNodes.length; i++) {
            if (meta_obj.childNodes[i].firstChild)


                if (meta_obj.childNodes[i].firstChild.innerHTML=="English") {
                    if (targetGroupCookie == "t_schoolleavers") targetGroupCookie = "";  
                    addEvt(meta_obj.childNodes[i].firstChild,"click", function() { zo.selPref.setCookie(zo.selPref.cookieName, targetGroupCookie+',c_unitedstates');});
                }
                if (meta_obj.childNodes[i].firstChild.innerHTML=="Deutsch") {
                    if (targetGroupCookie == "t_mbas") targetGroupCookie = "";  
                    addEvt(meta_obj.childNodes[i].firstChild,"click", function() { zo.selPref.setCookie(zo.selPref.cookieName, targetGroupCookie+',c_germany');});
                }
        }
        
        /* FS 2009-10-02 language link END */

    },
    /**
     * cookie accessors
     * @attribute   (String)     name       cookie name
     * @attribute   (String)     value      cookie value
     */
    cookieName: "tGCpref",
    setCookie: function(name, value) {
        jQuery.cookie(name, value, {expires: 30, path: '/'}); 
    },
    getCookie: function(name) {
         return jQuery.cookie(name);
    }
};
 
/* *///
var allowedPrivilegesTargetGroup = "",
    allowedPrivilegesCountry = "",
    cookieValue,
    cookieSelVal,
    filterExists = 0
    removeParentClass = 0
;

// cookie accessor and cookie name from priviliges bar js
if (cookieValue = zo.selPref.getCookie(zo.selPref.cookieName)) {
    cookieSelVal = cookieValue.split(',');
    allowedPrivilegesTargetGroup = cookieSelVal[0];
    allowedPrivilegesCountry = cookieSelVal[1];
}



function getFilterMethod(p) {
 //mögliche Filter:
 //0 keine rechte gesetzt, nichts wird gefiltert
 //1  nur eine berechtigung gesetzt, filtere nach einem kriterium
 //2 country und targetgroup gesetzt, filtere nach beiden kriterien
 var f;
 if (my_privileges == "undefined" || my_privileges == "") {f=0;}
      else if (my_privileges.indexOf("c_") != -1 && my_privileges.indexOf("t_") != -1) {f=2;}
           else {f=1;}
 return f;
}



function returnParsedNavigation_albi(obj) {
    for (var i=0; i<obj.childNodes.length; i++) {
        try { /* alert(obj.childNodes[i].getAttribute("privileges")); */ } catch (e) {}
        returnParsedNavigation(obj.childNodes[i]);
    }
}


function returnParsedNavigation(obj) {

    for (var i=0; i<obj.childNodes.length; i++) {
        my_privileges = "";
        //my_privileges = String(obj.childNodes[i].privileges);
        try { my_privileges = obj.childNodes[i].getAttribute("privileges"); } catch (e) {}


         if (my_privileges != "undefined" && my_privileges != "" && my_privileges != null) {
                filterExists = 1;
                 
                 var filter = getFilterMethod(my_privileges);

                  switch (filter) {
                     case 1:
                                 if (my_privileges.indexOf(allowedPrivilegesTargetGroup)!=-1 || my_privileges.indexOf(allowedPrivilegesCountry)!=-1) {
                                        //keep elemet and check child notes
                                        if (obj.childNodes[i].childNodes.length>0) returnParsedNavigation(obj.childNodes[i]);
                                 } else {
                                         //remove element
                                         removeParentClass = 1;
                                         obj.removeChild(obj.childNodes[i]);
                                         i=i-1;
                                         }
                                
                                 break;

                     case 2:
                               if (my_privileges.indexOf(allowedPrivilegesTargetGroup) ==-1 || my_privileges.indexOf(allowedPrivilegesCountry) ==-1) {          
                                        //remove element
                                         removeParentClass = 1;
                                         obj.removeChild(obj.childNodes[i]);                                          
                                         i=i-1; 
                               }  else {
                                         //keep element and check child notes
                                         obj.removeAttribute("privileges");
                                         if (obj.childNodes[i].childNodes.length>0) returnParsedNavigation(obj.childNodes[i]);
                                       }   
                              break;

                     default:
                              // no filter required,just and check childnodes
                              obj.removeAttribute("privileges");
                              if (obj.childNodes[i].childNodes.length>0) returnParsedNavigation(obj.childNodes[i]);
                             
                              break;
                 }



        } else {
                  //check child nodes
                  if (obj.childNodes[i].childNodes.length>0) returnParsedNavigation(obj.childNodes[i]); 
               }

    } //end loop

}


function returnParsedContent(obj) {

        my_privileges = "";

        //my_privileges = obj.privileges;
        try { my_privileges = obj.getAttribute("privileges"); } catch (e) {}
        var filter = getFilterMethod(my_privileges);

        filterExists = 1;

        switch (filter) {
           case 1:
                       if (my_privileges.indexOf(allowedPrivilegesTargetGroup)!=-1 || my_privileges.indexOf(allowedPrivilegesCountry)!=-1) {
                                //keep element
                                obj.removeAttribute("privileges");
                                return true;
                       } else {obj.parentNode.removeChild(obj);}                            
                  
                       break;

           case 2:
                      if (my_privileges.indexOf(allowedPrivilegesTargetGroup) ==-1 || my_privileges.indexOf(allowedPrivilegesCountry) ==-1) {          
                               //remove element  
                               obj.parentNode.removeChild(obj);
                      } else {obj.removeAttribute("privileges");}                                
                      break;

           default:
                       // no filter required, just remove html attribute
                       obj.removeAttribute("privileges");
                       break;
      }

}


function removeCssClass(obj,CSSclassName) {
if (removeParentClass==0) return;

     for (var i=0; i<obj.childNodes.length; i++) {
 
            if (obj.childNodes[i].className != 'undefined' && obj.childNodes[i].className != null) {
                        if(obj.childNodes[i].className.indexOf(CSSclassName) != -1) {                     
                             obj.childNodes[i].className = obj.childNodes[i].className.split(CSSclassName).join('');
                             //alert(obj.childNodes[i].className);
                        }
             }
             if (obj.childNodes[i].childNodes.length>0) removeCssClass(obj.childNodes[i],CSSclassName);

    } //end loop

}


function highlightCalenderTable(obj) {

      for (var i=0; i<obj.childNodes.length; i++) {
 
            if (obj.childNodes[i].className != 'undefined' && obj.childNodes[i].className != null) {

                        if(obj.childNodes[i].className.indexOf('eventCalendarRow') != -1) {                     
                             countEventRows++;
                             if (countEventRows%2 == 0) {obj.childNodes[i].style.backgroundColor = "#f0f0f0" } else {obj.childNodes[i].style.backgroundColor = "#ffffff";}
                             //obj.childNodes[i].style.backgroundColor = (countEventRows%2 == 0) ? "#f0f0f0" : "ffffff" ;
                        }

             }
             if (obj.childNodes[i].childNodes.length>0) highlightCalenderTable(obj.childNodes[i]);
     } //end loop
  
}


function clearBreadCrumbNav() {
/*
var breadcrumb = document.getElementById("breadcrumbNavi");
var ul = breadcrumb.firstChild.nextSibling;



   if (ul.firstChild == null) {
        breadcrumb.removeChild(breadcrumb.firstChild);

   }
*/
}




////
printPageURL="/careers/data/css/en/673.htm";

swfToggleCookieName="swfToggle__"
optEnableSwfDisplayToggle="false"
if (readCookie(swfToggleCookieName)) {
    parent.swfToggleState=readCookie(swfToggleCookieName)
} else {
    parent.swfToggleState=optEnableSwfDisplayToggle
}
var swfToggleValues = {
   swfToggleOFF: {
     reverseValue:"swfToggleON"
   },
   swfToggleON: {
     reverseValue:"swfToggleOFF"
   }
}
toggleSwfAbility= function(val) {
    createCookie(swfToggleCookieName,val,1000);
    location.reload();
}

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="Print this page";
        toolBarPrint.className="toolBarPrint";
        toolBarPrint.onclick=function(e) {
            printPopup=window.open('/careers/data/css/en/673.htm','trgpopup','width=620,height=600,scrollbars=yes,resizable=no'); printPopup.focus();
        };
        toolBarPrint.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Print");
        };
        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="Recommend this page";
        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=en&decorator=dbag&url="+window.location.href+"&description="+uriAnnex,"736","490");
        };
        toolBarSendafriend.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"E-mail");
        };
        toolBarSendafriend.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarSendafriend);
    }
    if ("ON"!="OFF" && bookmarkOpt!="OFF") {
        toolBarBookmark=document.createElement("a");
        toolBarBookmark.title="Add bookmark";
        toolBarBookmark.style.marginLeft=buttonMargin+"px";
        toolBarBookmark.className="toolBarBookmark";
        toolBarBookmark.onclick=function(e) {
            setBookmark();
        };
        toolBarBookmark.onmouseover=function(e) {
            showNote("ToolBarNote_"+boxPosition,"Bookmark");
        };
        toolBarBookmark.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarBookmark);
    }

    if ("ON"!="OFF" && feedbackOpt!="OFF" && "/careers/data/php/en/feedback_mailer.php"!="") {
        toolBarFeedback=document.createElement("a");
        toolBarFeedback.title="Vote this page";
        toolBarFeedback.style.marginLeft=buttonMargin+"px";
        toolBarFeedback.className="toolBarFeedback";
        toolBarFeedback.onclick=function(e) {
            loadToolBoxIFrame("/careers/data/php/en/feedback_mailer.php?lang=en&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,closeIconMode) {
    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="close window";
    toolBoxIFrame=document.createElement("iframe");
    toolBoxIFrame.className="toolBoxIFrame";
    toolBoxIFrame.id="toolBoxIFrame";
    toolBoxIFrame.setAttribute("scrolling","No");
    toolBoxIFrame.setAttribute("frameBorder","0");
    toolBoxIFrame.style.width=boxWidth+"px";
    toolBoxIFrame.style.height=boxHeight+"px";
    lightboxx('toolBoxParent','insert',toolBoxParent);
    toolBoxParent.appendChild(toolBox);
    if(closeIconMode!="off") {
        toolBox.appendChild(toolBoxClose);
        myfunction= function(e) {document.getElementById("closeButton").style.display="inline";}
        toolBoxIFrame.attachEvent ? toolBoxIFrame.attachEvent("onload", myfunction) : toolBoxIFrame.onload = myfunction;
    }
//    toolBox.appendChild(toolBoxClose);
    toolBox.appendChild(toolBoxIFrame);
    document.getElementById(toolBoxIFrame.id).src=boxSrc;
    window.scrollTo(100, 100);
}
function resizeToolBoxIFrame(boxWidth,boxHeight) {
    toolBoxIFrame.style.width=boxWidth+"px";
    toolBoxIFrame.style.height=boxHeight+"px";
}


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','Text size')");
    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','Text size')");
    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','Text size')");
    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','Contrast')");
    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']= "/careers/data/css/en/677.css";
cssHref['medium']= "/careers/data/css/en/676.css";
cssHref['large']= "/careers/data/css/en/675.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 = "/careers/data/css/en/674.css";
    contrastCSS.id = "contrastCSS";
    document.getElementsByTagName('head')[0].appendChild(contrastCSS);
    createCookie('contrastToggle','ON','2160');
  }
}
if (readCookie('contrastToggle') && activateFontResizing=="ON") {
    toggleContrast();    
}
 
function initPage() {
}