
jQuery.fn.openPopup=(function(type,conf,actionValue,formId,everyNthTime){var ccf_s2_version="$Id: jquery.s2.openPopup.js 12937 2009-08-18 13:24:48Z giaser $";conf=jQuery.extend({topic:'',where:'',width:'',height:'',toolbar:0,scrollbars:0,referenzname:'',winlook:'',closeMe:'',gerateUrlFrom:''},conf);everyNthTime=jQuery.extend({frequency:10,activityStatus:"on"},everyNthTime);return this.each(function(){switch(type){case"reload":$(this).click(function(){location.reload();});break;case"print":$(this).click(function(){if(window.print)window.print();return false;});break;case"everyNthTime":conf.where=((!conf.where)?(this.href):(conf.where));var frequency=parseFloat(everyNthTime.frequency);frequency=((isNaN(frequency))?(10):(frequency));frequency=Math.round(100/((frequency>=1)?(frequency):(1)));var activityStatus=(everyNthTime.activityStatus=="on");$(this).click(function(){var dontShowPopup=getPopupOrNot(conf,frequency,activityStatus);if(dontShowPopup){if($(this).attr('href').indexOf('&showPopup=false')==-1){$(this).attr('href',$(this).attr('href')+'&showPopup=false');}}else
{if($(this).attr('href').indexOf('&showPopup=false')!=-1){$(this).attr('href',$(this).attr('href').replace('&showPopup=false',''));}}return dontShowPopup;});break;case"openSelector":var formObjOrId=((formId)?(formId):(getParentForm(this)));$(this).click(function(){return openSelector(formObjOrId);});break;case"info":$(this).click(function(){if(location.href.indexOf('https:')!=-1){var where='/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/'+conf.topic+'.html';}else{var where='/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/'+conf.topic+'.html';}openWindow(where,580,471,0,0,'newInfo','wl01');return false;});break;case"sitemap":$(this).click(function(){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');return false;});break;case"openBrowser":$(this).click(function(){var width,height,toolbar,scrollbars;openWindow(conf.where,width,height,toolbar,scrollbars,'newBrowser','wl02');return false;});break;case"openWin":$(this).click(function(){openWindow(conf.where,conf.width,conf.height,conf.toolbar,conf.scrollbars,'newWin','wl01');return false;});break;case"openPdfWin":$(this).click(function(){var where=conf.where;var rndPrm="redirected="+Math.floor(10000000000*Math.random());if(where.indexOf("?")==-1){where=where+"?"+rndPrm;}else{where=where+"&"+rndPrm;}openWindow(where,conf.width,conf.height,conf.toolbar,conf.scrollbars,'pdfWin','wl01');return false;});break;case"openInfoFromPopup":$(this).click(function(){var where='/pbl/cms/cms/help/util/frameset.html?content=../pages/hp/'+conf.topic+'.html';openWindow(where,290,471,0,0,'newInfo','wl01');return false;});break;case"openSitemap":$(this).click(function(){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');return false;});break;case"openInfoBig":$(this).click(function(){if(location.href.indexOf('https:')!=-1){var where='/pbl/cms/cms/help/util/framesetBig.html?content=../pages/hp/'+conf.topic+'.html';}else{var where='/pbl/cms/cms/help/util/framesetBig.html?content=../pages/hp/'+conf.topic+'.html';}openWindow(where,580,550,0,0,'newInfo','wl01');return false;});break;case"openLexikon":$(this).click(function(){if(location.href.indexOf('https:')!=-1){var where='/pbl/exchangelexicon/FramesetVP.do?selectedPage='+conf.topic;}else{var where='/pbl/exchangelexicon/FramesetVP.do?selectedPage='+conf.topic;}openWindow(where,540,391,0,0,'lexiconWin','wl01');return false;});break;case"printer":$(this).click(function(){openWindow(conf.where,700,600,1,'yes','newPrint','wl03');return false;});break;case"openPrintDialog":$(this).click(function(){var URL="/noprinter.html";if(window.print){window.print();}else{openWin(URL,310,232);openWindow(where,'310','232',toolbar,scrollbars,'newWin','wl01');}return false;});break;case"closeMe":$(this).click(function(){close();});break;case"openInOpener":$(this).click(function(){openInOpener(conf.where,conf.closeMe);return false;});break;case"withoutClick":openWindow(conf.where,conf.width,conf.height,conf.toolbar,conf.scrollbars,conf.referenzname,conf.winlook);return false;break;case"generateURL":$(this).click(function(){var newURL=conf.where+$(conf.gerateUrlFrom).val();openWindow(newURL,conf.width,conf.height,conf.toolbar,conf.scrollbars,conf.referenzname,conf.winlook);return false;});break;case"geldautomatensuche":$(this).click(function(){var params=new Array();params[0]='PLZ';params[1]='Hauptort';params[2]='Teilort';params[3]='Strasse';var values=new Array();values[0]=$('#plz').val();values[1]=$('#ort').val();values[2]=$('#ortsteil').val();values[3]=$('#strasse').val();var first=true;var path='http://www.yellowmap.de/partner/comdirect/aufruf.asp';for(var i=0;i<params.length;i++){if(values[i]){if(first){path=path+'?';first=false;}else path=path+'&';path=path+params[i]+'='+values[i];}}var gaafWindow=window.open(path,'gWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=690,height=572');gaafWindow.focus();return false;});break;default:$(this).click(function(){openWindow(conf.where,conf.width,conf.height,conf.toolbar,conf.scrollbars,conf.referenzname,conf.winlook);return false;});break;}});function getFramesetProto(){try{return top.location.protocol;}catch(e){return location.protocol=="http:"?"https:":"http:";}}function openWindow(where,width,height,toolbar,scrollbars,referenzname,winlook){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;top.wins[numOfWins].focus();}catch(e){newWindow=window.open(where,referenzname,eval(winlook));newWindow.focus();return;}}else{newWindow=window.open(where,referenzname,eval(winlook));newWindow.focus();return;}}function checkDomain(url){return url.match("^(/[^/])|^((http[s]?:)?//[a-zA-Z0-9-]*.comdirect.(de|com)/)");}function getParentForm(elm){if(elm.form){elm=elm.form;}else{elm=elm.parentNode;while(elm&&(elm.nodeName.toLowerCase()!="form")){elm=elm.parentNode;}}return elm;}function openSelector(formObjOrId){var proceedWithHref=true;var formObj=(((typeof formObjOrId=="string")||(typeof formObjOrId=="number"))?(document.forms[formObjOrId]||document.getElementById(formObjOrId)):(formObjOrId));if(formObj&&(typeof formObj.nodeName=="string")&&(formObj.nodeName.toLowerCase()=="form")){openWindow("about:blank",((conf&&conf.width)||"794"),((conf&&conf.height)||"600"),"0","0","selectorWin","wl01");formObj.target="selectorWinz";var obj;obj=formObj.elements["action"];if(obj&&(obj.form===formObj)){obj.value="update";}obj=formObj.elements["actionValue"];if(obj&&(obj.form===formObj)){obj.value=actionValue;}formObj.submit();formObj.elements["action"].value="";formObj.target="";proceedWithHref=false;}return proceedWithHref;}function getPopupOrNot(conf,frequency,activityStatus){var doesMatchFrequency=(function(frq){return((Math.floor(Math.random()*100)+1)<=frq);});var isFollowLinkAlowed=true;if(activityStatus&&doesMatchFrequency(frequency)){openWindow(conf.where,(conf.width||"426"),(conf.height||"610"),(conf.toolbar||"0"),(conf.scrollbars||"0"),"newWin","wl01");isFollowLinkAlowed=false;}return isFollowLinkAlowed;}});jQuery(document).ready(function(){defaultRegistry.addEntry("openPopup","openPopup",["type","conf","actionValue","formId","everyNthTime"])});