(function(E){E.fn.jqm=function(A){var F={zIndex:3000,overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:false,target:false,modal:false,toTop:false,onShow:false,onHide:false,onLoad:false};return this.each(function(){if(this._jqm){return }N++;this._jqm=N;L[N]={c:E.extend(F,A),a:false,w:E(this).addClass("jqmID"+N),s:N};F.trigger&&E(this).jqmAddTrigger(F.trigger)})};E.fn.jqmAddClose=function(A){return C(this,A,"jqmHide")};E.fn.jqmAddTrigger=function(A){return C(this,A,"jqmShow")};E.fn.jqmShow=function(A){return this.each(function(){!L[this._jqm].a&&E.jqm.open(this._jqm,A)})};E.fn.jqmHide=function(A){return this.each(function(){L[this._jqm].a&&E.jqm.close(this._jqm,A)})};E.fn.jqmAnimate=function(H,F,A,O){return this.each(function(){E.jqm.animate(this._jqm,H,F,A,O)})};E.fn.jqmChangeConfig=function(A){var F={zIndex:3000,overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",trigger:".jqModal",ajax:false,target:false,modal:false,toTop:false,onShow:false,onHide:false,onLoad:false};return this.each(function(){if(this._jqm){L[this._jqm].c=E.extend(F,A)}})};E.jqm={hash:{},open:function(U,T){var O=L[U],P=O.c,H="."+P.closeClass,Q=/^\d+$/.test(O.w.css("z-index"))&&O.w.css("z-index")||P.zIndex,F=E("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":Q-1,opacity:P.overlay/100});O.t=T;O.a=true;O.w.css("z-index",Q);if(P.modal){!B[0]&&M("bind");B.push(U);F.css("cursor","wait")}else{if(P.overlay>0){O.w.jqmAddClose(F)}else{F=false}}O.o=(F)?F.addClass(P.overlayClass).prependTo("body"):false;if(D&&E("html,body").css({height:"100%",width:"100%"})&&F){F=F.css({position:"absolute"})[0];for(var R in {Top:1,Left:1}){F.style.setExpression(R.toLowerCase(),"(_=(document.documentElement.scroll"+R+" || document.body.scroll"+R+"))+'px'")}}if(P.ajax){var A=P.target||O.w,S=P.ajax,A=(typeof A=="string")?E(A,O.w):E(A),S=(S.substr(0,1)=="@")?E(T).attr(S.substring(1)):S;A.load(S,function(){P.onLoad&&P.onLoad.call(this,O);H&&O.w.jqmAddClose(E(H,O.w));I(O)})}else{H&&O.w.jqmAddClose(E(H,O.w))}P.toTop&&O.o&&O.w.before('<span id="jqmP'+O.w[0]._jqm+'"></span>').insertAfter(O.o);(P.onShow)?P.onShow(O):O.w.show();I(O);return false},close:function(F){var A=L[F];A.a=false;if(A.c.modal){B.pop();!B[0]&&M("unbind")}A.c.toTop&&A.o&&E("#jqmP"+A.w[0]._jqm).after(A.w).remove();if(A.c.onHide){A.c.onHide(A)}else{A.w.hide()&&A.o&&A.o.remove()}return false},animate:function(H,P,O,F,Q){var A=L[H];A.w.animate(P,O,F,Q);return false}};var N=0,L=E.jqm.hash,B=[],D=E.browser.msie&&(E.browser.version=="6.0"),G=E('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),I=function(A){if(D){A.o&&A.o.html('<p style="width:100%;height:100%"/>').prepend(G)||(!E("iframe.jqm",A.w)[0]&&A.w.prepend(G))}J(A)},J=function(A){try{E(":input:visible",A.w)[0].focus()}catch(F){}},M=function(A){E()[A]("keypress",K)[A]("keydown",K)[A]("mousedown",K)},K=function(H){var A=L[B[B.length-1]],F=(!E(H.target).parents(".jqmID"+A.s)[0]);F&&J(A);return !F},C=function(A,H,O){var F=[];A.each(function(){F.push(this._jqm)});E(H).each(function(){if(this[O]){E.extend(this[O],F)}else{this[O]=F;E(this).click(function(){for(var P in {jqmShow:1,jqmHide:1}){for(var Q in this[P]){if(L[this[P][Q]]){L[this[P][Q]].w[P](this)}}}return false})}});return A}})(jQuery);