jQuery.ui||(function(c){var j=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(l,m,o){var n=c.ui[l].prototype;for(var k in o){n.plugins[k]=n.plugins[k]||[];n.plugins[k].push([m,o[k]])}},call:function(k,m,l){var o=k.plugins[m];if(!o||!k.element[0].parentNode){return}for(var n=0;n<o.length;n++){if(k.options[o[n][0]]){o[n][1].apply(k.element,l)}}}},contains:function(l,k){return document.compareDocumentPosition?l.compareDocumentPosition(k)&16:l!==k&&l.contains(k)},hasScroll:function(n,l){if(c(n).css("overflow")=="hidden"){return false}var k=(l&&l=="left")?"scrollLeft":"scrollTop",m=false;if(n[k]>0){return true}n[k]=1;m=(n[k]>0);n[k]=0;return m},isOverAxis:function(l,k,m){return(l>k)&&(l<(k+m))},isOver:function(q,l,o,n,k,m){return c.ui.isOverAxis(q,o,k)&&c.ui.isOverAxis(l,n,m)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(l,k,m){var n=m!==undefined;return(k=="role"?(n?f.call(this,l,k,"wairole:"+m):(f.apply(this,arguments)||"").replace(b,"")):(a.test(k)?(n?l.setAttributeNS(h,k.replace(a,"aaa:"),m):f.call(this,l,k.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(k){return(a.test(k)?this.each(function(){this.removeAttributeNS(h,k.replace(a,""))}):e.call(this,k))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var k;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){k=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{k=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!k.length?c(document):k}});c.extend(c.expr[":"],{data:function(m,l,k){return !!c.data(m,k[3])},focusable:function(l){var m=l.nodeName.toLowerCase(),k=c.attr(l,"tabindex");return(/input|select|textarea|button|object/.test(m)?!l.disabled:"a"==m||"area"==m?l.href||!isNaN(k):!isNaN(k))&&!c(l)["area"==m?"parents":"closest"](":hidden").length},tabbable:function(l){var k=c.attr(l,"tabindex");return(isNaN(k)||k>=0)&&c(l).is(":focusable")}});function g(n,o,q,m){function l(s){var r=c[n][o][s]||[];return(typeof r=="string"?r.split(/,?\s+/):r)}var k=l("getter");if(m.length==1&&typeof m[0]=="string"){k=k.concat(l("getterSetter"))}return(c.inArray(q,k)!=-1)}c.widget=function(l,k){var m=l.split(".")[0];l=l.split(".")[1];c.fn[l]=function(r){var o=(typeof r=="string"),q=Array.prototype.slice.call(arguments,1);if(o&&r.substring(0,1)=="_"){return this}if(o&&g(m,l,r,q)){var n=c.data(this[0],l);return(n?n[r].apply(n,q):undefined)}return this.each(function(){var s=c.data(this,l);(!s&&!o&&c.data(this,l,new c[m][l](this,r))._init());(s&&o&&c.isFunction(s[r])&&s[r].apply(s,q))})};c[m]=c[m]||{};c[m][l]=function(q,o){var n=this;this.namespace=m;this.widgetName=l;this.widgetEventPrefix=c[m][l].eventPrefix||l;this.widgetBaseClass=m+"-"+l;this.options=c.extend({},c.widget.defaults,c[m][l].defaults,c.metadata&&c.metadata.get(q)[l],o);this.element=c(q).bind("setData."+l,function(s,r,u){if(s.target==q){return n._setData(r,u)}}).bind("getData."+l,function(s,r){if(s.target==q){return n._getData(r)}}).bind("remove",function(){return n.destroy()})};c[m][l].prototype=c.extend({},c.widget.prototype,k);c[m][l].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(m,n){var l=m,k=this;if(typeof m=="string"){if(n===undefined){return this._getData(m)}l={};l[m]=n}c.each(l,function(o,q){k._setData(o,q)})},_getData:function(k){return this.options[k]},_setData:function(k,l){this.options[k]=l;if(k=="disabled"){this.element[l?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",l)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(m,n,o){var r=this.options[m],k=(m==this.widgetEventPrefix?m:this.widgetEventPrefix+m);n=c.Event(n);n.type=k;if(n.originalEvent){for(var l=c.event.props.length,q;l;){q=c.event.props[--l];n[q]=n.originalEvent[q]}}this.element.trigger(n,o);return !(c.isFunction(r)&&r.call(this.element[0],n,o)===false||n.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var k=this;this.element.bind("mousedown."+this.widgetName,function(l){return k._mouseDown(l)}).bind("click."+this.widgetName,function(l){if(k._preventClickEvent){k._preventClickEvent=false;l.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(m){m.originalEvent=m.originalEvent||{};if(m.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(m));this._mouseDownEvent=m;var l=this,n=(m.which==1),k=(typeof this.options.cancel=="string"?c(m.target).parents().add(m.target).filter(this.options.cancel).length:false);if(!n||k||!this._mouseCapture(m)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){l.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(m)&&this._mouseDelayMet(m)){this._mouseStarted=(this._mouseStart(m)!==false);if(!this._mouseStarted){m.preventDefault();return true}}this._mouseMoveDelegate=function(o){return l._mouseMove(o)};this._mouseUpDelegate=function(o){return l._mouseUp(o)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||m.preventDefault());m.originalEvent.mouseHandled=true;return true},_mouseMove:function(k){if(c.browser.msie&&!k.button){return this._mouseUp(k)}if(this._mouseStarted){this._mouseDrag(k);return k.preventDefault()}if(this._mouseDistanceMet(k)&&this._mouseDelayMet(k)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,k)!==false);(this._mouseStarted?this._mouseDrag(k):this._mouseUp(k))}return !this._mouseStarted},_mouseUp:function(k){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(k.target==this._mouseDownEvent.target);this._mouseStop(k)}return false},_mouseDistanceMet:function(k){return(Math.max(Math.abs(this._mouseDownEvent.pageX-k.pageX),Math.abs(this._mouseDownEvent.pageY-k.pageY))>=this.options.distance)},_mouseDelayMet:function(k){return this.mouseDelayMet},_mouseStart:function(k){},_mouseDrag:function(k){},_mouseStop:function(k){},_mouseCapture:function(k){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);jQuery.fn.ajaxSubmit=function(d){if(typeof d=="function"){d={success:d}}d=jQuery.extend({url:this.attr("action")||"",method:this.attr("method")||"GET"},d||{});d.success=d.success||d.after;d.beforeSubmit=d.beforeSubmit||d.before;d.type=d.type||d.method;var b=this.formToArray(d.semantic);if(d.beforeSubmit&&d.beforeSubmit(b,this,d)===false){return this}var f=jQuery.param(b);if(d.type.toUpperCase()=="GET"){d.url+=(d.url.indexOf("?")>=0?"&":"?")+f;d.data=null}else{d.data=f}var c=this,e=[];if(d.resetForm){e.push(function(){c.resetForm()})}if(d.clearForm){e.push(function(){c.clearForm()})}if(!d.dataType&&d.target){var g=d.success||function(){};e.push(function(h,a){jQuery(d.target).attr("innerHTML",h).evalScripts().each(g,[h,a])})}else{if(d.success){e.push(d.success)}}d.success=function(k,h){for(var j=0,a=e.length;j<a;j++){e[j](k,h)}};jQuery.ajax(d);return this};jQuery.fn.ajaxForm=function(a){return this.each(function(){jQuery("input:submit,input:image,button:submit",this).click(function(c){var b=this.form;b.clk=this;if(this.type=="image"){if(c.offsetX!=undefined){b.clk_x=c.offsetX;b.clk_y=c.offsetY}else{if(typeof jQuery.fn.offset=="function"){var d=jQuery(this).offset();b.clk_x=c.pageX-d.left;b.clk_y=c.pageY-d.top}else{b.clk_x=c.pageX-this.offsetLeft;b.clk_y=c.pageY-this.offsetTop}}}setTimeout(function(){b.clk=b.clk_x=b.clk_y=null},10)})}).submit(function(b){jQuery(this).ajaxSubmit(a);return false})};jQuery.fn.formToArray=function(q){var o=[];if(this.length==0){return o}var c=this[0];var g=q?c.getElementsByTagName("*"):c.elements;if(!g){return o}for(var h=0,l=g.length;h<l;h++){var d=g[h];var e=d.name;if(!e){continue}if(q&&c.clk&&d.type=="image"){if(!d.disabled&&c.clk==d){o.push({name:e+".x",value:c.clk_x},{name:e+".y",value:c.clk_y})}continue}var r=jQuery.fieldValue(d,true);if(r===null){continue}if(r.constructor==Array){for(var f=0,b=r.length;f<b;f++){o.push({name:e,value:r[f]})}}else{o.push({name:e,value:r})}}if(!q&&c.clk){var k=c.getElementsByTagName("input");for(var h=0,l=k.length;h<l;h++){var m=k[h];var e=m.name;if(e&&!m.disabled&&m.type=="image"&&c.clk==m){o.push({name:e+".x",value:c.clk_x},{name:e+".y",value:c.clk_y})}}}return o};jQuery.fn.formSerialize=function(a){return jQuery.param(this.formToArray(a))};jQuery.fn.fieldSerialize=function(c){var b=[];this.each(function(){var f=this.name;if(!f){return}var d=jQuery.fieldValue(this,c);if(d&&d.constructor==Array){for(var e=0,a=d.length;e<a;e++){b.push({name:f,value:d[e]})}}else{if(d!==null&&typeof d!="undefined"){b.push({name:this.name,value:d})}}});return jQuery.param(b)};jQuery.fn.fieldValue=function(g){var f,e;for(var c=0,a=this.length;c<a;c++){var d=this[c];var b=jQuery.fieldValue(d,g);if(b===null||typeof b=="undefined"||(b.constructor==Array&&!b.length)){continue}if(d.type!="checkbox"){return b}e=e||d.name;if(e!=d.name){return f}f=f||[];f.push(b)}return f};jQuery.fieldValue=function(b,h){var d=b.name,o=b.type,q=b.tagName.toLowerCase();if(typeof h=="undefined"){h=true}if(h&&(!d||b.disabled||o=="reset"||(o=="checkbox"||o=="radio")&&!b.checked||(o=="submit"||o=="image")&&b.form&&b.form.clk!=b||q=="select"&&b.selectedIndex==-1)){return null}if(q=="select"){var j=b.selectedIndex;if(j<0){return null}var l=[],c=b.options;var f=(o=="select-one");var k=(f?j+1:c.length);for(var e=(f?j:0);e<k;e++){var g=c[e];if(g.selected){var m=jQuery.browser.msie&&!(g.attributes.value.specified)?g.text:g.value;if(f){return m}l.push(m)}}return l}return b.value};jQuery.fn.clearForm=function(){return this.each(function(){jQuery("input,select,textarea",this).clearFields()})};jQuery.fn.clearFields=jQuery.fn.clearInputs=function(){return this.each(function(){var b=this.type,a=this.tagName.toLowerCase();if(b=="text"||b=="password"||a=="textarea"){this.value=""}else{if(b=="checkbox"||b=="radio"){this.checked=false}else{if(a=="select"){this.selectedIndex=-1}}}})};jQuery.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};(function(d){d.fn.popup=function(f){var e={overlay:50,overlayClass:"popupOverlay",closeClass:"popupClose",trigger:".popupodal",ajax:o,ajaxText:"",target:o,modal:o,toTop:o,onShow:o,onHide:o,onLoad:o};return this.each(function(){if(this._popup){return n[this._popup].c=d.extend({},n[this._popup].c,f)}q++;this._popup=q;n[q]={c:d.extend(e,d.popup.params,f),a:o,w:d(this).addClass("popupID"+q),s:q};if(e.trigger){d(this).popupAddTrigger(e.trigger)}})};d.fn.popupAddClose=function(f){return l(this,f,"popupHide")};d.fn.popupAddTrigger=function(f){return l(this,f,"popupShow")};d.fn.popupShow=function(e){return this.each(function(){d.popup.open(this._popup,e)})};d.fn.popupHide=function(e){return this.each(function(){d.popup.close(this._popup,e)})};d.popup={hash:{},open:function(D,C){var v=n[D],w=v.c,m="."+w.closeClass,x=(parseInt(v.w.css("z-index"))),x=(x>0)?x:3000,f=d("<div></div>").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":x-1,opacity:w.overlay/100});if(v.a){return o}v.t=C;v.a=true;v.w.css("z-index",x);if(w.modal){if(!a[0]){k("bind")}a.push(D)}else{if(w.overlay>0){v.w.popupAddClose(f)}else{f=o}}v.o=(f)?f.addClass(w.overlayClass).prependTo("body"):o;if(c){d("html,body").css({height:"100%",width:"100%"});if(f){f=f.css({position:"absolute"})[0];for(var A in {Top:1,Left:1}){f.style.setExpression(A.toLowerCase(),"(_=(document.documentElement.scroll"+A+" || document.body.scroll"+A+"))+'px'")}}}if(w.ajax){var e=w.target||v.w,B=w.ajax,e=(typeof e=="string")?d(e,v.w):d(e),B=(B.substr(0,1)=="@")?d(C).attr(B.substring(1)):B;e.html(w.ajaxText).load(B,function(){if(w.onLoad){w.onLoad.call(this,v)}if(m){v.w.popupAddClose(d(m,v.w))}j(v)})}else{if(m){v.w.popupAddClose(d(m,v.w))}}if(w.toTop&&v.o){v.w.before('<span id="popupP'+v.w[0]._popup+'"></span>').insertAfter(v.o)}(w.onShow)?w.onShow(v):v.w.show();j(v);return o},close:function(f){var e=n[f];if(!e.a){return o}e.a=o;if(a[0]){a.pop();if(!a[0]){k("unbind")}}if(e.c.toTop&&e.o){d("#popupP"+e.w[0]._popup).after(e.w).remove()}if(e.c.onHide){e.c.onHide(e)}else{e.w.hide();if(e.o){e.o.remove()}}return o},params:{}};var q=0,n=d.popup.hash,a=[],c=d.browser.msie&&(d.browser.version=="6.0"),o=false,g=d('<iframe src="javascript:false;document.write(\'\');" class="popup"></iframe>').css({opacity:0}),j=function(e){if(c){if(e.o){e.o.html('<p style="width:100%;height:100%"/>').prepend(g)}else{if(!d("iframe.popup",e.w)[0]){e.w.prepend(g)}}}h(e)},h=function(f){try{d(":input:visible",f.w)[0].focus()}catch(e){}},k=function(e){d()[e]("keypress",b)[e]("keydown",b)[e]("mousedown",b)},b=function(s){var f=n[a[a.length-1]],m=(!d(s.target).parents(".popupID"+f.s)[0]);if(m){h(f)}return !m},l=function(e,f,m){return e.each(function(){var r=this._popup;d(f).each(function(){if(!this[m]){this[m]=[];d(this).click(function(){for(var u in {popupShow:1,popupHide:1}){for(var v in this[u]){if(n[this[u][v]]){n[this[u][v]].w[u](this)}}}return o})}this[m].push(r)})})}})(jQuery);(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var j=g[0]==this.active[0];if(this.running||(!d.collapsible&&j)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!j){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:j&&d.collapsible?a([]):g,oldHeader:this.active,newContent:j&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},k=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=j?a([]):g;this._toggle(c,h,e,j,k);return false},_toggle:function(b,j,g,k,l){var d=this.options,n=this;this.toShow=b;this.toHide=j;this.data=g;var c=function(){if(!n){return}return n._completed.apply(n,arguments)};this._trigger("changestart",null,this.data);this.running=j.size()===0?b.size():j.size();if(d.animated){var f={};if(d.collapsible&&k){f={toShow:a([]),toHide:j,complete:c,down:l,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:j,complete:c,down:l,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var m=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!m[h]){m[h]=function(o){this.slide(o,{easing:h,duration:e||700})}}m[h](f)}else{if(d.collapsible&&k){b.toggle()}else{j.hide();b.show()}c(true)}j.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(k,h){k=a.extend({easing:"swing",duration:300},k,h);if(!k.toHide.size()){k.toShow.animate({height:"show"},k);return}if(!k.toShow.size()){k.toHide.animate({height:"hide"},k);return}var c=k.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var j=k.toShow;b=j[0].style.width;j.width(parseInt(j.parent().width(),10)-parseInt(j.css("paddingLeft"),10)-parseInt(j.css("paddingRight"),10)-(parseInt(j.css("borderLeftWidth"),10)||0)-(parseInt(j.css("borderRightWidth"),10)||0));a.each(e,function(l,n){f[n]="hide";var m=(""+a.css(k.toShow[0],n)).match(/^([\d+-.]+)(.*)$/);d[n]={value:m[1],unit:m[2]||"px"}});k.toShow.css({height:0,overflow:"hidden"}).show();k.toHide.filter(":hidden").each(k.complete).end().filter(":visible").animate(f,{step:function(l,m){if(m.prop=="height"){g=(m.now-m.start)/(m.end-m.start)}k.toShow[0].style[m.prop]=(g*d[m.prop].value)+d[m.prop].unit},duration:k.duration,easing:k.easing,complete:function(){if(!k.autoHeight){k.toShow.css("height","")}k.toShow.css("width",b);k.toShow.css({overflow:c});k.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var q=this,d=this.options;var c=/^#.+/;this.anchors.each(function(s,o){var r=a(o).attr("href");var u=r.split("#")[0],v;if(u&&(u===location.toString().split("#")[0]||(v=a("base")[0])&&u===v.href)){r=o.hash;o.href=r}if(c.test(r)){q.panels=q.panels.add(q._sanitizeSelector(r))}else{if(r!="#"){a.data(o,"href.tabs",r);a.data(o,"load.tabs",r.replace(/#.*$/,""));var x=q._tabId(o);o.href="#"+x;var w=a("#"+x);if(!w.length){w=a(d.panelTemplate).attr("id",x).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(q.panels[s-1]||q.list);w.data("destroy.tabs",true)}q.panels=q.panels.add(w)}else{d.disabled.push(s)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(r,o){if(o.hash==location.hash){d.selected=r;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(q._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(r,o){return q.lis.index(r)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");q.element.queue("tabs",function(){q._trigger("show",null,q._ui(q.anchors[d.selected],q.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){q.lis.add(q.anchors).unbind(".tabs");q.lis=q.anchors=q.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(r,o){if(o.is(":not(.ui-state-disabled)")){o.addClass("ui-state-"+r)}};var j=function(r,o){o.removeClass("ui-state-"+r)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(o,r){o.css({display:""});if(a.browser.msie&&r.opacity){o[0].style.removeAttribute("filter")}}var k=h?function(o,r){a(o).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");r.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(r,h);q._trigger("show",null,q._ui(o,r[0]))})}:function(o,r){a(o).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");r.removeClass("ui-tabs-hide");q._trigger("show",null,q._ui(o,r[0]))};var l=b?function(r,o){o.animate(b,b.duration||"normal",function(){q.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");o.addClass("ui-tabs-hide");e(o,b);q.element.dequeue("tabs")})}:function(r,o,s){q.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");o.addClass("ui-tabs-hide");q.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var r=this,u=a(this).closest("li"),o=q.panels.filter(":not(.ui-tabs-hide)"),s=a(q._sanitizeSelector(this.hash));if((u.hasClass("ui-tabs-selected")&&!d.collapsible)||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||q._trigger("select",null,q._ui(this,s[0]))===false){this.blur();return false}d.selected=q.anchors.index(this);q.abort();if(d.collapsible){if(u.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){q._cookie(d.selected,d.cookie)}q.element.queue("tabs",function(){l(r,o)}).dequeue("tabs");this.blur();return false}else{if(!o.length){if(d.cookie){q._cookie(d.selected,d.cookie)}q.element.queue("tabs",function(){k(r,s)});q.load(q.anchors.index(this));this.blur();return false}}}if(d.cookie){q._cookie(d.selected,d.cookie)}if(s.length){if(o.length){q.element.queue("tabs",function(){l(r,o)})}q.element.queue("tabs",function(){k(r,s)});q.load(q.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,j=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",j)[0]);j.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){j.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{j.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(l,k){return l>=c?++l:l});this._tabify();if(this.anchors.length==1){j.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(j,h){a(c._sanitizeSelector(b.hash)).html(j);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(j,h)}catch(k){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading&#8230;</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var j=g.selected;b.select(++j<b.anchors.length?j:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:".",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,cells[i])}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i]}}return parsers[0]}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]))}cols.push(i);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){if(!node){return""}var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML}else{t=node.innerHTML}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node)}else{t=$(node).text()}}return t}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0}$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(!this.sortDisabled){$(this).addClass(table.config.cssHeader)}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0}else{i=(v==(0||1))?v:0}return i}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function sortText(a,b){return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){var DECIMAL="\\"+config.decimal;var exp="/(^[+]?0("+DECIMAL+"0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)"+DECIMAL+"(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*"+DECIMAL+"0+$)/";return RegExp(exp).test($.trim(s))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}$("tr:visible",table.tBodies[0]).filter(":even").removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(":odd").removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);$.fn.imageZoom=function(n){var n=n||{};var d=false;if($("#zoom").length==0){var j='<div id="zoom" style="display:none;"> 				  <div id="zoom_content"> 				  </div>                   <a href="#" title="Close" id="zoom_close" >                     <img src="/images/closebox.png" alt="Close" style="border:none; margin:0; padding:0;" />                   </a>                 </div>';$("body").append(j);$("html").click(function(o){if($(o.target).parents("#zoom:visible").length==0){k()}});$(document).keyup(function(o){if(o.keyCode==27&&$("#zoom:visible").length>0){k()}});$("#zoom_close").click(k)}var m=$("#zoom");var g=$("#zoom_table");var f=$("#zoom_close");var h=$("#zoom_content");var a=$("td.ml,td.mm,td.mr");this.each(function(o){$($(this).attr("href")).hide();$(this).click(l)});return this;function l(w){if(d){return false}d=true;var o=$($(this).attr("href"));var u=n.width;var v=n.height;var q=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var F=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var D=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var B=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var H={width:q,height:F,x:D,y:B};var q=(u||o.width())+60;var F=(v||o.height())+60;var z=H;if(n.scaleImg){var A=Math.max((z.height/2)-(F/2)+B,0);var E=(z.width/2)-(q/2)}else{var A=Math.max((z.height/2)-(F/2)+B,0)+40;var E=(z.width/2)-(q/2)-102}var r=w.pageY;var s=w.pageX;f.attr("curTop",r);f.attr("curLeft",s);f.attr("scaleImg",n.scaleImg?"true":"false");$("#zoom").hide().css({position:"absolute",top:r+"px",left:s+"px",width:"1px",height:"1px"});e();f.hide();if(n.closeOnClick){$("#zoom").click(k)}if(n.scaleImg){h.html(o.html());$("#zoom_content img").css("width","100%")}else{h.html(o.html());var G=$("#zoom_content img").attr("width");var C=$("#zoom_content img").attr("height");$("#zoom_content").css("width",G)}if(n.scaleImg!=true){q=G+22}$("#zoom").animate({top:A+"px",left:E+"px",opacity:"show",width:q,height:F},500,null,function(){if(n.scaleImg!=true){h.html(o.html())}c();f.show();d=false});return false}function k(){if(d){return false}d=true;$("#zoom").unbind("click");e();if(f.attr("scaleImg")!="true"){h.html("")}f.hide();$("#zoom").animate({top:f.attr("curTop")+"px",left:f.attr("curLeft")+"px",opacity:"hide",width:"1px",height:"1px"},500,null,function(){if(f.attr("scaleImg")=="true"){h.html("")}c();d=false});return false}function b(r){$("#zoom_table td").each(function(u){var s=$(this).css("background-image").replace(/\.(png|gif|none)\"\)$/,"."+r+'")');$(this).css("background-image",s)});var q=f.children("img");var o=q.attr("src").replace(/\.(png|gif|none)$/,"."+r);q.attr("src",o)}function e(){if($.browser.msie&&parseFloat($.browser.version)>=7){b("gif")}}function c(){if($.browser.msie&&$.browser.version>=7){b("png")}}};(function(a){a.fn.easySlider=function(b){var c={prevId:"prevBtn_pg",prevText:"",nextId:"nextBtn_pg",nextText:"",controlsShow:true,controlsBefore:"",controlsAfter:"",controlsFade:true,firstId:"firstBtn",firstText:"First",firstShow:false,lastId:"lastBtn",lastText:"Last",lastShow:false,vertical:false,speed:800,auto:false,pause:1000,continuous:false,numVisibleImages:4};var b=a.extend(c,b);this.each(function(){var e=a(this);var n=a("li",e).length;var l=a("li",e).width();var f=a("li",e).height();e.width("150px");e.height(f*b.numVisibleImages);e.css("overflow","hidden");var j=n-b.numVisibleImages;var m=0;a("ul",e).css("width","150px");if(!b.vertical){a("li",e).css("float","left")}if(b.controlsShow){var g=b.controlsBefore;g+=' <div  id="'+b.prevId+'"><a href="javascript:void(0);" style="text-decoration:none;"><img src="/images/photogallery/up_arrow.png" width="22px" height="22px"></a></div>';a(e).before(g);g="";g+=' <div id="'+b.nextId+'"><a href="javascript:void(0);"  style="text-decoration:none;"><img src="/images/photogallery/down_arrow.png" width="22px" height="22px"></span></a></div>';g+=b.controlsAfter;a(e).after(g)}a("#"+b.nextId).click(function(){d("next",true)});a("#"+b.prevId).click(function(){d("prev",true)});a("a","#"+b.firstId).click(function(){d("first",true)});a("a","#"+b.lastId).click(function(){d("last",true)});function d(h,o){var q=m;switch(h){case"next":m=(q>=j)?(b.continuous?0:j-b.numVisibleImages+1):m+b.numVisibleImages;break;case"prev":m=(m<=0)?(b.continuous?j:0):m-b.numVisibleImages;break;case"first":m=0;break;case"last":m=j;break;default:break}var s=Math.abs(q-m);var r=s*b.speed;if(!b.vertical){p=(m*l*-1);a("ul",e).animate({marginLeft:p},r)}else{p=(m*f*-1);a("ul",e).animate({marginTop:p},r)}if(!b.continuous&&b.controlsFade){if(m==j){a("a","#"+b.nextId).hide();a("a","#"+b.lastId).hide()}else{a("a","#"+b.nextId).show();a("a","#"+b.lastId).show()}if(m==0){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}else{a("a","#"+b.prevId).show();a("a","#"+b.firstId).show()}}if(o){clearTimeout(k)}if(b.auto&&h=="next"&&!o){k=setTimeout(function(){d("next",false)},s*b.speed+b.pause)}}var k;if(b.auto){k=setTimeout(function(){d("next",false)},b.pause)}if(!b.continuous&&b.controlsFade){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}})}})(jQuery);var totalImages=1;var imageCount=0;(function(e){document.write("<style type='text/css'>.noscript{display:none}</style>");var d="galleriffic-1.0";var g=4;var a=[];var o=[];var n;var c;var b;var l=false;var y=false;var w=false;function q(z){if(!z){return -1}z=z.replace(/^.*#/,"");if(isNaN(z)){return -1}return(+z)}function r(){var z=location.hash;return q(z)}function f(z){a.push(z);g+=z.data.length}function v(A){for(i=0;i<a.length;i++){var z=a[i];if(A<(z.data.length+z.offset)){return z}}return 0}function x(z,A){return A-z.offset}function k(D,z,B){if(!z.settings.enableHistory){var C=q(B.href);if(C>=0){var A=x(z,C);if(A>=0){z.jumpto(A)}}D.preventDefault()}}function h(){var B=r();if(B<0){return}var z=v(B);if(!z){return}var A=B-z.offset;z.jumpto(A)}function s(){if(w){return}w=true;var z=location.hash;n=z;if(e.browser.msie){if(n==""){n="#"}}else{if(e.browser.safari){c=[];c.length=history.length;b=[];l=true}}setInterval(function(){m()},100)}function u(z){c.push(z);b.length=0;l=true}function m(){if(e.browser.safari){if(!y){var z=history.length-c.length;if(z){l=false;if(z<0){for(var A=0;A<Math.abs(z);A++){b.unshift(c.pop())}}else{for(var A=0;A<z;A++){c.push(b.shift())}}var B=c[c.length-1];if(B!=undefined){n=location.hash;h()}}else{if(c[c.length-1]==undefined&&!l){h();l=true}}}}else{var C=location.hash;if(C!=n){n=C;h()}}}var j={delay:3000,numThumbs:3,preloadAhead:-1,enableTopPager:false,enableBottomPager:false,imageContainerSel:"",captionContainerSel:"",controlsContainerSel:"",loadingContainerSel:"",prevId:"prevImg",renderSSControls:true,renderNavControls:true,prevLinkText:"Previous",nextLinkText:"Next",nextPageLinkText:"Next &rsaquo;",prevPageLinkText:"&lsaquo; Prev",enableHistory:false,autoStart:false,onChange:undefined,onTransitionOut:undefined,onTransitionIn:undefined,onPageTransitionOut:undefined,onPageTransitionIn:undefined};e.fn.galleriffic=function(A,C){e.extend(this,{ver:function(){return d},initializeThumbs:function(){this.data=[];var G=this;this.$thumbsContainer.find("ul.thumbs_pg > li").each(function(I){var K=e(this);var H=K.find("a.thumb_pg");var J=G.offset+I;G.data.push({title:H.attr("title"),slideUrl:H.attr("href"),caption:K.find(".caption").remove(),hash:J});H.attr("rel","history");H.attr("href","#"+J);H.click(function(M){k(M,G,this);var L=q(this.href);imageCount=x(G,L)+1;setPageCount()})});return this},isPreloadComplete:false,preloadInit:function(){if(this.settings.preloadAhead==0){return this}this.preloadStartIndex=this.currentIndex;var G=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,G)},preloadRelocate:function(G){this.preloadStartIndex=G;return this},preloadRecursive:function(L,I){if(L!=this.preloadStartIndex){var G=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,G)}var H=this;var J=I-L;if(J<0){J=this.data.length-1-L+I}if(this.settings.preloadAhead>=0&&J>this.settings.preloadAhead){setTimeout(function(){H.preloadRecursive(L,I)},500);return this}var M=this.data[I];if(!M){return this}if(M.image){return this.preloadNext(L,I)}var K=new Image();K.onload=function(){M.image=this;H.preloadNext(L,I)};K.alt=M.title;K.src=M.slideUrl;return this},preloadNext:function(J,I){var G=this.getNextIndex(I);if(G==J){this.isPreloadComplete=true}else{var H=this;setTimeout(function(){H.preloadRecursive(J,G)},100)}return this},getNextIndex:function(H){var G=H+1;if(G>=this.data.length){G=0}return G},getPrevIndex:function(G){var H=G-1;if(H<0){H=this.data.length-1}return H},jumpto:function(G){if(G<0){G=0}else{if(G>=this.data.length){G=this.data.length-1}}if(this.settings.onChange){this.settings.onChange(this.currentIndex,G)}this.currentIndex=G;this.preloadRelocate(G);return this.refresh()},refresh:function(){var K=this.data[this.currentIndex];if(!K){return this}var J=true;var G=this;var I=function(){J=false;if(G.$controlsContainer){G.$controlsContainer.find("div.nav-controls_pg a.prev").attr("href","#"+G.data[G.getPrevIndex(G.currentIndex)].hash).end().find("div.nav-controls_pg a.next").attr("href","#"+G.data[G.getNextIndex(G.currentIndex)].hash)}var L=G.data[G.currentIndex];if(G.$captionContainer){G.$captionContainer.empty().append(L.caption)}if(L.image){G.buildImage(L.image)}else{if(G.$loadingContainer){G.$loadingContainer.show()}}};if(this.settings.onTransitionOut){this.settings.onTransitionOut(I)}else{this.$transitionContainers.hide();I()}if(!K.image){var H=new Image();H.onload=function(){K.image=this;if(!J){G.buildImage(K.image)}};H.alt=K.title;H.src=K.slideUrl}this.relocatePreload=true;return this.syncThumbs()},buildImage:function(I){if(this.$imageContainer){this.$imageContainer.empty();var H=this;totalImages=this.data.length;imageCount=this.currentIndex+1;setPageCount();var G=this.getNextIndex(this.currentIndex);if(this.$loadingContainer){this.$loadingContainer.hide()}this.$imageContainer.append('<span class="image-wrapper"><a class="advance-link" rel="history" href="#'+this.data[G].hash+'" title="'+I.alt+'"></a></span>').find("a").append(I).click(function(K){k(K,H,this);var J=q(this.href);imageCount=x(H,J)+1;if(imageCount==0){imageCount=1}setPageCount()})}if(this.settings.onTransitionIn){this.settings.onTransitionIn()}else{this.$transitionContainers.show()}return this},syncThumbs:function(){if(this.$thumbsContainer){var G=Math.floor(this.currentIndex/this.settings.numThumbs);if(G!=this.currentPage){this.currentPage=G;this.updateThumbs()}}return this},updateThumbs:function(){var G=this;var H=function(){G.rebuildThumbs();if(G.settings.onPageTransitionIn){G.settings.onPageTransitionIn()}else{G.$thumbsContainer.show()}};if(this.settings.onPageTransitionOut){this.settings.onPageTransitionOut(H)}else{this.$thumbsContainer.hide();H()}return this},rebuildThumbs:function(){if(this.currentPage<0){this.currentPage=0}var L=this.currentPage*this.settings.numThumbs;var H=L+this.settings.numThumbs-1;var I=this.data.length>this.settings.numThumbs;var G=this.$thumbsContainer.find("div.top");if(G.length==0){G=this.$thumbsContainer.prepend('<div class="top pagination_pg"></div>').find("div.top")}if(I&&this.settings.enableTopPager){G.empty()}if(I&&this.settings.enableBottomPager){var K=this.$thumbsContainer.find("div.bottom_gallery_pg");if(K.length==0){K=this.$thumbsContainer.append('<div class="bottom_gallery_pg pagination_pg"></div>').find("div.bottom_gallery_pg")}else{K.empty()}this.buildPager(K);imageCount=this.currentIndex+1;if(imageCount==0){imageCount=1}setPageCount()}if(H>=this.data.length){H=this.data.length-1}var J=this.$thumbsContainer.find("ul.thumbs_pg");J.find("li").each(function(M){var N=e(this);if(M>=L&&M<=H){N.show()}else{N.hide()}});J.removeClass("noscript");return this},buildPager:function(H){var P=this;var N=this.currentPage*this.settings.numThumbs;var M=N+this.settings.numThumbs-1;if(M>=this.data.length){M=this.data.length-1}var I=N+1;var O=M+1;totalImages=this.data.length;if(this.currentPage>0){var J=N-this.settings.numThumbs;H.append('<div class="prev_page_pg" style="width:90px; " align="right"><a  rel="history"    href="#'+this.data[J].hash+'" >'+this.settings.prevPageLinkText+"</a></div>")}else{var J=(this.numPages-1)*(this.settings.numThumbs);H.append('<div class="prev_page_pg" style="width:90px;" align="right"><a  rel="history"    href="#'+this.data[J].hash+'" >'+this.settings.prevPageLinkText+"</a></div>")}for(i=this.currentPage-3;i<=this.currentPage+3;i++){var K=i+1;if(i==this.currentPage){H.append('<div class="current_pg" >'+I+" - "+O+" of "+totalImages+"</div>")}else{if(i>=0&&i<this.numPages){var G=i*this.settings.numThumbs}}}var L=N+this.settings.numThumbs;if(L<this.data.length){H.append('<div class="next_page_pg" style="width:90px;"  align="left"><a rel="history" href="#'+this.data[L].hash+'">'+this.settings.nextPageLinkText+"</a></div>")}else{L=1;H.append('<div class="next_page_pg" style="width:90px;"  align="left"><a rel="history" href="#'+this.data[L].hash+'">'+this.settings.nextPageLinkText+"</a></div>")}H.find("a").click(function(R){k(R,P,this);var Q=q(this.href);imageCount=x(P,Q)+1;if(imageCount==0){imageCount=1}setPageCount()});return this}});this.settings=e.extend({},j,C);if(this.interval){clearInterval(this.interval)}this.interval=0;if(this.settings.imageContainerSel){this.$imageContainer=e(this.settings.imageContainerSel)}if(this.settings.captionContainerSel){this.$captionContainer=e(this.settings.captionContainerSel)}if(this.settings.loadingContainerSel){this.$loadingContainer=e(this.settings.loadingContainerSel)}this.$transitionContainers=e([]);if(this.$imageContainer){this.$transitionContainers=this.$transitionContainers.add(this.$imageContainer)}if(this.$captionContainer){this.$transitionContainers=this.$transitionContainers.add(this.$captionContainer)}this.offset=g;this.$thumbsContainer=e(A);this.initializeThumbs();f(this);this.numPages=Math.ceil(this.data.length/this.settings.numThumbs);this.currentPage=-1;this.currentIndex=0;var z=this;if(this.$loadingContainer){this.$loadingContainer.hide()}if(this.settings.controlsContainerSel){this.$controlsContainer=e(this.settings.controlsContainerSel).empty();if(this.settings.renderNavControls){var F=this.$controlsContainer.append('<div class="nav-controls_pg"  align="center;"><div style="float:left;  width:45px;  margin:0px; padding:0px;" align:"left"><a href="#" class="prev"  id="prevImg" rel="history" title="" >'+this.settings.prevLinkText+'</a></div><div  id="photo_count_pg" style="float:left;   width:45px;  padding-top:6px;"></div> <div style="float:left; width:45px;"><a class="next" style="width:50px; " rel="history" title="">'+this.settings.nextLinkText+"</a></div></div>").find("div.nav-controls_pg a").click(function(H){k(H,z,this);var G=q(this.href);imageCount=x(z,G)+1;setPageCount()})}}s();var D=r();var E=(D>=0)?v(D):0;var B=(E&&this==E)?(D-this.offset):0;this.jumpto(B);if(this.settings.autoStart){setTimeout(function(){z.play()},this.settings.delay)}setTimeout(function(){z.preloadInit()},1000);return this}})(jQuery);function setPageCount(){var a=imageCount-1;$("#story_pg").css("display","");if(document.getElementById("pic_headline_"+a)&&document.getElementById("pic_headline_"+a).innerHTML.length>0){if(document.getElementById("story_pg")){document.getElementById("story_pg").innerHTML="<div class='abt_pic_pg'><span>About the Picture</span></div><div class='pic_headline_pg'>"+document.getElementById("pic_headline_"+a).innerHTML+"</div>";document.getElementById("story_pg").style.border="1px solid #DFDFDF"}}else{document.getElementById("story_pg").style.display="none"}$("#photo_count_pg").html(imageCount+"/"+totalImages);$(".thumb_img_pg").css("border","none");$("#thumb_img_"+a).css("border","solid 2px black");if($(".caption").html()!=null&&$(".caption").html()!=""){if($(".caption").html().length>27){}}$.cbz.ads.selectzone()}(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(j){var q=this.offset.click.top,n=this.offset.click.left;var g=this.positionAbs.top,l=this.positionAbs.left;var k=j.height,m=j.width;var r=j.top,h=j.left;return a.ui.isOver(g+q,l+n,r,h,k,m)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(v,q){var g=a(this).data("draggable"),s=g.options;var z=s.snapTolerance;var y=q.offset.left,x=y+g.helperProportions.width,f=q.offset.top,e=f+g.helperProportions.height;for(var w=g.snapElements.length-1;w>=0;w--){var u=g.snapElements[w].left,n=u+g.snapElements[w].width,m=g.snapElements[w].top,B=m+g.snapElements[w].height;if(!((u-z<y&&y<n+z&&m-z<f&&f<B+z)||(u-z<y&&y<n+z&&m-z<e&&e<B+z)||(u-z<x&&x<n+z&&m-z<f&&f<B+z)||(u-z<x&&x<n+z&&m-z<e&&e<B+z))){if(g.snapElements[w].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,v,a.extend(g._uiHash(),{snapItem:g.snapElements[w].item})))}g.snapElements[w].snapping=false;continue}if(s.snapMode!="inner"){var c=Math.abs(m-e)<=z;var A=Math.abs(B-f)<=z;var j=Math.abs(u-x)<=z;var k=Math.abs(n-y)<=z;if(c){q.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(A){q.position.top=g._convertPositionTo("relative",{top:B,left:0}).top-g.margins.top}if(j){q.position.left=g._convertPositionTo("relative",{top:0,left:u-g.helperProportions.width}).left-g.margins.left}if(k){q.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||A||j||k);if(s.snapMode!="outer"){var c=Math.abs(m-f)<=z;var A=Math.abs(B-e)<=z;var j=Math.abs(u-y)<=z;var k=Math.abs(n-x)<=z;if(c){q.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(A){q.position.top=g._convertPositionTo("relative",{top:B-g.helperProportions.height,left:0}).top-g.margins.top}if(j){q.position.left=g._convertPositionTo("relative",{top:0,left:u}).left-g.margins.left}if(k){q.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[w].snapping&&(c||A||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,v,a.extend(g._uiHash(),{snapItem:g.snapElements[w].item})))}g.snapElements[w].snapping=(c||A||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(q){q=q||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");q.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var l=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=l&&l[1]?l[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var j=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var k=b(this.helper.css("left")),g=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;g+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:k,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,m={},r=this,j=this.originalMousePosition,n=this.axis;var s=(d.pageX-j.left)||0,q=(d.pageY-j.top)||0;var h=this._change[n];if(!h){return false}var l=h.apply(this,[d,s,q]),k=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){l=this._updateRatio(l,d)}l=this._respectSize(l,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,m=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:m.sizeDiff.height,k=d?0:m.sizeDiff.width;var n={width:(m.size.width-k),height:(m.size.height-e)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,j=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=j.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=j.top+(e.height-g.height);g.left=j.left+(e.width-g.width)}return g},_respectSize:function(l,f){var j=this.helper,h=this.options,s=this._aspectRatio||f.shiftKey,r=this.axis,v=a(l.width)&&h.maxWidth&&(h.maxWidth<l.width),m=a(l.height)&&h.maxHeight&&(h.maxHeight<l.height),g=a(l.width)&&h.minWidth&&(h.minWidth>l.width),u=a(l.height)&&h.minHeight&&(h.minHeight>l.height);if(g){l.width=h.minWidth}if(u){l.height=h.minHeight}if(v){l.width=h.maxWidth}if(m){l.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,q=this.position.top+this.size.height;var k=/sw|nw|w/.test(r),d=/nw|ne|n/.test(r);if(g&&k){l.left=e-h.minWidth}if(v&&k){l.left=e-h.maxWidth}if(u&&d){l.top=q-h.minHeight}if(m&&d){l.top=q-h.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var j=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var j=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,j){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),j=e.options,g=e.originalSize,l=e.originalPosition;var k={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-l.top)||0,left:(e.position.left-l.left)||0},d=function(m,n){c(m).each(function(){var r=c(this),s=c(this).data("resizable-alsoresize"),q={},o=n&&n.length?n:["width","height","top","left"];c.each(o||["width","height","top","left"],function(u,w){var v=(s[w]||0)+(k[w]||0);if(v&&v>=0){q[w]=v||null}});if(/relative/.test(r.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;r.css({position:"absolute",top:"auto",left:"auto"})}r.css(q)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){d(m,n)})}else{d(j.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,n){var q=c(this).data("resizable"),j=q.options;var g=q._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:q.sizeDiff.height,l=d?0:q.sizeDiff.width;var f={width:(q.size.width-l),height:(q.size.height-e)},k=(parseInt(q.element.css("left"),10)+(q.position.left-q.originalPosition.left))||null,m=(parseInt(q.element.css("top"),10)+(q.position.top-q.originalPosition.top))||null;q.element.animate(c.extend(f,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(q.element.css("width"),10),height:parseInt(q.element.css("height"),10),top:parseInt(q.element.css("top"),10),left:parseInt(q.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}q._updateCache(o);q._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,r){var u=c(this).data("resizable"),j=u.options,l=u.element;var f=j.containment,k=(f instanceof c)?f.get(0):(/parent/.test(f))?l.parent().get(0):f;if(!k){return}u.containerElement=c(k);if(/document/.test(f)||f==document){u.containerOffset={left:0,top:0};u.containerPosition={left:0,top:0};u.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),h=[];c(["Top","Right","Left","Bottom"]).each(function(v,o){h[v]=b(n.css("padding"+o))});u.containerOffset=n.offset();u.containerPosition=n.position();u.containerSize={height:(n.innerHeight()-h[3]),width:(n.innerWidth()-h[1])};var q=u.containerOffset,d=u.containerSize.height,m=u.containerSize.width,g=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:d);u.parentData={element:k,left:q.left,top:q.top,width:g,height:s}}},resize:function(f,r){var v=c(this).data("resizable"),h=v.options,e=v.containerSize,q=v.containerOffset,m=v.size,n=v.position,s=v._aspectRatio||f.shiftKey,d={top:0,left:0},g=v.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=q}if(n.left<(v._helper?q.left:0)){v.size.width=v.size.width+(v._helper?(v.position.left-q.left):(v.position.left-d.left));if(s){v.size.height=v.size.width/h.aspectRatio}v.position.left=h.helper?q.left:0}if(n.top<(v._helper?q.top:0)){v.size.height=v.size.height+(v._helper?(v.position.top-q.top):v.position.top);if(s){v.size.width=v.size.height*h.aspectRatio}v.position.top=v._helper?q.top:0}v.offset.left=v.parentData.left+v.position.left;v.offset.top=v.parentData.top+v.position.top;var l=Math.abs((v._helper?v.offset.left-d.left:(v.offset.left-d.left))+v.sizeDiff.width),u=Math.abs((v._helper?v.offset.top-d.top:(v.offset.top-q.top))+v.sizeDiff.height);var k=v.containerElement.get(0)==v.element.parent().get(0),j=/relative|absolute/.test(v.containerElement.css("position"));if(k&&j){l-=v.parentData.left}if(l+v.size.width>=v.parentData.width){v.size.width=v.parentData.width-l;if(s){v.size.height=v.size.width/v.aspectRatio}}if(u+v.size.height>=v.parentData.height){v.size.height=v.parentData.height-u;if(s){v.size.width=v.size.height*v.aspectRatio}}},stop:function(e,n){var r=c(this).data("resizable"),f=r.options,l=r.position,m=r.containerOffset,d=r.containerPosition,g=r.containerElement;var j=c(r.helper),s=j.offset(),q=j.outerWidth()-r.sizeDiff.width,k=j.outerHeight()-r.sizeDiff.height;if(r._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:s.left-d.left-m.left,width:q,height:k})}if(r._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:s.left-d.left-m.left,width:q,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,m){var q=c(this).data("resizable"),g=q.options,k=q.size,h=q.originalSize,j=q.originalPosition,n=q.axis,l=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((k.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((k.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(n)){q.size.width=h.width+f;q.size.height=h.height+e}else{if(/^(ne)$/.test(n)){q.size.width=h.width+f;q.size.height=h.height+e;q.position.top=j.top-e}else{if(/^(sw)$/.test(n)){q.size.width=h.width+f;q.size.height=h.height+e;q.position.left=j.left-f}else{q.size.width=h.width+f;q.size.height=h.height+e;q.position.top=j.top-e;q.position.left=j.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var m=this,n=this.options,k=n.title||this.originalTitle||"&nbsp;",e=c.ui.dialog.getTitleId(this.element),l=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+n.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:n.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(o){(n.closeOnEscape&&o.keyCode&&o.keyCode==c.ui.keyCode.ESCAPE&&m.close(o))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(o){m.moveToTop(false,o)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(l),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(l),j=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).mousedown(function(o){o.stopPropagation()}).click(function(o){m.close(o);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(n.closeText).appendTo(j),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(k).prependTo(f);f.find("*").add(f).disableSelection();(n.draggable&&c.fn.draggable&&this._makeDraggable());(n.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(n.buttons);this._isOpen=false;(n.bgiframe&&c.fn.bgiframe&&l.bgiframe());(n.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),j=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){j.focus()},1)}else{if(h.target==j&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,j){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){j.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(j){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(j,["center","top","right","bottom","left"])>=0){j=[j=="right"||j=="left"?j:"center",j=="top"||j=="bottom"?j:"middle"]}if(j.constructor!=Array){j=["center","middle"]}if(j[0].constructor==Number){d+=j[0]}else{switch(j[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(j[1].constructor==Number){g+=j[1]}else{switch(j[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||"&nbsp;");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);