﻿



// 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,opt) {

    opt ? myOpt= opt : myOpt = 'width=612, height=612, resizable=yes, scrollbars=yes';
    ppup=window.open(anch.href,anch.target,myOpt); ppup.focus();
    ppup.focus();


}

function openLightbox(anch,opt) {

    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) {
            jQuery("#layoutPositioner")
                .prepend(obj)
//            document.body.insertBefore(obj,document.body.firstChild);
        }
        jQuery("#layoutPositioner")
            .prepend(lightboxOuter)
//        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";
        }
        jQuery("#lightbox").remove();        
//        document.body.removeChild(document.getElementById('lightboxOuter'));
        if (mode=="self" && flashVars[objID]) { // ONLY FOR MOVIE PLAYER
            closeMovie(objID,"internal");
        } else if (obj) {
            jQuery(obj).remove();        
//            document.body.removeChild(obj);
        } else if (mode=="self" && document.getElementById(objID)) {
            jQuery("#"+objID).remove();        
//            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/de/flashbuilder.js"

generateFlashScript = function() {
    if (!document.getElementById("generatedFlashScript")) {
        var generatedFlashScript=document.createElement('script');
        generatedFlashScript.src="/careers/data/js/de/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')
                .appendTo('div#breadcrumbNavi'),                
            xmlFilePath = "/careers/content/de/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('Ihre Pr&auml;ferenzen:')
            .append(jQuery('<span></span>')
                .addClass('prefBoxContent')
                .html(prefBoxContent)
            )
            .append(jQuery('<span></span>')
                .addClass('prefBoxChange')
                .attr('id', 'prefBoxChange')
                .html('&Auml;ndern Sie Ihre Pr&auml;ferenzen:')
                .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 = "Wie ist Ihr Karrierestatus?",
            labelCountry = "In welchem Land m&ouml;chten Sie arbeiten?"
        ;
        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 = jQuery(document).height();
                    var wh = jQuery(window).height();
                    var layerHeight = dh > wh ? dh : wh
                   
                    jQuery('<div></div>')
                        .attr('id', 'whitelayer')
                        .css({'position':'absolute',
                              'display':'block',
                              'top':'0px',
                              'left':'0px',
                              'background-color': '#fff',
                              'filter': 'alpha(opacity=60)',
                              'opacity': '0.60',
                              'z-index': '90',
                              'width': '994px',
                              'height':(jQuery('div#layoutComplete').outerHeight()-40)+'px'
                              })                                
                       .appendTo('div#layoutPositioner')                   
                    ;
         }

        //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 + 37) +'px',
                //'left': (jQuery('div#prefBox span.prefBoxChange').offset().left + jQuery('div#prefBox span.prefBoxChange').width() - 455) +'px',
                //'left': '492px',
                'right': '0px',
                'z-index': '92',
                'opacity': 0.0
            })
            .append(jQuery('<div></div>')
                .addClass('zoLightBoxTitleBar')
                .append(jQuery('<h1></h1>').html('&Auml;ndern Sie Ihre Pr&auml;ferenzen:'))
             )
            //.append(content)
            .animate({opacity:1.0}, 500)
            .appendTo(jQuery('div#layoutPositioner'))
        ;
        // 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('Um Ihnen die f&uuml;r Sie relevanten Informationen anzeigen zu k&ouml;nnen, beantworten Sie bitte die folgenden zwei Fragen.')
            .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>Sie k&ouml;nnen Ihre Pr&auml;ferenzen w&auml;hrend Ihres Besuchs jederzeit &auml;ndern.<BR><BR>Diese Funktion finden Sie unterhalb der Hauptnavigationsleiste.</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
    clearLeftNav = 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(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
                                         clearLeftNav = 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
                                         clearLeftNav = 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 (clearLeftNav==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 cleanLeftNavi() {

   if (clearLeftNav==0) {return;} else {
        jQuery('div#parseLeftNavigation ul:first li:first').addClass('first');
   }

}


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() {

//Pages that are not in the usual breadrumb Navigation, can remove the "you are here" text.
     try {
        var breadcrumb = document.getElementById("brdInner");
        var ul = breadcrumb.firstChild.nextSibling;

        if (ul.firstChild == null) {
               breadcrumb.innerHTML = '&nbsp';
        }

     } catch (e) {}


}




////
printPageURL="/careers/data/css/de/printPopup.html";
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();
}
if (readCookie('resize_fontsize')) {
    fontToggleState = readCookie('resize_fontsize')
} else {
    fontToggleState = "small"
}
var fontToggleValues = {
    small: {
        reverseValue: "medium"
    },
    medium: {
        reverseValue: "small"
    }
}
zo.getRightPos = function(obj) {
    var rightPos = (jQuery(obj).parent().offset().left+jQuery(obj).parent().width())-(jQuery(obj).offset().left+jQuery(obj).width());
    return rightPos;
}




function buildToolBox(boxPosition,printOpt,sendafriendOpt,bookmarkOpt,feedbackOpt,swfToggleOpt,trckPrefix) {
 var toolBarOuter = {};
 if("ON"=="ON") {
    clearToolbarNote =function(e) {
        showNote("ToolBarNote_"+boxPosition,"")
    };
    toolBarOuter=document.createElement("div");
    toolBarOuter.id="ToolBar_"+boxPosition;
    toolBarOuter.className="toolBarOuter";
    
        
    
    toolBarNote=document.createElement("span");
    toolBarNote.id="ToolBarNote_"+boxPosition;
    toolBarNote.className="ToolBarNote";
    toolBarNote.innerHTML="&nbsp;";
    toolBarInner=document.createElement("div");
    toolBarInner.className="toolBarInner";
    toolBarOuter.appendChild(toolBarNote);
    toolBarOuter.appendChild(toolBarInner);
    buttonMargin=6;
    if ("ON"!="OFF" && printOpt!="OFF") {
        toolBarPrint=document.createElement("a");
        toolBarPrint.title="Print this page";
        toolBarPrint.className="toolBarPrint";
        toolBarPrint.href="#print";
        toolBarPrint.onclick=function(e) {
            printPopup=window.open('/careers/data/css/de/printPopup.html','trgpopup','width=620,height=600,scrollbars=yes,resizable=no'); printPopup.focus();
        };
        toolBarPrint.onmouseover=function(e) {
            jQuery("#ToolBarNote_"+boxPosition).css({right:zo.getRightPos(this)+"px"});
            showNote("ToolBarNote_"+boxPosition,"Print");
        };
        toolBarPrint.onmouseout=clearToolbarNote;
        toolBarInner.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.href="#sendafriend";
        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,"540","490");
        };
        toolBarSendafriend.onmouseover=function(e) {
            jQuery("#ToolBarNote_"+boxPosition).css({right:zo.getRightPos(this)+"px"});
            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.href="#bookmark";
        toolBarBookmark.onclick=function(e) {
            setBookmark();
        };
        toolBarBookmark.onmouseover=function(e) {
            jQuery("#ToolBarNote_"+boxPosition).css({right:zo.getRightPos(this)+"px"});
            showNote("ToolBarNote_"+boxPosition,"Bookmark");
        };
        toolBarBookmark.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarBookmark);
    }

    if ("ON"!="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.href="#feedback";
        toolBarFeedback.onclick=function(e) {
            loadToolBoxIFrame("https://secure.deutsche-bank.de/feedbackmanager/?id=77&lang=de&decorator=dbag&","540","700");
        };
        toolBarFeedback.onmouseover=function(e) {
            jQuery("#ToolBarNote_"+boxPosition).css({right:zo.getRightPos(this)+"px"});
            showNote("ToolBarNote_"+boxPosition,"Feedback");
        };
        toolBarFeedback.onmouseout=clearToolbarNote;
        buttonMargin=6;
        toolBarInner.appendChild(toolBarFeedback);
        //var socialMediaButton = buildSocialMediaButton();
        //toolBarInner.appendChild(socialMediaButton);
        //jQuery('div.toolBarInner').append(socialMediaButton);
    }









  }
  return toolBarOuter;
}


