function getFramesetProto() { try { return top.location.protocol; } catch (e) { return location.protocol == "http:" ? "https:" : "http:"; } } function openWindow(where, width, height, toolbar, scrollbars, referenzname, winlook) { if( where.match("^/[^/]") ) { where = "http://www.comdirect.de" + where; } if (checkDomain(where)) { var proto = getFramesetProto(); var posx = screen.width / 2 - width / 2; var posy = screen.height / 2 - height / 2; var xyPos = "top=" + posy + ",left=" + posx + ",screenX=" + posx + ",screenY=" + posy; var wl01 = "width=" + width + ",height=" + height + ",toolbar=" + toolbar + ",location=0,menubar=0,status=0,scrollbars=" + scrollbars + ",resizable=0," + xyPos; var wl02 = "toolbar=yes,location=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes"; var wl03 = "width=" + width + ",height=" + height + "toolbar=" + toolbar + ",location=0,menubar=yes,status=0,scrollbars=" + scrollbars + ",resizable=0" + xyPos; var wl04 = "width=" + width + ",height=" + height + ",toolbar=" + toolbar + ",location=0,menubar=0,status=0,scrollbars=" + scrollbars + ",resizable=yes," + xyPos; var whereProto = where.indexOf("https:") > -1 ? "https:" : where.indexOf("http:") > -1 ? "http:" : "unknown"; if (proto == whereProto && proto == location.protocol) { if (top.wins && top.wins.length > 0) { for (var a = 0; a <= top.wins.length; a++) { if (top.wins[a] && top.wins[a].closed != true) { if (top.wins[a].name == referenzname) { setTimeout("openWindow(\"" + where + "\"," + width + "," + height + "," + toolbar + "," + scrollbars + ",\"" + referenzname + "\",\"" + winlook + "\")", 800); top.wins[a].close(); return; } } } } } else { var newWindow; newWindow = window.open(where, referenzname + "z", eval(winlook)); newWindow.focus(); return; } if (top.wins != "undefined") { try { numOfWins = top.wins.length; top.wins[numOfWins] = window.open(where, referenzname, eval(winlook)); top.wins[numOfWins].name = referenzname; } catch (e) { window.open(where, referenzname, eval(winlook)); } } else { window.open(where, referenzname, eval(winlook)); } } } function checkDomain(url) { return url.match("^(/[^/])|^((http[s]?:)?//[a-zA-Z0-9-.]*.comdirect.(de|com)/)"); } function openBrowser(where) { var width,height,toolbar,scrollbars; openWindow(where, width, height, toolbar, scrollbars, "newBrowser", "wl02"); } function openWin(where,width,height,toolbar,scrollbars) { openWindow(where,width,height,toolbar,scrollbars,'newWin','wl01'); } function openPdfWin(where,width,height,toolbar,scrollbars) { var rndPrm = "redirected=" + Math.floor(10000000000 * Math.random()); if (where.indexOf("?") == -1) { where = where + "?" + rndPrm; } else { where = where + "&" + rndPrm; } openWindow(where, width, height, toolbar, scrollbars, "pdfWin", "wl01"); } function openSitemap(url,width,height) { if (location.href.indexOf("https:") != -1) { var where = "/pbl/cms/cms/direct/cori1154_index.html"; } else { var where = "/pbl/cms/cms/direct/cori1154_index.html"; } openWindow(where, 790, 620, 0, 0, "sitemapWin", "wl01"); } // schliesst die sitemap. wird aufgerufen, wenn das frameset ungeladen wird function closeSitemap() { top.closeWindow('sitemapWin'); } function submitFormAction(mylink, myform) { document.forms[myform].action = mylink; document.forms[myform].submit(); } // submitForm // formID: name oder index des Formulars (string) // params: Semikolon-separierte liste von key-Value-Pairs zum setzen von hidden Input-Fields (String) // fnkCalls: DSemikolon-separierte liste von funktionsaufrufen, die vor dem submit augefuehrt werden sollen (string) function submitForm(formID, params, fnktCalls) { if (fnktCalls) { var calls = fnktCalls.split(";"); for (var i = 0; i < calls.length; i++) { eval(calls[i]); } } if (params) { var myparams = params.split(";"); for (var i = 0; i < myparams.length; i++) { if (document.getElementById(formID)) { document.getElementById(formID)[myparams[i].split("=")[0]].value = myparams[i].split("=")[1]; } else { document.forms[formID][myparams[i].split("=")[0]].value = myparams[i].split("=")[1]; } } } if (document.getElementById(formID)) { document.getElementById(formID).submit(); } else { document.forms[formID].submit(); } } if (document.domain.indexOf("comdirect.de") != -1) { document.domain = "comdirect.de"; } // Nachfolgende Funktionen sind bei der Comdirect nicht in der JSLIBRARY direkt enthalten sondern werden umgebungsabhängig besetzt und in die Seite direkt eingebunden // opens a link (defined page in functions call) from a popup in the content-frame and shuts the window, if second parameter is set to 1 function openInhalt(page, shut) { if (checkDomain(page)) { // frames doesn't exists any more (ok, some iframes...) if( page.match("^/[^/]") ) { page = "http://www.comdirect.de" + page; } top.opener.location.href = page; if (shut == 1) { self.close(); } } } function openInhaltCommunity(page,shut) { opener.top.contarea.inhalt.commFrame5.location.href = page; if (shut == 1) { self.close(); } } // opens a new javascript browser-window (fixed size) with a certain help-page (topic+'.html') from another popup // to open help-popup from inside a popup must use this function, otherwise the 1st popup will be replaced by the help-page function openInfoFromPopup(topic) { var where = '/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/' + topic + '.html'; openWindow(where,580,471,0,0,'newInfo','wl01'); } // opens a new javascript browser-window (fixed size) with a certain help-page (topic+'.html') in the root directory function openInfo(topic) { if (location.href.indexOf('https:') != -1) { var where = '/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/' + topic + '.html'; } else { var where = '/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/' + topic + '.html'; } openWindow(where,580,471,0,0,'newInfo','wl01'); } // opens a new javascript browser-window (fixed size) with a certain help-page (topic+'.html') in the root directory function openInfoBig(topic) { if (location.href.indexOf('https:') != -1) { var where = '/pbl/cms/cms/help/util/framesetBig.html?content=../pages/hp/' + topic + '.html'; } else { var where = '/pbl/cms/cms/help/util/framesetBig.html?content=../pages/hp/' + topic + '.html'; } openWindow(where,580,550,0,0,'newInfo','wl01'); } // opens a new javascript browser-window (fixed size) with a certain help-page (topic+'.html') in the root directory function openLexikon(topic) { if (location.href.indexOf('https:') != -1) { var where = '/pbl/exchangelexicon/FramesetVP.do?selectedPage=' + topic; } else { var where = '/pbl/exchangelexicon/FramesetVP.do?selectedPage=' + topic; } openWindow(where,540,391,0,0,'lexiconWin','wl01'); } function printer(page) { if( page.match("^/[^/]") ) { page = "http://isht.comdirect.de" + page; } openWindow(page,700,600,1,'yes','newPrint','wl03'); } function openPrintDialog() { var URL = "/pbl/noprinter.html"; if (window.print) { window.print(); } else { openWin(URL, 310, 232); } } function setProto(mylink) { self.location.href = mylink.replace(/http[s]*:/gi,getFramesetProto()); } function encodeURL( plaintext ) { // The Javascript escape and unescape functions do not correspond // with what browsers actually do... var SAFECHARS = "0123456789" +// Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +// Alphabetic "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()";// RFC2396 Mark characters var HEX = "0123456789ABCDEF"; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "+";// x-www-urlencoded, rather than %20 } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += "+"; } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for return encoded; }