try { (void 0===window.QSI.UserDefinedHTML||window.QTest)&&(QSI.UserDefinedHTML=QSI.util.Creative(QSI.BuildElementModule,{initialize:function(a){this.globalInitialize(a),this.shouldShow()&&this.display()},display:function(){this.resetStyles(),this.options.elements?(this.elements=this.options.elements.Elements||[],this.minTop=this.options.elements.MinTop,this.minLeft=this.options.elements.MinLeft,QSI.util.processLocators(this.elements),this.node=this.build(),this.width&&this.height&&(this.options.size={width:this.width,height:this.height})):this.options.html&&(this.options.locators&&(QSI.PipedText.setLocators(this.options.locators),this.options.html=QSI.PipedText.evaluateLocators(this.options.html)),this.node=QSI.util.build("div",{style:{width:this.options.size.width+"px",height:this.options.size.height+"px",overflow:"hidden"}}),this.node.innerHTML=this.options.html),this.insert()},build:function(){for(var a=[],b=0,c=0,d=0,e=this.elements.length;e>d;d++){var f=this.buildElement(this.elements[d]);f&&(f.bc&&f.bc.x>b&&(b=f.bc.x),f.bc&&f.bc.y>c&&(c=f.bc.y),a.push(f))}this.width=b,this.height=c;var g=QSI.util.build("div",{className:"QSIUserDefinedHTML "+this.id+"_UserDefinedHTMLContainer",style:{width:b+"px",height:c+"px",overflow:"hidden",position:"relative"}},a);return g},getYPosition:function(a){return a.top-this.minTop},getXPosition:function(a){return a.left-this.minLeft},getElementStyle:function(a,b){return{top:this.getYPosition(b)+"px",left:this.getXPosition(b)+"px",position:"absolute",zIndex:a.zIndex,width:a.width+"px",height:a.height+"px",backgroundColor:a.backgroundColor,borderWidth:a.borderWidth+"px",borderColor:a.borderColor,borderStyle:"solid",borderRadius:a.borderRadius+"px",display:a.display}},insert:function(){if(this.options.insertionLocation){if(this.container=QSI.util.$(this.options.insertionLocation),!this.container)return;this.impress(),(void 0===this.displayOptions.replaceContents||this.displayOptions.replaceContents)&&(this.container.innerHTML=""),this.displayOptions.customPosition&&this.position(),this.displayOptions.insertContentsBefore?this.container.parentNode&&this.container.parentNode.insertBefore(this.node,this.container):this.displayOptions.insertContentsAfter?this.container.parentNode&&this.container.parentNode.insertBefore(this.node,this.container.nextSibling):this.container.appendChild(this.node),this.displayOptions.fixToPage&&(""!==this.displayOptions.minFixDist?this.scrollFix():this.fixPosition()),this.initializeIframes(),this.displayed.resolve()}},position:function(){if(!this.displayOptions.insertContentsBefore&&!this.displayOptions.insertContentsAfter){var a,b,c,d,e=this.displayOptions.position,f=1*(this.displayOptions.xOffset||0),g=1*(this.displayOptions.yOffset||0),h=QSI.util.getDimensions(this.container),i=this.options.size,j=h.height/2-i.height/2,k=h.width/2-i.width/2,l={},m={};switch(e){default:case"TL":a=0+g,b=0+f,m={top:a+"px",left:b+"px"};break;case"ML":a=j+g,b=0+f,m={top:a+"px",left:b+"px"};break;case"BL":c=0-g,b=0+f,m={bottom:c+"px",left:b+"px"};break;case"TC":a=0+g,b=k+f,m={top:a+"px",left:b+"px"};break;case"MC":a=j+g,b=k+f,m={top:a+"px",left:b+"px"};break;case"BC":c=0-g,b=k+f,m={bottom:c+"px",left:b+"px"};break;case"TR":a=0+g,d=0-f,m={top:a+"px",right:d+"px"};break;case"MR":a=j+g,d=0-f,m={top:a+"px",right:d+"px"};break;case"BR":c=0-g,d=0-f,m={bottom:c+"px",right:d+"px"};break;case"OML":l={overflow:"visible"},b=-i.width+f,a=j+g,m={top:a+"px",left:b+"px"};break;case"OTLL":l={overflow:"visible"},b=-i.width+f,a=0+g,m={top:a+"px",left:b+"px"};break;case"OTLT":l={overflow:"visible"},b=0+f,a=-i.height+g,m={top:a+"px",left:b+"px"};break;case"OBLL":l={overflow:"visible"},b=-i.width+f,c=0-g,m={bottom:c+"px",left:b+"px"};break;case"OBLB":l={overflow:"visible"},b=0+f,c=-i.height-g,m={bottom:c+"px",left:b+"px"};break;case"OTC":l={overflow:"visible"},b=k+f,a=-i.height+g,m={top:a+"px",left:b+"px"};break;case"OTRT":l={overflow:"visible"},d=0-f,a=-i.height+g,m={top:a+"px",right:d+"px"};break;case"OTRR":l={overflow:"visible"},d=-i.width-f,a=0+g,m={top:a+"px",right:d+"px"};break;case"OMR":l={overflow:"visible"},d=-i.width-f,a=j+g,m={top:a+"px",right:d+"px"};break;case"OBRR":l={overflow:"visible"},d=-i.width-f,c=0-g,m={bottom:c+"px",right:d+"px"};break;case"OBRB":l={overflow:"visible"},d=0-f,c=-i.height-g,m={bottom:c+"px",right:d+"px"};break;case"OBC":l={overflow:"visible"},b=k+f,c=-i.height-g,m={bottom:c+"px",left:b+"px"}}m.position="absolute",l.position="relative",QSI.util.setStyle(this.container,l),QSI.util.setStyle(this.node,m)}},scrollFix:function(){var a=this,b=1*this.displayOptions.minFixDist,c=QSI.util.cumulativeOffset(this.node),d=function(){try{var d=QSI.util.getScrollOffsets().top;if(c.top-db&&a.fixed&&a.unfixPosition()}catch(f){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(f)}};QSI.util.observe(window,"scroll",d),0!==QSI.util.getScrollOffsets().top&&d()},fixPosition:function(a){var b=QSI.util.cumulativeOffset(this.node),c=b.top;void 0!==a&&(c=a),QSI.util.setStyle(this.node,{top:c+"px",left:b.left+"px",position:"fixed"}),this.fixed=!0;var d=this,e=0,f=function(){try{d.finishResize()}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}};this.resizeW||(this.resizeW=QSI.util.observe(window,"resize",function(){try{e!==QSI.util.getPageSize().height&&(d.resizing?(clearTimeout(d.resizeW),d.resizeW=setTimeout(f,500)):(d.unfixPosition(),d.resizing=!0,d.resizeW=setTimeout(f,500)),e=QSI.util.getPageSize().height)}catch(a){"undefined"!=typeof QSI&&QSI.dbg&&QSI.dbg.e&&QSI.dbg.e(a)}}))},finishResize:function(){this.resizing=!1,clearTimeout(this.resizeW),this.fixPosition()},unfixPosition:function(){this.resizeW&&clearTimeout(this.resizeW),QSI.util.setStyle(this.node,{top:"auto",left:"auto",position:"fixed"}),this.position(),this.fixed=!1},remove:function(){this.node&&QSI.util.remove(this.node),this.cleanupImpressElement()}})); } catch(e) { if (typeof QSI !== 'undefined' && QSI.dbg && QSI.dbg.e) { QSI.dbg.e(e); } }