try { (void 0===window.QSI.PopUnderMixin||window.QTest)&&(QSI.PopUnderMixin={openParentWatcher:function(a,b){try{if(this.isPopUnderRunning())return;this.trigger("start");var c=new Date,d=c.valueOf().toString(),e=this.getName()+"_"+d;this.name=e;var f=this.getCurrentURL(),g=this.build(),h=this.getWidth(),i=this.getHeight();try{this.watcher=QSI.util.openWin("",e,this.getWindowOptions()),QSI.windowHandler.addWindowHandle(e,this.watcher);var j=QSI.windowHandler.getWindowOrigin(window);QSI.windowHandler.addOptInIDAndWindowName(a,e,b||j),this.watcher.openerURL=f,this.watcher.document.write(""),this.watcher.document.write("")}catch(k){return QSI.dbg.e("Failed to load PopUnder"),this.watcher&&this.watcher.close(),void QSI.cookie.erase(this.name)}this.validateWatcher(h,i),this.watcher.width=h,this.watcher.height=i,this.watcher.openerURL=f,this.watcher.openerOnLoadTime=c,this.writeHTMLToWatcher(h,i,g),this.initWatcher(),this.trigger("show"),QSI.util.moveToBackground()}catch(k){QSI.dbg.e(k)}},getWindowOptions:function(){var a=this.getParentDims();return{width:this.getWidth(),height:this.getHeight(),scrollbars:"1",resizable:"1",top:a.top,left:a.left}},isPopUnderRunning:function(){QSI.dbg.e("You must implement isPopUnderRunning")},getName:function(){QSI.dbg.e("You must implement getName")},getWidth:function(){QSI.dbg.e("You must implement getWidth")},getHeight:function(){QSI.dbg.e("You must implement getHeight")},getCloseIfTab:function(){return!1},getCurrentURL:function(){return window.location.href},getParentDims:function(){var a=(window.screenTop?window.screenTop:window.screenY)||0,b=(window.screenLeft?window.screenLeft:window.screenX)||0;return a+=20,b+=20,{top:a,left:b}},build:function(){QSI.dbg.e("You must implement build")},validateWatcher:function(a,b){var c=QSI.util.getWindowSize(this.watcher);if(c.height!==b&&c.width!==a&&this.getCloseIfTab()){var d=QSI.util.getWindowSize();d.width===c.width&&this.watcher.close()}},getNonce:function(){for(var a=document.getElementsByTagName("script"),b=null,c=0;null===b&&c',nonce=this.getNonce();winHtml+=nonce?'",winHtml+=html,winHtml+="",winDoc.write(winHtml),winDoc.close()},initWatcher:function(){QSI.dbg.e("You must implement initWatcher")},hasWatcherLoaded:function(a){for(var b=!1,c=0;2e4>c&&!b;c++)try{this.watcher.openerURL=a,b=!0}catch(d){}return b},on:function(a,b){this._evts||(this._evts={}),this._evts[a]||(this._evts[a]=[]),this._evts[a].push(b)},trigger:function(a){if(this._evts&&this._evts[a])for(var b=this._evts[a],c=0,d=b.length;d>c;c++)b[c]()}}); (void 0===window.QSI.PopUnder||window.QTest)&&(QSI.PopUnder=QSI.util.Creative(QSI.BuildElementModule,QSI.PopUnderMixin,{initialize:function(a){try{this.globalInitialize(a),this.shouldAnchor=!0,this.name="QSIPopUnder_"+this.id,("undefined"!=typeof a.isPlaceholderWindow&&a.isPlaceholderWindow||"undefined"!=typeof a.popunderOptions&&"undefined"!=typeof a.popunderOptions.showTargetOnPopForward&&a.popunderOptions.showTargetOnPopForward)&&(this.name=this.name+"_placeholderWindow"),QSI.global.intercepts[this.id]&&(this.asid=QSI.global.intercepts[this.id].ASID),this.popunderOptions=this.options.popunderOptions||{},this.popunderHelperOptions=this.options.popunderHelperOptions||{},this.shouldPreloadImages=!1;var b=this;this.on("start",function(){QSI.cookie.set(b.name.replace(/_placeholderWindow/,""),b.asid,!1,!1,{force:!0})}),this.on("show",function(){b.displayed.resolve()}),this.shouldShow()&&this.prepareParentWatcher()}catch(c){QSI.dbg.e(c)}},prepareParentWatcher:function(){var a=this;this.setPreventRepeatedDisplayCookie(),this.f=function(){try{a.startWatcher()}catch(b){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(b)}},QSI.util.observe(document,"click",this.f);for(var b=document.getElementsByTagName("embed"),c=0;ce;e++){var g=this.buildElement(this.elements[e]);g&&(g.style&&g.style.borderWidth&&(d=2*parseInt(g.style.borderWidth,10)),g.bc&&g.bc.x+d>b&&(b=g.bc.x+d),g.bc&&g.bc.y+d>c&&(c=g.bc.y+d),a.push(g))}this.width=b,this.height=c;var h="fixed";QSI.util.isFixed()?this.insertIntoBody&&(h="relative"):h="absolute";var i=this.height,j=QSI.util.build("div",{className:"QSIPopUnder "+this.id+"_PopUnderContainer",style:{width:"100%",height:i+"px",overflow:"hidden",position:h}},a),k=[];k.push(j);var l=QSI.util.build("div",{},k);return l.innerHTML},initWatcher:function(){this.popunderHelperOptions.targetURL=this.getTarget(),this.popunderHelperOptions.parent=this,this.popunderHelperOptions.id=this.id,this.popunderHelperOptions.noshow=this.interceptDisplayOptions.noshow,this.popunderHelperOptions.cookieDomain=this.interceptDisplayOptions.cookieDomain,this.popunderHelperOptions.browser=QSI.Browser.name,this.popunderHelperOptions.domain=QSI.CookieDomain?QSI.CookieDomain:null,this.options.resetStyle&&(this.popunderHelperOptions.resetCSS=this.options.resetStyle);var a=this.watcher.w;a.initialize(this.popunderHelperOptions),QSI.util.observe(window,"unload",function(){try{a.imagesLoaded'},getWidth:function(){return this.width},getHeight:function(){return this.height},isPopUnderRunning:function(){return!1},getName:function(){return"QSIPopUnderTargetWindow"},initWatcher:function(){if(this.watcher){var a=this.getParentDims();"Chrome"!==QSI.Browser.name&&this.watcher.blur(),window.focus(),setTimeout(function(){try{window.focus()}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}},1),this.watcher.w.initialize({showOnPageChange:!1,showOnSiteExit:!0,checkThreshold:3,watchInterval:1e3,width:this.width,height:this.height,parentTop:a.top,parentLeft:a.left,domain:QSI.CookieDomain?QSI.CookieDomain:null}),this.watcher.w.url=this.url,this.watcher.w.startWatching()}}})); QSI.popunderWatcher=function(){this.initialize=function(a){var b=document.body.getElementsByTagName("img");this.imgCount=b.length,this.imagesLoaded=0;var c=this;this.options={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&(this.options[d]=a[d]);this.id=this.options.id,this.name="QSIPopUnder_"+this.id,this.popForwardDelayInMS=5e3;var e=function(a){c.unload(a),c.eraseNameInOpenerSessionStorage(a)};window.onbeforeunload=e,window.onunload=e;var f=function(a){try{var b=window.location.origin;if(b||(b=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")),a.origin!==b)return;c.popUnderWindowReceiveMessage(a)}catch(d){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(d)}};window.addEventListener("message",f,!1),this.options.resetCSS&&this.addCSSReset(),this.initializeImages(),this.onWindowFocus(a),this.initializeTargetLinks()},this.popUnderWindowReceiveMessage=function(a){if("undefined"!=typeof a&&"undefined"!=typeof a.data){var b;try{b=JSON.parse(a.data)}catch(c){return}if("object"==typeof b&&"string"==typeof b.type&&"string"==typeof b.payload){var d=b.payload,e=this.options.targetURL;e=e.replace(/&Q_ED=.*/,""),d&&(d=encodeURIComponent(d),e+="&Q_ED="+d),this.options.targetURL=e}}},this.eraseNameInOpenerSessionStorage=function(){if(window.opener&&window.opener.sessionStorage){var a=window.opener.sessionStorage,b=a.getItem("QSI_OptInIDsAndWindowNames");if(b){try{b=JSON.parse(b)}catch(c){return}for(var d in b)b[d]===window.name&&delete b[d];a.setItem("QSI_OptInIDsAndWindowNames",JSON.stringify(b))}}},this.onWindowFocus=function(a){var b=this,c=function(a){b.load(a)};"onfocusin"in document?setTimeout(function(){try{document.onfocusin=c}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}},1):"Firefox"===a.browser?window.onfocus=c:window.onblur=function(){window.onfocus=c}},this.initializeTargetLinks=function(a){a=a||document;for(var b=a.getElementsByTagName("div"),c=this,d=function(){try{c.openTarget(c.options.targetURL)}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}},e=0,f=b.length;f>e;e++){var g=b[e];"target"===g.getAttribute("data-type")&&this.observe(g,"click",d)}},this.observe=function(a,b,c){if(a)if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else if(a["on"+this.capFirst(b)]){if(a["on"+this.capFirst(b)]){var d=a["on"+this.capFirst(b)],e=c;c=function(){d(),e()}}a["on"+this.capFirst(b)]=c}},this.load=function(){this.loaded||(this.loaded=!0,this.initializeIframes(),this.impress(this.options.impressionURL))},this.capFirst=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},this.initializeIframes=function(a){a=a||document;for(var b=a.getElementsByTagName("iframe"),c=0,d=b.length;d>c;c++){var e=b[c],f=e.getAttribute("data-src");f&&(e.src=f)}},this.initializeImages=function(a){var b=this;a=a||document;for(var c=a.getElementsByTagName("img"),d=function(){b.imagesLoaded++},e=0,f=c.length;f>e;e++){var g=c[e],h=g.getAttribute("data-src");g.onload=d,h&&(g.src=h)}},this.unload=function(){try{this.unloaded||(this.cookie.erase(this.name,this.options.domain),this.markDisplayed(),this.unloaded=!0)}catch(a){QSI.dbg.e(a)}return!0},this.markDisplayed=function(){0!=this.options.noshow&&this.cookie.set(this.id+"_intercept",!0,this.options.noshow,this.options.cookieDomain)},this.watch=function(){var a=this;this.lastLoc=window.opener.location,this.ival=setInterval(function(){try{a.intervalWatch()}catch(b){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(b)}},this.options.watchInterval)},this.addCSSReset=function(a){try{a=a||document;var b=a.getElementsByTagName("head")[0],c=a.createElement("style");b&&b.appendChild&&(c.type="text/css",c.styleSheet?c.styleSheet.cssText=this.options.resetCSS:c.appendChild(a.createTextNode(this.options.resetCSS)),b.appendChild(c))}catch(d){}},this.intervalWatch=function(){try{if(this.popunderDead)return void this.killPopunder()}catch(a){}var b=null;try{b=""+window.opener.location}catch(a){b=null}b?(this.lastLoc!==b&&this.onSiteChange(),this.lastLoc=b):this.onSiteExit()},this.clearWatcher=function(){this.ival&&clearInterval(this.ival)},this.destroyPopunder=function(){try{this.clearWatcher(),this.cookie.erase(this.name,this.options.domain),window.opener=window.self,window.close()}catch(a){}},this.showPopunder=function(a){var b=this;this.clearWatcher();try{if(this.options.onPopForwardShowTarget&&this.options.targetURL){var c=!1;setTimeout(function(){try{c||(b.redirectToURL(b.options.targetURL),c=!0)}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}},a),b.observe(window,"focus",function(){try{c||(c=!0,b.redirectToURL(b.options.targetURL))}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}}),!c&&document.hasFocus()&&(c=!0,b.redirectToURL(b.options.targetURL))}else window.focus()}catch(d){}this.cookie.erase(this.name,this.options.domain)},this.redirectToURL=function(a){var b=this;b.offsetWindowFromTopLeftCorner(100,100),document.hasFocus()||b.bringWindowIntoFocus(),b.redirectTo(a),b.resizeToFitInterceptTarget()},this.offsetWindowFromTopLeftCorner=function(a,b){window.moveBy(a,b)},this.bringWindowIntoFocus=function(){this.checkIfBrowserFocusesOnAlert()?alert("Your survey is ready."):window.focus()},this.checkIfBrowserFocusesOnAlert=function(){for(var a=["Chrome"],b=window.navigator.userAgent,c=!1,d=0;dd;d++){for(var f=c[d];" "===f.charAt(0);)f=f.substring(1,f.length);if(0===f.indexOf(b))return f.substring(b.length,f.length)}return null},erase:function(a,b){this.set(a,"",-1,b)}},this.openTarget=function(a){try{this.markDisplayed();var b=this.getWindowSize(),c=this.options.targetFullScreen?screen.availWidth||screen.width||b[0]:this.options.targetWidth,d=this.options.targetFullScreen?screen.availHeight||screen.height||b[1]:this.options.targetHeight,e=window.open(a,"targetwindow","location=1,status=1,scrollbars=1,resizable=yes,width="+c+",height="+d);e.resizeTo(c,d),setTimeout(function(){try{e.moveTo(0,0)}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}},100)}catch(f){}this.destroyPopunder()},this.impress=function(a){if(a){var b=document.createElement("img");b.style.display="none",b.src=a,b.alt="",document.body.appendChild(b)}}}; } catch(e) { if (typeof QSI !== 'undefined' && QSI.dbg && QSI.dbg.e) { QSI.dbg.e(e); } }