(function(b){if(!b.pslDynPopUpResPath){var a=document.getElementById("pslDynPopUpResPath");if(a&&a.content){b.pslDynPopUpResPath=a.content}}b.pslLastDynPopUpInfo={$pluginWin:b(window),strId:"",_intId:0,nextId:function(){var c=this._intId+1;
this._intId=c;return c},posTopStart:0,posLeftStart:0,offset:40,_topZIndex:10000,nextTopZIndex:function(){var c=this._topZIndex+2;this._topZIndex=c;return c}};b.pslGetAllDynPopUps=function(c){if(!c){c=b(b.pslLastDynPopUpInfo.$pluginWin.get(0).document)
}return c.find(".pslDynPopUp")};b.pslGetDynPopUpByIndex=function(e,c,d){if(!d){d=b.pslGetAllDynPopUps(e)}if(c<0){return null}else{if(c>=d.length){return null}}return d.eq(c)
};b.pslCloseAllDynPopUps=function(e,d){var c=b.pslGetAllDynPopUps(e);c.pslCloseDynPopUpNow(d);b.pslDynPopUpResetPos()};b.pslAllDynPopUpsInactive=function(d){var c=b.pslGetAllDynPopUps(d);
c.find("thead").addClass("dynPopupInActive");c.removeClass("dynPopupActive")};b.pslDynPopUpResetPos=function(){b.pslLastDynPopUpInfo.posTopStart=0;b.pslLastDynPopUpInfo.posLeftStart=0
};b.pslCleanDynPopUps=function(f){var d=b.pslGetAllDynPopUps(f),c,e;if(d.length>0){c=b.pslLastDynPopUpInfo.posTopStart;e=b.pslLastDynPopUpInfo.posLeftStart;d.each(function(g){b(this).css({top:c,left:e,zIndex:b.pslLastDynPopUpInfo.nextTopZIndex()});
c+=b.pslLastDynPopUpInfo.offset;e+=b.pslLastDynPopUpInfo.offset})}};b.fn.pslCloseDynPopUpNow=function(d){var c=true;this.each(function(){if(this.pslOnBeforeClose){if(this.pslOnBeforeClose.call(this,d)===false){c=false;
return false}}});if(c==false){return this}this.fadeOut("slow",function(){var f=false,g=this.ownerDocument,e;b(this).each(function(){if(this.pslPopUpTarget){b(this).find(this.pslPopUpTarget).remove()
}if(this.className.indexOf("dynPopupActive")>=0){f=true}}).jqmHide().remove();if(f){e=b.pslGetAllDynPopUps(b(g));if(e.length>0){e=e.eq(0);e.addClass("dynPopupActive");
e.find(".firstFocusableElement:visible:first").focus()}}});return this};b.fn.pslCloseDynPopUp=function(d){var c=this;setTimeout(function(){c.pslCloseDynPopUpNow(d)
},1);return this};b.pslGetShortTitle=function(e,d){var c;if(!d){d=80}if(e&&(e.length>d)){c=e.substring(0,d-3)+"..."}else{c=e}return c};b.fn.pslSetDynPopUpTitle=function(f,e,d,c){if(!e){e=b.pslGetShortTitle(f,d)
}return this.each(function(){var h=b(this).find(".dialogTitle");var i=b(this).find(".popupControl .jqmClose");if(i&&i.length&&f&&f.length){var g=i.data("detailedTitle");
if(g&&g.length){g=g.replace("{0}",f);i.attr("title",g)}}h.text(e);h.attr("title",f);if(c){h.attr("name",c)}})};b.fn.pslDynPopUp=function(d){if(this.length<=0){return null
}var e={$win:null,dialogRootName:"copyOf_",dialogVarName:"",dialogAnchorName:"",dialogTitle:"",dialogShortTitle:"",dialogMaxShortTitleLength:0,dialogPosition:null,dialogWidth:null,dialogHeight:null,ajaxUrl:"",ajaxParams:null,ajaxHtml:null,target:".itemDetailInterior",dialogAlert:false,isModal:true,isDraggable:true,isDismissable:true,isResizable:true,hasToolbar:true,dragHandle:".itemDetailHeader",iconCollapse:b.pslDynPopUpResPath+"/images/popups/itemDetailControlCollapse.gif",iconExpand:b.pslDynPopUpResPath+"/images/popups/itemDetailControlExpand.gif",onBeforeOpen:null,onBeforeClose:null,opener:null,topWinOfOpener:null,accessibilityEnabled:false},c=this.eq(0);
b.extend(e,d);if(!e.$win){e.$win=b.pslLastDynPopUpInfo.$pluginWin}return(function(){var p=e.$win,l=p.get(0),m=b(l.document),r=m.find("body"),q=b.pslLastDynPopUpInfo.nextId(),n=e.dialogRootName+e.dialogVarName,w=n+q,t=c.clone().removeClass(e.dialogVarName),g,v=(e.isModal)?50:0,u=(e.isModal)?50:0,o=(e.isModal)?50:0,i,f,k,j,h,s;
b.pslLastDynPopUpInfo.strId="#"+w;t.addClass("pslDynPopUp").addClass(n).css({zIndex:b.pslLastDynPopUpInfo.nextTopZIndex()});t.get(0).id=w;r.prepend(t);t=b(document.getElementById(w));
g=t.get(0);t.pslSetDynPopUpTitle(e.dialogTitle,e.dialogShortTitle,e.dialogMaxShortTitleLength,e.dialogAnchorName);i=b.pslGetAllDynPopUps(m);if(e.onBeforeClose){g.pslOnBeforeClose=e.onBeforeClose
}if(e.opener){g.opener=e.opener}if(e.topWinOfOpener){g.topWinOfOpener=e.topWinOfOpener}t.find(".jqmClose").bind("click",function(){t.pslCloseDynPopUp(true)});if(e.isModal){g.pslIsModal=true;
t.find(".jqmMin").remove();t.css({zIndex:b.pslLastDynPopUpInfo.nextTopZIndex()})}if(!e.hasToolbar){t.find(".itemDetailToolbar").remove()}g.pslPopUpTarget=e.target;
f=e.ajaxUrl?t.find(e.target).html():null;t.jqm({ajax:e.ajaxUrl,ajaxText:f?f:"",ajaxParams:e.ajaxParams,target:e.target,overlay:v,overlayClass:"jqmOverlay",closeClass:"jqmClose_IGNORE",toTop:false,modal:e.isModal});
if(e.ajaxHtml&&(!e.ajaxUrl)){setTimeout(function(){var x=t.find(e.target);x.html(e.ajaxHtml);x.css("font-size","0px")},1)}if(e.onBeforeOpen){e.onBeforeOpen.call(g)
}t.jqmShow();if((!e.onInitialFocus)||e.onInitialFocus.call(g)){t.find(".firstFocusableElement:visible:first").focus()}if(e.dialogAnchorName){if(e.accessibilityEnabled){l.location.hash="#"+e.dialogAnchorName
}}if(e.onFocusOfElementBeforeFirstFocusableElement){t.find(".elementBeforeFirstFocusableElement").focus(function(){e.onFocusOfElementBeforeFirstFocusableElement.call(g)
})}t.find(".elementAfterLastFocusableElement").focus(function(){t.find(".firstFocusableElement:visible:first").focus()});if(b.browser.msie&&b.browser.version<7){u=0;
o=0}if(e.isDraggable){t.draggable({scroll:true,opacity:u,handle:e.dragHandle,cursor:"move",start:function(){if(b("body").hasClass("rtl")){b(this).css("right","auto")
}},stop:function(){var B=b(this),z=e.dialogWidth?40-e.dialogWidth:0,A=p.width()-40,x=p.height()-40,y=parseInt(B.css("left"),10),C=parseInt(B.css("top"),10);if(y<z){B.css("left",z+"px")
}else{if(y>A){B.css("left",A)}}if(C<0){B.css("top","0px")}else{if(C>x){B.css("top",x)}}}});t.find(e.dragHandle).bind("click",function(){b.pslAllDynPopUpsInactive(m);
t.css({zIndex:b.pslLastDynPopUpInfo.nextTopZIndex()});t.find("thead").removeClass("dynPopupInActive");t.addClass("dynPopupActive")})}if(e.isResizable){t.resizable({alsoResize:".plateauPopupContentFrame:first",opacity:o,minWidth:300,minHeight:300,start:function(){t.append('<div id="maskIFrame" style="position: absolute; z-index: 99999; left: 0pt; top: 0pt; right: 0pt; bottom: 0pt;"></div>')
},stop:function(){b("#maskIFrame").remove()}});t.css("position","fixed")}if(!e.isDismissable){t.addClass("dynPopupNotDismissable")}if(e.dialogWidth){t.width(e.dialogWidth)
}if(e.dialogHeight){t.height(e.dialogHeight)}if(e.dialogPosition=="centered"){t.css({left:Math.max(Math.ceil((p.width()-t.width())/2),0),top:Math.max(Math.ceil((p.height()-t.height())/2),0)})
}if(i.length==1){k=t.offset();b.pslLastDynPopUpInfo.posTopStart=k.top-r.scrollTop();b.pslLastDynPopUpInfo.posLeftStart=k.left-r.scrollLeft()}if((e.dialogPosition!="centered")&&(i.length>1)){k=b.pslLastDynPopUpInfo.offset*(i.length-1);
j=b.pslLastDynPopUpInfo.posTopStart+k;h=b.pslLastDynPopUpInfo.posLeftStart+k;if(!e.dialogAlert){if(r.hasClass("rtl")){s=(r.width()-(b(b.pslLastDynPopUpInfo.strId).width()+b(b.pslLastDynPopUpInfo.strId).offset().left))+k;
t.css({top:j,right:s})}else{t.css({top:j,left:h})}}}if(!e.isModal){t.mousedown(function(){var x=b(this);x.css({zIndex:b.pslLastDynPopUpInfo.nextTopZIndex()});b.pslAllDynPopUpsInactive(m);
x.find("thead").removeClass("dynPopupInActive");x.addClass("dynPopupActive")}).find("img.minMaxIcon").click(function(){var x=b(this);if(x.hasClass("jqmMin")){x.removeClass("jqmMin").addClass("jqmMax").attr("src",e.iconCollapse);
t.find("tbody").toggle()}else{x.removeClass("jqmMax").addClass("jqmMin").attr("src",e.iconExpand);t.find("tbody").toggle()}}).find("tr.itemDetailHeader").click(function(){var x=t.find("img.minMaxIcon");
if(x.hasClass("jqmMin")){x.removeClass("jqmMin").addClass("jqmMax").attr("src",e.iconCollapse);t.find("tbody").toggle()}else{x.removeClass("jqmMax").addClass("jqmMin").attr("src",e.iconExpand);
t.find("tbody").toggle()}})}if(e.dialogAlert){t.attr("initAlertTop",parseInt(t.css("top"),10));t.attr("initAlertLeft",parseInt(t.css("left"),10));t.attr("isAlertPositioned","false");
t.css({top:"0px",left:"-1000px"});t.removeClass("pslDynPopupInit");t.find(".itemDetailLayout").css({width:"1%"});t.find("h2").css({background:"none"});t.find(".jqmClose").css({visibility:"hidden"});
setTimeout(function(){if(t.attr("isAlertPositioned")=="false"){t.css({top:t.attr("initAlertTop")+"px",left:t.attr("initAlertLeft")+"px"})}},4000)}b.pslAllDynPopUpsInactive(m);
t.find("thead").removeClass("dynPopupInActive");t.addClass("dynPopupActive");if(e.isModal&&b.browser.mozilla&&(b.browser.version.indexOf("1.8")==0)){(function(){var x=m.find(".jqmOverlay").eq(0),y=x.css("z-index");
x.css("z-index",-1);setTimeout(function(){x.css("z-index",y)},1)})()}if(!l.pslHasDynPopupKeydown){m.keydown(function(x){if(x.which==27){m.find(".dynPopupActive:not(.dynPopupNotDismissable)").eq(0).find(".jqmClose").click()
}});l.pslHasDynPopupKeydown=true}return t})()}})(jQuery);