var g_homemenu_hl_fontcolor = "rgb(204, 0, 0)";var g_homemenu_hl_background_color = "rgb(255,255,255)";var g_homemenu_hl_background_color_Level5 = "rgb(255,255,255)";var g_homemenu_ll_fontcolor_level0 = "rgb(255,255,255)";var g_homemenu_ll_fontcolor_level1 = "rgb(0, 0, 0)";var g_homemenu_ll_background_color = "rgb(238, 242, 245)";  //"transparent";var g_homemenu_ll_background_image_level0 = "url(../arrow-white.gif)";var g_homemenu_ll_background_image_level1 = "url(../arrow-gray.gif)";var g_timeout = -1;var g_timeoutTime = 80;var g_openZoom = 0;var g_imageNr = 1;var g_req;var g_is_home = false;var g_pageWidth = 839;var g_initHome = false;var g_timeoutHide1 = 0;var g_timeoutHide2 = 0;var g_timeoutHide3 = 0;var g_timeoutHide4 = 0;var g_timeoutHead = 0;var g_currentNav1 = "";var g_currentNav2 = "";var g_currentNav3 = "";var g_currentNav4 = "";var g_currentHi1 = "";var g_currentHi2 = "";var g_currentHi3 = "";var g_currentHi4 = "";var G_MAXSUBLAYERS = 16;var g_blackValue = 0;var g_blackTimeout = 0;var g_navShadeMax = .35;var g_echoCount = 0;var g_is_opera = false;var g_is_ie = false;var g_is_ie5 = false;var g_is_ie5_5 = false;var g_is_safari = false;// var g_is_macmoz = false; // mozilla on mac has flash problems on the homepage.var g_is_mac = false;var g_is_linux = false;var g_contextDebug = "";var g_fallbackImage = "";var g_newWinFocus;var g_isDesign2010 = false;var g_hasFlash;var g_homeImageNr;var g_isHomeImageSwitchAuto = true;var g_homeImageSwitchTimeout;var g_extraBoxId = "";var g_extraBoxNr = "1";/****************************************///global control variables for flash homepage.// turns flash on homepage on/off globally.var g_useFlashHomepage;// load flash hp configuration in the following xml object; var g_xmlFlashHPConfig;// also, copy the [pool].jpg into the fallback images directory.var g_flashHPFallbackOverride;/****************************************/var g_openDivPage = "";var g_openDivLayer = "";window.onload = function (){    initAll();};function initAll(){    var sClass = "";    if (document.body.className) {        sClass = document.body.className;    }    else {        sClass = document.body.getAttribute("class");    }    if (sClass != undefined) {         //g_is_home = sClass.indexOf("home") >= 1; changed        g_is_home = sClass.indexOf("home") >= 0;    }    else {        g_is_home = false;    }        positionFooter();        var noteConflict = false;    sniffAll();    //detectFlash();    if (document.getElementById) {        g_canHandleTransparency = !g_is_ie5;    }    else if (noteConflict) {        gotoUrl("/browser.htm");    }    if (g_is_home) {        initHome();    }    if (g_isDesign2010) g_pageWidth = 1063; //1024;    }function detectFlash() {    g_hasFlash = ((swfobject.getFlashPlayerVersion().major+'') != '0');}function sendRequest(url,callback,postData) {    var req = createXMLHTTPObject();    if (!req) return;    var method = (postData) ? "POST" : "GET";    req.open(method,url,true);    //req.setRequestHeader('User-Agent','XMLHTTP/1.0');f    if (postData)        req.setRequestHeader('Content-type','application/x-www-form-urlencoded');            req.onreadystatechange = function () {        if (req.readyState != 4) return;        if (req.status != 200 && req.status != 304) {//          alert('HTTP error ' + req.status);            return;        }        if(callback)            callback(req);    }    if (req.readyState == 4) return;    if (postData)         req.send(postData);    else         req.send(null);}function flashHP_getFlashHPConf(){    var req = createXMLHTTPObject();    if (!req) return;        req.open("GET","/all/media/flash/videos/homepage/settings.xml",true);    //req.setRequestHeader('User-Agent','XMLHTTP/1.0');    req.onreadystatechange = function () {        if (req.readyState != 4) return;        if (req.status != 200 && req.status != 304) {            //alert('HTTP error ' + req.status);            return;        }                g_xmlFlashHPConfig = req.responseXML;        flashHP_initFlashHomepage();    }    if (req.readyState == 4) return;    req.send(null);}var XMLHttpFactories = [    function () {return new XMLHttpRequest()},    function () {return new ActiveXObject("Msxml2.XMLHTTP")},    function () {return new ActiveXObject("Msxml3.XMLHTTP")},    function () {return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject() {    var xmlhttp = false;    for (var i=0;i<XMLHttpFactories.length;i++) {        try {            xmlhttp = XMLHttpFactories[i]();        }        catch (e) {            continue;        }        break;    }    return xmlhttp;}function flashHP_getSettings(xPoolNode, xGlobalNode){    var pool = new Object();    pool.id        = xPoolNode.getAttribute("id");    pool.lang      = xPoolNode.getAttribute("lang");        var hasFlash = (xPoolNode.getAttribute("hasFlash") != null) ? xPoolNode.getAttribute("hasFlash") : xGlobalNode.getAttribute("hasFlash");    pool.hasFlash  = eval(hasFlash); // "true" oder "false";    var overrideFallback = (xPoolNode.getAttribute("overrideFallback") != null) ? xPoolNode.getAttribute("overrideFallback") : xGlobalNode.getAttribute("overrideFallback");    pool.overrideFallback = eval(overrideFallback);        var timeOut = (xPoolNode.getAttribute("timeOut") != null) ? xPoolNode.getAttribute("timeOut") : xGlobalNode.getAttribute("timeOut");    pool.timeOut   = (isInteger(timeOut)) ? parseInt(timeOut) : 0;    pool.flashName = (xPoolNode.getAttribute("flashName") != null) ? xPoolNode.getAttribute("flashName") : xGlobalNode.getAttribute("flashName");    pool.claimPool = (xPoolNode.getElementsByTagName("claim")[0].getAttribute("pool") != null) ? xPoolNode.getElementsByTagName("claim")[0].getAttribute("pool") : xGlobalNode.getElementsByTagName("claim")[0].getAttribute("pool");       pool.claimId   = (xPoolNode.getElementsByTagName("claim")[0].getAttribute("id") != null) ? xPoolNode.getElementsByTagName("claim")[0].getAttribute("id") : xGlobalNode.getElementsByTagName("claim")[0].getAttribute("id");    pool.claimLang = (xPoolNode.getElementsByTagName("claim")[0].getAttribute("lang") != null) ? xPoolNode.getElementsByTagName("claim")[0].getAttribute("lang") : xGlobalNode.getElementsByTagName("claim")[0].getAttribute("lang");        var claimLink = (xPoolNode.getElementsByTagName("claim")[0].getAttribute("link") != null) ? xPoolNode.getElementsByTagName("claim")[0].getAttribute("link") : xGlobalNode.getElementsByTagName("claim")[0].getAttribute("link");        if (claimLink.indexOf("[pool_id]") != -1)        claimLink = myreplace(claimLink, "[pool_id]", pool.id);            if (claimLink.indexOf("[pool_lang]") != -1)        claimLink = myreplace(claimLink, "[pool_lang]", pool.lang);        pool.claimLink = claimLink;        return pool;}function isInteger (s){    var i;    if ((s == null) || (s.length == 0))    if (isInteger.arguments.length == 1) return 0;    else return (isInteger.arguments[1] == true);    for (i = 0; i < s.length; i++)    {        var c = s.charAt(i);        if (!isDigit(c)) return false;    }    return true;}function isDigit (c){    return ((c >= "0") && (c <= "9"))}function flashHP_getGlobalAttribute(setting){    var retVal;    try    {        retVal = g_xmlFlashHPConfig.documentElement.getElementsByTagName("globalsettings")[0].getAttribute(setting);    }    catch(e)    {        retVal = null;    }        return retVal;  }function flashHP_getPoolNode(poolName, poolLang){    var xmlRoot = g_xmlFlashHPConfig.documentElement;    var poolNodeList = xmlRoot.getElementsByTagName("pool");    var poolNode = null;        var i = 0;    var poolFound = false;        while (!poolFound && i < poolNodeList.length)    {        if (poolNodeList[i].getAttribute("id") == poolName && poolNodeList[i].getAttribute("lang") == poolLang)        {            poolFound = true;            poolNode = poolNodeList[i];        }        i++;    }    return poolNode;}function flashHP_initFlashHomepage(){    // pool id    var poolName = getPoolName().toLowerCase();        // pool language    var poolLang = getPoolLang(poolName).toLowerCase();        var poolHasFlashHP = true;        if (!g_xmlFlashHPConfig)     {        g_useFlashHomepage = false;        poolHasFlashHP = false;        // alert("debug: Fehler: konnte das Xml-Dokument NICHT laden.");    }    else    {           g_useFlashHomepage = eval(flashHP_getGlobalAttribute("useflashHomepage"));                // get pool Settings        var xmlPoolNode = flashHP_getPoolNode(poolName, poolLang);        // get global pool settings        var xmlGlobalsNode = flashHP_getPoolNode("global", "none");        var objSettings = flashHP_getSettings(xmlPoolNode, xmlGlobalsNode);        // override these variables in case of deviation in the switch statement below.        // var timeOut = 2480;        var rootPath = flashHP_getGlobalAttribute("rootPath");        var cachePrevent = flashHP_getGlobalAttribute("cachePrevent");        // flash settings        poolHasFlashHP = objSettings.hasFlash;        var timeOut = objSettings.timeOut;        var flashName = objSettings.flashName;        g_flashHPFallbackOverride = objSettings.overrideFallback;        // claim settings        var claimPool = objSettings.claimPool;        var claimId = objSettings.claimId;        var claimLang = objSettings.claimLang;        var claimLink = objSettings.claimLink;                /*        alert(        "debug:\nclaimPool = " + objSettings.claimPool +         "\npool-id = " + objSettings.id +         "\npoolLang = " + objSettings.lang +         "\npoolHasFlashHP = " + poolHasFlashHP +         "\nclaimId = " + objSettings.claimId +          "\nclaimLang = " + objSettings.claimLang +         "\nclaimLink = " + objSettings.claimLink +         "\nrootPath = " + rootPath +        "\ncachePrevent = " + cachePrevent +        "\ntimeOut = " + objSettings.timeOut +         ""              );        */                            // building the parts together..        var antiCacheSuffix = "?rid=" + cachePrevent;        var flashPath = rootPath + flashName + antiCacheSuffix;    }            // if both global and local variables are positive, go for it..    if (g_useFlashHomepage && poolHasFlashHP)    {        var introElem = getElementsByClassName('introImage')[0];        if (introElem)         {            var introImg = introElem.getElementsByTagName("img")[0];            if (introImg)             {                //STV:                 // >> Flashgr\u00F6\u00DFe = Gr\u00F6\u00DFe Introimage ... sollte eigentlich f\u00FCr jeden Markt funktionieren ...                if((poolName == 'usa') || (poolName == 'canada'))                {                    var imgWidth = parseInt(introImg.style.width);                    var imgHeight = parseInt(introImg.style.height);                    showFlash(flashPath, "introImage", imgWidth, imgHeight, 8, "#000", "loop=true,menu=true,quality=high,wmode=opaque", "pool=" + claimPool +  ",id=" + claimId + ",type=image,lang=" + claimLang + ",filetype=normal,claimlink=" + claimLink);                    //showFlash(flashPath, "introImage", "1063", "455", 8, "#000", "loop=true,menu=true,quality=high,wmode=opaque", "pool=" + claimPool +  ",id=" + claimId + ",type=image,lang=" + claimLang + ",filetype=normal,claimlink=" + claimLink);                }                else                {                    showFlash(flashPath, "introImage", "839", "440", 8, "#000", "loop=true,menu=true,quality=high,wmode=opaque", "pool=" + claimPool +  ",id=" + claimId + ",type=image,lang=" + claimLang + ",filetype=normal,claimlink=" + claimLink);                }                if (timeOut > 0) {                    window.setTimeout("showHomepageNavigation()", timeOut);                }                else {                    showHomepageNavigation();                    // The claim is called from within Flash..                }            }        }    }    else    // back to regular homepage.    {        // showHomepageNavigation();        // showHomepageClaim();    }    }// this is a porschewebsite hack and would probably not work in other cases..// paints a grey border below the introImage div. // Used by the flash videos which are triggered on the same page by a button (not hmoepage).function setIntroImageBorder() {    var elm = document.getElementById('introImage');    if (elm) {        elm.style.borderBottom = 'solid 1px #CECECE';        elm.style.width = '615px';    }}/*Flash Homepage functions*/// Delivers an array of DOM Elements matching the input criteria// // Returns: an array of found dom elementsfunction getElementsByClassName(strClass, strTag, objContElm) {  strTag = strTag || "*";  objContElm = objContElm || document;  var objColl = (strTag == '*' && document.all && !window.opera) ? document.all : objContElm.getElementsByTagName(strTag);  var arr = new Array();  var delim = strClass.indexOf('|') != -1  ? '|' : ' ';  var arrClass = strClass.split(delim);  for (var i = 0, j = objColl.length; i < j; i++) {    var arrObjClass = objColl[i].className.split(' ');    if (delim == ' ' && arrClass.length > arrObjClass.length) continue;    var c = 0;    comparisonLoop:    for (var k = 0, l = arrObjClass.length; k < l; k++) {      for (var m = 0, n = arrClass.length; m < n; m++) {        if (arrClass[m] == arrObjClass[k]) c++;        if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {          arr.push(objColl[i]);          break comparisonLoop;        }      }    }  }  return arr;}// finds the first Element carrying the class name and changes its visibility.function showHideByClassName(clsName, visible){    var visibility = (visible == true) ? 'visible' : 'hidden';    var display = (visible == true) ? 'block' : 'none';        var elm = getElementsByClassName(clsName)[0];    if (elm)        elm.style.visibility = visibility;        elm.style.display = display;}// this loads back the original Fallback-Image manually, and make the navi visible, in case the Flash animation fails to load.function fallBackFromFlash(pool) {    if (document.getElementById('introImage'))        introImgDiv = document.getElementById('introImage');    else        introImgDiv = getElementsByClassName('introImage')[0];    var introImg = introImgDiv.getElementsByTagName("img")[0];    var fbSrc;    if (g_flashHPFallbackOverride) {        fbSrc = pool + ".jpg";    }    else {        fbSrc = "default.jpg";    }    if (introImg) {    }    else {        introImg = document.createElement("img");        introImgDiv.appendChild(introImg);    }    introImg.src = "/all/media/flash/videos/homepage/fallback/" + fbSrc;    showHomepageClaim();    showHomepageNavigation();}//shows Navigation bar and shopping buttonsfunction showHomepageNavigation(){    // we don't use showHideClassByName here because of speed issues in IE6..    // document.getElementById('topnav1').parentNode.style.visibility = 'visible';    // getElementsByClassName("shoppingButtons", "span", document)[0].style.visibility = 'visible';    // getElementsByClassName("shoppingShade", "div", document)[0].style.visibility = 'visible';    showHideByClassName("homeNavigation", true);    showHideByClassName('shoppingButtons', true);    showHideByClassName("shoppingShade", true);}//hides Navigation bar and shopping buttonsfunction hideHomepageNavigation(){    showHideByClassName("homeNavigation", false);    showHideByClassName("shoppingButtons", false);    showHideByClassName("shoppingShade", false);}// makes the claim element invisible (flash loaded)function hideHomepageClaim() {    var claimElm = getHomepageClaim();    claimElm.style.visibility = 'hidden';    claimElm.style.display = 'none';}// makes the claim element visible (no flash loaded)function showHomepageClaim() {    var claimElm = getHomepageClaim();    claimElm.style.visibility = 'visible';    claimElm.style.display = 'block';}// returns the claim element to hide when loading the flash animation.function getHomepageClaim() {    return document.getElementById('homeHead');}function fitFrameFromParent(iHeight){    addContextDebug("iHeight", iHeight);    var elm = document.getElementById("mainframe");    var footer = document.getElementById("footer");    var search = document.getElementById("search");    if (elm) {        addContextDebug("enteredElm", true);        elm.style.height = (iHeight + 40 + 140) + "px";        if (search) { search.style.display = "none"; }        footer.style.bottom = "-1px";        if (search) { search.style.display = "block"; }        addContextDebug("finishedElm", true);    }}function addContextDebug(sName, sValue){    g_contextDebug += sName + "=" + sValue + "\r\n";}function showContextDebug(){    if (g_contextDebug != "") {        alert(g_contextDebug);    }}function positionFooter(){    var footer = document.getElementById("footer");    var search = document.getElementById("search");        //if (!g_is_home) setDocumentSize();    if (footer) { footer.style.bottom = "-1px"; }    if (search) { search.style.bottom = "-1px"; }}function setDocumentSize() {    var size = 350; //160 + 105 + 85;    var elm = document.getElementsByTagName("a");        if (elm) {        for (i = 0; i < elm.length; i++){            var className = elm[i].className;                        switch (true) {                case containsStr(className, "navigationBelowHome"):                    size += 24;                break;                case containsStr(className, "subNavigationChapter"):                case containsStr(className, "subSubNavigation"):                case containsStr(className, "subSubNavigationActive"):                                                  size += 20; // 1 line: 16, 2 lines: 31;                                 break;                  }        }    }           var elm = document.getElementsByTagName("div");        if (elm) {        for (i = 0; i < elm.length; i++){            if (elm[i].className == "content") {                //elm[i].style.border = "1px solid red";                elm[i].style.minHeight = size + "px";                elm[i].style.height = size + "px";                break;                      }        }    }}function containsStr(s, find) {    return (s.indexOf(find) != -1);}function overHome(){    if (g_openDivPage == '' && !g_is_safari) {        if (g_timeout != -1) { clearTimeout(g_timeout); }        showNavHomeSub();    }}function outHome(){    if (g_openDivPage == 0 && !g_is_safari) {        g_timeout = setTimeout("hideNavHomeSub()", g_timeoutTime);    }}function overNavHomeSub(){    if (g_timeout != -1) { clearTimeout(g_timeout); }}function outNavHomeSub(){    if (g_timeout != -1) { clearTimeout(g_timeout); }    g_timeout = setTimeout("hideNavHomeSub()", g_timeoutTime);}function showNavHomeSub(){    showLr("navigationHomeSub");    showLr("navigationShade");    setBackground("navigationHome", "rgb(242,242,242)");}function hideNavHomeSub(){    hideLr("navigationHomeSub");    hideLr("navigationShade");    setBackground("navigationHome", "rgb(255,255,255)");}function setBackground(id, sBack){    var elm = document.getElementById(id);    elm.style.backgroundColor = sBack;}function getCachePrevent(){    return "?rand=" + escape( Math.round( Math.random() * 10000 ) );}//Page in divfunction openDivPage(sUrl){    if (g_openDivPage == '')   {        var shadeborder = 8;        divWidth = 656;        divHeight = 535;        var elmShade = document.getElementById("divPageShade");        var elmPage = document.getElementById("divPage");        var divX = g_pageWidth / 2 - divWidth / 2;        var divY = Math.round( (viewportGetHeight() - divHeight)/2 ) + viewportGetScrollY();        if (divY < 0) { divY = 0; }        if (divX < 0) { divX = 0; }        elmShade.style.left = (divX - shadeborder) + "px";        elmShade.style.top = (divY - shadeborder) + "px";        elmPage.style.left = divX + "px";        elmPage.style.top = divY + "px";        /*        var elmCloseButton = document.getElementById("closeButtonDivPage");        if (elmCloseButton) {            elmCloseButton.style.left = (divWidth - 19) + "px";        }        */        g_openDivPage = sUrl;        prepareFillDivPage(sUrl);    }}function closeDivPage(){    var elm = document.getElementById("divPage");    elm.innerHTML = "<p>&nbsp;</p>";    elm.style.display = "none";    hideLr("divPageShade");    g_openDivPage = '';    if (g_is_safari) {        var introElm = document.getElementById("introImage");        if (introElm) {            introElm.style.visibility = "visible";        }    }}function prepareFillDivPage(sUrl){    sUrl += getCachePrevent();    if (window.XMLHttpRequest) {        g_req = new XMLHttpRequest();    }    else if (window.ActiveXObject) {        g_req = new ActiveXObject("Microsoft.XMLHTTP");    }    g_req.onreadystatechange = fillDivPage;    g_req.open("GET", sUrl, true);    g_req.send(null);}//shows page in popup division, header and content is delivered in xmlfunction fillDivPage(){    if (g_req.readyState == 4)    {        if (g_req.status == 200)        {            if (g_is_safari) {                var introElm = document.getElementById("introImage");                if (introElm) {                    introElm.style.visibility = "hidden";                }            }            var s = "";                    var elmPage = document.getElementById("divPage");            s += "";            s += "<div class=\"closeButton\" id=\"closeButtonDivPage\" onclick=\"closeDivPage(false)\"><img src=\"../close-button.gif\" alt=\"[X]\" title=\"\" /></div>";            s += g_req.responseText;            s = replStr(s, "<content>", "");            s = replStr(s, "</content>", "");            var sRun = getTextBetween(s, "// <![CDATA[", "// ]]>");            sRun = replStr(sRun, ",wmode=opaque", ",");            elmPage.innerHTML = s;            var elmShade = document.getElementById("divPageShade");            var elmPage = document.getElementById("divPage");            elmPage.style.display = "block";            elmShade.style.display = "block";            if (sRun != "") { eval(sRun); }        }        else        {            alert("Can't retrieve XML: " + g_req.statusText);        }    }}var browsePrintUrl = "";function browseLayerPage(dest) {	switch (dest) {	case "begin":			browseIndex = 1;		while (browseKeys[browseIndex - 1] == "empty") {			browseIndex++;		};		break;	case "prev":		browseIndex--;		while (browseKeys[browseIndex - 1] == "empty") {			browseIndex--;		};		break;	case "next":		browseIndex++;		while (browseKeys[browseIndex - 1] == "empty") {			browseIndex++;		};		break;	case "end":		browseIndex = browseLength;		while (browseKeys[browseIndex - 1] == "empty") {			browseIndex--;		};		break;	}	     if (browseIndex == firstIndex) document.getElementById("browseback").style.visibility = "hidden";	else document.getElementById("browseback").style.visibility = "visible";      if (browseIndex == lastIndex) document.getElementById("browseforward").style.visibility = "hidden";	 else document.getElementById("browseforward").style.visibility = "visible";     	browsePrintUrl = browseKeys[browseIndex - 1].replace(/weblayer/, "weblayerprint")	  g_openDivLayer = browseKeys[browseIndex - 1];           	        prepareFillDivLayer(browseKeys[browseIndex - 1]);}var g_oldScrollY;//Content in divfunction openDivLayer(url, index){    if (g_openDivLayer == '')   {        	 g_oldScrollY = viewportGetScrollY();	 document.getElementsByTagName("html")[0].style.overflowY = "hidden";	                var elmPage = document.getElementById("divLayer");              showLr("pageoverlay");                 var windowHeight = viewportGetHeight() - 20;              var divHeight = windowHeight;                elmPage.style.height = (divHeight - 55) + "px";           var divWidth = 632;        //divHeight = 535;                   var divX = Math.round((g_pageWidth - divWidth) / 2);        var divY = Math.round( (viewportGetHeight() - windowHeight) / 2 ) + viewportGetScrollY();           //divY = divY - 14;        //alert(divY);        if (divY < 0) { divY = 0; }        if (divX < 0) { divX = 0; }                elmPage.style.left = divX + "px";        elmPage.style.top = divY + "px";                if (document.getElementById("divLayerBrowse")) document.getElementById("divLayerBrowse").style.top = String(parseInt(strLeft(elmPage.style.height, "px")) + 20) + "px"		document.getElementById("divLayerWaitImg").style.top = Math.round((divHeight - 71) / 2) + "px";		   document.getElementById("divLayerWrapper").style.height = String(parseInt(strLeft(document.getElementById("divLayer").style.height, "px")) - 40) + "px"         elmPage.style.display = "block";                       g_openDivLayer = url;                      if (index) browseIndex = index;           browsePrintUrl = browseKeys[browseIndex - 1].replace(/weblayer/, "weblayerprint")                      if (browseIndex == firstIndex) document.getElementById("browseback").style.visibility = "hidden";		else document.getElementById("browseback").style.visibility = "visible";	      if (browseIndex == lastIndex) document.getElementById("browseforward").style.visibility = "hidden";		 else document.getElementById("browseforward").style.visibility = "visible";           	      prepareFillDivLayer(url);    }}function closeDivLayer(){	if (g_req) {		try {			g_req.abort();		}		catch(excption) { }	}		document.getElementsByTagName("html")[0].style.overflowY = "auto"	window.scrollTo(0, g_oldScrollY); 	g_oldScrollY = 0;    var elm = document.getElementById("divLayer");    //elm.innerHTML = "<p>&nbsp;</p>";    elm.style.display = "none";        g_openDivLayer = '';	hideLr('pageoverlay');    if (g_is_safari) {        var introElm = document.getElementById("introImage");        if (introElm) {            introElm.style.visibility = "visible";        }    }}function prepareFillDivLayer(sUrl){	document.getElementById("divLayerWrapper").appendChild(document.getElementById("divLayerWait"));	  showLr("divLayerWait");	  //window.setTimeout('testLatency("' + sUrl + '")', 2000);    sUrl += getCachePrevent();    if (window.XMLHttpRequest) {        g_req = new XMLHttpRequest();    }    else if (window.ActiveXObject) {        g_req = new ActiveXObject("Microsoft.XMLHTTP");    }    g_req.onreadystatechange = fillDivLayer;    g_req.open("GET", sUrl, true);    g_req.send(null);    }function testLatency(sUrl) {	sUrl += getCachePrevent();		    if (window.XMLHttpRequest) {        g_req = new XMLHttpRequest();    }    else if (window.ActiveXObject) {        g_req = new ActiveXObject("Microsoft.XMLHTTP");    }    g_req.onreadystatechange = fillDivLayer;    g_req.open("GET", sUrl, true);        g_req.send(null);}//shows content in popup division, header and content is delivered in xmlfunction fillDivLayer(){    if (g_req.readyState == 4)    {        if (g_req.status == 200)        {            if (g_is_safari) {                var introElm = document.getElementById("introImage");                if (introElm) {                    introElm.style.visibility = "hidden";                }            }           		document.getElementById("divLayer").appendChild(document.getElementById("divLayerWait"));         	  hideLr("divLayerWait");	            var response = g_req.responseText;                        if (response.indexOf("<header>") != -1) {      							document.getElementById("divLayerTitle").innerHTML = getTextBetween(response, "<header>", "</header>");            } 		   		document.getElementById("divLayerContent").innerHTML = getTextBetween(response, "<innercontent>", "</innercontent>");                    		document.getElementById("divLayerWrapper").style.height = String(parseInt(strLeft(document.getElementById("divLayer").style.height, "px")) - 40) + "px"                          }        else        {            alert("Can't retrieve XML: " + g_req.statusText);        }    }}function openDivLayerPrint() {	var width = 640;	var height = 480;	var windowWidth =  width + 30;	var windowHeight = height + 130;	var windowX = (screen.width - windowWidth) / 2;	var windowY = (screen.height - windowHeight) / 2;	var parameters = "width=" + windowWidth + ", height=" + windowHeight + ", left=" + windowX + ", top=" + windowY + ", location=no, status=no, toolbar=no, menubar=no, scrollbars=yes, dependent=yes";	var browsePrintWindow = window.open(browsePrintUrl, "browseprint", parameters);	if (browsePrintWindow) browsePrintWindow.focus();		}function getTextBetween(sAll, sStart, sEnd){    var sPart = "";    var posStart = sAll.indexOf(sStart);    var posEnd = sAll.indexOf(sEnd);    if (posStart >= 0 && posEnd >= 0 && posEnd > posStart) {        sPart = sAll.substring(posStart + sStart.length, posEnd);    }    return sPart;}function clickZoomable(id, imgWidth, imgHeight){    if (g_openZoom == 0)    {        var shadeborder = 8;        var elmShade = document.getElementById("zoomImageShade");        var elmImage = document.getElementById("zoomImage" + id);        var elmCloseButton = document.getElementById("closeButton" + id);        var imgX = Math.round((g_pageWidth - imgWidth) / 2);                //if (g_isDesign2010) imgX += 40;        var imgY = Math.round( ((viewportGetHeight() - imgHeight) / 2) + viewportGetScrollY());        if (imgY < 0) { imgY = 0; }        // if (imgX < 0) { imgX = 0; }        elmShade.style.left = (imgX - shadeborder) + "px";        elmShade.style.width = (imgWidth + shadeborder * 2) + "px";        elmShade.style.top = (imgY - shadeborder) + "px";        elmShade.style.height = (imgHeight + shadeborder * 2) + "px";        elmImage.style.left = imgX + "px";        elmImage.style.top = imgY + "px";        if (elmCloseButton) {            elmCloseButton.style.left = (imgWidth - 19) + "px";        }        elmImage.style.display = "block";        elmShade.style.display = "block";        g_openZoom = id;    }}function clickZoomed(){    hideLr("zoomImageShade");    hideLr("zoomImage" + g_openZoom);    g_openZoom = 0;}function showLr(id){    var elm = document.getElementById(id);    if (elm) {        elm.style.display = "block";    }}function hideLr(id){    var elm = document.getElementById(id);    if (elm) {        elm.style.display = "none";    }}/* Expandable module */function expandCollapse(id){    var elm = document.getElementById("expandable_" + id);    if (elm)    {        /* Hack alert -- footer will be hidden temporarily        to recalculate bottom position correctly.        */        var footer = document.getElementById("footer");        footer.style.display = "none";        if (elm.style.height != "auto")        {            collapseAllElements();            showElement(id);                }        else        {            collapseElement(id);        }        positionFooter();        footer.style.display = "block";    }}function showElement(id) {    var elm = document.getElementById("expandable_" + id);    elm.style.height = "auto";    var h3 = document.getElementById("expandableHead_" + id);    if (h3) {                        h3.style.backgroundColor = "rgb(102,102,102)";                         h3.style.color = "rgb(255,255,255)";                      h3.style.backgroundImage = "url(../arrow-lightgray-down.gif)";                    h3.style.backgroundPosition = "9px 9px";    }}function collapseElement(id) {    var elm = document.getElementById("expandable_" + id);    elm.style.height = "19px";    var h3 = document.getElementById("expandableHead_" + id);    if (h3) {        h3.style.backgroundColor = "rgb(204,204,204)";                        h3.style.color = "rgb(0,0,0)";        h3.style.backgroundImage = "url(../arrow-gray.gif)";                  h3.style.backgroundPosition = "11px 7px";    }}function collapseAllElements() {    var i=1;    do {        var elm = document.getElementById("expandable_" + i);        if (elm) collapseElement(i);        i++;    } while(elm);}function viewportGetHeight(){    var retval = 0;    if (window.innerHeight)        retval = window.innerHeight; // - 18;    else if (document.documentElement && document.documentElement.clientHeight)         retval = document.documentElement.clientHeight;    else if (document.body && document.body.clientHeight)         retval = document.body.clientHeight;    return retval;    }function viewportGetWidth(){    var retval = 0;    if (window.innerWidth)        retval = window.innerWidth - 18;    else if (document.documentElement && document.documentElement.clientWidth)         retval = document.documentElement.clientWidth;    else if (document.body && document.body.clientWidth)         retval = document.body.clientWidth;    return retval;    }function viewportGetScrollY(){    var retval = 0;    if (typeof window.pageYOffset == "number")        retval = window.pageYOffset;    else if (document.documentElement && document.documentElement.scrollTop)        retval = document.documentElement.scrollTop;    else if (document.body && document.body.scrollTop)         retval = document.body.scrollTop;     else if (window.scrollY)        retval = window.scrollY;    return retval;}/* Gallery module */var g_lastNumber = 1;function setImage(elm, n){    if (g_lastNumber != n)    {        var lastElm = document.getElementById("thumbnail" + g_lastNumber);        lastElm.className = "";        lastElm.style.border = "1px solid #ccc";        var thisElm = document.getElementById("thumbnail" + n);        thisElm.className = "selected";        thisElm.style.border = "1px solid rgb(204,0,0)";        /* ADDED */        if (document.getElementById("wallpaperRes" + g_lastNumber))             document.getElementById("wallpaperRes" + g_lastNumber).style.visibility = 'hidden';        if (document.getElementById("wallpaperRes" + n))             document.getElementById("wallpaperRes" + n).style.visibility = 'visible';        if (document.getElementById("galleryLabel" + g_lastNumber))             document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';          if (document.getElementById("galleryLabel" + n))             document.getElementById("galleryLabel" + n).style.visibility = 'visible';            /* END ADDED */        g_lastNumber = n;        sHref = elm.href;        document.getElementById("galleryImage").src = sHref;                showGallerySubtitle(n);    }    return false;}function setThumbnail(elm, n){    if (g_lastNumber != n)    {        var lastElm = document.getElementById("thumbnail" + g_lastNumber);        lastElm.className = "";        lastElm.style.border = "1px solid #ccc";        var thisElm = document.getElementById("thumbnail" + n);        thisElm.className = "selected";        thisElm.style.border = "1px solid rgb(204,0,0)";        g_lastNumber = n;    }    return false;}function prevgalleryImage(img, imgMax){    var lastElm = document.getElementById("thumbnail" + g_lastNumber);    if (lastElm) {            lastElm.className = "";        lastElm.style.border = "1px solid #ccc";    }    /* ADDED */    if (document.getElementById("wallpaperRes" + g_lastNumber))         document.getElementById("wallpaperRes" + g_lastNumber).style.visibility = 'hidden';      if (document.getElementById("galleryLabel" + g_lastNumber))         document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';      /* END ADDED */    var n = --g_lastNumber;    if (n < 1) { n = getMaxNumberGallery(); }    var thisElm = document.getElementById("thumbnail" + n);    if (thisElm) {             thisElm.className = "selected";        thisElm.style.border = "1px solid rgb(204,0,0)";    }    var elm = document.getElementById("href" + n);    sHref = elm.href;    document.getElementById("galleryImage").src = sHref;    /* ADDED */    if (document.getElementById("wallpaperRes" + n))         document.getElementById("wallpaperRes" + n).style.visibility = 'visible';        if (document.getElementById("galleryLabel" + n))         document.getElementById("galleryLabel" + n).style.visibility = 'visible';        /* END ADDED */    g_lastNumber = n;        showGallerySubtitle(n);    return false;}function nextgalleryImage(){    var lastElm = document.getElementById("thumbnail" + g_lastNumber);    if (lastElm) {        lastElm.className = "";        lastElm.style.border = "1px solid #ccc";    }    /* ADDED */    if (document.getElementById("wallpaperRes" + g_lastNumber))         document.getElementById("wallpaperRes" + g_lastNumber).style.visibility = 'hidden';      if (document.getElementById("galleryLabel" + g_lastNumber))         document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';      /* END ADDED */    var n = ++g_lastNumber;    var max = getMaxNumberGallery();    if (n > max) { n = 1; }    var thisElm = document.getElementById("thumbnail" + n);    if (thisElm) {            thisElm.className = "selected";        thisElm.style.border = "1px solid rgb(204,0,0)";    }    var elm = document.getElementById("href" + n);    sHref = elm.href;    document.getElementById("galleryImage").src = sHref;    /* ADDED */    if (document.getElementById("wallpaperRes" + n))         document.getElementById("wallpaperRes" + n).style.visibility = 'visible';        if (document.getElementById("galleryLabel" + n))         document.getElementById("galleryLabel" + n).style.visibility = 'visible';        /* END ADDED */    g_lastNumber = n;        showGallerySubtitle(n);    return false;}function initGallerySubtitles(){    var subtitles = document.getElementById("gallerySubtitles")                if (subtitles) {        var tab = getGallerySubtitleTab();                   if (tab) {            tab.style.display = "block";                        showGallerySubtitle(1);        }    }}function showGallerySubtitle(n){    var subtitles = document.getElementById("gallerySubtitles");        if (subtitles) {                var tab = getGallerySubtitleTab();                       if (tab != null) {            var tabSubtitles = tab.getElementsByTagName("div");                        if (tabSubtitles) {                            for (var i = 0; i < tabSubtitles.length; i++) {                    tabSubtitles[i].style.display = (i == n - 1) ? "block" : "none";                }            }        }           }}function getGallerySubtitleTab(){    var no = getGallerySubtitleTabNo();    var tab = document.getElementById("gallerySubtitlesTab" + no);        return tab;          }function getGallerySubtitleTabNo(){    var no = 1;        var regex = /tabindex=(\d)/;    var result = regex.exec(document.URL);        if (result != null) {         no = result[1]    }                    return no;          }function getMaxNumberGallery(){    var max = 0;    for (var i = 15; i >= 1 && max == 0; i--) {        var testElm = document.getElementById("thumbnail" + i);        if (testElm) {            max = i;            break;        }    }    return max;}function showWallpaper(img, iWidth, iHeight){    gotoUrlNewWin(img);}function showGalleryFlashVideo(n, videoUrl, videoWidth, videoHeight, videoTitle, countIt){    var elmImg = document.getElementById("galleryImage");    if (elmImg) {        g_fallbackImage = elmImg.src;    }            var flashWidth = (videoWidth).toString();    var flashHeight = (videoHeight + 20).toString();    var playerUrl = "../videoplayer.swf";            if (document.getElementById("galleryLabel" + g_lastNumber))         document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';      if (document.getElementById("galleryLabel" + n))         document.getElementById("galleryLabel" + n).style.visibility = 'visible';         g_lastNumber = n;         if (countIt) countResourceOpen("Video", videoTitle, videoUrl);        showFlash(playerUrl, "galleryStage", videoWidth, videoHeight, "7", "#FFFFFF",            "loop=true,menu=true,quality=high,wmode=opaque",                        "id=" + videoUrl + ",eventHandler=flashEnded");}function playGallerySound(n, soundUrl, soundTitle, countIt) {    if (countIt) countResourceOpen("Sound", soundTitle, soundUrl);    if (document.getElementById("galleryLabel" + g_lastNumber))         document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';      if (document.getElementById("galleryLabel" + n))         document.getElementById("galleryLabel" + n).style.visibility = 'visible';         g_lastNumber = n;        if (document.getElementById("galleryLabel" + g_lastNumber))         document.getElementById("galleryLabel" + g_lastNumber).style.visibility = 'hidden';      if (document.getElementById("galleryLabel" + n))         document.getElementById("galleryLabel" + n).style.visibility = 'visible';        document.getElementById("gallerySoundStage").style.visibility = "visible";      if (typeof g_hasFlash == "undefined") detectFlash();        if (g_hasFlash) {        var flashWidth = "200";        var flashHeight = "20";        var playerUrl = "../mp3playerje.swf";            showFlash(playerUrl, "gallerySoundStage", flashWidth, flashHeight, "7", "#FFFFFF",            "loop=true,menu=false,quality=high,wmode=opaque",                        "file=" + soundUrl + ",autostart=true,eventHandler=flashEnded");     }     else {         var audioPlayer = document.getElementById("audio");            if (audioPlayer == null) {              audioPlayer = document.createElement("audio");             audioPlayer.id = "audio";            audioPlayer.innerHTML = "Your browser does not support the audio element.";                       audioPlayer.autoplay = "autoplay";             audioPlayer.controls = "controls";            audioPlayer.style.width = "200px";              audioPlayer.style.height = "20px";                        document.getElementById("gallerySoundStage").appendChild(audioPlayer);          }          audioPlayer.src = soundUrl;          audioPlayer.play();                }}var g_sound = "";function playSound(n, soundUrl, soundTitle, countIt) {    if (countIt) countResourceOpen("Sound", soundTitle, soundUrl);		if (g_sound != "") document.getElementById("soundStage" + g_sound).innerHTML = "";	g_sound = n;        if (typeof g_hasFlash == "undefined") detectFlash();        if (g_hasFlash) {        var flashWidth = "150";        var flashHeight = "20";        var playerUrl = "../mp3playerje.swf";            showFlash(playerUrl, "soundStage" + n, flashWidth, flashHeight, "7", "#FFFFFF",            "loop=true,menu=false,quality=high,wmode=opaque",                        "file=" + soundUrl + ",autostart=true,eventHandler=flashEnded");     }     else {         var audioPlayer = document.getElementById("audio");            if (audioPlayer == null) {              audioPlayer = document.createElement("audio");             audioPlayer.id = "audio";            audioPlayer.innerHTML = "Your browser does not support the audio element.";                       audioPlayer.autoplay = "autoplay";             audioPlayer.controls = "controls";            audioPlayer.style.width = "150px";              audioPlayer.style.height = "20px";                        document.getElementById("soundStage" + n).appendChild(audioPlayer);          }          audioPlayer.src = soundUrl;          audioPlayer.play();                }}/* Windows module */function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}function gotoUrlNewWinSimple(s){    newWin = window.open(s, "newWin" + getRandomInt(10000));}function gotoUrlNewWin(s){    sWidth = 826;    sHeight = 610;    sWidth += 20;    sHeight += 25;    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}function gotoUrlNewWinSize(s, sWidth, sHeight){    sWidth += 20;    sHeight += 25;    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}function gotoUrlNewWinSizeScrollable(s, sWidth, sHeight){    sWidth += 20;    sHeight += 25;    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=yes,status=no");}function gotoUrlNewWinSizeScrollableWithMenu(s, sWidth, sHeight){    sWidth += 20;    sHeight += 50;    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=yes,menubar=yes,toolbar=yes,resizable=no,scrollbars=yes,status=yes");}function gotoUrlNewWinDefaultSize(s){    sWidth = 570;    sHeight = 610;    sWidth += 20;    sHeight += 25;    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}function gotoUrlNewWinSizeCentered(s, iWidth, iHeight){    iWidth += 20;    iHeight += 25;        iLeft = Math.round((screen.width - iWidth) / 2);    iTop = Math.round((screen.height - iHeight) / 2);    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top=" + iTop + ",dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}function gotoUrlNewWinSizeByName(s, sWidth, sHeight, sName){    sWidth += 20;    sHeight += 25;    newWin = window.open(s, sName, "width=" + sWidth + ",height=" + sHeight + ",left=40,top=40,dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}function openLeanWin(sUrl, sWidth, sHeight){    sWidth += 20;    sHeight += 25;    newWin = window.open(sUrl, "newWin" + getRandomInt(10000), "width=" + sWidth + ",height=" + sHeight + ",left=140,top=140,dependent=yes,location=no,resizable=no,scrollbars=no,status=no,menubar=no,toolbar=no");}function gotoUrlNewWinSizeCenteredScrollbar(s, iWidth, iHeight){    iWidth += 20;    iHeight += 25;      iLeft = Math.round((screen.width - iWidth) / 2);    iTop = Math.round((screen.height - iHeight) / 2);    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top=" + iTop + ",dependent=yes,location=no,resizable=no,scrollbars=yes,status=no");}function gotoUrlNewWinSizeCenteredResizable(s, iWidth, iHeight){    iWidth += 20;    iHeight += 25;      iLeft = 20;    iTop = 20;    newWin = window.open(s, "sportWin", "width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top=" + iTop + ",dependent=yes,location=no,resizable=no,scrollbars=yes,status=no");}function gotoUrlNewWinSizeCenteredScrollable(s, iWidth, iHeight){    iWidth += 20;    iHeight += 25;    iLeft = Math.round((screen.width - iWidth) / 2);    iTop = Math.round((screen.height - iHeight) / 2);    newWin = window.open(s, "newWin" + getRandomInt(10000), "width=" + iWidth + ",height=" + iHeight + ",left=" + iLeft + ",top=" + iTop + ",dependent=yes,location=no,resizable=no,scrollbars=yes,status=no");}function getRandomInt(max){    return Math.round( Math.random() * (max-1) );}/* Home module */function initHome(){    if (document.getElementById) {        g_initHome = true;    }	    if (document.getElementById(g_extraBoxId)) {		if (g_homeImageNr == g_extraBoxNr) 			document.getElementById(g_extraBoxId).style.visibility = "visible";		else 			document.getElementById(g_extraBoxId).style.visibility = "hidden";	}			startTimeoutPossNextHomeImage();}function bannerLinkToHi(sId){    if (g_initHome)      {        var elm = document.getElementById(sId);        if (elm)        {            elm.style.color = "#c00";            elm.style.backgroundImage = "url(../arrow-red.gif)";        }    }}function bannerLinkToLo(sId){    if (g_initHome)    {        var elm = document.getElementById(sId);        if (elm)        {            elm.style.color = "rgb(102,102,102)";            elm.style.backgroundImage = "url(../arrow-gray.gif)";        }    }}function navShadeIn(level){    if (g_initHome)    {        if (level == 1)        {            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }        }        else if (level == 2)        {            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            if (g_timeoutHide2 != 0) { clearTimeout(g_timeoutHide2); }        }        else if (level == 3)        {            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            if (g_timeoutHide2 != 0) { clearTimeout(g_timeoutHide2); }            if (g_timeoutHide3 != 0) { clearTimeout(g_timeoutHide3); }        }    }}function navShadeOut(level){    if (g_initHome)    {        if (level == 1)        {            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);        }        else if (level == 2)        {            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);            g_timeoutHide2 = setTimeout("hideNav(2,\"" + g_currentNav2 + "\",\"" + g_currentHi2 + "\")", g_timeoutTime);        }        else if (level == 3)        {            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);            g_timeoutHide2 = setTimeout("hideNav(2,\"" + g_currentNav2 + "\",\"" + g_currentHi2 + "\")", g_timeoutTime);            g_timeoutHide3 = setTimeout("hideNav(3,\"" + g_currentNav3 + "\",\"" + g_currentHi3 + "\")", g_timeoutTime);        }    }}function overNav(level, sName, sSelf){    if (g_initHome)    {        if (level == 0 || level == "0")        {            echo("level in 0");            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            hideSubLayers(g_currentNav1);            loliteLr(level, g_currentHi1);            if (g_currentNav1 != "") { hideSubLayers(g_currentNav1); }            if (g_currentHi1 != "") { loliteLr(level, g_currentHi1); }            showNav(level + 1, sName, sSelf);            g_currentNav1 = sName;            g_currentHi1 = sSelf;                    }        else if (level == 1 || level == "1")        {            echo("level in 1");            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            if (g_timeoutHide2 != 0) { clearTimeout(g_timeoutHide2); }            if (g_currentNav2 != "") { hideSubLayers(g_currentNav2); }            if (g_currentHi2 != "") { loliteLr(level, g_currentHi2); }            showNav(level + 1, sName, sSelf);            g_currentNav2 = sName;            g_currentHi2 = sSelf;        }        else if (level == 2 || level == "2")        {            echo("level in 2");            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            if (g_timeoutHide2 != 0) { clearTimeout(g_timeoutHide2); }            if (g_timeoutHide3 != 0) { clearTimeout(g_timeoutHide3); }            if (g_currentNav3 != "") { hideSubLayers(g_currentNav3); }            if (g_currentHi3 != "") { loliteLr(level, g_currentHi3); }            showNav(level + 1, sName, sSelf);            g_currentNav3 = sName;            g_currentHi3 = sSelf;                    }        else if (level == 3 || level == "3")        {            echo("level in 3");            if (g_timeoutHide1 != 0) { clearTimeout(g_timeoutHide1); }            if (g_timeoutHide2 != 0) { clearTimeout(g_timeoutHide2); }            if (g_timeoutHide3 != 0) { clearTimeout(g_timeoutHide3); }            if (g_timeoutHide4 != 0) { clearTimeout(g_timeoutHide4); }            if (g_currentNav4 != "") { hideSubLayers(g_currentNav4); }            showNav(level + 1, sName, sSelf);            g_currentNav4 = sName;        }    }}function loadImage(sName, sUrl){     var elem = document.getElementById(sName + "_image");    if (elem) elem.src = sUrl;}function outNav(level){    if (g_initHome)    {        if (level == 0 || level == "0")        {            echo("level out 0");            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);              }        else if (level == 1 || level == "1")        {            echo("level out 1");            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);            g_timeoutHide2 = setTimeout("hideNav(2,\"" + g_currentNav2 + "\",\"" + g_currentHi2 + "\")", g_timeoutTime);        }        else if (level == 2 || level == "2")        {            echo("level out 2");            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);            g_timeoutHide2 = setTimeout("hideNav(2,\"" + g_currentNav2 + "\",\"" + g_currentHi2 + "\")", g_timeoutTime);            g_timeoutHide3 = setTimeout("hideNav(3,\"" + g_currentNav3 + "\",\"" + g_currentHi3 + "\")", g_timeoutTime);        }        else if (level == 3 || level == "3")        {            echo("level out 3");            g_timeoutHide1 = setTimeout("hideNav(1,\"" + g_currentNav1 + "\",\"" + g_currentHi1 + "\")", g_timeoutTime);            g_timeoutHide2 = setTimeout("hideNav(2,\"" + g_currentNav2 + "\",\"" + g_currentHi2 + "\")", g_timeoutTime);            g_timeoutHide3 = setTimeout("hideNav(3,\"" + g_currentNav3 + "\",\"" + g_currentHi3 + "\")", g_timeoutTime);            g_timeoutHide4 = setTimeout("hideNav(4,\"" + g_currentNav4 + "\",\"" + g_currentHi4 + "\")", g_timeoutTime);        }        else        {            echo("level out is else: " + level);        }             }}function dimHeadline(doOn){             var elem = document.getElementById("homeHead");        if (elem) {        if (parseInt(elem.style.top.replace(/px/, ""),10) > 88) {                               if (doOn)                {                    elem.style.MozOpacity = ".99";                    elem.style.filter = "alpha(opacity=100)";                }                else                {                    elem.style.MozOpacity = ".40";                    elem.style.filter = "alpha(opacity=40)";                }        }    }}function showNav(level, sName, sSelf){    dimHeadline(false);    hiliteLr(level - 1, sSelf);    var foundOne = showSubLayers(sName);    if (foundOne)    {        if (g_canHandleTransparency)        {            var elm = document.getElementById("navshade" + level);            showLr("navshade" + level);        }        else        {            var elm = document.getElementById("navshadeSimple" + level);            showLr("navshadeSimple" + level);        }    }    else    {        if (g_canHandleTransparency)        {            hideLr("navshade" + level);        }        else        {            hideLr("navshadeSimple" + level);        }    }     }function hideNav(level, sName, sSelf){    if (level == 1) { g_timeoutHide1 = 0; g_currentNav1 = ""; g_currentSelf1 = ""; dimHeadline(true); }    if (level == 2) { g_timeoutHide2 = 0; g_currentNav2 = ""; g_currentSelf2 = ""; }    if (level == 3) { g_timeoutHide3 = 0; g_currentNav3 = ""; g_currentSelf3 = ""; }    if (level == 4) { g_timeoutHide4 = 0; g_currentNav4 = ""; }    loliteLr(level - 1, sSelf);    if (g_canHandleTransparency)    {        hideLr("navshade" + level);    }    else    {        hideLr("navshadeSimple" + level);    }    hideSubLayers(sName);}function fadeAllOut(elem){    return;  if(elem == undefined)    return;  if(g_jdpowerphase == "none")   return;  var ID = elem.id  var i = 0;  var which = parseInt(ID.replace('link', '').replace('topnav', ''));  for( ; i <= 9; i++)  {    if((i <= 4) && (which != i))    {      fadeOut('topnavlink' + i.toString());    }    if((i >= 5) && (which != i))      fadeOut('topnavlink' + i.toString());  }}function fadeAllIn(elem){    return;  if(elem == undefined)    return;  if(g_jdpowerphase == "none")   return;  var ID = elem.id  var i = 0;  var which = parseInt(ID.replace('link', '').replace('topnav', ''));  for( ; i <= 9; i++)  {    if((i <= 4) && (which != i))    {      fadeIn('topnavlink' + i.toString());    }    if((i >= 5) && (which != i))      fadeIn('topnavlink' + i.toString());  }}function fadeOut(ID){  var elem = document.getElementById(ID);  if(elem)  {    elem.style.MozOpacity = ".5";     elem.style.Opacity = ".5";     elem.style.opacity = ".5";     elem.style.filter = "Alpha(opacity=50, finishopacity=50, style=2)";  }}function fadeIn(ID){  var elem = document.getElementById(ID);  if(elem)  {    elem.style.MozOpacity = "1.00"; // hack around weeeiiird bug which causes "1" to break NS7.02    elem.style.Opacity = "1.00";     elem.style.opacity = "1.00";     elem.style.filter = "Alpha(opacity=100, finishopacity=100, style=2)";  }}function hiliteLr(level, sName){    var elem = document.getElementById(sName);    if (elem)    {        if (level == 0 || level == "0")        {           elem.style.backgroundColor = g_homemenu_hl_background_color_Level5;                     elem.style.color = g_homemenu_hl_fontcolor;             if (! (elem.className.indexOf("final") >= 0) )            {                elem.style.backgroundImage = "url(../arrow-red.gif)";            }                        fadeAllOut(elem);        }        else        {            elem.style.color = g_homemenu_hl_fontcolor; //"rgb(204, 0, 0)";            elem.style.backgroundColor = "#FFFFFF";            if (! (elem.className.indexOf("final") >= 0) )            {                elem.style.backgroundImage = "url(../arrow-red.gif)";            }            elem.style.MozOpacity = ".99"; // hack around weeeiiird bug which causes "1" to break NS7.02            elem.style.Opacity = "1.00";             elem.style.opacity = "1.00";             elem.style.filter = "alpha(opacity=100)";        }    }}function loliteLr(level, sName){    var elem = document.getElementById(sName);    if (elem)    {        if (level == 0 || level == "0")        {                       elem.style.backgroundColor = g_homemenu_ll_background_color;                          elem.style.color = g_homemenu_ll_fontcolor_level0;              elem.style.backgroundColor = g_homemenu_ll_background_color;              if (! (elem.className.indexOf("final") >= 0) )             {                 elem.style.backgroundImage = g_homemenu_ll_background_image_level0;              }                        fadeAllIn(elem);                    }        else        {            elem.style.color = g_homemenu_ll_fontcolor_level1;            elem.style.backgroundColor = g_homemenu_ll_background_color; //"#FFFFFF";            if (! (elem.className.indexOf("final") >= 0) )            {                elem.style.backgroundImage = g_homemenu_ll_background_image_level1;            }            elem.style.MozOpacity = ".86";            elem.style.Opacity = ".86";             elem.style.opacity = ".86";             elem.style.filter = "alpha(opacity=86)";        }    }}function showSubLayers(sName){    var i = 0;    var foundOne = false;    for (i = 1; i <= 13; i++)    {        var s = "nav_" + sName + "_" + i;        var elem = document.getElementById(s);        if (elem)        {            foundOne = true;        }        else        {            break;        }        showLr(s);    }    return foundOne;}function hideSubLayers(sName){    var i = 0;    var foundOne = false;    for (i = 1; i <= 13; i++)    {        var s = "nav_" + sName + "_" + i;        var elem = document.getElementById(s);        if (elem)        {            foundOne = true;        }        else        {            break;        }        hideLr(s);    }    return foundOne;}function echo(s){    /*    var elDebug = document.getElementById("debug");    elDebug.innerHTML = "<div><span>" + (++g_echoCount) + ".</span> " + s + "</div>" + elDebug.innerHTML;    */}function gotoUrl(s){    document.location.href = s;}function gotoUrlIE(url){    if (g_is_ie) {        gotoUrl(url);    }}function nogo(){    //}function getRandomInt(max){    return Math.round( Math.random() * (max-1) );}function selectAllInput(elm){    if (elm)    {        elm.focus();        elm.select();    }}function changedCountry(elmThis){    if (document.getElementById)    {        var sUrl = elmThis.value;        if (sUrl != "")        {            document.location.href = sUrl;        }    }}function sniffAll(){    /* JavaScript Browser Sniffer       Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002       see http://www.webreference.com/ for more information       This program is free software */    var agt=navigator.userAgent.toLowerCase();    var appVer = navigator.appVersion.toLowerCase();    var is_minor = parseFloat(appVer);    var is_major = parseInt(is_minor);    var is_opera = (agt.indexOf("opera") != -1);    /*    var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1);    var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1);    var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5);    var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6);    */    var iePos  = appVer.indexOf('msie');    if (iePos !=-1) {       is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));       is_major = parseInt(is_minor);    }        var is_konq = false;    var kqPos   = agt.indexOf('konqueror');    if (kqPos !=-1) {                        is_konq  = true;       is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));       is_major = parseInt(is_minor);    }    var is_getElementById   = (document.getElementById) ? "true" : "false";    var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false";    var is_documentElement = (document.documentElement) ? "true" : "false";    var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;    var is_khtml  = (is_safari || is_konq);    var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;    var is_gver  = 0;    if (is_gecko) is_gver=navigator.productSub;    var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&                    (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&                    (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&                    (is_gecko) &&                     ((navigator.vendor=="")||(navigator.vendor=="Mozilla")));    var is_mac = ((agt.indexOf('macintosh')!=-1))?true:false;    var is_linux = (navigator.platform.toLowerCase().indexOf('linux')!=-1)?true:false;    var is_win = (navigator.platform.toLowerCase().indexOf('win')!=-1)?true:false;        if (is_moz) {       var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;       if(!(is_moz_ver)) {           is_moz_ver = agt.indexOf('rv:');           is_moz_ver = agt.substring(is_moz_ver+3);           is_paren   = is_moz_ver.indexOf(')');           is_moz_ver = is_moz_ver.substring(0,is_paren);       }       is_minor = is_moz_ver;       is_major = parseInt(is_moz_ver);    }    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)                && (!is_khtml) && (!(is_moz)));    if ((navigator.vendor)&&        ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&        (is_nav)) {       is_major = parseInt(navigator.vendorSub);       is_minor = parseFloat(navigator.vendorSub);    }    var is_nav2 = (is_nav && (is_major == 2));    var is_nav3 = (is_nav && (is_major == 3));    var is_nav4 = (is_nav && (is_major == 4));    var is_nav4up = (is_nav && is_minor >= 4);     var is_navonly  = (is_nav && ((agt.indexOf(";nav") != -1) ||                          (agt.indexOf("; nav") != -1)) );    var is_nav6   = (is_nav && is_major==6);    var is_nav6up = (is_nav && is_minor >= 6);    var is_nav5   = (is_nav && is_major == 5 && !is_nav6);    var is_nav5up = (is_nav && is_minor >= 5);    var is_nav7   = (is_nav && is_major == 7);    var is_nav7up = (is_nav && is_minor >= 7);    var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));    var is_ie3  = (is_ie && (is_major < 4));    var is_ie4   = (is_ie && is_major == 4);    var is_ie4up = (is_ie && is_minor >= 4);    var is_ie5   = (is_ie && is_major == 5);    var is_ie5up = (is_ie && is_minor >= 5);        var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1));    var is_ie5_5up =(is_ie && is_minor >= 5.5);        var is_ie6   = (is_ie && is_major == 6);    var is_ie6up = (is_ie && is_minor >= 6);    // OS    g_is_win = is_win;    g_is_mac = is_mac;    g_is_linux = is_linux;        g_is_ie = is_ie;    g_is_opera = is_opera;    g_is_ie5 = is_ie5;    g_is_ie5_5 = is_ie5_5;    g_is_safari = is_safari;} /* Module Image Switch */function updateImageSwitch(elm, state){    var elmChild = null;        if (elm.childNodes[0].style != undefined) {        elmChild = elm.childNodes[0];    } else {        elmChild = elm.childNodes[1];    }    switch (state) {        case "active":                var i = 1;            do {                var elmInactive = document.getElementById("switchImage" + i);                if (elmInactive != null) {                    updateImageSwitch(elmInactive, "inactive");                }                i++;            } while (elmInactive != null)                elm.style.color = "rgb(204,0,0)";            elm.style.background = "white url(../arrow-red.gif) no-repeat left 3px";            elmChild.style.display = "block";                                  break;        case "inactive":            elm.style.color = "rgb(102,102,102)";            elm.style.background = "white url(../arrow-gray.gif) no-repeat left 3px";            elmChild.style.display = "none";                                          }}/* Macht ein Redirect zur Value des ausgew\u00E4hlten Elements der angegebenen Select Box */function RedirectToOptionValue(name){  obj = document.getElementById(name);  if(obj)  {    link = obj.options[obj.selectedIndex].value;    if(link.length > 0)    {      document.location.href = link;    }  }}function getCookie(name){    var thisCookie = document.cookie;    var index = thisCookie.indexOf(name + "=");    if (index == -1) return null;    index = thisCookie.indexOf("=", index) + 1;    var endstr = thisCookie.indexOf(";", index);    if (endstr == -1) endstr = thisCookie.length;    return unescape(thisCookie.substring(index, endstr));}function replStr(str,oldStr,newStr){ var strPos=str.indexOf(oldStr);  return (strPos>=0) ?    str.substring(0,strPos) + newStr +       replStr( str.substring(strPos +       oldStr.length), oldStr, newStr ) :    str}function middleStr(sAll, sStart, sEnd){        var sPart = "";        var posStart = sAll.indexOf(sStart);    var posEnd = sAll.indexOf(sEnd, posStart + sStart.length + 1);     if (posStart >= 0 && posEnd >= 0 && posEnd > posStart) {        sPart = sAll.substring(posStart + sStart.length, posEnd);        }        return sPart;}function rightStr(sAll, sStart){        var sPart = "";        var posStart = sAll.indexOf(sStart);    if (posStart >= 0) {        sPart = sAll.substring(posStart + sStart.length, sAll.length);        }        return sPart;}function leftStr(sAll, sStart){        var sPart = "";        var posEnd = sAll.indexOf(sStart);    if (posEnd >= 0) {        sPart = sAll.substring(0, posEnd);        }        return sPart;}function strLeft(src, delim) {    var pos = src.indexOf(delim);    return  src.substring(0, pos);}function strLeftBack(src, delim) {    var pos = src.lastIndexOf(delim);    return  src.substring(0, pos);}    function strRight(src, delim) {    var pos = src.indexOf(delim);    return  src.substring(pos + delim.length, src.length);}function strRightBack(src, delim) {    var pos = src.lastIndexOf(delim);    return  src.substring(pos + delim.length, src.length);}function startSearch() {            var webArea = middleStr(document.location.href, "/web/", "-");    var term = encodeURIComponent(document.forms["searchform"].query.value);    var action = webArea + "-searchresult?OpenDocument&search=" + term;     document.location.href = action;    }function startSearch2(webArea) {            var term = encodeURIComponent(document.forms["searchform"].query.value);    var action = "web/" + webArea + "-searchresult?OpenDocument&search=" + term;     document.location.href = action;    }/* Inline videos */function videoWin(area, videoURL, videoWidth, videoHeight, docUNID, multimediaNr) {    var  url = '../Video?OpenNavigator&area=' + area + '&url=' + videoURL + '&width=' + String(videoWidth) + '&height=' + String(videoHeight) + '&unid=' + docUNID + '&nr=' + multimediaNr;    var windowWidth = videoWidth + 52;    var windowHeight;    if(videoURL.indexOf('.mov') > -1) windowHeight = videoHeight + 107;    else windowHeight = videoHeight + 137;    var windowLeft = Math.round((screen.width - windowWidth) / 2);    var windowTop = Math.round((screen.height - windowHeight) / 2);    newWin = window.open(url, "newWin" + getRandomInt(10000), "width=" + windowWidth + ",height=" + windowHeight + ",left=" + windowLeft + ",top=" + windowTop + ",dependent=yes,location=no,resizable=no,scrollbars=no,status=no");}//Flashfunction showFlashaaa(url, id, width, height, version, bgcolor, playerparamstr, flashparamstr) {        //var fo = new FlashObject(url, id + "_flash", width, height, version, bgcolor);        var fo = new FlashObject(url, id + "_flash", width, height, version, bgcolor, flashparamstr);                if (playerparamstr != undefined) {                var playerparams = playerparamstr.split(",");            for (var i=0; i < playerparams.length; i++ ){                var param = playerparams[i].split("=");                fo.addParam(param[0], param[1]);            }        }                if (flashparamstr != undefined) {            var flashparams = flashparamstr.split(",");            for (var i=0; i < flashparams.length; i++ ){                                   var param = flashparams[i].split("=");                fo.addVariable(param[0], param[1]);            }        }                fo.write(id);   }function showFlash(url, id, width, height, version, bgcolor, playerparamstr, flashparamstr) {    var flashElmId = id + "_flash";    width = "" + width;    height = "" + height;    version = "" + version;        //var elm = $('#'+id).get(0) || $('.' + id).get(0);    var elm = document.getElementById(id);    if (!elm) {        return;    }    var flashvars = JSONify(flashparamstr); // + ',posx=296,cdnhost=http://special.porsche.com/'); //    var params = JSONify(playerparamstr);    var attributes = false;    params.bgcolor = bgcolor;    params.align = "middle";    var expressinstall = "/all/media/flash/expressInstall.swf";    if (g_is_home) {        expressinstall = false;    }    var playFlash = true;//    log("showFlash - " + url);    if (g_is_home) {        if (!swfobject.hasFlashPlayerVersion(version)) {            // fall back to regular page (without flash)            fallBackFromFlash(getPoolName());            playFlash = false; // on the homepage, if flash check fails, do not attempt to run  flash..        }        else {            // prepare the homepage before loading flash animation.            //hideHomepageNavigation();            //hideHomepageClaim();        }    }    else    {        if ((swfobject.getFlashPlayerVersion().major+'') == '0') // no Flash installed            playFlash = false;    }    // go    if (playFlash) {       // $(elm).html("<div id=\"" + flashElmId + "\"></div>");        elm.innerHTML = "<div id=\"" + flashElmId + "\"></div>";//        log("url: " + url); //        log("flashElmId: " + flashElmId); //        log("width: " + width); //        log("height: " + height); //        log("version: " + version); //        log("expressinstall: " + expressinstall); //        log("flashvars: " + $(flashvars)); //        log("params: " + $(params));//        log("attributes: " + attributes);        swfobject.embedSWF(url, flashElmId, width, height, version, expressinstall, flashvars, params, attributes);    }}// parses an array into a json string, // evals it and returns an object.function JSONify(str) {        //alert("JSONify ing: " + str);    if (str == undefined || str == null) return "{}";    var json = "{";    var trap = false;    var params = str.split(",");    for (var i = 0; i < params.length; i++) {        var param = params[i].split("=");        if (param[0] == undefined || param[0] == null || param[0] == "") {            trap = true;            continue;        }        else {            if (i > 0 && !trap) {                json += ",";                trap = false;            }            json += param[0] + ":\"" + param[1] + "\"";        }    }    json += "}";    return eval('(' + json + ')');   }function openDivLayerPrintWindow() {	var docURL = document.URL;	var pos = docURL.indexOf("?OpenDocument");	if(pos != "-1") {		docURL = docURL.substring(0, pos);	}	var entryURL = replStr(docURL, "/web/", "/webimagegalleryentryprint/") + "?OpenDocument&tab=" + tabNr + "&img=" + imgNr;		var width = 640;	var height = 480;	var windowWidth =  width + 30;	var windowHeight = height + 130;	var windowX = (screen.width - windowWidth) / 2;	var windowY = (screen.height - windowHeight) / 2;	var parameters = "width=" + windowWidth + ", height=" + windowHeight + ", left=" + windowX + ", top=" + windowY + ", location=no, status=no, toolbar=no, menubar=no, dependent=yes";	var entryWindow = window.open(entryURL, "entry", parameters);	if (entryWindow) entryWindow.focus();		}function closePopupDiv(stopIt){    // IE Hack for dropdowns    //ieToggleDropDowns(getListIEDropDowns(), false);    showLr("divLayerMore");    if (stopIt) document.getElementById("divLayerContent").innerHTML = "<p>&nbsp;</p>";    else stopSlideshow();    hideLr("divLayer");        hideLr("divLayerShade");     hideLr("pageoverlay");        g_openpopupDiv = 0;    }function closeContentDiv(){     hideLr("divLayer");        hideLr("divLayerShade");     hideLr("pageoverlay");        g_openDivLayer = 0;    }function countResourceOpen(type, title, url) {    var counterUrl = strLeftBack(document.location.href, ".nsf/") + ".nsf/ResourceOpenCounter?OpenAgent";    var callback = null;    var postData = "DocumentUrl=" + escape(document.location.href) + "&DocumentTitle=" + escape(document.title);    postData += "&Type=" + type + "&ResourceTitle=" + escape(title) + "&ResourceUrl=" + escape(url);                sendRequest(counterUrl, callback, postData)}function showFlashVideo(videoTitle, videoTitleImg, videoUrl, videoWidth, videoHeight, hasMore, countIt, moreLink) {        if (countIt) countResourceOpen("Video", videoTitle, videoUrl);            var shadeborder = 8;	//scale by 1.2375 for galleryPlayer.swf	videoWidth = Math.round(videoWidth * 1.2375);	videoHeight = Math.round(videoHeight * 1.2375);     var divWidth = videoWidth + 8;    var divHeight = videoHeight + 8;    if (hasMore) divHeight += 23;        //var popupWidth = divWidth;    //var popupHeight = divHeight - 36;    //var shadeWidth = divWidth + 23;    //var shadeHeight = divHeight + 70;/*  if (screen.width <= 800) {        divHeight = 300;          popupHeight = 276;          shadeHeight = 353;    }*/    //var elmShade = document.getElementById("divLayerShade");    var elmPopup = document.getElementById("divLayer");    var elmContent = document.getElementById("divLayerContent");    var elmOverlay = document.getElementById('pageoverlay');    var divX = Math.round(g_pageWidth / 2 - divWidth / 2);    var divY = Math.round((viewportGetHeight() - divHeight) / 2) + viewportGetScrollY();    if (divX < 0) { divX = 0; }    if (divY < 0) { divY = 0; }        /*elmShade.style.left = (divX - shadeborder) + "px";    elmShade.style.top = (divY - shadeborder) + "px";    elmShade.style.width = shadeWidth + "px";    elmShade.style.height = shadeHeight + "px";*/    elmPopup.style.left = divX + "px";    elmPopup.style.top = divY + "px";    elmPopup.style.width = divWidth + "px";    elmPopup.style.height = divHeight + "px";    elmContent.style.width = videoWidth + "px";    elmContent.style.height = videoHeight + "px";    document.getElementById("divLayerTitle").style.width = (divWidth - 8) + "px";    document.getElementById("closeButtonDivLayer").style.left = (divWidth - 16) + "px";      //g_openpopupDiv = sUrl;        document.getElementById("divLayerTitle").innerHTML = "<img src=\"" + videoTitleImg + "\" alt=\"" + videoTitle + "\">";    elmOverlay.style.display = "block";     elmPopup.style.display = "block";    //elmShade.style.display = "block";    elmContent.style.display = "block";                if (moreLink) document.getElementById("divLayerMore").getElementsByTagName("a")[0].href = moreLink;            if (typeof g_hasFlash == "undefined") detectFlash();            if (g_hasFlash) {            var flashParams = 'filetype=swf';                   var flashWidth = (videoWidth).toString();        var flashHeight = (videoHeight + 20).toString();        //var playerUrl = "../videoplayer.swf";        //var playerUrl = "../galleryplayer.swf";        var playerUrl = "/mediaplayer/galleryPlayer.swf";        //var playerUrl = "/mediaplayer/mediaplayer.swf";    	     var videoUrlBegin = "";	    if (videoUrl.substring(0, 1) != "/") videoUrlBegin = strLeftBack(strLeftBack(document.location.href, "/"), "/") + "/";                    //"videourl=" + videoUrl + ",eventhandler=flashEnded," + flashParams);        //showFlash(playerUrl, "divLayerContent", videoWidth, videoHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=opaque", "id=" + videoUrl + ",eventHandler=flashEnded");        showFlash(playerUrl, "divLayerContent", videoWidth, videoHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=opaque", "videopath=" + videoUrlBegin + videoUrl + ",eventHandler=flashEnded");        //showFlash(playerUrl, "popupDivLayer", videoUrl, videoWidth, videoHeight);                }    else {            elmContent.innerHTML = "";        if (videoUrl.indexOf(".flv") == -1) {             var videoPlayer = document.getElementById("video");                if (videoPlayer == null) {                  videoPlayer = document.createElement("video");                 videoPlayer.id = "video";                videoPlayer.innerHTML = "Your browser does not support the video element.";                           videoPlayer.autoplay = "autoplay";                 videoPlayer.controls = "controls";                videoPlayer.style.width = videoWidth + "px";                  videoPlayer.style.height = videoHeight + "px";                            elmContent.appendChild(videoPlayer);             }                     var dbPath = leftStr(document.location.href, ".nsf") + ".nsf/";             //var docUnid = middleStr(videoUrl, ".nsf/", "$file");              //var video5Url = "/servlet/GetNotesAttachmentBinContentType?dbpath=" + dbPath + "&unid=" + docUnid + "&contenttype=video/mp4";             videoPlayer.src = dbPath + videoUrl;              videoPlayer.play();                    }           else {             elmContent.innerHTML = "Video format not supported!";           }    }    }function showExternalVideo(videoTitle, videoTitleImg, videoHtml, videoId, videoWidth, videoHeight, hasMore, countIt, moreLink) {        if (countIt) countResourceOpen("Video", videoTitle, videoId);            var shadeborder = 8;	     var divWidth = videoWidth + 8;    var divHeight = videoHeight + 8;    if (hasMore) divHeight += 23;    var elmPopup = document.getElementById("divLayer");    var elmContent = document.getElementById("divLayerContent");    var elmOverlay = document.getElementById('pageoverlay');    var divX = Math.round(g_pageWidth / 2 - divWidth / 2);    var divY = Math.round((viewportGetHeight() - divHeight) / 2) + viewportGetScrollY();    if (divX < 0) { divX = 0; }    if (divY < 0) { divY = 0; }    elmPopup.style.left = divX + "px";    elmPopup.style.top = divY + "px";    elmPopup.style.width = divWidth + "px";    elmPopup.style.height = divHeight + "px";    elmContent.style.width = videoWidth + "px";    elmContent.style.height = videoHeight + "px";    document.getElementById("divLayerTitle").style.width = (divWidth - 8) + "px";    document.getElementById("closeButtonDivLayer").style.left = (divWidth - 16) + "px";            document.getElementById("divLayerTitle").innerHTML = "<img src=\"" + videoTitleImg + "\" alt=\"" + videoTitle + "\">";    elmOverlay.style.display = "block";     elmPopup.style.display = "block";    elmContent.style.display = "block";                if (moreLink) document.getElementById("divLayerMore").getElementsByTagName("a")[0].href = moreLink;                 document.getElementById("divLayerContent").innerHTML = videoHtml;    }function showFlashVideoMore(videoTitle, videoTitleImg, videoUrl, videoWidth, videoHeight, hasMore, countIt, moreLink) {    showFlashVideo(videoTitle, videoTitleImg, videoUrl, videoWidth, videoHeight, hasMore, countIt);        document.getElementById("divLayerMore").getElementsByTagName("a")[0].href = moreLink;}function showFlashSound(soundTitle, soundTitleImg, soundUrl) {        if (countIt) countResourceOpen("Sound", soundTitle, soundUrl);            var shadeborder = 8;     var divWidth = videoWidth + 8;    var divHeight = videoHeight + 8;    if (hasMore) divHeight += 23;    // magic numbers follow, do not try at home    //var popupWidth = divWidth;    //var popupHeight = divHeight - 36;    //var shadeWidth = divWidth + 23;    //var shadeHeight = divHeight + 70;/*  if (screen.width <= 800) {        divHeight = 300;          popupHeight = 276;          shadeHeight = 353;    }*/    //var elmShade = document.getElementById("divLayerShade");    var elmPopup = document.getElementById("divLayer");    var elmContent = document.getElementById("divLayerContent");    var elmOverlay = document.getElementById('pageoverlay');    var divX = Math.round(g_pageWidth / 2 - divWidth / 2);    var divY = Math.round((viewportGetHeight() - divHeight) / 2) + viewportGetScrollY();    if (divX < 0) { divX = 0; }    if (divY < 0) { divY = 0; }        /*elmShade.style.left = (divX - shadeborder) + "px";    elmShade.style.top = (divY - shadeborder) + "px";    elmShade.style.width = shadeWidth + "px";    elmShade.style.height = shadeHeight + "px";*/    elmPopup.style.left = divX + "px";    elmPopup.style.top = divY + "px";    elmPopup.style.width = divWidth + "px";    elmPopup.style.height = divHeight + "px";    elmContent.style.width = videoWidth + "px";    elmContent.style.height = videoHeight + "px";    document.getElementById("divLayerTitle").style.width = (divWidth - 8) + "px";    document.getElementById("closeButtonDivLayer").style.left = (divWidth - 16) + "px";      //g_openpopupDiv = sUrl;        document.getElementById("divLayerTitle").innerHTML = "<img src=\"" + videoTitleImg + "\" alt=\"" + videoTitle + "\">";    elmOverlay.style.display = "block";     elmPopup.style.display = "block";    //elmShade.style.display = "block";    elmContent.style.display = "block";                if (moreLink) document.getElementById("divLayerMore").getElementsByTagName("a")[0].href = moreLink;            if (typeof g_hasFlash == "undefined") detectFlash();            if (g_hasFlash) {            var flashParams = 'filetype=swf';                   var flashWidth = (videoWidth).toString();        var flashHeight = (videoHeight + 20).toString();        var playerUrl = "../videoplayer.swf";            //"videourl=" + videoUrl + ",eventhandler=flashEnded," + flashParams);        showFlash(playerUrl, "divLayerContent", videoWidth, videoHeight, "7", "#FFFFFF",            "loop=true,menu=true,quality=high,wmode=opaque",                        "id=" + videoUrl + ",eventHandler=flashEnded");        //showFlash(playerUrl, "popupDivLayer", videoUrl, videoWidth, videoHeight);                }    else {    //videoUrl = "http://marvin/flowplayer/example/PV11_0001_de_MP4.mp4";                elmContent.innerHTML = "";        if (videoUrl.indexOf(".flv") == -1) {             var videoPlayer = document.getElementById("video");                if (videoPlayer == null) {                  videoPlayer = document.createElement("video");                 videoPlayer.id = "video";                videoPlayer.innerHTML = "Your browser does not support the video element.";                           videoPlayer.autoplay = "autoplay";                 videoPlayer.controls = "controls";                videoPlayer.style.width = videoWidth + "px";                  videoPlayer.style.height = videoHeight + "px";                            elmContent.appendChild(videoPlayer);             }                     videoPlayer.src = videoUrl;              videoPlayer.play();                    }           else {             elmContent.innerHTML = "Video format not supported!";           }    }    }function showFlashCount(url, id, width, height, version, bgcolor, playerparamstr, flashparamstr) {		showFlash(url, id, width, height, version, bgcolor, playerparamstr, flashparamstr);	}//Header flash videofunction showHeaderFlashVideo(videoTitle, videoUrl, imageWidth, imageHeight, videoWidth, videoHeight, playButtonText, countIt) {    if (countIt) countResourceOpen("Video", videoTitle, videoUrl);        if (typeof g_hasFlash == "undefined") detectFlash();        if (g_hasFlash) {        //var flashParams = 'filetype=swf';               //var playerUrl = "../videoplayer.swf";                          //showFlash(playerUrl, "introImage", videoWidth, videoHeight, "7", "#FFFFFF", "loop=true,menu=true,quality=high,wmode=opaque", "id=" + videoUrl + ",eventHandler=flashEnded");                          var playerUrl = "/mediaplayer/mediaplayer.swf";                //  showFlash(playerUrl, "introImage", videoWidth, videoHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=opaque", "videopath=" + videoUrlBegin + videoUrl + ",eventHandler=flashEnded");                      showFlash(playerUrl, "introFlash", imageWidth, imageHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=transparent", "playbuttontext=" + playButtonText + ",maintitle=" + videoTitle + ",videopath=" + videoUrl);                                }       else {              var elmContent = document.getElementById("introFlash");        var startButton = document.createElement("div");        startButton.id = "startButton";        //startButton.appendChild(document.createTextNode(playButtonText));                    startButton.onclick = function(){showHeaderFlashVideoHTML5(videoTitle, videoUrl, videoWidth, videoHeight, countIt, elmContent)};        elmContent.appendChild(startButton);        }}function showHeaderFlashVideoHTML5(videoTitle, videoUrl, videoWidth, videoHeight, countIt, elmContent) {	  elmContent.innerHTML = "";	 // document.getElementById("startButton").style.display = "none";	//  	          if (videoUrl.indexOf(".flv") == -1) {             var videoPlayer = document.getElementById("video");                if (videoPlayer == null) {                  videoPlayer = document.createElement("video");                 videoPlayer.id = "video";                videoPlayer.innerHTML = "Your browser does not support the video element.";                           videoPlayer.autoplay = "autoplay";                 videoPlayer.controls = "controls";                videoPlayer.style.width = videoWidth + "px";                  videoPlayer.style.height = videoHeight + "px";                            videoPlayer.style.position = "absolute";                  videoPlayer.style.top = "0px";                  videoPlayer.style.left = "296px";                  elmContent.appendChild(videoPlayer);             }                     videoPlayer.src = videoUrl;              videoPlayer.play();                                   //  document.getElementById("introImage").style.backgroundColor = "#FF0000";	  	  //document.getElementById("introImage").style.opacity = "0.2";	  	  	  	  //elmContent.style.opacity = "0.2";           }           else {             alert("Video format not supported!");           }}//Header flash videofunction showHeaderFlashVideo2(videoTitle, videoUrl, videoWidth, videoHeight, countIt) {    if (countIt) countResourceOpen("Video", videoTitle, videoUrl);        if (typeof g_hasFlash == "undefined") detectFlash();        if (g_hasFlash) {        //var flashParams = 'filetype=swf';               //var playerUrl = "../videoplayer.swf";                          //showFlash(playerUrl, "introImage", videoWidth, videoHeight, "7", "#FFFFFF", "loop=true,menu=true,quality=high,wmode=opaque", "id=" + videoUrl + ",eventHandler=flashEnded");                          var playerUrl = "/mediaplayer/mediaplayer.swf";                //  showFlash(playerUrl, "introImage", videoWidth, videoHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=opaque", "videopath=" + videoUrlBegin + videoUrl + ",eventHandler=flashEnded");                      showFlash(playerUrl, "introImage", videoWidth, videoHeight, "7", "#FFFFFF", "allowfullscreen=true,loop=true,menu=true,quality=high,wmode=opaque", "autoplay=true,playbuttontext=Video starten,maintitle=Sport- und Lifestyle Village,videopath=/Porsche/prod/entw_extern/sirius/cms/template/cms_template.nsf/resources/village_head_flash/$file/village_2008.flv");                                }       else {              var elmContent = document.getElementById("introImage");        elmContent.innerHTML = "";        if (videoUrl.indexOf(".flv") == -1) {             var videoPlayer = document.getElementById("video");                if (videoPlayer == null) {                  videoPlayer = document.createElement("video");                 videoPlayer.id = "video";                videoPlayer.innerHTML = "Your browser does not support the video element.";                           videoPlayer.autoplay = "autoplay";                 videoPlayer.controls = "controls";                videoPlayer.style.width = videoWidth + "px";                  videoPlayer.style.height = videoHeight + "px";                            elmContent.appendChild(videoPlayer);             }                     videoPlayer.src = videoUrl;              videoPlayer.play();                    }           else {             alert("Video format not supported!");           }    }}function flashEnded() {    /*if (g_fallbackImage != "") {        var elmContent = document.getElementById("galleryContent");        elmContent.innerHTML = "<img src=\"" + g_fallbackImage + "\" alt=\"\" id=\"galleryImage\" />";    }*/}//// Function ieToggleDropDowns: //// Description: Toggles dropdown visibility in case of a dynamic layer // covering them pops up, and has a z-index higher than these. IE does not handle them correctly.//// Input: //      strAttr: String Array, whose elements are the <DIV> id's to toggle. See function: getListIEDropDowns() //      boolHide: Boolean toggle. true, if the layer should be made visible, false otherwise.// Returns : none.function ieToggleDropDowns(strArr, boolHide) {    // collection of dropdowns        if (strArr.length > 0) {        for (i=0; i < strArr.length; i++) {            dd = document.getElementById(strArr[i]);            if (dd)                 if (boolHide)                 {                    dd.style.visibility = 'hidden'                }                else                {                    dd.style.visibility = 'visible';                }        }    }}//// Function getListIEDropDowns()://// Description: Builds an array of Dropdowns whose visibility should be toggled // in case of a dynamic layer covering them.// Input: none.// Returns: String array of <DIV> id's.function getListIEDropDowns() {    //return (new Array("monthDropDown"));    return null;}function switchHomeImage2(nr) {    var url = window.location.href;    if (url.indexOf("?OpenDocument") != -1) url = strLeft(url, "?OpenDocument");    url += "?OpenDocument";    if (url.indexOf("&homeimage=") == -1) url += "&homeimage=";    url += nr;     window.location.href = url;}function switchHomeImage(nr) {	window.clearTimeout(g_homeImageSwitchTimeout);	    g_isHomeImageSwitchAuto = false;	var areaViewKey = strRightBack(document.location.href, "/");    var url = strLeftBack(document.location.href, ".nsf/") + ".nsf/HomeSwitch/" + areaViewKey + "?OpenDocument&homeimage=" + nr;	    var callback = switchTheHomeImage;	          sendRequest(url, callback, "")}function switchToNextHomeImage() {      var areaViewKey = strRightBack(document.location.href, "/");    var url = strLeftBack(document.location.href, ".nsf/") + ".nsf/HomeSwitch/" + areaViewKey + "?OpenDocument&oldhomeimage=" + g_homeImageNr;        var callback = switchTheHomeImage;            sendRequest(url, callback, "")}function switchTheHomeImage(req){	 	var xmlDoc = req.responseXML;	document.getElementById("homeimageswitcher" + g_homeImageNr).className = "";	g_homeImageNr = xmlDoc.getElementsByTagName("homeimagenr")[0].childNodes[0].nodeValue;	var imageSrc = xmlDoc.getElementsByTagName("homeimagesrc")[0].childNodes[0].nodeValue;	document.getElementById("imgIntroImage").src = imageSrc;	/*for (var i = 1; i <= 6; i++) {		var elem = document.getElementById("homeimageswitcher" + String(i));		if (elem) 			document.getElementById("homeimageswitcher" + String(i)).className = "";	}*/	document.getElementById("homeimageswitcher" + g_homeImageNr).className = "homeimageselected";		if (xmlDoc.getElementsByTagName("homeimagemapcoords")[0].childNodes[0]) {		   var homeImageMapCoords = xmlDoc.getElementsByTagName("homeimagemapcoords")[0].childNodes[0].nodeValue;	   var homeImageMapHref = xmlDoc.getElementsByTagName("homeimagemaphref")[0].childNodes[0].nodeValue;	   var homeImageMapAlt = xmlDoc.getElementsByTagName("homeimagemapalt")[0].childNodes[0].nodeValue;	   var areaHtml = '<area shape="rect" coords="' + homeImageMapCoords + '" href="' + homeImageMapHref + '" alt="' + homeImageMapAlt + '" title="' + homeImageMapAlt + '" />';	   document.getElementsByName("homeimagemap")[0].innerHTML = areaHtml;       }    else {	    	document.getElementsByName("homeimagemap")[0].innerHTML = "";       }		if (xmlDoc.getElementsByTagName("newsboxnr")[0].childNodes[0]) {		   var newsboxnr = xmlDoc.getElementsByTagName("newsboxnr")[0].childNodes[0].nodeValue;        if (document.getElementById("newsbox")) {            if (g_homeImageNr == newsboxnr)                 document.getElementById("newsbox").style.visibility = "visible";            else                 document.getElementById("newsbox").style.visibility = "hidden";	   }    }		if (xmlDoc.getElementsByTagName("messagesboxnr")[0].childNodes[0]) {		var messagesboxnr = xmlDoc.getElementsByTagName("messagesboxnr")[0].childNodes[0].nodeValue;		if (document.getElementById("messagesbox")) {			if (g_homeImageNr == messagesboxnr) 				document.getElementById("messagesbox").style.visibility = "visible";			else 				document.getElementById("messagesbox").style.visibility = "hidden";		}	}		if (xmlDoc.getElementsByTagName("extraboxid")[0].childNodes[0]) {        var extraboxid = xmlDoc.getElementsByTagName("extraboxid")[0].childNodes[0].nodeValue;        if (document.getElementById(extraboxid)) {			var extraboxnr = xmlDoc.getElementsByTagName("extraboxnr")[0].childNodes[0].nodeValue;            if (g_homeImageNr == extraboxnr)                 document.getElementById(extraboxid).style.visibility = "visible";            else                 document.getElementById(extraboxid).style.visibility = "hidden";        }    }		startTimeoutPossNextHomeImage();	}function startTimeoutPossNextHomeImage() {	if (g_isHomeImageSwitchAuto) g_homeImageSwitchTimeout = window.setTimeout("switchToNextHomeImage()", 7000);}/* ------------------------- Social Networks ----------------------------*/function sharethis(href) {    var link = href.replace('URL', encodeURIComponent(document.location.toString()));    link = link.replace('TITEL', document.title);    window.open(link, 'share');}var activeSocialNetworks;function showSocialNetworks() {    if(!activeSocialNetworks) {        document.getElementById('sharelayer').style.display = "block";            document.getElementById('followlayer').style.display = "block";    }    else {        stopSocialNetworksClose();    }}function closeSocialNetworks() {    document.getElementById('sharelayer').style.display = "none";       document.getElementById('followlayer').style.display = "none";    activeSocialNetworks = null;}function stopSocialNetworksClose() {    if(activeSocialNetworks) clearTimeout(activeSocialNetworks);}function startSocialNetworksClose() {    var timeout = 100;    if (activeSocialNetworks) clearTimeout(activeSocialNetworks);    activeSocialNetworks = setTimeout("closeSocialNetworks()", timeout);  }function showSurveyQuestion(contentWidth, contentHeight) {    var shadeborder = 8;     var divWidth = contentWidth + 8;    var divHeight = contentHeight + 8;    var elmPopup = document.getElementById("divLayer");    var elmContent = document.getElementById("divLayerContent");    var elmOverlay = document.getElementById('pageoverlay');    var divX = Math.round(g_pageWidth / 2 - divWidth / 2);    var divY = Math.round((viewportGetHeight() - divHeight) / 2) + viewportGetScrollY();    if (divX < 0) { divX = 0; }    if (divY < 0) { divY = 0; }          elmPopup.style.left = divX + "px";    elmPopup.style.top = divY + "px";    elmPopup.style.width = divWidth + "px";    elmPopup.style.height = divHeight + "px";    elmContent.style.width = contentWidth + "px";    elmContent.style.height = contentHeight + "px";    document.getElementById("divLayerTitle").style.width = (divWidth - 8) + "px";    document.getElementById("closeButtonDivLayer").style.left = (divWidth - 16) + "px";    //    document.getElementById("divLayerTitle").innerHTML = "<img src=\"" + videoTitleImg + "\" alt=\"" + videoTitle + "\">";    elmOverlay.style.display = "block";     elmPopup.style.display = "block";    elmContent.style.display = "block";           }function noSurvey() {	showLr("divLayerMore");	hideLr("divLayer");    hideLr("divLayerShade");    hideLr("pageoverlay");        var expires = new Date();    var expires2 = expires.getTime() + (7 * 24 * 60 * 60 * 1000);  //in 7 days    expires.setTime(expires2);    document.cookie = "NoSurvey=1; expires=" + expires.toGMTString();    }//debugvar showDebug = false;function getDebugDiv() {    var elem = document.getElementById("debug");        if (!elem) {        elem = document.createElement("div");        elem.id = "debug"                var elemStyle = elem.style;                elemStyle.position = "absolute";        elemStyle.top = "10px";        elemStyle.left = "10px";                elemStyle.width = "980px";        elemStyle.height = "100px";        elemStyle.padding = "3px";        elemStyle.backgroundColor = "#000000";        elemStyle.border = "1px solid #FF0000";        elemStyle.color = "#FFFFFF";        elemStyle.fontFamily = "arial, helvetica, sans-serif";        elemStyle.fontSize = "12px";        elemStyle.visibility = showDebug ? "visible" : "hidden";            elemStyle.zIndex = "1000000";                       //elemStyle.overflow = "-moz-scrollbars-vertical !important";            elemStyle.overflow = "auto";            elemStyle.overflowY = "auto";                document.getElementsByTagName("body")[0].appendChild(elem);    }           return elem;}function debug(text) {          getDebugDiv().innerHTML = text;}function debugAppend(text) {    var elem = getDebugDiv();    elem.innerHTML += "<br />" + text;}function hideDebug() {    var elem = getDebugDiv();    elem.innerHTML = "";    elem.style.visibility = "hidden";}