/* 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.style.left=((994-boxWidth)/2)+"px";

    toolBoxClose=document.createElement("a");
    toolBoxClose.className="toolBoxClose icon close hovericon";
    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") {
        var fontResizingBarOuter = jQuery('<div></div>').addClass('fontResizingBarOuter'),
            fontResizingBarNote = jQuery('<span></span>').attr('id', 'fontResizingBarNote').addClass('ToolBarNote').html('&nbsp;'),
            fontResizingBarInner = jQuery('<div></div>').addClass('toolBarInner'),
            fontButton = jQuery('<a></a>')
                .attr({ 'href': '#fontsize', 'name': 'smallfont', 'id': 'font', 'title': 'Schriftgröße verändern' })
                .addClass('fontSizeButton')
/**
                .toggle(
                    function() { change_size('medium'); },
                    function() { change_size('small'); }
                )
*/
                .click(function() {
                    this.blur();
                    change_size(fontToggleValues[fontToggleState]['reverseValue']);
                    fontToggleState = fontToggleState == "small" ? "medium" : "small";
                })
                .hover(
                    function() {
                        jQuery("#fontResizingBarNote").css({right:zo.getRightPos(this)+"px"});
                        showNote('fontResizingBarNote', 'Text size');
                    },
                    function() { showNote('fontResizingBarNote', ''); }
                )
            ,
            contrastButton = jQuery('<a></a>')
                .attr({ 'href': '#contrast', 'name': 'contrast', 'id': 'contrast', 'title': 'Change contrast' })
                .addClass('fontSizeButton')
                .click(function() { this.blur(); toggleContrast(); })
                .hover(
                    function() { 
                        jQuery("#fontResizingBarNote").css({right:zo.getRightPos(this)+"px"});
                        showNote('fontResizingBarNote', 'Contrast'); 
                    },
                    function() { showNote('fontResizingBarNote', ''); }
                )
        ;
