(function(E){var H=[];var K=false;var J=[];var A={screenLockerBackground:"#000",screenLockerOpacity:"0.5"};E.setupJMPopups=function(M){A=jQuery.extend(A,M);return this};E.openPopupLayer=function(M){if(typeof(M.name)!="undefined"&&!F(M.name)){M=jQuery.extend({width:"auto",height:"auto",parameters:{},target:"",success:function(){},error:function(){},beforeClose:function(){},afterClose:function(){},reloadSuccess:null,cache:false},M);C(M,true);return this}};E.closePopupLayer=function(M){if(M){for(var O=0;O<H.length;O++){if(H[O].name==M){var N=H[O];H.splice(O,1);N.beforeClose();E("#"+M).hide(function(){E("#"+M).find(".jmp-link-at-top,.jmp-link-at-bottom").remove();E("#"+M).hide();J.pop();if(J.length>0){E(J[J.length-1]).focus()}N.afterClose();D(M)});break}}}else{if(H.length>0){E.closePopupLayer(H[H.length-1].name)}}return this};E.reloadPopupLayer=function(M,O){if(M){for(var N=0;N<H.length;N++){if(H[N].name==M){if(O){H[N].reloadSuccess=O}C(H[N],false);break}}}else{if(H.length>0){E.reloadPopupLayer(H[H.length-1].name)}}return this};function G(){if(K){E("#popupLayerScreenLocker").height(E(document).height()+"px");E("#popupLayerScreenLocker").width(E(document.body).outerWidth(true)+"px")}}function F(M){if(M){for(var N=0;N<H.length;N++){if(H[N].name==M){return true}}}return false}function L(){if(E("#popupLayerScreenLocker").length){if(H.length==1){K=true;G();E("#popupLayerScreenLocker").show()}if(E.browser.msie&&E.browser.version<7){E("select:not(.hidden-by-jmp)").addClass("hidden-by-jmp hidden-by-"+H[H.length-1].name).css("visibility","hidden")}E("#popupLayerScreenLocker").css("z-index",parseInt(H.length==1?99:E("#"+H[H.length-2].name).css("z-index"))+1)}else{E("body").append("<div id='popupLayerScreenLocker'><!-- --></div>");E("#popupLayerScreenLocker").css({position:"absolute",background:A.screenLockerBackground,left:"0",top:"0",opacity:A.screenLockerOpacity,display:"none"});L()}}function D(M){if(H.length==0){screenlocker=false;E("#popupLayerScreenLocker").hide()}else{E("#popupLayerScreenLocker").css("z-index",parseInt(E("#"+H[H.length-1].name).css("z-index"))-1)}if(E.browser.msie&&E.browser.version<7){E("select.hidden-by-"+M).removeClass("hidden-by-jmp hidden-by-"+M).css("visibility","visible")}}function B(P,N){if(P){if(P.width()<E(window).width()){var O=(document.documentElement.offsetWidth-P.width())/2}else{var O=document.documentElement.scrollLeft+5}if(P.height()<E(window).height()){var M=document.documentElement.scrollTop+(E(window).height()-P.height())/2}else{var M=document.documentElement.scrollTop+5}var R={left:O+"px",top:M+"px"};if(!N){P.css(R)}else{P.animate(R,"slow")}G()}else{for(var Q=0;Q<H.length;Q++){B(E("#"+H[Q].name),true)}}}function I(M,S,Q){var V=M.name;if(S){L();var P=parseInt(H.length==1?100:E("#"+H[H.length-2].name).css("z-index"))+2}else{var P=E("#"+V).css("z-index")}var N=E("#"+V);N.css({visibility:"hidden",width:M.width=="auto"?"":M.width+"px",height:M.height=="auto"?"":M.height+"px",position:"absolute","z-index":P});var R="<a href='#' class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;'>&nbsp;</a><input class='jmp-link-at-top' style='position:absolute; left:-9999px; top:-1px;' />";var U="<a href='#' class='jmp-link-at-bottom' style='position:absolute; left:-9999px; bottom:-1px;'>&nbsp;</a><input class='jmp-link-at-bottom' style='position:absolute; left:-9999px; top:-1px;' />";if(Q){N.html(R+Q+U)}B(N);N.css("display","none");N.css("visibility","visible");if(S){N.show()}else{N.show()}E("#"+V+" .jmp-link-at-top, #"+V+" .jmp-link-at-bottom").focus(function(){E(J[J.length-1]).focus()});var T=E("#"+V+" a:visible:not(.jmp-link-at-top, .jmp-link-at-bottom), #"+V+" *:input:visible:not(.jmp-link-at-top, .jmp-link-at-bottom)");if(T.length==0){var O="<a href='#' class='jmp-link-inside-popup' style='position:absolute; left:-9999px;'>&nbsp;</a>";N.find(".jmp-link-at-top").after(O);J.push(E(N).find(".jmp-link-inside-popup")[0])}else{T.each(function(){if(!E(this).hasClass("jmp-link-at-top")&&!E(this).hasClass("jmp-link-at-bottom")){J.push(this);return false}})}E(J[J.length-1]).focus();M.success();if(M.reloadSuccess){M.reloadSuccess();M.reloadSuccess=null}}function C(M,N){if(N){H.push(M)}if(M.target!=""){I(M,N)}else{E.ajax({url:M.url,data:M.parameters,cache:M.cache,dataType:"html",method:"GET",success:function(O){I(M,N,O)},error:M.error})}}})(jQuery);function openShowDiv(A){$.openPopupLayer({name:A,target:A})}function closeDiv(A){$.closePopupLayer(A)};