/*!
 * jQuery UI 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(e,d){function b(f,c){var g=f.nodeName.toLowerCase();if("area"===g){c=f.parentNode;g=c.name;if(!f.href||!g||c.nodeName.toLowerCase()!=="map"){return false}f=e("img[usemap=#"+g+"]")[0];return !!f&&a(f)}return(/input|select|textarea|button|object/.test(g)?!f.disabled:"a"==g?f.href||c:c)&&a(f)}function a(c){return !e(c).parents().andSelf().filter(function(){return e.curCSS(this,"visibility")==="hidden"||e.expr.filters.hidden(this)}).length}e.ui=e.ui||{};if(!e.ui.version){e.extend(e.ui,{version:"1.8.16",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});e.fn.extend({propAttr:e.fn.prop||e.fn.attr,_focus:e.fn.focus,focus:function(f,c){return typeof f==="number"?this.each(function(){var g=this;setTimeout(function(){e(g).focus();c&&c.call(g)},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var c;c=e.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.curCSS(this,"position",1))&&/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.curCSS(this,"overflow",1)+e.curCSS(this,"overflow-y",1)+e.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!c.length?e(document):c},zIndex:function(f){if(f!==d){return this.css("zIndex",f)}if(this.length){f=e(this[0]);for(var c;f.length&&f[0]!==document;){c=f.css("position");if(c==="absolute"||c==="relative"||c==="fixed"){c=parseInt(f.css("zIndex"),10);if(!isNaN(c)&&c!==0){return c}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});e.each(["Width","Height"],function(f,c){function l(o,i,h,p){e.each(k,function(){i-=parseFloat(e.curCSS(o,"padding"+this,true))||0;if(h){i-=parseFloat(e.curCSS(o,"border"+this+"Width",true))||0}if(p){i-=parseFloat(e.curCSS(o,"margin"+this,true))||0}});return i}var k=c==="Width"?["Left","Right"]:["Top","Bottom"],j=c.toLowerCase(),g={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+c]=function(h){if(h===d){return g["inner"+c].call(this)}return this.each(function(){e(this).css(j,l(this,h)+"px")})};e.fn["outer"+c]=function(i,h){if(typeof i!=="number"){return g["outer"+c].call(this,i)}return this.each(function(){e(this).css(j,l(this,i,true,h)+"px")})}});e.extend(e.expr[":"],{data:function(f,c,g){return !!e.data(f,g[3])},focusable:function(c){return b(c,!isNaN(e.attr(c,"tabindex")))},tabbable:function(f){var c=e.attr(f,"tabindex"),g=isNaN(c);return(g||c>=0)&&b(f,!g)}});e(function(){var f=document.body,c=f.appendChild(c=document.createElement("div"));e.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});e.support.minHeight=c.offsetHeight===100;e.support.selectstart="onselectstart" in c;f.removeChild(c).style.display="none"});e.extend(e.ui,{plugin:{add:function(f,c,h){f=e.ui[f].prototype;for(var g in h){f.plugins[g]=f.plugins[g]||[];f.plugins[g].push([c,h[g]])}},call:function(f,c,h){if((c=f.plugins[c])&&f.element[0].parentNode){for(var g=0;g<c.length;g++){f.options[c[g][0]]&&c[g][1].apply(f.element,h)}}}},contains:function(f,c){return document.compareDocumentPosition?f.compareDocumentPosition(c)&16:f!==c&&f.contains(c)},hasScroll:function(f,c){if(e(f).css("overflow")==="hidden"){return false}c=c&&c==="left"?"scrollLeft":"scrollTop";var g=false;if(f[c]>0){return true}f[c]=1;g=f[c]>0;f[c]=0;return g},isOverAxis:function(f,c,g){return f>c&&f<c+g},isOver:function(f,c,l,k,j,g){return e.ui.isOverAxis(f,l,j)&&e.ui.isOverAxis(c,k,g)}})}})(jQuery);
/*!
 * jQuery UI Widget 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(a,e){if(a.cleanData){var d=a.cleanData;a.cleanData=function(b){for(var h=0,g;(g=b[h])!=null;h++){try{a(g).triggerHandler("remove")}catch(f){}}d(b)}}else{var c=a.fn.remove;a.fn.remove=function(b,f){return this.each(function(){if(!f){if(!b||a.filter(b,[this]).length){a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(g){}})}}return c.call(a(this),b,f)})}}a.widget=function(b,j,i){var h=b.split(".")[0],g;b=b.split(".")[1];g=h+"-"+b;if(!i){i=j;j=a.Widget}a.expr[":"][g]=function(f){return !!a.data(f,b)};a[h]=a[h]||{};a[h][b]=function(f,k){arguments.length&&this._createWidget(f,k)};j=new j;j.options=a.extend(true,{},j.options);a[h][b].prototype=a.extend(true,j,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:g},i);a.widget.bridge(b,a[h][b])};a.widget.bridge=function(b,f){a.fn[b]=function(k){var j=typeof k==="string",i=Array.prototype.slice.call(arguments,1),g=this;k=!j&&i.length?a.extend.apply(null,[true,k].concat(i)):k;if(j&&k.charAt(0)==="_"){return g}j?this.each(function(){var l=a.data(this,b),h=l&&a.isFunction(l[k])?l[k].apply(l,i):l;if(h!==l&&h!==e){g=h;return false}}):this.each(function(){var h=a.data(this,b);h?h.option(k||{})._init():a.data(this,b,new f(k,this))});return g}};a.Widget=function(b,f){arguments.length&&this._createWidget(b,f)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var f=this;this.element.bind("remove."+this.widgetName,function(){f.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,g){var f=b;if(arguments.length===0){return a.extend({},this.options)}if(typeof b==="string"){if(g===e){return this.options[b]}f={};f[b]=g}this._setOptions(f);return this},_setOptions:function(b){var f=this;a.each(b,function(h,g){f._setOption(h,g)});return this},_setOption:function(b,f){this.options[b]=f;if(b==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,j,i){var h=this.options[b];j=a.Event(j);j.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();i=i||{};if(j.originalEvent){b=a.event.props.length;for(var g;b;){g=a.event.props[--b];j[g]=j.originalEvent[g]}}this.element.trigger(j,i);return !(a.isFunction(h)&&h.call(this.element[0],j,i)===false||j.isDefaultPrevented())}}})(jQuery);
/*!
 * jQuery UI Mouse 1.8.16
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(a){var c=false;a(document).mouseup(function(){c=false});a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(d){return b._mouseDown(d)}).bind("click."+this.widgetName,function(d){if(true===a.data(d.target,b.widgetName+".preventClickEvent")){a.removeData(d.target,b.widgetName+".preventClickEvent");d.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var h=this,e=b.which==1,d=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:false;if(!e||d||!this._mouseCapture(b)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){h.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==false;if(!this._mouseStarted){b.preventDefault();return true}}true===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(f){return h._mouseMove(f)};this._mouseUpDelegate=function(f){return h._mouseUp(f)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();return c=true}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false)?this._mouseDrag(b):this._mouseUp(b)}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",true);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(f){f.ui=f.ui||{};var e=/left|center|right/,d=/top|center|bottom/,b=f.fn.position,a=f.fn.offset;f.fn.position=function(c){if(!c||!c.of){return b.apply(this,arguments)}c=f.extend({},c);var i=f(c.of),q=i[0],o=(c.collision||"flip").split(" "),p=c.offset?c.offset.split(" "):[0,0],n,l,m;if(q.nodeType===9){n=i.width();l=i.height();m={top:0,left:0}}else{if(q.setTimeout){n=i.width();l=i.height();m={top:i.scrollTop(),left:i.scrollLeft()}}else{if(q.preventDefault){c.at="left top";n=l=0;m={top:c.of.pageY,left:c.of.pageX}}else{n=i.outerWidth();l=i.outerHeight();m=i.offset()}}}f.each(["my","at"],function(){var g=(c[this]||"").split(" ");if(g.length===1){g=e.test(g[0])?g.concat(["center"]):d.test(g[0])?["center"].concat(g):["center","center"]}g[0]=e.test(g[0])?g[0]:"center";g[1]=d.test(g[1])?g[1]:"center";c[this]=g});if(o.length===1){o[1]=o[0]}p[0]=parseInt(p[0],10)||0;if(p.length===1){p[1]=p[0]}p[1]=parseInt(p[1],10)||0;if(c.at[0]==="right"){m.left+=n}else{if(c.at[0]==="center"){m.left+=n/2}}if(c.at[1]==="bottom"){m.top+=l}else{if(c.at[1]==="center"){m.top+=l/2}}m.left+=p[0];m.top+=p[1];return this.each(function(){var x=f(this),s=x.outerWidth(),k=x.outerHeight(),j=parseInt(f.curCSS(this,"marginLeft",true))||0,h=parseInt(f.curCSS(this,"marginTop",true))||0,z=s+j+(parseInt(f.curCSS(this,"marginRight",true))||0),y=k+h+(parseInt(f.curCSS(this,"marginBottom",true))||0),u=f.extend({},m),g;if(c.my[0]==="right"){u.left-=s}else{if(c.my[0]==="center"){u.left-=s/2}}if(c.my[1]==="bottom"){u.top-=k}else{if(c.my[1]==="center"){u.top-=k/2}}u.left=Math.round(u.left);u.top=Math.round(u.top);g={left:u.left-j,top:u.top-h};f.each(["left","top"],function(v,r){f.ui.position[o[v]]&&f.ui.position[o[v]][r](u,{targetWidth:n,targetHeight:l,elemWidth:s,elemHeight:k,collisionPosition:g,collisionWidth:z,collisionHeight:y,offset:p,my:c.my,at:c.at})});f.fn.bgiframe&&x.bgiframe();x.offset(f.extend(u,{using:c.using}))})};f.ui.position={fit:{left:function(c,g){var h=f(window);h=g.collisionPosition.left+g.collisionWidth-h.width()-h.scrollLeft();c.left=h>0?c.left-h:Math.max(c.left-g.collisionPosition.left,c.left)},top:function(c,g){var h=f(window);h=g.collisionPosition.top+g.collisionHeight-h.height()-h.scrollTop();c.top=h>0?c.top-h:Math.max(c.top-g.collisionPosition.top,c.top)}},flip:{left:function(c,i){if(i.at[0]!=="center"){var m=f(window);m=i.collisionPosition.left+i.collisionWidth-m.width()-m.scrollLeft();var k=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,l=i.at[0]==="left"?i.targetWidth:-i.targetWidth,j=-2*i.offset[0];c.left+=i.collisionPosition.left<0?k+l+j:m>0?k+l+j:0}},top:function(c,i){if(i.at[1]!=="center"){var m=f(window);m=i.collisionPosition.top+i.collisionHeight-m.height()-m.scrollTop();var k=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,l=i.at[1]==="top"?i.targetHeight:-i.targetHeight,j=-2*i.offset[1];c.top+=i.collisionPosition.top<0?k+l+j:m>0?k+l+j:0}}}};if(!f.offset.setOffset){f.offset.setOffset=function(c,i){if(/static/.test(f.curCSS(c,"position"))){c.style.position="relative"}var m=f(c),k=m.offset(),l=parseInt(f.curCSS(c,"top",true),10)||0,j=parseInt(f.curCSS(c,"left",true),10)||0;k={top:i.top-k.top+l,left:i.left-k.left+j};"using" in i?i.using.call(c,k):m.css(k)};f.fn.offset=function(c){var g=this[0];if(!g||!g.ownerDocument){return null}if(c){return this.each(function(){f.offset.setOffset(this,c)})}return a.call(this)}}})(jQuery);(function(g,f){function e(){return ++c}function b(){return ++a}var c=0,a=0;g.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(d,h){if(d=="selected"){this.options.collapsible&&h==this.options.selected||this.select(h)}else{this.options[d]=h;this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+b());return g.cookie.apply(null,[d].concat(g.makeArray(arguments)))},_ui:function(d,h){return{tab:d,panel:h,index:this.anchors.index(d)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d=g(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(y){function w(h,j){h.css("display","");!g.support.opacity&&j.opacity&&h[0].style.removeAttribute("filter")}var z=this,x=this.options,v=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=g(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return g("a",this)[0]});this.panels=g([]);this.anchors.each(function(k,n){var j=g(n).attr("href"),h=j.split("#")[0],m;if(h&&(h===location.toString().split("#")[0]||(m=g("base")[0])&&h===m.href)){j=n.hash;n.href=j}if(v.test(j)){z.panels=z.panels.add(z.element.find(z._sanitizeSelector(j)))}else{if(j&&j!=="#"){g.data(n,"href.tabs",j);g.data(n,"load.tabs",j.replace(/#.*$/,""));j=z._tabId(n);n.href="#"+j;n=z.element.find("#"+j);if(!n.length){n=g(x.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(z.panels[k-1]||z.list);n.data("destroy.tabs",true)}z.panels=z.panels.add(n)}else{x.disabled.push(k)}}});if(y){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(x.selected===f){location.hash&&this.anchors.each(function(h,j){if(j.hash==location.hash){x.selected=h;return false}});if(typeof x.selected!=="number"&&x.cookie){x.selected=parseInt(z._cookie(),10)}if(typeof x.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){x.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}x.selected=x.selected||(this.lis.length?0:-1)}else{if(x.selected===null){x.selected=-1}}x.selected=x.selected>=0&&this.anchors[x.selected]||x.selected<0?x.selected:0;x.disabled=g.unique(x.disabled.concat(g.map(this.lis.filter(".ui-state-disabled"),function(h){return z.lis.index(h)}))).sort();g.inArray(x.selected,x.disabled)!=-1&&x.disabled.splice(g.inArray(x.selected,x.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(x.selected>=0&&this.anchors.length){z.element.find(z._sanitizeSelector(z.anchors[x.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(x.selected).addClass("ui-tabs-selected ui-state-active");z.element.queue("tabs",function(){z._trigger("show",null,z._ui(z.anchors[x.selected],z.element.find(z._sanitizeSelector(z.anchors[x.selected].hash))[0]))});this.load(x.selected)}g(window).bind("unload",function(){z.lis.add(z.anchors).unbind(".tabs");z.lis=z.anchors=z.panels=null})}else{x.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[x.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");x.cookie&&this._cookie(x.selected,x.cookie);y=0;for(var u;u=this.lis[y];y++){g(u)[g.inArray(y,x.disabled)!=-1&&!g(u).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}x.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(x.event!=="mouseover"){var q=function(h,j){j.is(":not(.ui-state-disabled)")&&j.addClass("ui-state-"+h)},l=function(h,j){j.removeClass("ui-state-"+h)};this.lis.bind("mouseover.tabs",function(){q("hover",g(this))});this.lis.bind("mouseout.tabs",function(){l("hover",g(this))});this.anchors.bind("focus.tabs",function(){q("focus",g(this).closest("li"))});this.anchors.bind("blur.tabs",function(){l("focus",g(this).closest("li"))})}var p,i;if(x.fx){if(g.isArray(x.fx)){p=x.fx[0];i=x.fx[1]}else{p=i=x.fx}}var d=i?function(h,j){g(h).closest("li").addClass("ui-tabs-selected ui-state-active");j.hide().removeClass("ui-tabs-hide").animate(i,i.duration||"normal",function(){w(j,i);z._trigger("show",null,z._ui(h,j[0]))})}:function(h,j){g(h).closest("li").addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");z._trigger("show",null,z._ui(h,j[0]))},A=p?function(h,j){j.animate(p,p.duration||"normal",function(){z.lis.removeClass("ui-tabs-selected ui-state-active");j.addClass("ui-tabs-hide");w(j,p);z.element.dequeue("tabs")})}:function(h,j){z.lis.removeClass("ui-tabs-selected ui-state-active");j.addClass("ui-tabs-hide");z.element.dequeue("tabs")};this.anchors.bind(x.event+".tabs",function(){var k=this,m=g(k).closest("li"),j=z.panels.filter(":not(.ui-tabs-hide)"),h=z.element.find(z._sanitizeSelector(k.hash));if(m.hasClass("ui-tabs-selected")&&!x.collapsible||m.hasClass("ui-state-disabled")||m.hasClass("ui-state-processing")||z.panels.filter(":animated").length||z._trigger("select",null,z._ui(this,h[0]))===false){this.blur();return false}x.selected=z.anchors.index(this);z.abort();if(x.collapsible){if(m.hasClass("ui-tabs-selected")){x.selected=-1;x.cookie&&z._cookie(x.selected,x.cookie);z.element.queue("tabs",function(){A(k,j)}).dequeue("tabs");this.blur();return false}else{if(!j.length){x.cookie&&z._cookie(x.selected,x.cookie);z.element.queue("tabs",function(){d(k,h)});z.load(z.anchors.index(this));this.blur();return false}}}x.cookie&&z._cookie(x.selected,x.cookie);if(h.length){j.length&&z.element.queue("tabs",function(){A(k,j)});z.element.queue("tabs",function(){d(k,h)});z.load(z.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}g.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(d){if(typeof d=="string"){d=this.anchors.index(this.anchors.filter("[href$="+d+"]"))}return d},destroy:function(){var d=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 i=g.data(this,"href.tabs");if(i){this.href=i}var h=g(this).unbind(".tabs");g.each(["href","load","cache"],function(k,j){h.removeData(j+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){g.data(this,"destroy.tabs")?g(this).remove():g(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")});d.cookie&&this._cookie(null,d.cookie);return this},add:function(d,m,i){if(i===f){i=this.anchors.length}var n=this,l=this.options;m=g(l.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,m));d=!d.indexOf("#")?d.replace("#",""):this._tabId(g("a",m)[0]);m.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var k=n.element.find("#"+d);k.length||(k=g(l.panelTemplate).attr("id",d).data("destroy.tabs",true));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(i>=this.lis.length){m.appendTo(this.list);k.appendTo(this.list[0].parentNode)}else{m.insertBefore(this.lis[i]);k.insertBefore(this.panels[i])}l.disabled=g.map(l.disabled,function(h){return h>=i?++h:h});this._tabify();if(this.anchors.length==1){l.selected=0;m.addClass("ui-tabs-selected ui-state-active");k.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){n._trigger("show",null,n._ui(n.anchors[0],n.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[i],this.panels[i]));return this},remove:function(d){d=this._getIndex(d);var i=this.options,h=this.lis.eq(d).remove(),j=this.panels.eq(d).remove();if(h.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(d+(d+1<this.anchors.length?1:-1))}i.disabled=g.map(g.grep(i.disabled,function(k){return k!=d}),function(k){return k>=d?--k:k});this._tabify();this._trigger("remove",null,this._ui(h.find("a")[0],j[0]));return this},enable:function(d){d=this._getIndex(d);var h=this.options;if(g.inArray(d,h.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");h.disabled=g.grep(h.disabled,function(i){return i!=d});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]));return this}},disable:function(d){d=this._getIndex(d);var h=this.options;if(d!=h.selected){this.lis.eq(d).addClass("ui-state-disabled");h.disabled.push(d);h.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))}return this},select:function(d){d=this._getIndex(d);if(d==-1){if(this.options.collapsible&&this.options.selected!=-1){d=this.options.selected}else{return this}}this.anchors.eq(d).trigger(this.options.event+".tabs");return this},load:function(d){d=this._getIndex(d);var m=this,i=this.options,n=this.anchors.eq(d)[0],l=g.data(n,"load.tabs");this.abort();if(!l||this.element.queue("tabs").length!==0&&g.data(n,"cache.tabs")){this.element.dequeue("tabs")}else{this.lis.eq(d).addClass("ui-state-processing");if(i.spinner){var k=g("span",n);k.data("label.tabs",k.html()).html(i.spinner)}this.xhr=g.ajax(g.extend({},i.ajaxOptions,{url:l,success:function(j,o){m.element.find(m._sanitizeSelector(n.hash)).html(j);m._cleanup();i.cache&&g.data(n,"cache.tabs",true);m._trigger("load",null,m._ui(m.anchors[d],m.panels[d]));try{i.ajaxOptions.success(j,o)}catch(h){}},error:function(j,o){m._cleanup();m._trigger("load",null,m._ui(m.anchors[d],m.panels[d]));try{i.ajaxOptions.error(j,o,d,n)}catch(h){}}}));m.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(d,h){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",h);return this},length:function(){return this.anchors.length}});g.extend(g.ui.tabs,{version:"1.8.16"});g.extend(g.ui.tabs.prototype,{rotation:null,rotate:function(d,k){var i=this,l=this.options,j=i._rotate||(i._rotate=function(h){clearTimeout(i.rotation);i.rotation=setTimeout(function(){var m=l.selected;i.select(++m<i.anchors.length?m:0)},d);h&&h.stopPropagation()});k=i._unrotate||(i._unrotate=!k?function(h){h.clientX&&i.rotate(null)}:function(){t=l.selected;j()});if(d){this.element.bind("tabsshow",j);this.anchors.bind(l.event+".tabs",k);j()}else{clearTimeout(i.rotation);this.element.unbind("tabsshow",j);this.anchors.unbind(l.event+".tabs",k);delete this._rotate;delete this._unrotate}return this}})})(jQuery);(function(b){var a=0;b.fn.splitter=function(c){c=c||{};return this.each(function(){if(b(this).is(".splitter")){return}var o;function j(u){n.removeClass(d.barStateClasses).addClass(u)}function i(u){if(u.which!=1){return}n.removeClass(d.barHoverClass);if(d.outline){o=o||n.clone(false).insertAfter(h);n.removeClass(d.barDockedClass)}j(d.barActiveClass);p.css("-webkit-user-select","none").find("iframe").addClass(d.iframeClass);h._posSplit=h[0][d.pxSplit]-u[d.eventPos];b(document).bind("mousemove"+d.eventNamespace,l).bind("mouseup"+d.eventNamespace,r)}function l(v){var x=h._posSplit+v[d.eventPos],w=Math.max(0,Math.min(x,e._DA-n._DA)),u=Math.max(h._min,e._DA-g._max,Math.min(x,h._max,e._DA-n._DA-g._min));if(d.outline){if((d.dockPane==h&&x<Math.max(h._min,n._DA))||(d.dockPane==g&&x>Math.min(x,h._max,e._DA-n._DA-g._min))){n.addClass(d.barDockedClass).css(d.origin,w)}else{n.removeClass(d.barDockedClass).css(d.origin,u)}n._DA=n[0][d.pxSplit]}else{m(x)}j(x==u?d.barActiveClass:d.barLimitClass)}function r(u){j(d.barNormalClass);n.addClass(d.barHoverClass);var v=h._posSplit+u[d.eventPos];if(d.outline){o.remove();o=null;m(v)}p.css("-webkit-user-select","text").find("iframe").removeClass(d.iframeClass);b(document).unbind("mousemove"+d.eventNamespace+" mouseup"+d.eventNamespace)}function m(u){n._DA=n[0][d.pxSplit];if((d.dockPane==h&&u<Math.max(h._min,n._DA))||(d.dockPane==g&&u>Math.min(u,h._max,e._DA-n._DA-g._min))){n.addClass(d.barDockedClass);n._DA=n[0][d.pxSplit];u=d.dockPane==h?0:e._DA-n._DA;if(n._pos==null){n._pos=h[0][d.pxSplit]}}else{n.removeClass(d.barDockedClass);n._DA=n[0][d.pxSplit];n._pos=null;u=Math.max(h._min,e._DA-g._max,Math.min(u,h._max,e._DA-n._DA-g._min))}n.css(d.origin,u).css(d.fixed,e._DF);h.css(d.origin,0).css(d.split,u).css(d.fixed,e._DF);g.css(d.origin,u+n._DA).css(d.split,e._DA-n._DA-u).css(d.fixed,e._DF);if(!b.browser.msie){p.trigger("resize")}}function q(x,w){var v=0;for(var u=1;u<arguments.length;u++){v+=Math.max(parseInt(x.css(arguments[u]),10)||0,0)}return v}var k=(c.splitHorizontal?"h":c.splitVertical?"v":c.type)||"v";var d=b.extend({splitterClass:"splitter ui-widget ui-widget-content",paneClass:"splitter-pane",barClass:"splitter-bar",barNormalClass:"ui-state-default",barHoverClass:"ui-state-hover",barActiveClass:"ui-state-highlight",barLimitClass:"ui-state-error",iframeClass:"splitter-iframe-hide",eventNamespace:".splitter"+(++a),pxPerKey:8,tabIndex:0,accessKey:""},{v:{keyLeft:39,keyRight:37,cursor:"e-resize",barStateClass:"splitter-bar-vertical",barDockedClass:"splitter-bar-vertical-docked"},h:{keyTop:40,keyBottom:38,cursor:"n-resize",barStateClass:"splitter-bar-horizontal",barDockedClass:"splitter-bar-horizontal-docked"}}[k],c,{v:{type:"v",eventPos:"pageX",origin:"left",split:"width",pxSplit:"offsetWidth",side1:"Left",side2:"Right",fixed:"height",pxFixed:"offsetHeight",side3:"Top",side4:"Bottom"},h:{type:"h",eventPos:"pageY",origin:"top",split:"height",pxSplit:"offsetHeight",side1:"Top",side2:"Bottom",fixed:"width",pxFixed:"offsetWidth",side3:"Left",side4:"Right"}}[k]);d.barStateClasses=[d.barNormalClass,d.barHoverClass,d.barActiveClass,d.barLimitClass].join(" ");var e=b(this).css({position:"relative"}).addClass(d.splitterClass);var p=b(">*",e[0]).addClass(d.paneClass).css({position:"absolute","z-index":"1","-moz-outline-style":"none"});var h=b(p[0]),g=b(p[1]);d.dockPane=d.dock&&(/right|bottom/.test(d.dock)?g:h);var f=b('<a href="javascript:void(0)"></a>').attr({accessKey:d.accessKey,tabIndex:d.tabIndex,title:d.splitbarClass}).bind((b.browser.opera?"click":"focus")+d.eventNamespace,function(){this.focus();n.addClass(d.barActiveClass)}).bind("keydown"+d.eventNamespace,function(w){var v=w.which||w.keyCode;var u=v==d["key"+d.side1]?1:v==d["key"+d.side2]?-1:0;if(u){m(h[0][d.pxSplit]+u*d.pxPerKey,false)}}).bind("blur"+d.eventNamespace,function(){n.removeClass(d.barActiveClass)});var n=b("<div></div>").insertAfter(h).addClass(d.barClass).addClass(d.barStateClass).append(f).attr({unselectable:"on"}).css({position:"absolute","user-select":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","z-index":"100"}).bind("mousedown"+d.eventNamespace,i).bind("mouseover"+d.eventNamespace,function(){b(this).addClass(d.barHoverClass)}).bind("mouseout"+d.eventNamespace,function(){b(this).removeClass(d.barHoverClass)});if(/^(auto|default|)$/.test(n.css("cursor"))){n.css("cursor",d.cursor)}n._DA=n[0][d.pxSplit];e._PBF=q(e,"border"+d.side3+"Width","border"+d.side4+"Width");e._PBA=q(e,"border"+d.side1+"Width","border"+d.side2+"Width");h._pane=d.side1;g._pane=d.side2;b.each([h,g],function(){this._splitter_style=this.style;this._min=d["min"+this._pane]||q(this,"min-"+d.split);this._max=d["max"+this._pane]||q(this,"max-"+d.split)||9999;this._init=d["size"+this._pane]===true?parseInt(b.curCSS(this[0],d.split),10):d["size"+this._pane]});var s=h._init;if(!isNaN(g._init)){s=e[0][d.pxSplit]-e._PBA-g._init-n._DA}if(d.cookie){if(!b.cookie){alert("jQuery.splitter(): jQuery cookie plugin required")}s=parseInt(b.cookie(d.cookie),10);b(window).bind("unload"+d.eventNamespace,function(){var u=String(n.css(d.origin));b.cookie(d.cookie,u,{expires:d.cookieExpires||365,path:d.cookiePath||document.location.pathname})})}if(isNaN(s)){s=Math.round((e[0][d.pxSplit]-e._PBA-n._DA)/2)}if(d.anchorToWindow){d.resizeTo=window}if(d.resizeTo){e._hadjust=q(e,"borderTopWidth","borderBottomWidth","marginBottom");e._hmin=Math.max(q(e,"minHeight"),20);b(window).bind("resize"+d.eventNamespace,function(){var u=e.offset().top;var v=b(d.resizeTo).height();e.css("height",Math.max(v-u-e._hadjust,e._hmin)+"px");if(!b.browser.msie){e.trigger("resize")}}).trigger("resize"+d.eventNamespace)}else{if(d.resizeToWidth&&!b.browser.msie){b(window).bind("resize"+d.eventNamespace,function(){e.trigger("resize")})}}if(d.dock){e.bind("toggleDock"+d.eventNamespace,function(){var u=d.dockPane[0][d.pxSplit];e.trigger(u?"dock":"undock")}).bind("dock"+d.eventNamespace,function(){var v=h[0][d.pxSplit];if(!v){return}n._pos=v;var u={};u[d.origin]=d.dockPane==h?0:e[0][d.pxSplit]-e._PBA-n[0][d.pxSplit];n.animate(u,d.dockSpeed||1,d.dockEasing,function(){n.addClass(d.barDockedClass);m(u[d.origin])})}).bind("undock"+d.eventNamespace,function(){var v=d.dockPane[0][d.pxSplit];if(v){return}var u={};u[d.origin]=n._pos+"px";n.removeClass(d.barDockedClass).animate(u,d.undockSpeed||d.dockSpeed||1,d.undockEasing||d.dockEasing,function(){m(n._pos);n._pos=null})});if(d.dockKey){b('<a title="'+d.splitbarClass+' toggle dock" href="javascript:void(0)"></a>').attr({accessKey:d.dockKey,tabIndex:-1}).appendTo(n).bind(b.browser.opera?"click":"focus",function(){e.trigger("toggleDock");this.blur()})}n.bind("dblclick",function(){e.trigger("toggleDock")})}e.bind("destroy"+d.eventNamespace,function(){b([window,document]).unbind(d.eventNamespace);n.unbind().remove();p.removeClass(d.paneClass);e.removeClass(d.splitterClass).add(p).unbind(d.eventNamespace).attr("style",function(u){return this._splitter_style||""});e=n=f=p=h=g=d=c=null}).bind("resize"+d.eventNamespace,function(v,u){if(v.target!=this){return}e._DF=e[0][d.pxFixed]-e._PBF;e._DA=e[0][d.pxSplit]-e._PBA;if(e._DF<=0||e._DA<=0){return}m(!isNaN(u)?u:(!(d.sizeRight||d.sizeBottom)?h[0][d.pxSplit]:e._DA-g[0][d.pxSplit]-n._DA));j(d.barNormalClass)}).trigger("resize",[s])})}})(jQuery);
/*!
 * jQuery Templates Plugin 1.0.0pre
 * http://github.com/jquery/jquery-tmpl
 * Requires jQuery 1.4.2
 *
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 */
(function(i,f){var u=i.fn.domManip,h="_tmplitem",v=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,p={},e={},z,y={key:0,data:{}},x=0,q=0,g=[];function k(C,B,E,F){var D={data:F||(F===0||F===false)?F:(B?B.data:{}),_wrap:B?B._wrap:null,tmpl:null,parent:B||null,nodes:[],calls:c,nest:b,wrap:n,html:r,update:A};if(C){i.extend(D,C,{nodes:[],parent:B})}if(E){D.tmpl=E;D._ctnt=D._ctnt||D.tmpl(i,D);D.key=++x;(g.length?e:p)[x]=D}return D}i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(B,C){i.fn[B]=function(D){var G=[],J=i(D),F,H,E,K,I=this.length===1&&this[0].parentNode;z=p||{};if(I&&I.nodeType===11&&I.childNodes.length===1&&J.length===1){J[C](this[0]);G=this}else{for(H=0,E=J.length;H<E;H++){q=H;F=(H>0?this.clone(true):this).get();i(J[H])[C](F);G=G.concat(F)}q=0;G=this.pushStack(G,B,J.selector)}K=z;z=null;i.tmpl.complete(K);return G}});i.fn.extend({tmpl:function(D,C,B){return i.tmpl(this[0],D,C,B)},tmplItem:function(){return i.tmplItem(this[0])},template:function(B){return i.template(B,this[0])},domManip:function(F,I,H,J){if(F[0]&&i.isArray(F[0])){var C=i.makeArray(arguments),B=F[0],G=B.length,D=0,E;while(D<G&&!(E=i.data(B[D++],"tmplItem"))){}if(E&&q){C[2]=function(K){i.tmpl.afterManip(this,K,H)}}u.apply(this,C)}else{u.apply(this,arguments)}q=0;if(!z){i.tmpl.complete(p)}return this}});i.extend({tmpl:function(D,G,F,C){var E,B=!C;if(B){C=y;D=i.template[D]||i.template(null,D);e={}}else{if(!D){D=C.tmpl;p[C.key]=C;C.nodes=[];if(C.wrapped){s(C,C.wrapped)}return i(m(C,null,C.tmpl(i,C)))}}if(!D){return[]}if(typeof G==="function"){G=G.call(C||{})}if(F&&F.wrapped){s(F,F.wrapped)}E=i.isArray(G)?i.map(G,function(H){return H?k(F,C,D,H):null}):[k(F,C,D,G)];return B?i(m(C,null,E)):E},tmplItem:function(C){var B;if(C instanceof i){C=C[0]}while(C&&C.nodeType===1&&!(B=i.data(C,"tmplItem"))&&(C=C.parentNode)){}return B||y},template:function(C,B){if(B){if(typeof B==="string"){B=l(B)}else{if(B instanceof i){B=B[0]||{}}}if(B.nodeType){B=i.data(B,"tmpl")||i.data(B,"tmpl",l(B.innerHTML))}return typeof C==="string"?(i.template[C]=B):B}return C?(typeof C!=="string"?i.template(null,C):(i.template[C]||i.template(null,v.test(C)?C:i(C)))):null},encode:function(B){return(""+B).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});i.extend(i.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(B){p={}},afterManip:function w(D,B,E){var C=B.nodeType===11?i.makeArray(B.childNodes):B.nodeType===1?[B]:[];E.call(D,B);o(C);q++}});function m(B,F,D){var E,C=D?i.map(D,function(G){return(typeof G==="string")?(B.key?G.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+h+'="'+B.key+'" $2'):G):m(G,B,G._ctnt)}):B;if(F){return C}C=C.join("");C.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(H,I,G,J){E=i(G).get();o(E);if(I){E=a(I).concat(E)}if(J){E=E.concat(a(J))}});return E?E:a(C)}function a(C){var B=document.createElement("div");B.innerHTML=C;return i.makeArray(B.childNodes)}function l(B){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+i.trim(B).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(J,D,H,E,F,K,G){var M=i.tmpl.tag[H],C,I,L;if(!M){throw"Unknown template tag: "+H}C=M._default||[];if(K&&!/\w$/.test(F)){F+=K;K=""}if(F){F=j(F);G=G?(","+j(G)+")"):(K?")":"");I=K?(F.indexOf(".")>-1?F+j(K):("("+F+").call($item"+G)):F;L=K?I:"(typeof("+F+")==='function'?("+F+").call($item):("+F+"))"}else{L=I=C.$1||"null"}E=j(E);return"');"+M[D?"close":"open"].split("$notnull_1").join(F?"typeof("+F+")!=='undefined' && ("+F+")!=null":"true").split("$1a").join(L).split("$1").join(I).split("$2").join(E||C.$2||"")+"__.push('"})+"');}return __;")}function s(C,B){C._wrap=m(C,true,i.isArray(B)?B:[v.test(B)?B:i(B).html()]).join("")}function j(B){return B?B.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function d(B){var C=document.createElement("div");C.appendChild(B.cloneNode(true));return C.innerHTML}function o(H){var J="_"+q,C,B,F={},G,E,D;for(G=0,E=H.length;G<E;G++){if((C=H[G]).nodeType!==1){continue}B=C.getElementsByTagName("*");for(D=B.length-1;D>=0;D--){I(B[D])}I(C)}function I(P){var M,O=P,N,K,L;if((L=P.getAttribute(h))){while(O.parentNode&&(O=O.parentNode).nodeType===1&&!(M=O.getAttribute(h))){}if(M!==L){O=O.parentNode?(O.nodeType===11?0:(O.getAttribute(h)||0)):0;if(!(K=p[L])){K=e[L];K=k(K,p[O]||e[O]);K.key=++x;p[x]=K}if(q){Q(L)}}P.removeAttribute(h)}else{if(q&&(K=i.data(P,"tmplItem"))){Q(K.key);p[K.key]=K;O=i.data(P.parentNode,"tmplItem");O=O?O.key:0}}if(K){N=K;while(N&&N.key!=O){N.nodes.push(P);N=N.parent}delete K._ctnt;delete K._wrap;i.data(P,"tmplItem",K)}function Q(R){R=R+J;K=F[R]=(F[R]||k(K,p[K.parent.key+J]||K.parent))}}}function c(D,B,E,C){if(!D){return g.pop()}g.push({_:D,tmpl:B,item:this,data:E,options:C})}function b(B,D,C){return i.tmpl(i.template(B),D,C,this)}function n(D,B){var C=D.options||{};C.wrapped=B;return i.tmpl(i.template(D.tmpl),D.data,C,D.item)}function r(C,D){var B=this._wrap;return i.map(i(i.isArray(B)?B.join(""):B).filter(C||"*"),function(E){return D?E.innerText||E.textContent:E.outerHTML||d(E)})}function A(){var B=this.nodes;i.tmpl(null,null,null,this).insertBefore(B[0]);i(B).remove()}})(jQuery);function Hash(){this.length=0;this.items={};for(var a=0;a<arguments.length;a+=2){if(typeof(arguments[a+1])!="undefined"){this.items[arguments[a]]=arguments[a+1];this.length++}}this.removeItem=function(b){var c;if(typeof(this.items[b])!="undefined"){this.length--;var c=this.items[b];delete this.items[b]}return c};this.getItem=function(b){return this.items[b]};this.setItem=function(b,d){var c;if(typeof(d)!="undefined"){if(typeof(this.items[b])=="undefined"){this.length++}else{c=this.items[b]}this.items[b]=d}return c};this.hasItem=function(b){return typeof(this.items[b])!="undefined"};this.clear=function(){for(var b in this.items){delete this.items[b]}this.length=0}}String.prototype.startsWith=function(a){return(this.match("^"+a)==a)};String.prototype.trim=function(){return(this.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,""))};String.prototype.endsWith=function(a){return(this.match(a+"$")==a)};Array.prototype.insertAt=function(b,a){if(a>-1&&a<=this.length){this.splice(a,0,b);return true}return false};Array.prototype.insertBefore=function(d,a){var c=false;var b=this.indexOf(d);if(b==-1){return false}else{if(b==0){this.unshift(a);return true}else{return this.insertAt(a,b-1)}}};Array.prototype.insertAfter=function(d,a){var c=false;var b=this.indexOf(d);if(b==-1){return false}else{if(b==this.length-1){this.push(a);return true}else{return this.insertAt(a,b+1)}}};if(!Array.indexOf){Array.prototype.indexOf=function(b,c){for(var a=(c||0);a<this.length;a++){if(this[a]==b){return a}}return -1}}Array.prototype.binarySearch=function(f,b){var a=0,e=this.length-1,c,d;while(a<=e){c=Math.floor((a+e)/2);d=b(this[c],f);if(d<0){a=c+1;continue}if(d>0){e=c-1;continue}return c}return -1};function htmlEncode(a){return $("<div/>").text(a).html()}function debugOut(a){if(!(typeof console==="undefined")){console.log((new Date()).getTime()+": "+a)}}function linkUrl(b){var a=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;link=b.match(a);if(link){b=b.replace(link[0],'<A href="'+link[0]+'">'+link[0]+"</A>")}return b}var JSON;if(!JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify2!=="function"){JSON.stringify2=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse2!=="function"){JSON.parse2=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(v,u){var s,w,r;if(u===v.length-1){v.length=u}else{s=v.slice(u+1);v.length=u;for(w=0,r=s.length;w<r;++w){v[u+w]=s[w]}}};function a(u){var r;if(typeof u=="string"){return u}else{if(typeof u.hashCode==p){r=u.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof u.toString==p){return u.toString()}else{try{return String(u)}catch(s){return Object.prototype.toString.call(u)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(v,s,u,r){this[0]=v;this.entries=[];this.addEntry(s,u);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(u){var s=this.entries.length,w,v=this.getEqualityFunction(u);while(s--){w=this.entries[s];if(v(u,w[0])){switch(r){case h:return true;case j:return w;case f:return[s,w[1]]}}}return false}}function k(r){return function(v){var w=v.length;for(var u=0,s=this.entries.length;u<s;++u){v[w+u]=this.entries[u][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var v=s.length;for(var u=0,r=this.entries.length;u<r;++u){s[v+u]=this.entries[u].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,u){var r=s.length,v;while(r--){v=s[r];if(u===v[0]){return r}}return null}function i(r,s){var u=r[s];return(u&&(u instanceof d))?u:null}function b(u,r){var x=this;var w=[];var v={};var y=(typeof u==p)?u:a;var s=(typeof r==p)?r:null;this.put=function(C,D){q(C);l(D);var E=y(C),F,B,A=null;F=i(v,E);if(F){B=F.getEntryForKey(C);if(B){A=B[1];B[1]=D}else{F.addEntry(C,D)}}else{F=new d(E,C,D,s);w[w.length]=F;v[E]=F}return A};this.get=function(B){q(B);var C=y(B);var D=i(v,C);if(D){var A=D.getEntryForKey(B);if(A){return A[1]}}return null};this.containsKey=function(B){q(B);var A=y(B);var C=i(v,A);return C?C.containsKey(B):false};this.containsValue=function(B){l(B);var A=w.length;while(A--){if(w[A].containsValue(B)){return true}}return false};this.clear=function(){w.length=0;v={}};this.isEmpty=function(){return !w.length};var z=function(A){return function(){var B=[],C=w.length;while(C--){w[C][A](B)}return B}};this.keys=z("keys");this.values=z("values");this.entries=z("getEntries");this.remove=function(C){q(C);var D=y(C),A,B=null;var E=i(v,D);if(E){B=E.removeEntryForKey(C);if(B!==null){if(!E.entries.length){A=m(w,D);n(w,A);delete v[D]}}}return B};this.size=function(){var B=0,A=w.length;while(A--){B+=w[A].entries.length}return B};this.each=function(D){var A=x.entries(),B=A.length,C;while(B--){C=A[B];D(C[0],C[1])}};this.putAll=function(I,D){var C=I.entries();var F,G,E,A,B=C.length;var H=(typeof D==p);while(B--){F=C[B];G=F[0];E=F[1];if(H&&(A=x.get(G))){E=D(G,A,E)}x.put(G,E)}};this.clone=function(){var A=new b(u,r);A.putAll(x);return A}}return b})();var Settings=function(){this._groupsApiSubscribed="api/groups/get_subscribed";this._groupsApiFiltered="api/groups/get_filtered";this._groupsMaxNumber=500;this.GroupsPrefixes={FILTERED:"f_",SUBSCRIBED:"s_"}};configuration=new Settings();var Enums=function(){this.GroupsType={UNDEFINED:0,SUBSCRIBED:1,FILTERED:2}};enums=new Enums();function compareGroups(d,c){if(d.group_name>c.group_name){return 1}if(d.group_name<c.group_name){return -1}return 0}var Event=function(a){this._sender=a;this._listeners=[]};Event.prototype={attach:function(a){this._listeners.push(a)},notify:function(a){for(var b=0;b<this._listeners.length;b++){this._listeners[b](this._sender,a)}}};function zebraColor(a){$(a).removeClass("row_even").removeClass("row_odd");$(a+":visible:even").addClass("row_even");$(a+":visible:odd").addClass("row_odd")}function setWait(a){setWaitByObject($(a))}function setWaitByObject(a){var b="<div id='wait_image'></div>";a.html(b)}function prepareStringForId(b){var a=b.replace(/\./g,"_");a=a.replace(/\:/g,"_");return a}function selectItemInList(a,b,c){$(a).removeClass(b);$(c).addClass(b)}var article_cache=new Hash();var header_cache=new Hash();var groups_subscribed_cache=null;var localStorageSaved=false;Storage.prototype.setObject=function(a,b){try{this.setItem(a,JSON.stringify2(b));return true}catch(c){}return false};Storage.prototype.getObject=function(a){return JSON.parse2(this.getItem(a))};Storage.prototype.size=function(b){var a=0;for(var b in this){a+=b.length;a+=this[b].length}return a};$(window).bind("beforeunload",saveToLocalStorage);function saveToLocalStorage(){if(localStorage&&!localStorageSaved){localStorage.clear();localStorage.setObject("saved_app_version",appVersion);localStorage.setObject("current_group",current_group);localStorage.setObject("groups_subscribed_cache",groups_subscribed_cache);localStorage.setObject("article_cache",article_cache);localStorage.setObject("header_cache",header_cache);localStorageSaved=true}}function loadFromLocalStorage(){if(localStorage){saved_ver=localStorage.getObject("saved_app_version");if(typeof saved_ver=="undefined"||saved_ver==null||saved_ver!=appVersion){localStorage.clear();debugOut("Saved app version: "+saved_ver+", Current app version: "+appVersion+", Clearing local storage")}current_group=localStorage.getObject("current_group");groups_subscribed_cache=localStorage.getObject("groups_subscribed_cache");if(localStorage.getObject("article_cache")){extend(article_cache,localStorage.getObject("article_cache"))}if(localStorage.getObject("header_cache")){extend(header_cache,localStorage.getObject("header_cache"))}var a=0;for(var b in localStorage){a+=localStorage[b].length}debugOut("local storage size: "+a+" bytes")}}var GroupModel=function(a,b){this._groups=a;this._selectedGroup="";this._type=b;this.groupAdded=new Event(this);this.groupRemoved=new Event(this);this.groupsStartedUpdate=new Event(this);this.groupsUpdated=new Event(this);this.selectedGroupChanged=new Event(this);this.groupsError=new Event(this)};GroupModel.prototype={getGroups:function(){return this._groups},selectGroup:function(a){if(a==this._selectedGroup){return}this._selectedGroup=a;this.selectedGroupChanged.notify({group:a})},addGroup:function(a){this._groups.push(a);this._groups.sort(compareGroups);this.groupAdded.notify({group:a})},removeGroup:function(c){if(c==this._selectedGroup){this._selectedGroup=""}var a=0;foreach(var b in this._groups){if(b.group_name==c){this._groups.splice(a,1);this.groupRemoved.notify({group:c})}a++}}};GroupModelSubscribed.prototype=new GroupModel();GroupModelSubscribed.prototype.constructor=GroupModelSubscribed;GroupModelSubscribed.prototype.parent=GroupModel.prototype;function GroupModelSubscribed(){GroupModel.call(this,[],enums.GroupsType.SUBSCRIBED)}GroupModelSubscribed.prototype.updateGroups=function(){var a=this;this.groupsStartedUpdate.notify();$.get(configuration._groupsApiSubscribed,{},function(b){if(b.length>configuration._groupsMaxNumber){b.splice(0,b.length-configuration._groupsMaxNumber)}if(b.length>1){b.sort(compareGroups)}a._groups=b;a.groupsUpdated.notify({type:this._type,groups:a._groups})})};GroupModelFiltered.prototype=new GroupModel();GroupModelFiltered.prototype.constructor=GroupModelFiltered;GroupModelFiltered.prototype.parent=GroupModel.prototype;function GroupModelFiltered(){GroupModel.call(this,[],enums.GroupsType.FILTERED);this._search=""}GroupModelFiltered.prototype.updateGroups=function(b,a){this._search=b;if(b==null||b.length<3){this.groupsError.notify("Enter at least 3 characters in the search box")}else{var c=this;this.groupsStartedUpdate.notify();$.get(configuration._groupsApiFiltered,{wildcard:b},function(f){if(f.length>configuration._groupsMaxNumber){f.splice(0,f.length-configuration._groupsMaxNumber)}if(f.length>1){f.sort(compareGroups)}if(a){for(var d=0;d<a.length;d++){var e=f.binarySearch(a[d],compareGroups);if(e!=-1){f[e].group_subscribed=true}}}c._groups=f;c.groupsUpdated.notify({type:this._type,groups:c._groups})})}};var GroupView=function(b,a,d,c){this._model=b;this._controller=a;this._elements=d;this._template=c;var e=this;this._model.groupAdded.attach(function(){e.rebuildGroupView()});this._model.groupRemoved.attach(function(){e.rebuildGroupView()});this._model.groupsUpdated.attach(function(){e.rebuildGroupView()});this._model.groupsStartedUpdate.attach(function(){setWait(e._elements.groups)});this._model.selectedGroupChanged.attach(function(g,f){selectItemInList(".group-list-item","selected","#"+e.getDivIdForGroup(f.group))});this._model.groupsError.attach(function(g,f){alert(f)})};GroupView.prototype={show:function(){this.rebuildGroupView()},rebuildGroupView:function(){var a=this._elements.groups;var e=this;a.html("");var b=this._model.getGroups();var f="";var d=0;var c="";foreach(var g in b){if(g.group_name.length==0){continue}c=g.group_name;var h=this.getDivIdForGroup(g.group_name);f="ui-icon ui-icon-plus";if(g.group_subscribed){f="ui-icon ui-icon-check"}var j=$(this._template).tmpl({group_id:h,group_name:g.group_name,subscribed:g.group_subscribed,tab:d,icon_class:f});j.bind("click",{group_name:c},$.proxy(function(i){e._controller.selectGroup(i.data.group_name)},e));j.appendTo(a);d++}if(this._model._selectedGroup.length>0){selectItemInList(".group-list-item","selected","#"+this.getDivIdForGroup(this._model._selectedGroup))}},getDivIdForGroup:function(b){var a=configuration.GroupsPrefixes.SUBSCRIBED;if(this._model._type==enums.GroupsType.FILTERED){a=configuration.GroupsPrefixes.FILTERED}return prepareStringForId(a+b)}};var GroupController=function(a){this._model=a};GroupController.prototype={selectGroup:function(a){this._model.selectGroup(a)}};GroupControllerFiltered.prototype=new GroupController();GroupControllerFiltered.prototype.constructor=GroupControllerFiltered;GroupControllerFiltered.prototype.parent=GroupController.prototype;function GroupControllerFiltered(a,b){GroupController.call(this,a);this._subscribed_model=b}GroupControllerFiltered.prototype.searchGroupNames=function(a){this._model.updateGroups(a.toLowerCase(),this._subscribed_model.getGroups())};appVersion="0.0.003";var current_group="";jQuery.fn.oneFingerScroll=function(){var a=0;$(this).bind("touchstart",function(b){var c=b.originalEvent;a=$(this).scrollTop()+c.touches[0].pageY});$(this).bind("touchmove",function(b){var c=b.originalEvent;$(this).scrollTop(a-c.touches[0].pageY);c.preventDefault()});return this};function initOneFingerScroll(){$("#TopPane").oneFingerScroll();$("#BottomPane").oneFingerScroll()}var extend=function(c,b){for(var a in b){if(!b.hasOwnProperty(a)){continue}c[a]=b[a]}};function loadHeaders(b){setWait("#TopPane");$("#BottomPane").html("");debugOut("Load headers "+b);current_group=b;var a=header_cache.getItem(current_group);if(a){debugOut("Getting new headers");$.get("api/headers/"+b+"/get",{newer_than_id:findLatestHeader(a)},processHeadersAdditional)}else{$.get("api/headers/"+b+"/get",{},processHeadersFull)}}function processHeadersAdditional(a){debugOut("processHeadersAdditional");processHeaders(a,true)}function processHeadersFull(a){debugOut("processHeadersFull");processHeaders(a,false)}function processHeaders(e,a){debugOut("processHeaders");if(typeof a!="undefined"&&a&&e!=null&&e.length>0&&header_cache.hasItem(current_group)){oldData=header_cache.getItem(current_group);e=oldData.concat(e);debugOut("Old data len: "+oldData.length+", new data len: "+e.length)}else{if(header_cache.hasItem(current_group)){e=header_cache.getItem(current_group)}}if(e.length>500){e.splice(0,e.length-500)}header_cache.setItem(current_group,e);$("#TopPane").html("");$("#TopPane").append("<table  id='HeadersTable' class='headers-table'></table>");debugOut("threadHeaders");e=threadHeaders(e);thread_id="none";debugOut("Creting headers from templates");$("#headerTemplate").template("HdrTemplate");var c=[];for(var b=0;b<e.length;b++){var f="../images/arrow_empty.png";var g=new Date(e[b].headers.date);add_class="";if(!e[b].is_read){add_class="unread-item"}if(e[b].is_root_element){if(e[b].has_children){f="../images/arrow_right.png"}thread_id="thread_"+b;c.push({article:e[b].headers.message_id,subject:e[b].headers.subject,from:e[b].headers.from_name,date:g.toLocaleString(),indent:(e[b].indent_level*10),thread_id:thread_id,thread_class:"",image:f,tab:b,add_class:add_class})}else{c.push({article:e[b].headers.message_id,subject:e[b].headers.subject,from:e[b].headers.from_name,date:g.toLocaleString(),indent:(e[b].indent_level*10),thread_id:"none",thread_class:thread_id,image:f,tab:b,add_class:add_class+" child_post"})}}debugOut("Creted headers from templates");$.tmpl("HdrTemplate",c).appendTo("#HeadersTable");debugOut("Hide child posts");$(".child_post").hide();debugOut("Bind and zebra");bindItemsForSelection(".header-list-item");zebraColor(".header-list-item");debugOut("Finished processHeaders")}function findLatestHeader(a){var c=0;for(var b=0;b<a.length;b++){if(parseInt(a[b].headers.id)>c){c=parseInt(a[b].headers.id)}}return c}function loadArticle(b){markRead(current_group,b);var a=article_cache.getItem(b);if(a){processArticle(a)}else{$("#BottomPane").scrollTop();$("#wait_overlay").css({"z-index":200,opacity:0.5});$.get("api/articles/"+encodeURIComponent(b)+"/get",{},processArticle)}}function processArticle(b){if(!article_cache.hasItem(b.headers["message-id"])){article_cache.setItem(b.headers["message-id"],b)}$("#BottomPane").html("<div id='wait_overlay'></div>");$("#BottomPane").scrollTop();$("#articleHeaderTemplate").tmpl({from:b.headers.from,subject:b.headers.subject,date:b.headers.date,charset:b.charset}).appendTo("#BottomPane");for(var a=0;a<b.body.length;a++){color="black";line=b.body[a];if(line.startsWith(">>>>")){color="brown"}else{if(line.startsWith(">>>")){color="red"}else{if(line.startsWith(">>")){color="green"}else{if(line.startsWith(">")){color="blue"}}}}$("#articleLineTemplate").tmpl({color:color,line:line}).appendTo("#BottomPane")}$("#articleLineTemplate").tmpl({color:"white",line:""}).appendTo("#BottomPane");$("#wait_overlay").css({"z-index":-1000,opacity:0})}function threadHeaders(c){sorted=[];for(var a=0;a<c.length;a++){if(c[a].headers.references.length==0){c[a].is_root_element=true;c[a].indent_level=0;c[a].parent=null;sorted.push(c[a])}else{parentPost=findParent(sorted,c[a].headers.references);if(parentPost==null){c[a].is_root_element=true;c[a].parent=null;c[a].indent_level=0;sorted.push(c[a])}else{parentPost.has_children=true;c[a].is_root_element=false;c[a].parent=parentPost;c[a].indent_level=parentPost.indent_level+1;insertPos=parentPost;for(var b=0;b<sorted.length;b++){if(sorted[b].parent==parentPost){insertPos=sorted[b]}}sorted.insertAfter(insertPos,c[a])}}}return sorted}function findParent(a,c){for(var d=0;d<c.length;d++){ref=c[d];for(var b=0;b<a.length;b++){if(a[b].headers.message_id==ref){return a[b]}}}return null}function bindItemsForSelection(a){$(a).bind({focus:function(b){$(a).removeClass("selected");$(b.currentTarget).addClass("selected")},click:function(b){$(b.currentTarget).removeClass("unread-item")}})}function markRead(b,d){var c=header_cache.getItem(b);if(c){for(var a=0;a<c.length;a++){if(c[a].headers.message_id==d){c[a].is_read=true}}}}function changeSubscription(b,c,a){if($(b).hasClass("ui-icon-plus")){$(b).removeClass("ui-icon-plus");$(b).addClass("ui-icon-check")}else{if($(b).hasClass("ui-icon-check")){$(b).removeClass("ui-icon-check");$(b).addClass("ui-icon-plus")}}}function InitGroups(){groupsSubscribedModel=new GroupModelSubscribed();groupsSubscribedController=new GroupController(groupsSubscribedModel);groupsSubscribedView=new GroupView(groupsSubscribedModel,groupsSubscribedController,{groups:$("#tab-subscribed-groups")},"#groupTemplate");groupsSubscribedModel.updateGroups();groupsSubscribedModel.selectedGroupChanged.attach(function(b,a){loadHeaders(a.group)});groupsFilteredModel=new GroupModelFiltered();groupsFilteredController=new GroupControllerFiltered(groupsFilteredModel,groupsSubscribedModel);groupsFilteredView=new GroupView(groupsFilteredModel,groupsFilteredController,{groups:$("#tab-all-groups-content")},"#groupTemplateFiltered");groupsFilteredModel.selectedGroupChanged.attach(function(b,a){loadHeaders(a.group)})};
window['InitGroups'] = InitGroups;