/**



*/
        fontResizingBarOuter
            .append(fontResizingBarNote)
            .append(
                fontResizingBarInner
                    .append(contrastButton)
                    .append(fontButton)
            )
        ;
        return fontResizingBarOuter;
    } else {
        return {};
    }
}


function buildSocialMediaButton()
{
    return jQuery('<a></a>')
        .attr({ 'href': '#socialmedia', 'name': 'socialmedia', 'id': 'socialmedia' })
        .addClass('fontSizeButton')
        .click(function(ev) {
            ev.preventDefault;
            if (jQuery('#socialmediaList').length) {
                jQuery('#socialmediaList').show();
            }
            else {
                jQuery(this)
                    .parent()
                    .append(jQuery('<div></div>')
                        .attr('id', 'socialmediaList')
                        .css({
                            'position': 'absolute',
                            'bottom': '20px',
                            'left': '10px',
                            'width': '100px',
                            'background': '#333',
                            'display': 'block'
                        })
                        .click(function() { jQuery(this).hide() })
                        .append(jQuery('<span></span>')
                            .html('Social Media')
                        )
                        .append(jQuery('<ul></ul>')
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#browser')
                                    .html('Browser')
                                )
                                .addClass('browser spacer')
                            )
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#delicious')
                                    .html('Del.Icio.Us')
                                )
                                .addClass('delicious')
                            )
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#mrwong')
                                    .html('Mister Wong')
                                )
                                .addClass('mrwong')
                            )
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#linkarena')
                                    .html('Linkarena')
                                )
                                .addClass('linkarena')
                            )
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#yigg')
                                    .html('Y!GG')
                                )
                                .addClass('yigg')
                            )
                            .append(jQuery('<li></li>')
                                .append(jQuery('<a></a>')
                                    .attr('href', '#google')
                                    .html('Google')
                                )
                                .addClass('google')
                            )
                        )
                    )
                ;
            }
        })
        .hover(
            function() { showNote('fontResizingBarNote', 'Social Media'); },
            function() { showNote('fontResizingBarNote', ''); }
        )
    ;
}



cssHref= new Object();
cssHref['small']= "/careers/data/css/de/677.css";
cssHref['medium']= "/careers/data/css/de/676.css";
cssHref['large']= "/careers/data/css/de/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'));
/**
    jQuery(document).ready(function() {
        jQuery('a#font').trigger('click');
    });
*/
}
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/de/674.css";
    contrastCSS.id = "contrastCSS";
    document.getElementsByTagName('head')[0].appendChild(contrastCSS);
    createCookie('contrastToggle','ON','2160');
  }
}
if (readCookie('contrastToggle') && activateFontResizing=="ON") {
    toggleContrast();    
}//
var zo; // declares a global symbol
if (!zo) zo = {};
    else if (typeof zo != 'object')
        throw new Error('zo exists, but is not an object!');


function flashMovieResize(object,width,height) {
    if (object=="") return;
    if (document.getElementById("flashobject"+object) ) {
        document.getElementById("flashobject"+object).width=width;
        document.getElementById("flashobject"+object).height=height;
    }
    if (document.getElementById("flashcontent"+object) ) {
        document.getElementById("flashcontent"+object).style.width=width+"px";
        document.getElementById("flashcontent"+object).style.height=height+"px";
    }
}

zo.submitSearch = function () {
 searchwindow = window.open('','db_search','toolbar=yes,location=no,directories=no,scrollbars=yes,status=yes,menubar=no,resizable=yes,width=717,height=600');
 searchwindow.focus();
}

zo.str_replace = function(repsearch, repreplace, repsubject) { return repsubject.split(repsearch).join(repreplace); }

zo.createTabsInTarget = function(targetElement,fullWidth,tabWidth,startTabHash) {  
    if (!startTabHash) {startTabHash="";}

    var numTabs = targetElement.find(".tabContent").length;
    if (numTabs<=1) {
        // TODO: Headergrafik bei Non-Tab-Optik
        return;
    }
    
    targetElement.find(".tabContent").each(function(ev){

        var backgroundImage = jQuery(this).closest('.tabContainer').css('background-image');
        if (typeof jQuery(this).find('a.tabBackground').attr('rel')!='undefined') {
            backgroundImage = jQuery(this).find('a.tabBackground').attr('rel');
        }
        var tabUrl = "";
        if (typeof jQuery(this).find('a.tabBackground').attr('name')!='undefined') {
            tabUrl = jQuery(this).find('a.tabBackground').attr('name');
        }

        jQuery(this).find('a.tabBackground').remove();

        headline = jQuery(this).find(".tabHeadline").remove().html();
        targetElement.find("ul:first")
          .removeClass("boxTop")
          .append(jQuery("<li></li>")
          .addClass("tab")
          .append(jQuery("<div></div>")
            .append(jQuery("<a></a>")
              .attr({href: "#"+tabUrl })
              .click(function(e){this.blur(); e.preventDefault();})
              .addClass("noTrack")
              .html(headline)
              .mouseenter(function(ev){
                this.blur();
                jQuery(this).trigger('changeTab');
                var targetHeight = jQuery(jQuery(this).data("myContent")).outerHeight()+"px";
                jQuery(jQuery(this).data("myContent"))
                    .addClass('activeContentTab')
                    .removeClass('inActiveContentTab')
                    .siblings()
                      .removeClass('activeContentTab')
                      .addClass('inActiveContentTab')
                    .end()
                    .closest('.tabContainer')
                       .css({backgroundImage:jQuery(this).data("myBackground")})
                    .end()
                    .closest(".tabContainer")
                       .css({height:targetHeight})
                ;
                jQuery(this)
                    .closest('li')
                    .addClass('active')
                    .siblings()
                      .removeClass('active')
                ;       
                })
              .data("myContent",this)              
              .data("myBackground",backgroundImage ) 
            )
          )
        )
        ;
    });

    var tabWidth = parseInt((fullWidth + 3) / numTabs - 3); 
    var calcWidth = (tabWidth + 3) * numTabs - 3;

    targetElement.find(".tabContainer .tabContent").css({position:"absolute"})
    targetElement.find(".tabContainer .tabContent:first")
        .addClass('activeContentTab')
        .siblings()
            .addClass('inActiveContentTab')
    ;

    var targetHeight = targetElement.find(".tabContainer .tabContent:first").outerHeight()+"px";
    targetElement.find(".tabContainer").css({height:targetHeight});

    targetElement.find("ul:first li:first").addClass("active");
    targetElement.find("ul:first li:last").addClass("last");

    targetElement.find("ul:first li").css("width",tabWidth+"px");

    var floatDiff = fullWidth - calcWidth; 
    if (floatDiff != 0) {
        targetElement.find("ul:first li:lt(" + Math.abs(floatDiff) + ")").css("width",(tabWidth + 1 )+"px");
    }

    var startTab = "";
    if (window.location.hash.length > 1) {
        startTab = targetElement.find("a[href='" + window.location.hash + "']");
    } else if (startTabHash.length > 0) {
        startTab = targetElement.find("a[href='#" + startTabHash + "']");
    }

    if (startTab.length==1) {
        jQuery(function(){startTab.trigger('mouseenter')});
    }

}

zo.createStockFeed = function(feedContent) {
    if (typeof(sharepriceObj)=='undefined') return "<span></span>";
    return "<span class='stockfeedJSON'>" + feedContent
      .replace(/%h/g, sharepriceObj.time[1].toString().split(":")[0])        // hours
      .replace(/%m/g, sharepriceObj.time[1].toString().split(":")[1])        // minutes
      .replace(/%t/g, sharepriceObj.time[0])                                 // timezone
      .replace(/%c/g, sharepriceObj.shareprice[0])                           // currency
      .replace(/%i/g, sharepriceObj.shareprice[1].toString().split(",")[0])  // value before comma
      .replace(/%d/g, sharepriceObj.shareprice[1].toString().split(",")[1])  // decimal value
      + "</span>";
}


zo.showHide = {
    init: function(pageID, closeAll) {
        var entries = jQuery('div#shBox' + pageID + '.toggleShowHide div.showHideEntry'),
            headlines = entries.find('h2'),
            content = entries.find('div.shItem'),
            self = this
        ;
        headlines
            .filter(':first')
            .addClass('closeClick')
            .css({'cursor': 'default'})
            .end()
            .not(':first')
            .addClass('openClick')
            .end()
            .bind('click', function(ev) {
                if (jQuery(this).hasClass('openClick') === true) {
                    self.toggle(this);
                }
            })
            .hover(
                function(){
                    if (jQuery(this).hasClass('openClick') === true) {
                        jQuery(this).addClass('newBlue clickHover');
                    }
                },
                function(){
                    jQuery(this).removeClass('newBlue clickHover');
                }
            )
        ;
        content.not(':first').hide();
    },
    toggle: function(evTarget) {
        jQuery(evTarget)
            .removeClass('openClick')
            .removeClass('newBlue clickHover')
            .css({'cursor': 'default'})
            .addClass('closeClick')
            .next('div.shItem:hidden')
            .slideDown(500)
            .end()
            .closest('div.toggleShowHide')
            .find('h2.closeClick')
            .not(evTarget)
            .removeClass('closeClick')
            .addClass('openClick')
            .css({'cursor': 'pointer'})
            .next('div.shItem:visible')
            .slideUp(500)
        ;
    }
};


zo.initAwards = function(awardslist) {
    awardslist 
        .find('.awardsEntry .awardsHead').each(function() {
            jQuery(this)
                .addClass("closeClick")
                .bind("click",function(ev){
                    if (jQuery(this).hasClass('openClick')===true) {
                        jQuery(this).closest('.awardsEntry').find('.closeMe').slideDown(300);
                    } else {
                        jQuery(this).closest('.awardsEntry').find('.closeMe').slideUp(200);
                    }
                    jQuery(this)
                        .toggleClass('openClick')
                        .toggleClass('closeClick');
                    return false;
                })
                .hover(function(){
                    jQuery(this).addClass('newBlue clickHover');
                },function(){
                    jQuery(this).removeClass('newBlue clickHover');
                })
            ;
        })
    ;

    awardslist.children().each( function() {
        var monthHead = jQuery(this);
        if (monthHead.hasClass('newslistMonth')) {
            monthHead
                .wrapInner('<a></a>')
                .find("a")
                .addClass('openClick')
                .addClass('newBlue2')
                .hover(function(e){jQuery(this).addClass('clickHover newBlue').removeClass('newBlue2');},function(e){jQuery(this).removeClass('clickHover newBlue').addClass('newBlue2');})
                .click(function(e){
                    var headl = jQuery(this);
                    if (headl.hasClass('openClick')) { // Open
                        headl.removeClass('openClick').addClass('closeClick');
                        headl.parent().next().slideDown(300);
                    } else { // Close
                        headl.addClass('openClick').removeClass('closeClick');
                        headl.parent().next().slideUp(200);
                    }
                })
                    .parent()
                    .next()
                    .hide()
            ;
        }
    });
    
    awardslist.find('.newslistMonth:first a')
            .addClass('closeClick')
            .removeClass('openClick')
                .parent()
                .next()
                .show();
}


zo.collapseNews = function(newslistClassID) {
  
  var newslist = jQuery(newslistClassID);
  newslist.children().each( function() {
      var monthHead = jQuery(this);
      if (monthHead.hasClass('newslistMonth')) {
          monthHead
              .wrapInner('<a></a>')
              .find("a")
              .addClass('openClick')
              .addClass('newBlue2')
              .hover(function(e){jQuery(this).addClass('clickHover newBlue').removeClass('newBlue2');},function(e){jQuery(this).removeClass('clickHover newBlue').addClass('newBlue2');})
              .click(function(e){
                  var headl = jQuery(this);
                  if (headl.hasClass('openClick')) { // Öffnen
                      headl.removeClass('openClick').addClass('closeClick');
                      headl.parent().next().slideDown(300)
                          .closest('.dbnNewsList').find('.newsEntries:not(:animated)')
                      ;
                  } else { // Schliessen
                     headl.addClass('openClick').removeClass('closeClick');
                     headl.parent().next().slideUp(200);
                  }
              })
                  .parent()
                  .next()
                  .hide()
          ;
      }
  });
  newslist.find('.newslistMonth:first a')
          .addClass('closeClick')
          .removeClass('openClick')
              .parent()
              .next()
              .show();
}



zo.alertBox = function(ev) {
    ev.preventDefault();
    jQuery('div.alertContainer').remove(); 
    var evTarget = jQuery(ev.target),
        isExtern = evTarget.closest('a').hasClass('alertBoxExtern'),
        alertText = isExtern ? "&Uuml;ber diesen Link verlassen Sie die Informationsseiten der Deutsche Bank Gruppe und erreichen die Web-Page eines anderen Anbieters. Die dort eingestellten Informationen sind ohne Mitwirkung der Deutsche Bank Gruppe erstellt worden und unterliegen der ausschlie&szlig;lichen Verantwortung des anderen Anbieters. Die Deutsche Bank Gruppe &uuml;bernimmt keinerlei Haftung f&uuml;r die Richtigkeit, Vollst&auml;ndigkeit und Aktualit&auml;t dieser Informationen. Wenn Sie die vorstehenden Hinweise akzeptieren, best&auml;tigen Sie dies mit dem Button einverstanden." : "",
        alertAccept = "akzeptieren",
        alertDeny = "ablehnen",
        target = evTarget.closest('a').attr('target'),
        href = evTarget.closest('a').attr('href'),
        posTop = evTarget.closest('a').offset().top - 10
    ;
    jQuery('<div></div>')
        .addClass('alertContainer font3')
        .css({'top': posTop+ 'px'})
        .append(jQuery('<div></div>')
            .addClass('alertBox colWidth3')
            .append(jQuery('<p></p>').html(alertText))
            .append(jQuery('<a></a>')
                .attr({'href': href,'target':target})
                .bind('click', function(ev) {
                    jQuery(this).closest('div.alertContainer').remove();
                })
                .html(alertAccept)
            )
            .append(jQuery('<a></a>')
                .attr({'href': '#close'})
                .bind('click', function(ev) {
                    ev.preventDefault();
                    jQuery(this).closest('div.alertContainer').remove();
                })
                .html(alertDeny)
            )
        )
        .appendTo('div#layoutComplete')
    ;


    jQuery(document).bind('click', function(ev) {
        if ((!jQuery(ev.target).closest('a').hasClass('alertBoxExtern') && !jQuery(ev.target).closest('a').hasClass('alertBoxIntern')) && !jQuery(ev.target).closest('div.alertContainer').length) {
            jQuery('div.alertContainer').remove();
            jQuery(document).unbind('click');
        }
    });


    // ESC: escape key pressed quits the alert box
    jQuery(document)
        .bind('keydown', function(ev) {
            if (ev.keyCode === 27) {
                jQuery('div.alertContainer').remove();
                jQuery(this).unbind('keydown');
            }
        })
    ;
};

jQuery(function() {
    jQuery('a.alertBoxIntern,a.alertBoxExtern').bind('click', function(ev) {
        zo.alertBox(ev);
    });
});

/* TWITTER SNIPPET */





zo.twitterImport =
{
    conf: {
        // default values, do not change
        twFormat: 'JSON', // the response will use the JSONP format with a callback
        twUsername: '', // get tweets from a specified username
        twLang: '', // restricts tweets to the given language, given by an ISO 639-1 code
        twRpp: 0 // number of tweets to return per page
    },

    init: function(options)
    {
        var conf = this.conf;
        conf.twFormat = options.format;
        conf.twUsername = options.username;
        conf.twLang = options.lang;
        conf.twRpp = options.rpp;
        this.importTweets();
    },
    // import tweets using the JSONP format with an callback
    importTweets: function()
    {
        var conf = this.conf;
        if (conf.twFormat.toUpperCase() === "JSON") {
            jQuery.getJSON('http://search.twitter.com/search.json?q=from%3A' +conf.twUsername+ '&rpp=' +conf.twRpp+ '&callback=?',
                function(data) {
                    zo.twitterImport.buildTweetShow(data);
                }
            );
        }
    },
    
    buildTweetShow: function(data)
    {
        var conf = this.conf,
            url = /(\w+):\/\/([\w.]+)\/(\S*)/g;
        jQuery.each(data.results, function(i) {
            var twDate = new Date(this.created_at),
                twShowDate = strFormatDate("%e. %B %Y",twDate),
                twText = this.text,
                twUrl = twText.match(url), // parse urls
                twLink
            ;
            if (twUrl !== null) {
                for (var i=0, l=twUrl.length; i<l; i++) {
                    // build anchor with the parsed url
                    twLink = " <a href=\"" +twUrl[i]+ "\" target=\"_blank\">" +twUrl[i]+ "</a>";
                    // replace the url-string with the built anchor
                    twText = twText.replace(twUrl[i], twLink);
                }
            }
            // create tweet container with date and text
            jQuery('<div style=font-size:11px;></div>')
                .addClass('zoTweet')
                .append(jQuery('<p></p>')
                    .addClass('twDate block')
                    .text(twShowDate)
                )
                .append(jQuery('<p></p>')
                    .addClass('twText')
                    .html(twText)
                )
                .appendTo(jQuery('div#zoTweets'))
            ;
        });
    }
};



/* DateFormat Function */
var strFormatDate = function(dateFormat, date) {
  var date = date || new Date();
  var twDateMonthNames = ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
  var dateFormatRe = new RegExp("%[eBY]","g");  
  
  return dateFormat.replace(dateFormatRe, function(m){
    switch(m) {
      case "%B" : return twDateMonthNames[date.getMonth()];
      case "%e" : return date.getDate();
      case "%Y" : return date.getFullYear();
      default   : return "";
    }
  }); 
}


/**/
/* No SWF-File Deeplinking inside RedDot */


function initPage() {
}