(function($,undefined){function visible(element){return!$(element).parents().andSelf().filter(function(){return $.curCSS(this,"visibility")==="hidden"||$.expr.filters.hidden(this)}).length}if(!$.curCSS)$.curCSS=$.css;$.ui=$.ui||{};if($.ui.version)return;$.extend($.ui,{version:"@VERSION",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}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn)fn.call(elem)},delay)}):this._focus.apply(this,arguments)},scrollParent:function(){var scrollParent;if($.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position")))scrollParent=
this.parents().filter(function(){return/(relative|absolute|fixed)/.test($.curCSS(this,"position",1))&&/(auto|scroll)/.test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1))}).eq(0);else scrollParent=this.parents().filter(function(){return/(auto|scroll)/.test($.curCSS(this,"overflow",1)+$.curCSS(this,"overflow-y",1)+$.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!scrollParent.length?$(document):scrollParent},zIndex:function(zIndex){if(zIndex!==
undefined)return this.css("zIndex",zIndex);if(this.length){var elem=$(this[0]);var position;for(var value;elem.length&&elem[0]!==document;){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0)return value}elem=elem.parent()}}return 0},disableSelection:function(){return this.bind(($.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(event){event.preventDefault()})},
enableSelection:function(){return this.unbind(".ui-disableSelection")}});$.each(["Width","Height"],function(i,name){function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.curCSS(elem,"padding"+this,true))||0;if(border)size-=parseFloat($.curCSS(elem,"border"+this+"Width",true))||0;if(margin)size-=parseFloat($.curCSS(elem,"margin"+this,true))||0});return size}var side=name==="Width"?["Left","Right"]:["Top","Bottom"];var type=name.toLowerCase();var orig={innerWidth:$.fn.innerWidth,
innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};$.fn["inner"+name]=function(size){if(size===undefined)return orig["inner"+name].call(this);return this.each(function(){$(this).css(type,reduce(this,size)+"px")})};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number")return orig["outer"+name].call(this,size);return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px")})}});$.extend($.expr[":"],{data:function(elem,i,match){return!!$.data(elem,
match[3])},focusable:function(element){var nodeName=element.nodeName.toLowerCase();var tabIndex=$.attr(element,"tabindex");if("area"===nodeName){var map=element.parentNode;var mapName=map.name;var img;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map")return false;img=$("img[usemap\x3d#"+mapName+"]")[0];return!!img&&visible(img)}return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:"a"==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&visible(element)},
tabbable:function(element){var tabIndex=$.attr(element,"tabindex");return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(":focusable")}});$(function(){var body=document.body;var div=body.appendChild(div=document.createElement("div"));$.extend(div.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});$.support.minHeight=div.offsetHeight===100;$.support.selectstart="onselectstart"in div;body.removeChild(div).style.display="none"});$.extend($.ui,{plugin:{add:function(module,option,set){var proto=
$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode)return;for(var i=0;i<set.length;i++)if(instance.options[set[i][0]])set[i][1].apply(instance.element,args)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(el,a){if($(el).css("overflow")===
"hidden")return false;var scroll=a&&a==="left"?"scrollLeft":"scrollTop";var has=false;if(el[scroll]>0)return true;el[scroll]=1;has=el[scroll]>0;el[scroll]=0;return has},isOverAxis:function(x,reference,size){return x>reference&&x<reference+size},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width)}})})(jQuery);
(function($,undefined){if($.cleanData){var _cleanData=$.cleanData;$.cleanData=function(elems){var i=0;for(var elem;(elem=elems[i])!=null;i++)$(elem).triggerHandler("remove");_cleanData(elems)}}else{var _remove=$.fn.remove;$.fn.remove=function(selector,keepData){return this.each(function(){if(!keepData)if(!selector||$.filter(selector,[this]).length)$("*",this).add([this]).each(function(){$(this).triggerHandler("remove")});return _remove.call($(this),selector,keepData)})}}$.widget=function(name,base,
prototype){var namespace=name.split(".")[0];var fullName;name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget}$.expr[":"][fullName]=function(elem){return!!$.data(elem,name)};$[namespace]=$[namespace]||{};$[namespace][name]=function(options,element){if(arguments.length)this._createWidget(options,element)};var basePrototype=new base;basePrototype.options=$.extend(true,{},basePrototype.options);$[namespace][name].prototype=$.extend(true,basePrototype,{namespace:namespace,
widgetName:name,widgetEventPrefix:$[namespace][name].prototype.widgetEventPrefix||name,widgetBaseClass:fullName},prototype);$.widget.bridge(name,$[namespace][name])};$.widget.bridge=function(name,object){$.fn[name]=function(options){var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);var returnValue=this;options=!isMethodCall&&args.length?$.extend.apply(null,[true,options].concat(args)):options;if(isMethodCall&&options.charAt(0)==="_")return returnValue;if(isMethodCall)this.each(function(){var instance=
$.data(this,name);var methodValue=instance&&$.isFunction(instance[options])?instance[options].apply(instance,args):instance;if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue;return false}});else this.each(function(){var instance=$.data(this,name);if(instance)instance.option(options||{})._init();else $.data(this,name,new object(options,this))});return returnValue}};$.Widget=function(options,element){if(arguments.length)this._createWidget(options,element)};$.Widget.prototype=
{widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(options,element){$.data(element,this.widgetName,this);this.element=$(element);this.options=$.extend(true,{},this.options,this._getCreateOptions(),options);var self=this;this.element.bind("remove."+this.widgetName,function(){self.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return $.metadata&&$.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(key,value){var options=key;if(arguments.length===0)return $.extend({},this.options);if(typeof key==="string"){if(value===undefined)return this.options[key];options={};options[key]=value}this._setOptions(options);
return this},_setOptions:function(options){var self=this;$.each(options,function(key,value){self._setOption(key,value)});return this},_setOption:function(key,value){this.options[key]=value;if(key==="disabled")this.widget()[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",value);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(type,event,
data){var callback=this.options[type];event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();data=data||{};if(event.originalEvent){var i=$.event.props.length;for(var prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop]}}this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented())}}})(jQuery);
(function($,undefined){$.ui=$.ui||{};var horizontalPositions=/left|center|right/;var verticalPositions=/top|center|bottom/;var center="center";var _position=$.fn.position;var _offset=$.fn.offset;$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);options=$.extend({},options);var target=$(options.of);var targetElem=target[0];var collision=(options.collision||"flip").split(" ");var offset=options.offset?options.offset.split(" "):[0,0];var targetWidth;var targetHeight;
var basePosition;if(targetElem.nodeType===9){targetWidth=target.width();targetHeight=target.height();basePosition={top:0,left:0}}else if(targetElem.setTimeout){targetWidth=target.width();targetHeight=target.height();basePosition={top:target.scrollTop(),left:target.scrollLeft()}}else if(targetElem.preventDefault){options.at="left top";targetWidth=targetHeight=0;basePosition={top:options.of.pageY,left:options.of.pageX}}else{targetWidth=target.outerWidth(true);targetHeight=target.outerHeight(true);basePosition=
target.offset()}$.each(["my","at"],function(){var pos=(options[this]||"").split(" ");if(pos.length===1)pos=horizontalPositions.test(pos[0])?pos.concat([center]):verticalPositions.test(pos[0])?[center].concat(pos):[center,center];pos[0]=horizontalPositions.test(pos[0])?pos[0]:center;pos[1]=verticalPositions.test(pos[1])?pos[1]:center;options[this]=pos});if(collision.length===1)collision[1]=collision[0];offset[0]=parseInt(offset[0],10)||0;if(offset.length===1)offset[1]=offset[0];offset[1]=parseInt(offset[1],
10)||0;if(options.at[0]==="right")basePosition.left+=targetWidth;else if(options.at[0]===center)basePosition.left+=targetWidth/2;if(options.at[1]==="bottom")basePosition.top+=targetHeight;else if(options.at[1]===center)basePosition.top+=targetHeight/2;basePosition.left+=offset[0];basePosition.top+=offset[1];return this.each(function(){var elem=$(this);var elemWidth=elem.outerWidth(true);var elemHeight=elem.outerHeight(true);var marginLeft=parseInt($.curCSS(this,"marginLeft",true))||0;var marginTop=
parseInt($.curCSS(this,"marginTop",true))||0;var collisionWidth=elemWidth+marginLeft+parseInt($.curCSS(this,"marginRight",true))||0;var collisionHeight=elemHeight+marginTop+parseInt($.curCSS(this,"marginBottom",true))||0;var position=$.extend({},basePosition);var collisionPosition;if(options.my[0]==="right")position.left-=elemWidth;else if(options.my[0]===center)position.left-=elemWidth/2;if(options.my[1]==="bottom")position.top-=elemHeight;else if(options.my[1]===center)position.top-=elemHeight/
2;position.left=parseInt(position.left);position.top=parseInt(position.top);collisionPosition={left:position.left-marginLeft,top:position.top-marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]])$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:offset,my:options.my,at:options.at})});
if($.fn.bgiframe)elem.bgiframe();elem.offset($.extend(position,{using:options.using}))})};$.ui.position={fit:{left:function(position,data){var win=$(window);var over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft();position.left=over>0?position.left-over:Math.max(position.left-data.collisionPosition.left,position.left)},top:function(position,data){var win=$(window);var over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop();position.top=over>0?
position.top-over:Math.max(position.top-data.collisionPosition.top,position.top)}},flip:{left:function(position,data){if(data.at[0]===center)return;var win=$(window);var over=data.collisionPosition.left+data.collisionWidth-win.width()-win.scrollLeft();var myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0;var atOffset=data.at[0]==="left"?data.targetWidth:-data.targetWidth;var offset=-2*data.offset[0];position.left+=data.collisionPosition.left<0?myOffset+atOffset+offset:
over>0?myOffset+atOffset+offset:0},top:function(position,data){if(data.at[1]===center)return;var win=$(window);var over=data.collisionPosition.top+data.collisionHeight-win.height()-win.scrollTop();var myOffset=data.my[1]==="top"?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0;var atOffset=data.at[1]==="top"?data.targetHeight:-data.targetHeight;var offset=-2*data.offset[1];position.top+=data.collisionPosition.top<0?myOffset+atOffset+offset:over>0?myOffset+atOffset+offset:0}}};if(!$.offset.setOffset){$.offset.setOffset=
function(elem,options){if(/static/.test($.curCSS(elem,"position")))elem.style.position="relative";var curElem=$(elem);var curOffset=curElem.offset();var curTop=parseInt($.curCSS(elem,"top",true),10)||0;var curLeft=parseInt($.curCSS(elem,"left",true),10)||0;var props={top:options.top-curOffset.top+curTop,left:options.left-curOffset.left+curLeft};if("using"in options)options.using.call(elem,props);else curElem.css(props)};$.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument)return null;
if(options)return this.each(function(){$.offset.setOffset(this,options)});return _offset.call(this)}}})(jQuery);
(function($,undefined){var uiDialogClasses="ui-dialog "+"ui-widget "+"ui-widget-content "+"ui-corner-all ";var sizeRelatedOptions={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true};var resizableRelatedOptions={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};$.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,
minWidth:150,modal:false,position:{my:"center",at:"center",of:window,collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0)$(this).css("top",pos.top-topOffset)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var self=this;var options=self.options;var title=
options.title||"\x26#160;";var titleId=$.ui.dialog.getTitleId(self.element);var uiDialog=(self.uiDialog=$("\x3cdiv\x3e\x3c/div\x3e")).appendTo(document.body).hide().addClass(uiDialogClasses+options.dialogClass).css({zIndex:options.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(event){if(options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){self.close(event);event.preventDefault()}}).attr({role:"dialog","aria-labelledby":titleId}).mousedown(function(event){self.moveToTop(false,
event)});var uiDialogContent=self.element.show().removeAttr("title").addClass("ui-dialog-content "+"ui-widget-content").appendTo(uiDialog);var uiDialogTitlebar=(self.uiDialogTitlebar=$("\x3cdiv\x3e\x3c/div\x3e")).addClass("ui-dialog-titlebar "+"ui-widget-header "+"ui-corner-all "+"ui-helper-clearfix").prependTo(uiDialog);var uiDialogTitlebarClose=$('\x3ca href\x3d"#"\x3e\x3c/a\x3e').addClass("ui-dialog-titlebar-close "+"ui-corner-all").attr("role","button").hover(function(){uiDialogTitlebarClose.addClass("ui-state-hover")},
function(){uiDialogTitlebarClose.removeClass("ui-state-hover")}).focus(function(){uiDialogTitlebarClose.addClass("ui-state-focus")}).blur(function(){uiDialogTitlebarClose.removeClass("ui-state-focus")}).click(function(event){self.close(event);return false}).appendTo(uiDialogTitlebar);var uiDialogTitlebarCloseText=(self.uiDialogTitlebarCloseText=$("\x3cspan\x3e\x3c/span\x3e")).addClass("ui-icon "+"ui-icon-closethick").text(options.closeText).appendTo(uiDialogTitlebarClose);var uiDialogTitle=$("\x3cspan\x3e\x3c/span\x3e").addClass("ui-dialog-title").attr("id",
titleId).html(title).prependTo(uiDialogTitlebar);if($.isFunction(options.beforeclose)&&!$.isFunction(options.beforeClose))options.beforeClose=options.beforeclose;uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();if(options.draggable&&$.fn.draggable)self._makeDraggable();if(options.resizable&&$.fn.resizable)self._makeResizable();self._createButtons(options.buttons);self._isOpen=false;if($.fn.bgiframe)uiDialog.bgiframe()},_init:function(){if(this.options.autoOpen)this.open()},destroy:function(){var self=
this;if(self.overlay)self.overlay.destroy();self.uiDialog.hide();self.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");self.uiDialog.remove();if(self.originalTitle)self.element.attr("title",self.originalTitle);return self},widget:function(){return this.uiDialog},close:function(event){var self=this;var maxZ;if(false===self._trigger("beforeClose",event))return;if(self.overlay)self.overlay.destroy();self.uiDialog.unbind("keypress.ui-dialog");
self._isOpen=false;if(self.options.hide)self.uiDialog.hide(self.options.hide,function(){self._trigger("close",event)});else{self.uiDialog.hide();self._trigger("close",event)}$.ui.dialog.overlay.resize();if(self.options.modal){maxZ=0;$(".ui-dialog").each(function(){if(this!==self.uiDialog[0])maxZ=Math.max(maxZ,$(this).css("z-index"))});$.ui.dialog.maxZ=maxZ}return self},isOpen:function(){return this._isOpen},moveToTop:function(force,event){var self=this;var options=self.options;var saveScroll;if(options.modal&&
!force||!options.stack&&!options.modal)return self._trigger("focus",event);if(options.zIndex>$.ui.dialog.maxZ)$.ui.dialog.maxZ=options.zIndex;if(self.overlay){$.ui.dialog.maxZ+=1;self.overlay.$el.css("z-index",$.ui.dialog.overlay.maxZ=$.ui.dialog.maxZ)}saveScroll={scrollTop:self.element.attr("scrollTop"),scrollLeft:self.element.attr("scrollLeft")};$.ui.dialog.maxZ+=1;self.uiDialog.css("z-index",$.ui.dialog.maxZ);self.element.attr(saveScroll);self._trigger("focus",event);return self},open:function(){if(this._isOpen)return;
var self=this;var options=self.options;var uiDialog=self.uiDialog;self.overlay=options.modal?new $.ui.dialog.overlay(self):null;self._size();self._position(options.position);uiDialog.show(options.show);self.moveToTop(true);if(options.modal)uiDialog.bind("keypress.ui-dialog",function(event){if(event.keyCode!==$.ui.keyCode.TAB)return;var tabbables=$(":tabbable",this);var first=tabbables.filter(":first");var last=tabbables.filter(":last");if(event.target===last[0]&&!event.shiftKey){first.focus(1);return false}else if(event.target===
first[0]&&event.shiftKey){last.focus(1);return false}});$(self.element.find(":tabbable").get().concat(uiDialog.find(".ui-dialog-buttonpane :tabbable").get().concat(uiDialog.get()))).eq(0).focus();self._isOpen=true;self._trigger("open");return self},_createButtons:function(buttons){var self=this;var hasButtons=false;var uiDialogButtonPane=$("\x3cdiv\x3e\x3c/div\x3e").addClass("ui-dialog-buttonpane "+"ui-widget-content "+"ui-helper-clearfix");var uiButtonSet=$("\x3cdiv\x3e\x3c/div\x3e").addClass("ui-dialog-buttonset").appendTo(uiDialogButtonPane);
self.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof buttons==="object"&&buttons!==null)$.each(buttons,function(){return!(hasButtons=true)});if(hasButtons){$.each(buttons,function(name,props){props=$.isFunction(props)?{click:props,text:name}:props;var button=$('\x3cbutton type\x3d"button"\x3e\x3c/button\x3e').attr(props,true).unbind("click").click(function(){props.click.apply(self.element[0],arguments)}).appendTo(uiButtonSet);if($.fn.button)button.button()});uiDialogButtonPane.appendTo(self.uiDialog)}},
_makeDraggable:function(){function filteredUi(ui){return{position:ui.position,offset:ui.offset}}var self=this;var options=self.options;var doc=$(document);var heightBeforeDrag;self.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(event,ui){heightBeforeDrag=options.height==="auto"?"auto":$(this).height();$(this).height($(this).height()).addClass("ui-dialog-dragging");self._trigger("dragStart",event,filteredUi(ui))},
drag:function(event,ui){self._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){options.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);self._trigger("dragStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}})},_makeResizable:function(handles){function filteredUi(ui){return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,size:ui.size}}handles=handles===
undefined?this.options.resizable:handles;var self=this;var options=self.options;var position=self.uiDialog.css("position");var resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";self.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:self.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,minWidth:options.minWidth,minHeight:self._minHeight(),handles:resizeHandles,start:function(event,ui){$(this).addClass("ui-dialog-resizing");self._trigger("resizeStart",
event,filteredUi(ui))},resize:function(event,ui){self._trigger("resize",event,filteredUi(ui))},stop:function(event,ui){$(this).removeClass("ui-dialog-resizing");options.height=$(this).height();options.width=$(this).width();self._trigger("resizeStop",event,filteredUi(ui));$.ui.dialog.overlay.resize()}}).css("position",position).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var options=this.options;if(options.height==="auto")return options.minHeight;else return Math.min(options.minHeight,
options.height)},_position:function(position){var myAt=[];var offset=[0,0];var isVisible;if(position){if(typeof position==="string"||typeof position==="object"&&"0"in position){myAt=position.split?position.split(" "):[position[0],position[1]];if(myAt.length===1)myAt[1]=myAt[0];$.each(["left","top"],function(i,offsetPosition){if(+myAt[i]===myAt[i]){offset[i]=myAt[i];myAt[i]=offsetPosition}});position={my:myAt.join(" "),at:myAt.join(" "),offset:offset.join(" ")}}position=$.extend({},$.ui.dialog.prototype.options.position,
position)}else position=$.ui.dialog.prototype.options.position;isVisible=this.uiDialog.is(":visible");if(!isVisible)this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(position);if(!isVisible)this.uiDialog.hide()},_setOptions:function(options){var self=this;var resizableOptions={};var resize=false;$.each(options,function(key,value){self._setOption(key,value);if(key in sizeRelatedOptions)resize=true;if(key in resizableRelatedOptions)resizableOptions[key]=value});if(resize)this._size();
if(this.uiDialog.is(":data(resizable)"))this.uiDialog.resizable("option",resizableOptions)},_setOption:function(key,value){var self=this;var uiDialog=self.uiDialog;switch(key){case "beforeclose":key="beforeClose";break;case "buttons":self._createButtons(value);break;case "closeText":self.uiDialogTitlebarCloseText.text(""+value);break;case "dialogClass":uiDialog.removeClass(self.options.dialogClass).addClass(uiDialogClasses+value);break;case "disabled":if(value)uiDialog.addClass("ui-dialog-disabled");
else uiDialog.removeClass("ui-dialog-disabled");break;case "draggable":var isDraggable=uiDialog.is(":data(draggable)");if(isDraggable&&!value)uiDialog.draggable("destroy");if(!isDraggable&&value)self._makeDraggable();break;case "position":self._position(value);break;case "resizable":var isResizable=uiDialog.is(":data(resizable)");if(isResizable&&!value)uiDialog.resizable("destroy");if(isResizable&&typeof value==="string")uiDialog.resizable("option","handles",value);if(!isResizable&&value!==false)self._makeResizable(value);
break;case "title":$(".ui-dialog-title",self.uiDialogTitlebar).html(""+(value||"\x26#160;"));break}$.Widget.prototype._setOption.apply(self,arguments)},_size:function(){var options=this.options;var nonContentHeight;var minContentHeight;this.element.show().css({width:"auto",minHeight:0,height:0});if(options.minWidth>options.width)options.width=options.minWidth;nonContentHeight=this.uiDialog.css({height:"auto",width:options.width}).height();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);
if(options.height==="auto")if($.support.minHeight)this.element.css({minHeight:minContentHeight,height:"auto"});else{this.uiDialog.show();var autoHeight=this.element.css("height","auto").height();this.uiDialog.hide();this.element.height(Math.max(autoHeight,minContentHeight))}else this.element.height(Math.max(options.height-nonContentHeight,0));if(this.uiDialog.is(":data(resizable)"))this.uiDialog.resizable("option","minHeight",this._minHeight())}});$.extend($.ui.dialog,{version:"@VERSION",uuid:0,maxZ:0,
getTitleId:function($el){var id=$el.attr("id");if(!id){this.uuid+=1;id=this.uuid}return"ui-dialog-title-"+id},overlay:function(dialog){this.$el=$.ui.dialog.overlay.create(dialog)}});$.extend($.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:$.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(event){return event+".dialog-overlay"}).join(" "),create:function(dialog){if(this.instances.length===0){setTimeout(function(){if($.ui.dialog.overlay.instances.length)$(document).bind($.ui.dialog.overlay.events,
function(event){if($(event.target).zIndex()<$.ui.dialog.overlay.maxZ)return false})},1);$(document).bind("keydown.dialog-overlay",function(event){if(dialog.options.closeOnEscape&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){dialog.close(event);event.preventDefault()}});$(window).bind("resize.dialog-overlay",$.ui.dialog.overlay.resize)}var $el=(this.oldInstances.pop()||$("\x3cdiv\x3e\x3c/div\x3e").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});
if($.fn.bgiframe)$el.bgiframe();this.instances.push($el);return $el},destroy:function($el){var indexOf=$.inArray($el,this.instances);if(indexOf!=-1)this.oldInstances.push(this.instances.splice(indexOf,1)[0]);if(this.instances.length===0)$([document,window]).unbind(".dialog-overlay");$el.remove();var maxZ=0;$.each(this.instances,function(){maxZ=Math.max(maxZ,this.css("z-index"))});this.maxZ=maxZ},height:function(){var scrollHeight;var offsetHeight;if($.browser.msie&&$.browser.version<7){scrollHeight=
Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);offsetHeight=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(scrollHeight<offsetHeight)return $(window).height()+"px";else return scrollHeight+"px"}else return $(document).height()+"px"},width:function(){var scrollWidth;var offsetWidth;if($.browser.msie&&$.browser.version<7){scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);offsetWidth=Math.max(document.documentElement.offsetWidth,
document.body.offsetWidth);if(scrollWidth<offsetWidth)return $(window).width()+"px";else return scrollWidth+"px"}else return $(document).width()+"px"},resize:function(){var $overlays=$([]);$.each($.ui.dialog.overlay.instances,function(){$overlays=$overlays.add(this)});$overlays.css({width:0,height:0}).css({width:$.ui.dialog.overlay.width(),height:$.ui.dialog.overlay.height()})}});$.extend($.ui.dialog.overlay.prototype,{destroy:function(){$.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
(function($){$.widget("ui.selectmenu",{getter:"value",version:"1.8",eventPrefix:"selectmenu",options:{transferClasses:true,typeAhead:"sequential",style:"dropdown",positionOptions:{my:"left top",at:"left bottom",offset:null},width:null,menuWidth:null,handleWidth:26,maxHeight:null,icons:null,format:null,bgImage:function(){},wrapperElement:""},_create:function(){var self=this;var o=this.options;var selectmenuId=this.element.attr("id")||"ui-selectmenu-"+Math.random().toString(16).slice(2,10);this.ids=
[selectmenuId+"-button",selectmenuId+"-menu"];this._safemouseup=true;if($.browser.msie)o.typeAhead="";this.newelement=$('\x3ca class\x3d"'+this.widgetBaseClass+' ui-widget ui-state-default ui-corner-all" id\x3d"'+this.ids[0]+'" role\x3d"button" href\x3d"#" tabindex\x3d"0" aria-haspopup\x3d"true" aria-owns\x3d"'+this.ids[1]+'"\x3e\x3c/a\x3e').insertAfter(this.element);this.newelement.wrap(o.wrapperElement);var tabindex=this.element.attr("tabindex");if(tabindex)this.newelement.attr("tabindex",tabindex);
this.newelement.data("selectelement",this.element);this.selectmenuIcon=$('\x3cspan class\x3d"'+this.widgetBaseClass+'-icon ui-icon"\x3e\x3c/span\x3e').prependTo(this.newelement);this.newelement.prepend('\x3cspan class\x3d"'+self.widgetBaseClass+'-status" /\x3e');$('label[for\x3d"'+this.element.attr("id")+'"]').attr("for",this.ids[0]).bind("click.selectmenu",function(){self.newelement[0].focus();return false});this.newelement.bind("mousedown.selectmenu",function(event){self._toggle(event,true);if(o.style==
"popup"){self._safemouseup=false;setTimeout(function(){self._safemouseup=true},300)}return false}).bind("click.selectmenu",function(){return false}).bind("keydown.selectmenu",function(event){var ret=false;switch(event.keyCode){case $.ui.keyCode.ENTER:ret=true;break;case $.ui.keyCode.SPACE:self._toggle(event);break;case $.ui.keyCode.UP:if(event.altKey)self.open(event);else self._moveSelection(-1);break;case $.ui.keyCode.DOWN:if(event.altKey)self.open(event);else self._moveSelection(1);break;case $.ui.keyCode.LEFT:self._moveSelection(-1);
break;case $.ui.keyCode.RIGHT:self._moveSelection(1);break;case $.ui.keyCode.TAB:ret=true;break;default:ret=true;self._typeAhead(event.keyCode,"mouseup");break}return ret}).bind("mouseover.selectmenu focus.selectmenu",function(){if(!o.disabled)$(this).addClass(self.widgetBaseClass+"-focus ui-state-hover")}).bind("mouseout.selectmenu blur.selectmenu",function(){if(!o.disabled)$(this).removeClass(self.widgetBaseClass+"-focus ui-state-hover")});$(document).bind("mousedown.selectmenu",function(event){self.close(event)});
this.element.bind("click.selectmenu",function(){self._refreshValue()}).bind("focus.selectmenu",function(){if(self.newelement)self.newelement[0].focus()});var selectWidth=this.element.width();this.newelement.width(o.width?o.width:selectWidth);this.element.hide();this.list=$('\x3cul class\x3d"'+self.widgetBaseClass+'-menu ui-widget ui-widget-content" aria-hidden\x3d"true" role\x3d"listbox" aria-labelledby\x3d"'+this.ids[0]+'" id\x3d"'+this.ids[1]+'"\x3e\x3c/ul\x3e').appendTo("body");this.list.wrap(o.wrapperElement);
this.list.bind("keydown.selectmenu",function(event){var ret=false;switch(event.keyCode){case $.ui.keyCode.UP:if(event.altKey)self.close(event,true);else self._moveFocus(-1);break;case $.ui.keyCode.DOWN:if(event.altKey)self.close(event,true);else self._moveFocus(1);break;case $.ui.keyCode.LEFT:self._moveFocus(-1);break;case $.ui.keyCode.RIGHT:self._moveFocus(1);break;case $.ui.keyCode.HOME:self._moveFocus(":first");break;case $.ui.keyCode.PAGE_UP:self._scrollPage("up");break;case $.ui.keyCode.PAGE_DOWN:self._scrollPage("down");
break;case $.ui.keyCode.END:self._moveFocus(":last");break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:self.close(event,true);$(event.target).parents("li:eq(0)").trigger("mouseup");break;case $.ui.keyCode.TAB:ret=true;self.close(event,true);$(event.target).parents("li:eq(0)").trigger("mouseup");break;case $.ui.keyCode.ESCAPE:self.close(event,true);break;default:ret=true;self._typeAhead(event.keyCode,"focus");break}return ret});$(window).bind("resize.selectmenu",$.proxy(self._refreshPosition,this))},
_init:function(){var self=this;var o=this.options;var selectOptionData=[];this.element.find("option").each(function(){selectOptionData.push({value:$(this).attr("value"),text:self._formatText($(this).text()),selected:$(this).attr("selected"),disabled:$(this).attr("disabled"),classes:$(this).attr("class"),typeahead:$(this).attr("typeahead"),parentOptGroup:$(this).parent("optgroup"),bgImage:o.bgImage.call($(this))})});var activeClass=self.options.style=="popup"?" ui-state-active":"";this.list.html("");
for(var i=0;i<selectOptionData.length;i++){var thisLi=$('\x3cli role\x3d"presentation"'+(selectOptionData[i].disabled?' class\x3d"'+this.namespace+"-state-disabled"+'"':"")+'\x3e\x3ca href\x3d"#" tabindex\x3d"-1" role\x3d"option"'+(selectOptionData[i].disabled?' aria-disabled\x3d"true"':"")+' aria-selected\x3d"false"'+(selectOptionData[i].typeahead?' typeahead\x3d"'+selectOptionData[i].typeahead+'"':"")+"\x3e"+selectOptionData[i].text+"\x3c/a\x3e\x3c/li\x3e").data("index",i).addClass(selectOptionData[i].classes).data("optionClasses",
selectOptionData[i].classes||"").bind("mouseup.selectmenu",function(event){if(self._safemouseup&&!self._disabled(event.currentTarget)&&!self._disabled($(event.currentTarget).parents("ul\x3eli."+self.widgetBaseClass+"-group "))){var changed=$(this).data("index")!=self._selectedIndex();self.index($(this).data("index"));self.select(event);if(changed)self.change(event);self.close(event,true)}return false}).bind("click.selectmenu",function(){return false}).bind("mouseover.selectmenu focus.selectmenu",
function(e){if(!$(e.currentTarget).hasClass(self.namespace+"-state-disabled")){self._selectedOptionLi().addClass(activeClass);self._focusedOptionLi().removeClass(self.widgetBaseClass+"-item-focus ui-state-hover");$(this).removeClass("ui-state-active").addClass(self.widgetBaseClass+"-item-focus ui-state-hover")}}).bind("mouseout.selectmenu blur.selectmenu",function(){if($(this).is(self._selectedOptionLi()))$(this).addClass(activeClass);$(this).removeClass(self.widgetBaseClass+"-item-focus ui-state-hover")});
if(selectOptionData[i].parentOptGroup.length){var optGroupName=self.widgetBaseClass+"-group-"+this.element.find("optgroup").index(selectOptionData[i].parentOptGroup);if(this.list.find("li."+optGroupName).length)this.list.find("li."+optGroupName+":last ul").append(thisLi);else $(' \x3cli role\x3d"presentation" class\x3d"'+self.widgetBaseClass+"-group "+optGroupName+(selectOptionData[i].parentOptGroup.attr("disabled")?" "+this.namespace+'-state-disabled" aria-disabled\x3d"true"':'"')+'\x3e\x3cspan class\x3d"'+
self.widgetBaseClass+'-group-label"\x3e'+selectOptionData[i].parentOptGroup.attr("label")+"\x3c/span\x3e\x3cul\x3e\x3c/ul\x3e\x3c/li\x3e ").appendTo(this.list).find("ul").append(thisLi)}else thisLi.appendTo(this.list);this.list.bind("mousedown.selectmenu mouseup.selectmenu",function(){return false});if(o.icons)for(var j in o.icons)if(thisLi.is(o.icons[j].find)){thisLi.data("optionClasses",selectOptionData[i].classes+" "+self.widgetBaseClass+"-hasIcon").addClass(self.widgetBaseClass+"-hasIcon");var iconClass=
o.icons[j].icon||"";thisLi.find("a:eq(0)").prepend('\x3cspan class\x3d"'+self.widgetBaseClass+"-item-icon ui-icon "+iconClass+'"\x3e\x3c/span\x3e');if(selectOptionData[i].bgImage)thisLi.find("span").css("background-image",selectOptionData[i].bgImage)}}var isDropDown=o.style=="dropdown";this.newelement.toggleClass(self.widgetBaseClass+"-dropdown",isDropDown).toggleClass(self.widgetBaseClass+"-popup",!isDropDown);this.list.toggleClass(self.widgetBaseClass+"-menu-dropdown ui-corner-bottom",isDropDown).toggleClass(self.widgetBaseClass+
"-menu-popup ui-corner-all",!isDropDown).find("li:first").toggleClass("ui-corner-top",!isDropDown).end().find("li:last").addClass("ui-corner-bottom");this.selectmenuIcon.toggleClass("ui-icon-triangle-1-s",isDropDown).toggleClass("ui-icon-triangle-2-n-s",!isDropDown);if(o.transferClasses){var transferClasses=this.element.attr("class")||"";this.newelement.add(this.list).addClass(transferClasses)}var selectWidth=this.element.width();if(o.style=="dropdown")this.list.width(o.menuWidth?o.menuWidth:o.width?
o.width:selectWidth);else this.list.width(o.menuWidth?o.menuWidth:o.width?o.width-o.handleWidth:selectWidth-o.handleWidth);if(o.maxHeight){if(o.maxHeight<this.list.height())this.list.height(o.maxHeight)}else if(!o.format&&$(window).height()/3<this.list.height()){o.maxHeight=$(window).height()/3;this.list.height(o.maxHeight)}this._optionLis=this.list.find("li:not(."+self.widgetBaseClass+"-group)");if(this.element.attr("disabled")===true)this.disable();this.index(this._selectedIndex());window.setTimeout(function(){self._refreshPosition()},
200)},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled"+" "+this.namespace+"-state-disabled").removeAttr("aria-disabled").unbind(".selectmenu");$(window).unbind(".selectmenu");$(document).unbind(".selectmenu");$("label[for\x3d"+this.newelement.attr("id")+"]").attr("for",this.element.attr("id")).unbind(".selectmenu");if(this.options.wrapperElement){this.newelement.find(this.options.wrapperElement).remove();this.list.find(this.options.wrapperElement).remove()}else{this.newelement.remove();
this.list.remove()}this.element.show();$.Widget.prototype.destroy.apply(this,arguments)},_typeAhead:function(code,eventType){var self=this;var focusFound=false;var C=String.fromCharCode(code);c=C.toLowerCase();if(self.options.typeAhead=="sequential"){var focusOptSeq=function(elem,ind,c){focusFound=true;$(elem).trigger(eventType);typeof self._prevChar=="undefined"?self._prevChar=[c]:self._prevChar[self._prevChar.length]=c};window.clearTimeout("ui.selectmenu-"+self.selectmenuId);var find=typeof self._prevChar==
"undefined"?"":self._prevChar.join("");this.list.find("li a").each(function(i){if(!focusFound){var thisText=$(this).attr("typeahead")||$(this).text();if(thisText.indexOf(find+C)==0)focusOptSeq(this,i,C);else if(thisText.indexOf(find+c)==0)focusOptSeq(this,i,c)}});window.setTimeout(function(el){el._prevChar=undefined},1E3,self)}else{var focusOpt=function(elem,ind){focusFound=true;$(elem).trigger(eventType);self._prevChar[1]=ind};if(!self._prevChar)self._prevChar=["",0];focusFound=false;this.list.find("li a").each(function(i){if(!focusFound){var thisText=
$(this).text();if(thisText.indexOf(C)==0||thisText.indexOf(c)==0)if(self._prevChar[0]==C){if(self._prevChar[1]<i)focusOpt(this,i)}else focusOpt(this,i)}});this._prevChar[0]=C}},_uiHash:function(){var index=this.index();return{index:index,option:$("option",this.element).get(index),value:this.element[0].value}},open:function(event){var self=this;if(this.newelement.attr("aria-disabled")!="true"){this._closeOthers(event);this.newelement.addClass("ui-state-active");if(self.options.wrapperElement)this.list.parent().appendTo("body");
else this.list.appendTo("body");this.list.addClass(self.widgetBaseClass+"-open").attr("aria-hidden",false);this._refreshPosition();this.list.find("li:not(."+self.widgetBaseClass+"-group):eq("+this._selectedIndex()+") a")[0].focus();if(this.options.style=="dropdown")this.newelement.removeClass("ui-corner-all").addClass("ui-corner-top");this._trigger("open",event,this._uiHash())}},close:function(event,retainFocus){if(this.newelement.is(".ui-state-active")){this.newelement.removeClass("ui-state-active");
this.list.attr("aria-hidden",true).removeClass(this.widgetBaseClass+"-open");if(this.options.style=="dropdown")this.newelement.removeClass("ui-corner-top").addClass("ui-corner-all");if(retainFocus)this.newelement.focus();this._trigger("close",event,this._uiHash())}},change:function(event){this.element.trigger("change");this._trigger("change",event,this._uiHash())},select:function(event){this._trigger("select",event,this._uiHash())},_closeOthers:function(event){$("."+this.widgetBaseClass+".ui-state-active").not(this.newelement).each(function(){$(this).data("selectelement").selectmenu("close",
event)});$("."+this.widgetBaseClass+".ui-state-hover").trigger("mouseout")},_toggle:function(event,retainFocus){if(this.list.is("."+this.widgetBaseClass+"-open"))this.close(event,retainFocus);else this.open(event)},_formatText:function(text){return this.options.format?this.options.format(text):text},_selectedIndex:function(){return this.element[0].selectedIndex},_selectedOptionLi:function(){return this._optionLis.eq(this._selectedIndex())},_focusedOptionLi:function(){return this.list.find("."+this.widgetBaseClass+
"-item-focus")},_moveSelection:function(amt){var currIndex=parseInt(this._selectedOptionLi().data("index"),10);var newIndex=currIndex+amt;if(newIndex>=0)return this._optionLis.eq(newIndex).trigger("mouseup")},_moveFocus:function(amt){if(!isNaN(amt)){var currIndex=parseInt(this._focusedOptionLi().data("index")||0,10);var newIndex=currIndex+amt}else newIndex=parseInt(this._optionLis.filter(amt).data("index"),10);if(newIndex<0)newIndex=0;if(newIndex>this._optionLis.size()-1)newIndex=this._optionLis.size()-
1;var activeID=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1E3);this._focusedOptionLi().find("a:eq(0)").attr("id","");if(this._optionLis.eq(newIndex).hasClass(this.namespace+"-state-disabled")){amt>0?amt++:amt--;this._moveFocus(amt,newIndex)}else this._optionLis.eq(newIndex).find("a:eq(0)").attr("id",activeID).focus();this.list.attr("aria-activedescendant",activeID)},_scrollPage:function(direction){var numPerPage=Math.floor(this.list.outerHeight()/this.list.find("li:first").outerHeight());
numPerPage=direction=="up"?-numPerPage:numPerPage;this._moveFocus(numPerPage)},_setOption:function(key,value){this.options[key]=value;if(key=="disabled"){this.close();this.element.add(this.newelement).add(this.list)[value?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+this.namespace+"-state-disabled").attr("aria-disabled",value)}},disable:function(index,type){if(typeof index=="undefined")this._setOption("disabled",true);else if(type=="optgroup")this._disableOptgroup(index);else this._disableOption(index)},
enable:function(index,type){if(typeof index=="undefined")this._setOption("disabled",false);else if(type=="optgroup")this._enableOptgroup(index);else this._enableOption(index)},_disabled:function(elem){return $(elem).hasClass(this.namespace+"-state-disabled")},_disableOption:function(index){var optionElem=this._optionLis.eq(index);if(optionElem){optionElem.addClass(this.namespace+"-state-disabled").find("a").attr("aria-disabled",true);this.element.find("option").eq(index).attr("disabled","disabled")}},
_enableOption:function(index){var optionElem=this._optionLis.eq(index);if(optionElem){optionElem.removeClass(this.namespace+"-state-disabled").find("a").attr("aria-disabled",false);this.element.find("option").eq(index).removeAttr("disabled")}},_disableOptgroup:function(index){var optGroupElem=this.list.find("li."+this.widgetBaseClass+"-group-"+index);if(optGroupElem){optGroupElem.addClass(this.namespace+"-state-disabled").attr("aria-disabled",true);this.element.find("optgroup").eq(index).attr("disabled",
"disabled")}},_enableOptgroup:function(index){var optGroupElem=this.list.find("li."+this.widgetBaseClass+"-group-"+index);if(optGroupElem){optGroupElem.removeClass(this.namespace+"-state-disabled").attr("aria-disabled",false);this.element.find("optgroup").eq(index).removeAttr("disabled")}},index:function(newValue){if(arguments.length)if(!this._disabled($(this._optionLis[newValue]))){this.element[0].selectedIndex=newValue;this._refreshValue()}else return false;else return this._selectedIndex()},value:function(newValue){if(arguments.length){this.element[0].value=
newValue;this._refreshValue()}else return this.element[0].value},_refreshValue:function(){var activeClass=this.options.style=="popup"?" ui-state-active":"";var activeID=this.widgetBaseClass+"-item-"+Math.round(Math.random()*1E3);this.list.find("."+this.widgetBaseClass+"-item-selected").removeClass(this.widgetBaseClass+"-item-selected"+activeClass).find("a").attr("aria-selected","false").attr("id","");this._selectedOptionLi().addClass(this.widgetBaseClass+"-item-selected"+activeClass).find("a").attr("aria-selected",
"true").attr("id",activeID);var currentOptionClasses=this.newelement.data("optionClasses")?this.newelement.data("optionClasses"):"";var newOptionClasses=this._selectedOptionLi().data("optionClasses")?this._selectedOptionLi().data("optionClasses"):"";this.newelement.removeClass(currentOptionClasses).data("optionClasses",newOptionClasses).addClass(newOptionClasses).find("."+this.widgetBaseClass+"-status").html(this._selectedOptionLi().find("a:eq(0)").html());this.list.attr("aria-activedescendant",activeID)},
_refreshPosition:function(){var o=this.options;if(o.style=="popup"&&!o.positionOptions.offset){var selected=this._selectedOptionLi();var _offset="0 -"+(selected.outerHeight()+selected.offset().top-this.list.offset().top)}this.list.css({zIndex:this.element.zIndex()}).position({of:o.positionOptions.of||this.newelement,my:o.positionOptions.my,at:o.positionOptions.at,offset:o.positionOptions.offset||_offset})}})})(jQuery);
(function($){var allImages={};var imageCounter=0;$.galleriffic={version:"2.0.1",normalizeHash:function(hash){return hash.replace(/^.*#/,"").replace(/\?.*$/,"")},getImage:function(hash){if(!hash)return undefined;hash=$.galleriffic.normalizeHash(hash);return allImages[hash]},gotoImage:function(hash){var imageData=$.galleriffic.getImage(hash);if(!imageData)return false;var gallery=imageData.gallery;gallery.gotoImage(imageData);return true},removeImageByHash:function(hash,ownerGallery){var imageData=
$.galleriffic.getImage(hash);if(!imageData)return false;var gallery=imageData.gallery;if(ownerGallery&&ownerGallery!=gallery)return false;return gallery.removeImageByIndex(imageData.index)}};var defaults={delay:3E3,numThumbs:20,preloadAhead:40,enableTopPager:false,enableBottomPager:true,maxPagesToShow:7,imageContainerSel:"",captionContainerSel:"",controlsContainerSel:"",loadingContainerSel:"",renderSSControls:true,renderNavControls:true,playLinkText:"Play",pauseLinkText:"Pause",prevLinkText:"Previous",
nextLinkText:"Next",nextPageLinkText:"Next \x26rsaquo;",prevPageLinkText:"\x26lsaquo; Prev",enableHistory:false,enableKeyboardNavigation:true,autoStart:false,syncTransitions:false,defaultTransitionDuration:1E3,onSlideChange:undefined,onTransitionOut:undefined,onTransitionIn:undefined,onPageTransitionOut:undefined,onPageTransitionIn:undefined,onImageAdded:undefined,onImageRemoved:undefined};$.fn.galleriffic=function(settings){$.extend(this,{version:$.galleriffic.version,isSlideshowRunning:false,slideshowTimeout:undefined,
clickHandler:function(e,link){this.pause();if(!this.enableHistory){var href=$(link).attr("href");var hash;if(href){hash=$.galleriffic.normalizeHash(href);if(hash-1==this.currentImage.index){e.preventDefault();return}$.galleriffic.gotoImage(hash);e.preventDefault()}}},appendImage:function(listItem){this.addImage(listItem,false,false);return this},insertImage:function(listItem,position){this.addImage(listItem,false,true,position);return this},addImage:function(listItem,thumbExists,insert,position){var $li=
typeof listItem==="string"?$(listItem):listItem;var $aThumb=$li.find("a.thumb");var slideUrl=$aThumb.attr("href");var title=$aThumb.attr("title");var $caption=$li.find(".caption").remove();var hash=$aThumb.attr("name");imageCounter++;if(!hash||allImages[""+hash])hash=imageCounter;if(!insert)position=this.data.length;var imageData={title:title,slideUrl:slideUrl,caption:$caption,hash:hash,gallery:this,index:position};if(insert){this.data.splice(position,0,imageData);this.updateIndices(position)}else this.data.push(imageData);
var gallery=this;if(!thumbExists)this.updateThumbs(function(){var $thumbsUl=gallery.find("ul.thumbs");if(insert)$thumbsUl.children(":eq("+position+")").before($li);else $thumbsUl.append($li);if(gallery.onImageAdded)gallery.onImageAdded(imageData,$li)});allImages[""+hash]=imageData;$aThumb.attr("rel","history").attr("href","#"+hash).removeAttr("name").click(function(e){gallery.clickHandler(e,this)});return this},removeImageByIndex:function(index){if(index<0||index>=this.data.length)return false;var imageData=
this.data[index];if(!imageData)return false;this.removeImage(imageData);return true},removeImageByHash:function(hash){return $.galleriffic.removeImageByHash(hash,this)},removeImage:function(imageData){var index=imageData.index;this.data.splice(index,1);delete allImages[""+imageData.hash];this.updateThumbs(function(){var $li=gallery$$0.find("ul.thumbs").children(":eq("+index+")").remove();if(gallery$$0.onImageRemoved)gallery$$0.onImageRemoved(imageData,$li)});this.updateIndices(index);return this},
updateIndices:function(startIndex){for(i=startIndex;i<this.data.length;i++)this.data[i].index=i;return this},initializeThumbs:function(){this.data=[];var gallery=this;this.find("ul.thumbs \x3e li").each(function(i){gallery.addImage($(this),true,false)});return this},isPreloadComplete:false,preloadInit:function(){if(this.preloadAhead==0)return this;this.preloadStartIndex=this.currentImage.index;var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,
nextIndex)},preloadRelocate:function(index){this.preloadStartIndex=index;return this},preloadRecursive:function(startIndex,currentIndex){if(startIndex!=this.preloadStartIndex){var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,nextIndex)}var gallery=this;var preloadCount=currentIndex-startIndex;if(preloadCount<0)preloadCount=this.data.length-1-startIndex+currentIndex;if(this.preloadAhead>=0&&preloadCount>this.preloadAhead){setTimeout(function(){gallery.preloadRecursive(startIndex,
currentIndex)},500);return this}var imageData=this.data[currentIndex];if(!imageData)return this;if(imageData.image)return this.preloadNext(startIndex,currentIndex);var image=new Image;image.onload=function(){imageData.image=this;gallery.preloadNext(startIndex,currentIndex)};image.src=imageData.slideUrl;return this},preloadNext:function(startIndex,currentIndex){var nextIndex=this.getNextIndex(currentIndex);if(nextIndex==startIndex)this.isPreloadComplete=true;else{var gallery=this;setTimeout(function(){gallery.preloadRecursive(startIndex,
nextIndex)},100)}return this},getNextIndex:function(index){var nextIndex=index+1;if(nextIndex>=this.data.length)nextIndex=0;return nextIndex},getPrevIndex:function(index){var prevIndex=index-1;if(prevIndex<0)prevIndex=this.data.length-1;return prevIndex},pause:function(){this.isSlideshowRunning=false;if(this.slideshowTimeout){clearTimeout(this.slideshowTimeout);this.slideshowTimeout=undefined}if(this.$controlsContainer)this.$controlsContainer.find("div.ss-controls a").removeClass().addClass("play").attr("title",
this.playLinkText).attr("href","#play").html("\x3cb\x3e\x3c/b\x3e"+this.playLinkText);return this},play:function(){this.isSlideshowRunning=true;if(this.$controlsContainer)this.$controlsContainer.find("div.ss-controls a").removeClass().addClass("pause").attr("title",this.pauseLinkText).attr("href","#pause").html("\x3cb\x3e\x3c/b\x3e"+this.pauseLinkText);if(!this.slideshowTimeout){var gallery=this;this.slideshowTimeout=setTimeout(function(){gallery.ssAdvance()},this.delay)}return this},toggleSlideshow:function(){if(this.isSlideshowRunning)this.pause();
else this.play();return this},ssAdvance:function(){if(this.isSlideshowRunning)this.next(true);return this},next:function(dontPause,bypassHistory){this.gotoIndex(this.getNextIndex(this.currentImage.index),dontPause,bypassHistory);return this},previous:function(dontPause,bypassHistory){this.gotoIndex(this.getPrevIndex(this.currentImage.index),dontPause,bypassHistory);return this},nextPage:function(dontPause,bypassHistory){var page=this.getCurrentPage();var lastPage=this.getNumPages()-1;if(page<lastPage){var startIndex=
page*this.numThumbs;var nextPage=startIndex+this.numThumbs;this.gotoIndex(nextPage,dontPause,bypassHistory)}return this},previousPage:function(dontPause,bypassHistory){var page=this.getCurrentPage();if(page>0){var startIndex=page*this.numThumbs;var prevPage=startIndex-this.numThumbs;this.gotoIndex(prevPage,dontPause,bypassHistory)}return this},gotoIndex:function(index,dontPause,bypassHistory){if(!dontPause)this.pause();if(index<0)index=0;else if(index>=this.data.length)index=this.data.length-1;var imageData=
this.data[index];if(!bypassHistory&&this.enableHistory)$.historyLoad(String(imageData.hash));else this.gotoImage(imageData);return this},gotoImage:function(imageData){var index=imageData.index;if(this.onSlideChange)this.onSlideChange(this.currentImage.index,index);this.currentImage=imageData;this.preloadRelocate(index);this.refresh();return this},getDefaultTransitionDuration:function(isSync){if(isSync)return this.defaultTransitionDuration;return this.defaultTransitionDuration/2},refresh:function(){var imageData=
this.currentImage;if(!imageData)return this;var index=imageData.index;if(this.$controlsContainer)this.$controlsContainer.find("div.nav-controls a.prev").attr("href","#"+this.data[this.getPrevIndex(index)].hash).end().find("div.nav-controls a.next").attr("href","#"+this.data[this.getNextIndex(index)].hash);var previousSlide=this.$imageContainer.find("span.current").addClass("previous").removeClass("current");var previousCaption=0;if(this.$captionContainer)previousCaption=this.$captionContainer.find("span.current").addClass("previous").removeClass("current");
var isSync=this.syncTransitions&&imageData.image;var isTransitioning=true;var gallery=this;var transitionOutCallback=function(){isTransitioning=false;previousSlide.remove();if(previousCaption)previousCaption.remove();if(!isSync)if(imageData.image&&imageData.hash==gallery.data[gallery.currentImage.index].hash)gallery.buildImage(imageData,isSync);else if(gallery.$loadingContainer)gallery.$loadingContainer.show()};if(previousSlide.length==0)transitionOutCallback();else if(this.onTransitionOut)this.onTransitionOut(previousSlide,
previousCaption,isSync,transitionOutCallback);else{previousSlide.fadeTo(this.getDefaultTransitionDuration(isSync),0,transitionOutCallback);if(previousCaption)previousCaption.fadeTo(this.getDefaultTransitionDuration(isSync),0)}if(isSync)this.buildImage(imageData,isSync);if(!imageData.image){var image=new Image;image.onload=function(){imageData.image=this;if(!isTransitioning&&imageData.hash==gallery.data[gallery.currentImage.index].hash)gallery.buildImage(imageData,isSync);var isFirefox="MozBoxSizing"in
document.documentElement.style;if(isFirefox)window.stop()};image.src=imageData.slideUrl}this.relocatePreload=true;return this.syncThumbs()},buildImage:function(imageData,isSync){var gallery=this;var nextIndex=this.getNextIndex(imageData.index);var newSlide=this.$imageContainer.append('\x3cspan class\x3d"image-wrapper current"\x3e\x3ca\x3e\x3c/a\x3e\x3c/span\x3e').find("span.current").css("opacity","0");newSlide.find("a").append(imageData.image).click(function(e){gallery.clickHandler(e,this)});var newCaption=
0;if(this.$captionContainer)newCaption=this.$captionContainer.append('\x3cspan class\x3d"image-caption current"\x3e\x3c/span\x3e').find("span.current").css("opacity","0").append(imageData.caption);if(this.$loadingContainer)this.$loadingContainer.hide();if(this.onTransitionIn)this.onTransitionIn(newSlide,newCaption,isSync);else{newSlide.fadeTo(this.getDefaultTransitionDuration(isSync),1);if(newCaption)newCaption.fadeTo(this.getDefaultTransitionDuration(isSync),1)}if(this.isSlideshowRunning){if(this.slideshowTimeout)clearTimeout(this.slideshowTimeout);
this.slideshowTimeout=setTimeout(function(){gallery.ssAdvance()},this.delay)}return this},getCurrentPage:function(){return Math.floor(this.currentImage.index/this.numThumbs)},syncThumbs:function(){var page=this.getCurrentPage();if(page!=this.displayedPage)this.updateThumbs();var $thumbs=this.find("ul.thumbs").children();$thumbs.filter(".selected").removeClass("selected");$thumbs.eq(this.currentImage.index).addClass("selected");return this},updateThumbs:function(postTransitionOutHandler){var gallery=
this;var transitionOutCallback=function(){if(postTransitionOutHandler)postTransitionOutHandler();gallery.rebuildThumbs();if(gallery.onPageTransitionIn)gallery.onPageTransitionIn();else gallery.show()};if(this.onPageTransitionOut)this.onPageTransitionOut(transitionOutCallback);else{this.hide();transitionOutCallback()}return this},rebuildThumbs:function(){var needsPagination=this.data.length>this.numThumbs;if(this.enableTopPager){var $topPager=this.find("div.top");if($topPager.length==0)$topPager=this.prepend('\x3cdiv class\x3d"top pagination"\x3e\x3c/div\x3e').find("div.top");
else $topPager.empty();if(needsPagination)this.buildPager($topPager)}if(this.enableBottomPager){var $bottomPager=this.find("div.bottom");if($bottomPager.length==0)$bottomPager=this.append('\x3cdiv class\x3d"bottom pagination"\x3e\x3c/div\x3e').find("div.bottom");else $bottomPager.empty();if(needsPagination)this.buildPager($bottomPager)}var page=this.getCurrentPage();var startIndex=page*this.numThumbs;var stopIndex=startIndex+this.numThumbs-1;if(stopIndex>=this.data.length)stopIndex=this.data.length-
1;var $thumbsUl=this.find("ul.thumbs");$thumbsUl.find("li").each(function(i){var $li=$(this);if(i>=startIndex&&i<=stopIndex)$li.show();else $li.hide()});this.displayedPage=page;$thumbsUl.removeClass("noscript");return this},getNumPages:function(){return Math.ceil(this.data.length/this.numThumbs)},buildPager:function(pager){var gallery=this;var numPages=this.getNumPages();var page=this.getCurrentPage();var startIndex=page*this.numThumbs;var pagesRemaining=this.maxPagesToShow-1;pager.append("Pages:");
var pageNum=page-Math.floor((this.maxPagesToShow-1)/2)+1;if(pageNum>0){var remainingPageCount=numPages-pageNum;if(remainingPageCount<pagesRemaining)pageNum=pageNum-(pagesRemaining-remainingPageCount)}if(pageNum<0)pageNum=0;if(page>0){var prevPage=startIndex-this.numThumbs;pager.append('\x3ca rel\x3d"history" href\x3d"#'+this.data[prevPage].hash+'" title\x3d"'+this.prevPageLinkText+'"\x3e'+this.prevPageLinkText+"\x3c/a\x3e")}if(pageNum>0){this.buildPageLink(pager,0,numPages);if(pageNum>1)pager.append('\x3cspan class\x3d"ellipsis"\x3e\x26hellip;\x3c/span\x3e');
pagesRemaining--}for(;pagesRemaining>0;){this.buildPageLink(pager,pageNum,numPages);pagesRemaining--;pageNum++}if(pageNum<numPages){var lastPageNum=numPages-1;if(pageNum<lastPageNum)pager.append('\x3cspan class\x3d"ellipsis"\x3e\x26hellip;\x3c/span\x3e');this.buildPageLink(pager,lastPageNum,numPages)}var nextPage=startIndex+this.numThumbs;if(nextPage<this.data.length)pager.append('\x3ca rel\x3d"history" href\x3d"#'+this.data[nextPage].hash+'" title\x3d"'+this.nextPageLinkText+'"\x3e'+this.nextPageLinkText+
"\x3c/a\x3e");pager.find("a").click(function(e){gallery.clickHandler(e,this)});return this},buildPageLink:function(pager,pageNum,numPages){var pageLabel=pageNum+1;var currentPage=this.getCurrentPage();if(pageNum==currentPage)pager.append('\x3cspan class\x3d"current"\x3e'+pageLabel+"\x3c/span\x3e");else if(pageNum<numPages){var imageIndex=pageNum*this.numThumbs;pager.append('\x3ca rel\x3d"history" href\x3d"#'+this.data[imageIndex].hash+'" title\x3d"'+pageLabel+'"\x3e'+pageLabel+"\x3c/a\x3e")}return this}});
$.extend(this,defaults,settings);if(this.enableHistory&&!$.historyInit)this.enableHistory=false;if(this.imageContainerSel)this.$imageContainer=$(this.imageContainerSel);if(this.captionContainerSel)this.$captionContainer=$(this.captionContainerSel);if(this.loadingContainerSel)this.$loadingContainer=$(this.loadingContainerSel);this.initializeThumbs();if(this.maxPagesToShow<3)this.maxPagesToShow=3;this.displayedPage=-1;this.currentImage=this.data[0];var gallery$$0=this;if(this.$loadingContainer)this.$loadingContainer.hide();
if(this.controlsContainerSel){this.$controlsContainer=$(this.controlsContainerSel).empty();if(this.renderSSControls){if(this.autoStart)this.$controlsContainer.append('\x3cdiv class\x3d"ss-controls"\x3e\x3ca href\x3d"#pause" class\x3d"pause" title\x3d"'+this.pauseLinkText+'"\x3e\x3cb\x3e\x3c/b\x3e'+this.pauseLinkText+"\x3c/a\x3e\x3c/div\x3e");else this.$controlsContainer.append('\x3cdiv class\x3d"ss-controls"\x3e\x3ca href\x3d"#play" class\x3d"play" title\x3d"'+this.playLinkText+'"\x3e\x3cb\x3e\x3c/b\x3e'+
this.playLinkText+"\x3c/a\x3e\x3c/div\x3e");this.$controlsContainer.find("div.ss-controls a").click(function(e){gallery$$0.toggleSlideshow();e.preventDefault();return false})}if(this.renderNavControls)this.$controlsContainer.append('\x3cdiv class\x3d"nav-controls"\x3e\x3ca class\x3d"prev" rel\x3d"history" title\x3d"'+this.prevLinkText+'"\x3e'+this.prevLinkText+'\x3c/a\x3e\x3cb\x3e\x3c/b\x3e\x3ca class\x3d"next" rel\x3d"history" title\x3d"'+this.nextLinkText+'"\x3e'+this.nextLinkText+"\x3c/a\x3e\x3c/div\x3e").find("div.nav-controls a").click(function(e){gallery$$0.clickHandler(e,
this)})}var initFirstImage=!this.enableHistory||!location.hash;if(this.enableHistory&&location.hash){var hash$$0=$.galleriffic.normalizeHash(location.hash);var imageData$$0=allImages[hash$$0];if(!imageData$$0)initFirstImage=true}if(initFirstImage){this.gotoIndex(0,false,true);$("#slideshow").css({backgroundImage:"none"})}if(this.enableKeyboardNavigation)$(document).keydown(function(e){var key=e.charCode?e.charCode:e.keyCode?e.keyCode:0;switch(key){case 32:gallery$$0.next();e.preventDefault();break;
case 33:gallery$$0.previousPage();e.preventDefault();break;case 34:gallery$$0.nextPage();e.preventDefault();break;case 35:gallery$$0.gotoIndex(gallery$$0.data.length-1);e.preventDefault();break;case 36:gallery$$0.gotoIndex(0);e.preventDefault();break;case 37:gallery$$0.previous();e.preventDefault();break;case 39:gallery$$0.next();e.preventDefault();break}});if(this.autoStart)this.play();setTimeout(function(){gallery$$0.preloadInit();$("#fitslidesfirst, #fit ul").hide()},1E3);return this}})(jQuery);
jQuery.fn.initMenu=function(){return this.each(function(){var theMenu=$(this).get(0);if($(this).parent().attr("class")=="prog"){var prog=true;var headings=$("h3",this)}else if($(this).parent().attr("class")=="wearable"){var wearable=true;headings=$("h4",this)}else if($(this).parent().attr("id")=="media"){var media=true;headings=$("h3",this)}headings.each(function(){$(this).parent().children("*").not(this).wrapAll('\x3cdiv class\x3d"acitem"\x3e\x3c/div\x3e')}).click(function(e){e.stopImmediatePropagation();
var theElement=$(this).parent().find("div.acitem");var parent=$(this).parent().parent();if(!theElement.is(":visible")){parent.find("div.acitem:visible").slideUp("normal",function(){$(this).parent().removeClass("active")});theElement.slideDown("normal").parent().addClass("active");if(prog)curImg.hide(0,function(){curImg=imgs.eq(theElement.parent().attr("index")-1);curImg.fadeIn(250,"easeInOutCubic")});else if(wearable){var imgRdyToFadeIn=imgs.eq(theElement.parent().attr("index")-1);curImg.fadeOut(250,
"easeInOutCubic");imgRdyToFadeIn.fadeIn(250,"easeInOutCubic",function(){curImg=imgRdyToFadeIn})}}});$("div.acitem",this).hide().eq(0).show().parent().addClass("active");$("li",this).each(function(i){$(this).addClass("li-"+(i+1)).attr({index:i+1})}).wrapAll('\x3cdiv class\x3d"wrapper"\x3e\x3c/div\x3e').last().addClass("last");var imgs=$("img",this);imgs.appendTo(this);var curImg=imgs.eq(0);curImg.show();$(this).css({visibility:"visible"})})};
var Hashtable=function(){function a(t){var r;if(typeof t=="string")return t;else if(typeof t.hashCode==p){r=t.hashCode();return typeof r=="string"?r:a(r)}else if(typeof t.toString==p)return t.toString();else try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}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");}}function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null)this.getEqualityFunction=function(){return r}}function o(r){return function(t){var s=this.entries.length;var v;for(var u=this.getEqualityFunction(t);s--;){v=this.entries[s];if(u(t,v[0]))switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}return false}}function k(r){return function(u){var v=u.length;var t=0;for(var s=this.entries.length;t<s;++t)u[v+t]=this.entries[t][r]}}function m(s,
t){var r=s.length;for(var u;r--;){u=s[r];if(t===u[0])return r}return null}function i(r,s){var t=r[s];return t&&t instanceof d?t:null}function b(t,r){var w=this;var v=[];var u={};var x=typeof t==p?t:a;var s=typeof r==p?r:null;this.put=function(B,C){q(B);l(C);var D=x(B);var E;var A;var z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else E.addEntry(B,C)}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);
if(z)return z[1]}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);for(var z=v.length;z--;)if(v[z].containsValue(A))return true;return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return!v.length};var y=function(z){return function(){var A=[];for(var B=v.length;B--;)v[B][z](A);return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);
var C=x(B);var z;var A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null)if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}return A};this.size=function(){var A=0;for(var z=v.length;z--;)A+=v[z].entries.length;return A};this.each=function(C){var z=w.entries();var A=z.length;for(var B;A--;){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E;var F;var D;var z;var A=B.length;for(var G=typeof C==p;A--;){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F)))D=C(F,z,D);w.put(F,D)}};this.clone=
function(){var z=new b(t,r);z.putAll(w);return z}}var p="function";var n=typeof Array.prototype.splice==p?function(s,r){s.splice(r,1)}:function(u,t){var s;var v;var r;if(t===u.length-1)u.length=t;else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v)u[t+v]=s[v]}};var q=c("key");var l=c("value");var h=0;var j=1;var f=2;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 u=s.length;var t=0;for(var r=this.entries.length;t<r;++t)s[u+t]=this.entries[t].slice(0)},containsKey:o(h),containsValue:function(s){for(var r=this.entries.length;r--;)if(s===this.entries[r][1])return true;return false}};return b}();
(function(jQuery){function FormatData(dec,group,neg){this.dec=dec;this.group=group;this.neg=neg}function init(){for(var localeGroupIdx=0;localeGroupIdx<nfAllLocales.length;localeGroupIdx++){localeGroup=nfAllLocales[localeGroupIdx];for(var i=0;i<localeGroup.length;i++)nfLocales.put(localeGroup[i],localeGroupIdx)}}function formatCodes(locale,isFullLocale){if(nfLocales.size()==0)init();var dec=".";var group=",";var neg="-";if(isFullLocale==false)if(locale.indexOf("_")!=-1)locale=locale.split("_")[1].toLowerCase();
else if(locale.indexOf("-")!=-1)locale=locale.split("-")[1].toLowerCase();var codesIndex=nfLocales.get(locale);if(codesIndex){var codes=nfLocaleFormatting[codesIndex];if(codes){dec=codes[0];group=codes[1]}}return new FormatData(dec,group,neg)}var nfLocales=new Hashtable;var nfLocalesLikeUS=["ae","au","ca","cn","eg","gb","hk","il","in","jp","sk","th","tw","us"];var nfLocalesLikeDE=["at","br","de","dk","es","gr","it","nl","pt","tr","vn"];var nfLocalesLikeFR=["cz","fi","fr","ru","se","pl"];var nfLocalesLikeCH=
["ch"];var nfLocaleFormatting=[[".",","],[",","."],[","," "],[".","'"]];var nfAllLocales=[nfLocalesLikeUS,nfLocalesLikeDE,nfLocalesLikeFR,nfLocalesLikeCH];jQuery.fn.formatNumber=function(options,writeBack,giveReturnValue){return this.each(function(){if(writeBack==null)writeBack=true;if(giveReturnValue==null)giveReturnValue=true;var text;if(jQuery(this).is(":input"))text=new String(jQuery(this).val());else text=new String(jQuery(this).text());var returnString=jQuery.formatNumber(text,options);if(writeBack)if(jQuery(this).is(":input"))jQuery(this).val(returnString);
else jQuery(this).text(returnString);if(giveReturnValue)return returnString})};jQuery.formatNumber=function(numberString,options){options=jQuery.extend({},jQuery.fn.formatNumber.defaults,options);var formatData=formatCodes(options.locale.toLowerCase(),options.isFullLocale);var dec=formatData.dec;var group=formatData.group;var neg=formatData.neg;var validFormat="0#-,.";var prefix="";var negativeInFront=false;for(var i=0;i<options.format.length;i++)if(validFormat.indexOf(options.format.charAt(i))==
-1)prefix=prefix+options.format.charAt(i);else if(i==0&&options.format.charAt(i)=="-"){negativeInFront=true;continue}else break;var suffix="";for(i=options.format.length-1;i>=0;i--)if(validFormat.indexOf(options.format.charAt(i))==-1)suffix=options.format.charAt(i)+suffix;else break;options.format=options.format.substring(prefix.length);options.format=options.format.substring(0,options.format.length-suffix.length);var number=new Number(numberString);return jQuery._formatNumber(number,options,suffix,
prefix,negativeInFront)};jQuery._formatNumber=function(number,options,suffix,prefix,negativeInFront){options=jQuery.extend({},jQuery.fn.formatNumber.defaults,options);var formatData=formatCodes(options.locale.toLowerCase(),options.isFullLocale);var dec=formatData.dec;var group=formatData.group;var neg=formatData.neg;var forcedToZero=false;if(isNaN(number))if(options.nanForceZero==true){number=0;forcedToZero=true}else return null;if(suffix=="%")number=number*100;var returnString="";if(options.format.indexOf(".")>
-1){var decimalPortion=dec;var decimalFormat=options.format.substring(options.format.lastIndexOf(".")+1);if(options.round==true)number=new Number(number.toFixed(decimalFormat.length));else{var numStr=number.toString();numStr=numStr.substring(0,numStr.lastIndexOf(".")+decimalFormat.length+1);number=new Number(numStr)}var decimalValue=number%1;var decimalString=new String(decimalValue.toFixed(decimalFormat.length));decimalString=decimalString.substring(decimalString.lastIndexOf(".")+1);for(var i=0;i<
decimalFormat.length;i++)if(decimalFormat.charAt(i)=="#"&&decimalString.charAt(i)!="0"){decimalPortion+=decimalString.charAt(i);continue}else if(decimalFormat.charAt(i)=="#"&&decimalString.charAt(i)=="0"){var notParsed=decimalString.substring(i);if(notParsed.match("[1-9]")){decimalPortion+=decimalString.charAt(i);continue}else break}else if(decimalFormat.charAt(i)=="0")decimalPortion+=decimalString.charAt(i);returnString+=decimalPortion}else number=Math.round(number);var ones=Math.floor(number);if(number<
0)ones=Math.ceil(number);var onesFormat="";if(options.format.indexOf(".")==-1)onesFormat=options.format;else onesFormat=options.format.substring(0,options.format.indexOf("."));var onePortion="";if(!(ones==0&&onesFormat.substr(onesFormat.length-1)=="#")||forcedToZero){var oneText=new String(Math.abs(ones));var groupLength=9999;if(onesFormat.lastIndexOf(",")!=-1)groupLength=onesFormat.length-onesFormat.lastIndexOf(",")-1;var groupCount=0;for(i=oneText.length-1;i>-1;i--){onePortion=oneText.charAt(i)+
onePortion;groupCount++;if(groupCount==groupLength&&i!=0){onePortion=group+onePortion;groupCount=0}}if(onesFormat.length>onePortion.length){var padStart=onesFormat.indexOf("0");if(padStart!=-1){var padLen=onesFormat.length-padStart;for(var pos=onesFormat.length-onePortion.length-1;onePortion.length<padLen;){var padChar=onesFormat.charAt(pos);if(padChar==",")padChar=group;onePortion=padChar+onePortion;pos--}}}}if(!onePortion&&onesFormat.indexOf("0",onesFormat.length-1)!==-1)onePortion="0";returnString=
onePortion+returnString;if(number<0&&negativeInFront&&prefix.length>0)prefix=neg+prefix;else if(number<0)returnString=neg+returnString;if(!options.decimalSeparatorAlwaysShown)if(returnString.lastIndexOf(dec)==returnString.length-1)returnString=returnString.substring(0,returnString.length-1);returnString=prefix+returnString+suffix;return returnString};jQuery.fn.parseNumber=function(options,writeBack,giveReturnValue){if(writeBack==null)writeBack=true;if(giveReturnValue==null)giveReturnValue=true;var text;
if(jQuery(this).is(":input"))text=new String(jQuery(this).val());else text=new String(jQuery(this).text());var number=jQuery.parseNumber(text,options);if(number){if(writeBack)if(jQuery(this).is(":input"))jQuery(this).val(number.toString());else jQuery(this).text(number.toString());if(giveReturnValue)return number}};jQuery.parseNumber=function(numberString,options){options=jQuery.extend({},jQuery.fn.parseNumber.defaults,options);var formatData=formatCodes(options.locale.toLowerCase(),options.isFullLocale);
var dec=formatData.dec;var group=formatData.group;var neg=formatData.neg;for(var valid="1234567890.-";numberString.indexOf(group)>-1;)numberString=numberString.replace(group,"");numberString=numberString.replace(dec,".").replace(neg,"-");var validText="";var hasPercent=false;if(numberString.charAt(numberString.length-1)=="%"||options.isPercentage==true)hasPercent=true;for(var i=0;i<numberString.length;i++)if(valid.indexOf(numberString.charAt(i))>-1)validText=validText+numberString.charAt(i);var number=
new Number(validText);if(hasPercent){number=number/100;var decimalPos=validText.indexOf(".");if(decimalPos!=-1){var decimalPoints=validText.length-decimalPos-1;number=number.toFixed(decimalPoints+2)}else number=number.toFixed(validText.length-1)}return number};jQuery.fn.parseNumber.defaults={locale:"us",decimalSeparatorAlwaysShown:false,isPercentage:false,isFullLocale:false};jQuery.fn.formatNumber.defaults={format:"#,###.00",locale:"us",decimalSeparatorAlwaysShown:false,nanForceZero:true,round:true,
isFullLocale:false};Number.prototype.toFixed=function(precision){return jQuery._roundNumber(this,precision)};jQuery._roundNumber=function(number,decimalPlaces){var power=Math.pow(10,decimalPlaces||0);var value=String(Math.round(number*power)/power);if(decimalPlaces>0){var dp=value.indexOf(".");if(dp==-1){value+=".";dp=0}else dp=value.length-(dp+1);for(;dp<decimalPlaces;){value+="0";dp++}}return value}})(jQuery);
var Handlebars={};Handlebars.VERSION="1.0.beta.6";Handlebars.helpers={};Handlebars.partials={};Handlebars.registerHelper=function(name,fn,inverse){if(inverse)fn.not=inverse;this.helpers[name]=fn};Handlebars.registerPartial=function(name,str){this.partials[name]=str};Handlebars.registerHelper("helperMissing",function(arg){if(arguments.length===2)return undefined;else throw new Error("Couldn't find property '"+arg+"'");});var toString=Object.prototype.toString;var functionType="[object Function]";
Handlebars.registerHelper("blockHelperMissing",function(context,options){var inverse=options.inverse||function(){};var fn=options.fn;var ret="";var type=toString.call(context);if(type===functionType)context=context.call(this);if(context===true)return fn(this);else if(context===false||context==null)return inverse(this);else if(type==="[object Array]"){if(context.length>0){var i=0;for(var j=context.length;i<j;i++)ret=ret+fn(context[i])}else ret=inverse(this);return ret}else return fn(context)});
Handlebars.registerHelper("each",function(context,options){var fn=options.fn;var inverse=options.inverse;var ret="";if(context&&context.length>0){var i=0;for(var j=context.length;i<j;i++)ret=ret+fn(context[i])}else ret=inverse(this);return ret});Handlebars.registerHelper("if",function(context,options){var type=toString.call(context);if(type===functionType)context=context.call(this);if(!context||Handlebars.Utils.isEmpty(context))return options.inverse(this);else return options.fn(this)});
Handlebars.registerHelper("unless",function(context,options){var fn=options.fn;var inverse=options.inverse;options.fn=inverse;options.inverse=fn;return Handlebars.helpers["if"].call(this,context,options)});Handlebars.registerHelper("with",function(context,options){return options.fn(context)});Handlebars.registerHelper("log",function(context){Handlebars.log(context)});
var handlebars=function(){var parser={trace:function trace(){},yy:{},symbols_:{"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,
"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],
[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return $$[$0-1];break;case 2:this.$=new yy.ProgramNode($$[$0-2],$$[$0]);break;case 3:this.$=new yy.ProgramNode($$[$0]);break;case 4:this.$=new yy.ProgramNode([]);break;case 5:this.$=[$$[$0]];break;case 6:$$[$0-1].push($$[$0]);this.$=$$[$0-1];break;case 7:this.$=new yy.InverseNode($$[$0-2],$$[$0-1],$$[$0]);
break;case 8:this.$=new yy.BlockNode($$[$0-2],$$[$0-1],$$[$0]);break;case 9:this.$=$$[$0];break;case 10:this.$=$$[$0];break;case 11:this.$=new yy.ContentNode($$[$0]);break;case 12:this.$=new yy.CommentNode($$[$0]);break;case 13:this.$=new yy.MustacheNode($$[$0-1][0],$$[$0-1][1]);break;case 14:this.$=new yy.MustacheNode($$[$0-1][0],$$[$0-1][1]);break;case 15:this.$=$$[$0-1];break;case 16:this.$=new yy.MustacheNode($$[$0-1][0],$$[$0-1][1]);break;case 17:this.$=new yy.MustacheNode($$[$0-1][0],$$[$0-
1][1],true);break;case 18:this.$=new yy.PartialNode($$[$0-1]);break;case 19:this.$=new yy.PartialNode($$[$0-2],$$[$0-1]);break;case 20:break;case 21:this.$=[[$$[$0-2]].concat($$[$0-1]),$$[$0]];break;case 22:this.$=[[$$[$0-1]].concat($$[$0]),null];break;case 23:this.$=[[$$[$0-1]],$$[$0]];break;case 24:this.$=[[$$[$0]],null];break;case 25:$$[$0-1].push($$[$0]);this.$=$$[$0-1];break;case 26:this.$=[$$[$0]];break;case 27:this.$=$$[$0];break;case 28:this.$=new yy.StringNode($$[$0]);break;case 29:this.$=
new yy.IntegerNode($$[$0]);break;case 30:this.$=new yy.BooleanNode($$[$0]);break;case 31:this.$=new yy.HashNode($$[$0]);break;case 32:$$[$0-1].push($$[$0]);this.$=$$[$0-1];break;case 33:this.$=[$$[$0]];break;case 34:this.$=[$$[$0-2],$$[$0]];break;case 35:this.$=[$$[$0-2],new yy.StringNode($$[$0])];break;case 36:this.$=[$$[$0-2],new yy.IntegerNode($$[$0])];break;case 37:this.$=[$$[$0-2],new yy.BooleanNode($$[$0])];break;case 38:this.$=new yy.IdNode($$[$0]);break;case 39:$$[$0-2].push($$[$0]);this.$=
$$[$0-2];break;case 40:this.$=[$$[$0]];break}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,
6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,
33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,
38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],
20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,
30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},
{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,
23],53:[2,21]},parseError:function parseError(str,hash){throw new Error(str);},parse:function parse(input){function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}function lex(){var token;token=self.lexer.lex()||1;if(typeof token!=="number")token=self.symbols_[token]||token;return token}var self=this;var stack=[0];var vstack=[null];var lstack=[];var table=this.table;var yytext="";var yylineno=0;var yyleng=0;var recovering=0;var TERROR=2;var EOF=
1;this.lexer.setInput(input);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var yyloc=this.lexer.yylloc;lstack.push(yyloc);if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;var symbol;var preErrorSymbol;var state;var action;var a;var r;var yyval={};var p;var len;var newState;for(var expected;true;){state=stack[stack.length-1];if(this.defaultActions[state])action=this.defaultActions[state];else{if(symbol==null)symbol=
lex();action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0])if(!recovering){expected=[];for(p in table[state])if(this.terminals_[p]&&p>2)expected.push("'"+this.terminals_[p]+"'");var errStr="";if(this.lexer.showPosition)errStr="Parse error on line "+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+this.terminals_[symbol]+"'";else errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==1?"end of input":
"'"+(this.terminals_[symbol]||symbol)+"'");this.parseError(errStr,{text:this.lexer.match,token:this.terminals_[symbol]||symbol,line:this.lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1)throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol);switch(action[0]){case 1:stack.push(symbol);vstack.push(this.lexer.yytext);lstack.push(this.lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=this.lexer.yyleng;
yytext=this.lexer.yytext;yylineno=this.lexer.yylineno;yyloc=this.lexer.yylloc;if(recovering>0)recovering--}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};r=this.performAction.call(yyval,yytext,yyleng,yylineno,
this.yy,action[1],vstack,lstack);if(typeof r!=="undefined")return r;if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parseError)this.yy.parseError(str,hash);
else throw new Error(str);},setInput:function(input){this._input=input;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.match+=ch;this.matched+=ch;var lines=ch.match(/\n/);if(lines)this.yylineno++;this._input=this._input.slice(1);return ch},unput:function(ch){this._input=
ch+this._input;return this},more:function(){this._more=true;return this},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20)next+=this._input.substr(0,20-next.length);return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=(new Array(pre.length+1)).join("-");return pre+
this.upcomingInput()+"\n"+c+"^"},next:function(){if(this.done)return this.EOF;if(!this._input)this.done=true;var token;var match;var col;var lines;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;i<rules.length;i++){match=this._input.match(this.rules[rules[i]]);if(match){lines=match[0].match(/\n.*/g);if(lines)this.yylineno+=lines.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?
lines[lines.length-1].length-1:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,rules[i],this.conditionStack[this.conditionStack.length-1]);if(token)return token;else return}}if(this._input==="")return this.EOF;else this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+
this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function lex(){var r=this.next();if(typeof r!=="undefined")return r;else return this.lex()},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){return this.conditionStack.pop()},_currentRules:function _currentRules(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function begin(condition){this.begin(condition)}};
lexer.performAction=function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:if(yy_.yytext.slice(-1)!=="\\")this.begin("mu");if(yy_.yytext.slice(-1)==="\\")yy_.yytext=yy_.yytext.substr(0,yy_.yyleng-1),this.begin("emu");if(yy_.yytext)return 14;break;case 1:return 14;break;case 2:this.popState();return 14;break;case 3:return 24;break;case 4:return 16;break;case 5:return 20;break;case 6:return 19;break;case 7:return 19;break;case 8:return 23;
break;case 9:return 23;break;case 10:yy_.yytext=yy_.yytext.substr(3,yy_.yyleng-5);this.popState();return 15;break;case 11:return 22;break;case 12:return 34;break;case 13:return 33;break;case 14:return 33;break;case 15:return 36;break;case 16:break;case 17:this.popState();return 18;break;case 18:this.popState();return 18;break;case 19:yy_.yytext=yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"');return 28;break;case 20:return 30;break;case 21:return 30;break;case 22:return 29;break;case 23:return 33;
break;case 24:yy_.yytext=yy_.yytext.substr(1,yy_.yyleng-2);return 33;break;case 25:return"INVALID";break;case 26:return 5;break}};lexer.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/];lexer.conditions=
{"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,26],"inclusive":true}};return lexer}();parser.lexer=lexer;return parser}();
if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=handlebars;exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)};exports.main=function commonjsMain(args){if(!args[1])throw new Error("Usage: "+args[0]+" FILE");if(typeof process!=="undefined")var source=require("fs").readFileSync(require("path").join(process.cwd(),args[1]),"utf8");else{var cwd=require("file").path(require("file").cwd());source=cwd.join(args[1]).read({charset:"utf-8"})}return exports.parser.parse(source)};
if(typeof module!=="undefined"&&require.main===module)exports.main(typeof process!=="undefined"?process.argv.slice(1):require("system").args)}Handlebars.Parser=handlebars;Handlebars.parse=function(string){Handlebars.Parser.yy=Handlebars.AST;return Handlebars.Parser.parse(string)};Handlebars.print=function(ast){return(new Handlebars.PrintVisitor).accept(ast)};Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(level,str){}};
Handlebars.log=function(level,str){Handlebars.logger.log(level,str)};
(function(){Handlebars.AST={};Handlebars.AST.ProgramNode=function(statements,inverse){this.type="program";this.statements=statements;if(inverse)this.inverse=new Handlebars.AST.ProgramNode(inverse)};Handlebars.AST.MustacheNode=function(params,hash,unescaped){this.type="mustache";this.id=params[0];this.params=params.slice(1);this.hash=hash;this.escaped=!unescaped};Handlebars.AST.PartialNode=function(id,context){this.type="partial";this.id=id;this.context=context};var verifyMatch=function(open,close){if(open.original!==
close.original)throw new Handlebars.Exception(open.original+" doesn't match "+close.original);};Handlebars.AST.BlockNode=function(mustache,program,close){verifyMatch(mustache.id,close);this.type="block";this.mustache=mustache;this.program=program};Handlebars.AST.InverseNode=function(mustache,program,close){verifyMatch(mustache.id,close);this.type="inverse";this.mustache=mustache;this.program=program};Handlebars.AST.ContentNode=function(string){this.type="content";this.string=string};Handlebars.AST.HashNode=
function(pairs){this.type="hash";this.pairs=pairs};Handlebars.AST.IdNode=function(parts){this.type="ID";this.original=parts.join(".");var dig=[];var depth=0;var i=0;for(var l=parts.length;i<l;i++){var part=parts[i];if(part==="..")depth++;else if(part==="."||part==="this")this.isScoped=true;else dig.push(part)}this.parts=dig;this.string=dig.join(".");this.depth=depth;this.isSimple=dig.length===1&&depth===0};Handlebars.AST.StringNode=function(string){this.type="STRING";this.string=string};Handlebars.AST.IntegerNode=
function(integer){this.type="INTEGER";this.integer=integer};Handlebars.AST.BooleanNode=function(bool){this.type="BOOLEAN";this.bool=bool};Handlebars.AST.CommentNode=function(comment){this.type="comment";this.comment=comment}})();Handlebars.Exception=function(message){var tmp=Error.prototype.constructor.apply(this,arguments);for(var p in tmp)if(tmp.hasOwnProperty(p))this[p]=tmp[p];this.message=tmp.message};Handlebars.Exception.prototype=new Error;
Handlebars.SafeString=function(string){this.string=string};Handlebars.SafeString.prototype.toString=function(){return this.string.toString()};
(function(){var escape={"\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","`":"\x26#x60;"};var badChars=/&(?!\w+;)|[<>"'`]/g;var possible=/[&<>"'`]/;var escapeChar=function(chr){return escape[chr]||"\x26amp;"};Handlebars.Utils={escapeExpression:function(string){if(string instanceof Handlebars.SafeString)return string.toString();else if(string==null||string===false)return"";if(!possible.test(string))return string;return string.replace(badChars,escapeChar)},isEmpty:function(value){if(typeof value===
"undefined")return true;else if(value===null)return true;else if(value===false)return true;else if(Object.prototype.toString.call(value)==="[object Array]"&&value.length===0)return true;else return false}}})();Handlebars.Compiler=function(){};Handlebars.JavaScriptCompiler=function(){};
(function(Compiler,JavaScriptCompiler){Compiler.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16};Compiler.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,
pushStringParam:1};Compiler.DISASSEMBLE_MAP={};for(var prop in Compiler.OPCODE_MAP){var value$$0=Compiler.OPCODE_MAP[prop];Compiler.DISASSEMBLE_MAP[value$$0]=prop}Compiler.multiParamSize=function(code){return Compiler.MULTI_PARAM_OPCODES[Compiler.DISASSEMBLE_MAP[code]]};Compiler.prototype={compiler:Compiler,disassemble:function(){var opcodes=this.opcodes;var opcode;var nextCode;var out=[];var str;var name;var value;var i=0;for(var l=opcodes.length;i<l;i++){opcode=opcodes[i];if(opcode==="DECLARE"){name=
opcodes[++i];value=opcodes[++i];out.push("DECLARE "+name+" \x3d "+value)}else{str=Compiler.DISASSEMBLE_MAP[opcode];var extraParams=Compiler.multiParamSize(opcode);var codes=[];for(var j=0;j<extraParams;j++){nextCode=opcodes[++i];if(typeof nextCode==="string")nextCode='"'+nextCode.replace("\n","\\n")+'"';codes.push(nextCode)}str=str+" "+codes.join(" ");out.push(str)}}return out.join("\n")},guid:0,compile:function(program,options){this.children=[];this.depths={list:[]};this.options=options;var knownHelpers=
this.options.knownHelpers;this.options.knownHelpers={"helperMissing":true,"blockHelperMissing":true,"each":true,"if":true,"unless":true,"with":true,"log":true};if(knownHelpers)for(var name in knownHelpers)this.options.knownHelpers[name]=knownHelpers[name];return this.program(program)},accept:function(node){return this[node.type](node)},program:function(program){var statements=program.statements;var statement;this.opcodes=[];var i=0;for(var l=statements.length;i<l;i++){statement=statements[i];this[statement.type](statement)}this.isSimple=
l===1;this.depths.list=this.depths.list.sort(function(a,b){return a-b});return this},compileProgram:function(program){var result=(new this.compiler).compile(program,this.options);var guid=this.guid++;this.usePartial=this.usePartial||result.usePartial;this.children[guid]=result;var i=0;for(var l=result.depths.list.length;i<l;i++){depth=result.depths.list[i];if(depth<2)continue;else this.addDepth(depth-1)}return guid},block:function(block){var mustache=block.mustache;var depth;var child;var inverse;
var inverseGuid;var params=this.setupStackForMustache(mustache);var programGuid=this.compileProgram(block.program);if(block.program.inverse){inverseGuid=this.compileProgram(block.program.inverse);this.declare("inverse",inverseGuid)}this.opcode("invokeProgram",programGuid,params.length,!!mustache.hash);this.declare("inverse",null);this.opcode("append")},inverse:function(block){var params=this.setupStackForMustache(block.mustache);var programGuid=this.compileProgram(block.program);this.declare("inverse",
programGuid);this.opcode("invokeProgram",null,params.length,!!block.mustache.hash);this.declare("inverse",null);this.opcode("append")},hash:function(hash){var pairs=hash.pairs;var pair;var val;this.opcode("push","{}");var i=0;for(var l=pairs.length;i<l;i++){pair=pairs[i];val=pair[1];this.accept(val);this.opcode("assignToHash",pair[0])}},partial:function(partial){var id=partial.id;this.usePartial=true;if(partial.context)this.ID(partial.context);else this.opcode("push","depth0");this.opcode("invokePartial",
id.original);this.opcode("append")},content:function(content){this.opcode("appendContent",content.string)},mustache:function(mustache){var params=this.setupStackForMustache(mustache);this.opcode("invokeMustache",params.length,mustache.id.original,!!mustache.hash);if(mustache.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},ID:function(id){this.addDepth(id.depth);this.opcode("getContext",id.depth);this.opcode("lookupWithHelpers",id.parts[0]||null,id.isScoped||
false);var i=1;for(var l=id.parts.length;i<l;i++)this.opcode("lookup",id.parts[i])},STRING:function(string){this.opcode("pushString",string.string)},INTEGER:function(integer){this.opcode("push",integer.integer)},BOOLEAN:function(bool){this.opcode("push",bool.bool)},comment:function(){},pushParams:function(params){var i=params.length;for(var param;i--;){param=params[i];if(this.options.stringParams){if(param.depth)this.addDepth(param.depth);this.opcode("getContext",param.depth||0);this.opcode("pushStringParam",
param.string)}else this[param.type](param)}},opcode:function(name,val1,val2,val3){this.opcodes.push(Compiler.OPCODE_MAP[name]);if(val1!==undefined)this.opcodes.push(val1);if(val2!==undefined)this.opcodes.push(val2);if(val3!==undefined)this.opcodes.push(val3)},declare:function(name,value){this.opcodes.push("DECLARE");this.opcodes.push(name);this.opcodes.push(value)},addDepth:function(depth){if(depth===0)return;if(!this.depths[depth]){this.depths[depth]=true;this.depths.list.push(depth)}},setupStackForMustache:function(mustache){var params=
mustache.params;this.pushParams(params);if(mustache.hash)this.hash(mustache.hash);this.ID(mustache.id);return params}};JavaScriptCompiler.prototype={nameLookup:function(parent,name,type){if(/^[0-9]+$/.test(name))return parent+"["+name+"]";else if(JavaScriptCompiler.isValidJavaScriptVariableName(name))return parent+"."+name;else return parent+"['"+name+"']"},appendToBuffer:function(string){if(this.environment.isSimple)return"return "+string+";";else return"buffer +\x3d "+string+";"},initializeBuffer:function(){return this.quotedString("")},
namespace:"Handlebars",compile:function(environment,options,context,asObject){this.environment=environment;this.options=options||{};this.name=this.environment.name;this.isChild=!!context;this.context=context||{programs:[],aliases:{self:"this"},registers:{list:[]}};this.preamble();this.stackSlot=0;this.stackVars=[];this.compileChildren(environment,options);var opcodes=environment.opcodes;var opcode;this.i=0;for(l$$0=opcodes.length;this.i<l$$0;this.i++){opcode=this.nextOpcode(0);if(opcode[0]==="DECLARE"){this.i=
this.i+2;this[opcode[1]]=opcode[2]}else{this.i=this.i+opcode[1].length;this[opcode[0]].apply(this,opcode[1])}}return this.createFunctionContext(asObject)},nextOpcode:function(n){var opcodes=this.environment.opcodes;var opcode=opcodes[this.i+n];var name;var val;var extraParams;var codes;if(opcode==="DECLARE"){name=opcodes[this.i+1];val=opcodes[this.i+2];return["DECLARE",name,val]}else{name=Compiler.DISASSEMBLE_MAP[opcode];extraParams=Compiler.multiParamSize(opcode);codes=[];for(var j=0;j<extraParams;j++)codes.push(opcodes[this.i+
j+1+n]);return[name,codes]}},eat:function(opcode){this.i=this.i+opcode.length},preamble:function(){var out=[];this.useRegister("foundHelper");if(!this.isChild){var namespace=this.namespace;var copies="helpers \x3d helpers || "+namespace+".helpers;";if(this.environment.usePartial)copies=copies+" partials \x3d partials || "+namespace+".partials;";out.push(copies)}else out.push("");if(!this.environment.isSimple)out.push(", buffer \x3d "+this.initializeBuffer());else out.push("");this.lastContext=0;this.source=
out},createFunctionContext:function(asObject){var locals=this.stackVars;if(!this.isChild)locals=locals.concat(this.context.registers.list);if(locals.length>0)this.source[1]=this.source[1]+", "+locals.join(", ");if(!this.isChild){var aliases=[];for(var alias in this.context.aliases)this.source[1]=this.source[1]+", "+alias+"\x3d"+this.context.aliases[alias]}if(this.source[1])this.source[1]="var "+this.source[1].substring(2)+";";if(!this.isChild)this.source[1]+="\n"+this.context.programs.join("\n")+
"\n";if(!this.environment.isSimple)this.source.push("return buffer;");var params=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];var i=0;for(var l=this.environment.depths.list.length;i<l;i++)params.push("depth"+this.environment.depths.list[i]);if(asObject){params.push(this.source.join("\n  "));return Function.apply(this,params)}else{var functionSource="function "+(this.name||"")+"("+params.join(",")+") {\n  "+this.source.join("\n  ")+"}";Handlebars.log(Handlebars.logger.DEBUG,
functionSource+"\n\n");return functionSource}},appendContent:function(content){this.source.push(this.appendToBuffer(this.quotedString(content)))},append:function(){var local=this.popStack();this.source.push("if("+local+" || "+local+" \x3d\x3d\x3d 0) { "+this.appendToBuffer(local)+" }");if(this.environment.isSimple)this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var opcode=this.nextOpcode(1);var extra="";this.context.aliases.escapeExpression="this.escapeExpression";
if(opcode[0]==="appendContent"){extra=" + "+this.quotedString(opcode[1][0]);this.eat(opcode)}this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+extra))},getContext:function(depth){if(this.lastContext!==depth)this.lastContext=depth},lookupWithHelpers:function(name,isScoped){if(name){var topStack=this.nextStack();this.usingKnownHelper=false;var toPush;if(!isScoped&&this.options.knownHelpers[name]){toPush=topStack+" \x3d "+this.nameLookup("helpers",name,"helper");this.usingKnownHelper=
true}else if(isScoped||this.options.knownHelpersOnly)toPush=topStack+" \x3d "+this.nameLookup("depth"+this.lastContext,name,"context");else{this.register("foundHelper",this.nameLookup("helpers",name,"helper"));toPush=topStack+" \x3d foundHelper || "+this.nameLookup("depth"+this.lastContext,name,"context")}toPush+=";";this.source.push(toPush)}else this.pushStack("depth"+this.lastContext)},lookup:function(name){var topStack=this.topStack();this.source.push(topStack+" \x3d ("+topStack+" \x3d\x3d\x3d null || "+
topStack+" \x3d\x3d\x3d undefined || "+topStack+" \x3d\x3d\x3d false ? "+topStack+" : "+this.nameLookup(topStack,name,"context")+");")},pushStringParam:function(string){this.pushStack("depth"+this.lastContext);this.pushString(string)},pushString:function(string){this.pushStack(this.quotedString(string))},push:function(name){this.pushStack(name)},invokeMustache:function(paramSize,original,hasHash){this.populateParams(paramSize,this.quotedString(original),"{}",null,hasHash,function(nextStack,helperMissingString,
id){if(!this.usingKnownHelper){this.context.aliases.helperMissing="helpers.helperMissing";this.context.aliases.undef="void 0";this.source.push("else if("+id+"\x3d\x3d\x3d undef) { "+nextStack+" \x3d helperMissing.call("+helperMissingString+"); }");if(nextStack!==id)this.source.push("else { "+nextStack+" \x3d "+id+"; }")}})},invokeProgram:function(guid,paramSize,hasHash){var inverse=this.programExpression(this.inverse);var mainProgram=this.programExpression(guid);this.populateParams(paramSize,null,
mainProgram,inverse,hasHash,function(nextStack,helperMissingString,id){if(!this.usingKnownHelper){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";this.source.push("else { "+nextStack+" \x3d blockHelperMissing.call("+helperMissingString+"); }")}})},populateParams:function(paramSize,helperId,program,inverse,hasHash,fn){var needsRegister=hasHash||this.options.stringParams||inverse||this.options.data;var id=this.popStack();var nextStack;var params=[];var param;var stringParam;var stringOptions;
if(needsRegister){this.register("tmp1",program);stringOptions="tmp1"}else stringOptions="{ hash: {} }";if(needsRegister){var hash=hasHash?this.popStack():"{}";this.source.push("tmp1.hash \x3d "+hash+";")}if(this.options.stringParams)this.source.push("tmp1.contexts \x3d [];");for(var i=0;i<paramSize;i++){param=this.popStack();params.push(param);if(this.options.stringParams)this.source.push("tmp1.contexts.push("+this.popStack()+");")}if(inverse){this.source.push("tmp1.fn \x3d tmp1;");this.source.push("tmp1.inverse \x3d "+
inverse+";")}if(this.options.data)this.source.push("tmp1.data \x3d data;");params.push(stringOptions);this.populateCall(params,id,helperId||id,fn,program!=="{}")},populateCall:function(params,id,helperId,fn,program){var paramString=["depth0"].concat(params).join(", ");var helperMissingString=["depth0"].concat(helperId).concat(params).join(", ");var nextStack=this.nextStack();if(this.usingKnownHelper)this.source.push(nextStack+" \x3d "+id+".call("+paramString+");");else{this.context.aliases.functionType=
'"function"';var condition=program?"foundHelper \x26\x26 ":"";this.source.push("if("+condition+"typeof "+id+" \x3d\x3d\x3d functionType) { "+nextStack+" \x3d "+id+".call("+paramString+"); }")}fn.call(this,nextStack,helperMissingString,id);this.usingKnownHelper=false},invokePartial:function(context){params=[this.nameLookup("partials",context,"partial"),"'"+context+"'",this.popStack(),"helpers","partials"];if(this.options.data)params.push("data");this.pushStack("self.invokePartial("+params.join(", ")+
");")},assignToHash:function(key){var value=this.popStack();var hash=this.topStack();this.source.push(hash+"['"+key+"'] \x3d "+value+";")},compiler:JavaScriptCompiler,compileChildren:function(environment,options){var children=environment.children;var child;var compiler;var i=0;for(var l=children.length;i<l;i++){child=children[i];compiler=new this.compiler;this.context.programs.push("");var index=this.context.programs.length;child.index=index;child.name="program"+index;this.context.programs[index]=
compiler.compile(child,options,this.context)}},programExpression:function(guid){if(guid==null)return"self.noop";var child=this.environment.children[guid];var depths=child.depths.list;var programParams=[child.index,child.name,"data"];var i=0;for(var l=depths.length;i<l;i++){depth=depths[i];if(depth===1)programParams.push("depth0");else programParams.push("depth"+(depth-1))}if(depths.length===0)return"self.program("+programParams.join(", ")+")";else{programParams.shift();return"self.programWithDepth("+
programParams.join(", ")+")"}},register:function(name,val){this.useRegister(name);this.source.push(name+" \x3d "+val+";")},useRegister:function(name){if(!this.context.registers[name]){this.context.registers[name]=true;this.context.registers.list.push(name)}},pushStack:function(item){this.source.push(this.nextStack()+" \x3d "+item+";");return"stack"+this.stackSlot},nextStack:function(){this.stackSlot++;if(this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return"stack"+
this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(str){return'"'+str.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var reservedWords=("break else new var"+" case finally return void"+" catch for switch while"+" continue function this with"+" default if throw"+" delete in try"+" do instanceof typeof"+" abstract enum int short"+" boolean export interface static"+" byte extends long super"+
" char final native synchronized"+" class float package throws"+" const goto private transient"+" debugger implements protected volatile"+" double import public let yield").split(" ");var compilerWords=JavaScriptCompiler.RESERVED_WORDS={};var i$$0=0;for(var l$$0=reservedWords.length;i$$0<l$$0;i$$0++)compilerWords[reservedWords[i$$0]]=true;JavaScriptCompiler.isValidJavaScriptVariableName=function(name){if(!JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name))return true;
return false}})(Handlebars.Compiler,Handlebars.JavaScriptCompiler);Handlebars.precompile=function(string,options){options=options||{};var ast=Handlebars.parse(string);var environment=(new Handlebars.Compiler).compile(ast,options);return(new Handlebars.JavaScriptCompiler).compile(environment,options)};
Handlebars.compile=function(string,options$$0){function compile(){var ast=Handlebars.parse(string);var environment=(new Handlebars.Compiler).compile(ast,options$$0);var templateSpec=(new Handlebars.JavaScriptCompiler).compile(environment,options$$0,undefined,true);return Handlebars.template(templateSpec)}options$$0=options$$0||{};var compiled;return function(context,options){if(!compiled)compiled=compile();return compiled.call(this,context,options)}};
Handlebars.VM={template:function(templateSpec){var container={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(i,fn,data){var programWrapper=this.programs[i];if(data)return Handlebars.VM.program(fn,data);else if(programWrapper)return programWrapper;else{programWrapper=this.programs[i]=Handlebars.VM.program(fn);return programWrapper}},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(context,
options){options=options||{};return templateSpec.call(container,Handlebars,context,options.helpers,options.partials,options.data)}},programWithDepth:function(fn,data,$depth){var args=Array.prototype.slice.call(arguments,2);return function(context,options){options=options||{};return fn.apply(this,[context,options.data||data].concat(args))}},program:function(fn,data){return function(context,options){options=options||{};return fn(context,options.data||data)}},noop:function(){return""},invokePartial:function(partial,
name,context,helpers,partials,data){options={helpers:helpers,partials:partials,data:data};if(partial===undefined)throw new Handlebars.Exception("The partial "+name+" could not be found");else if(partial instanceof Function)return partial(context,options);else if(!Handlebars.compile)throw new Handlebars.Exception("The partial "+name+" could not be compiled when running in runtime-only mode");else{partials[name]=Handlebars.compile(partial);return partials[name](context,options)}}};
Handlebars.template=Handlebars.VM.template;
fitbit=window["fitbit"]||{};fitbit.User=function(opts){this.heightSystem=opts.heightSystem;this.weightSystem=opts.weightSystem;this.startDayOfWeek=opts.startDayOfWeek};
fitbit.User.prototype.formatWeight=function(grams){var lbs=grams/453.592;lbs=Math.round(lbs*10)/10;var kgs=grams/1E3;kgs=Math.round(kgs*10)/10;switch(this.weightSystem){case "UK":var st=Math.floor(lbs/14);lbs=lbs-14*st;lbs=Math.round(lbs*10)/10;return jQuery.formatNumber(st,{format:"#,##0.#",locale:fitbit.i18n.locale})+" \x3cspan class\x3d'units'\x3est\x3c/span\x3e "+jQuery.formatNumber(lbs,{format:"#,##0.#",locale:fitbit.i18n.locale})+" \x3cspan class\x3d'units'\x3elbs\x3c/span\x3e";case "METRIC":return jQuery.formatNumber(kgs,
{format:"#,##0.#",locale:fitbit.i18n.locale})+" \x3cspan class\x3d'units'\x3ekg\x3c/span\x3e";case "US":default:return jQuery.formatNumber(lbs,{format:"#,##0.#",locale:fitbit.i18n.locale})+" \x3cspan class\x3d'units'\x3elbs\x3c/span\x3e"}};
jQuery.subcookie=function(name,part,value,options){var helper={set:function(name,part,value,options){options=options||{};if(value===null){value="";if(!part)options.expires=-1}if(part){var full={};var existing=this.get(name);if(existing)full=this.parseCookieHash(existing);full[part]=value;value=this.createCookieHashString(full)}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date;date.setTime(date.getTime()+
options.expires*24*60*60*1E3)}else date=options.expires;expires="; expires\x3d"+date.toUTCString()}var path=options.path?"; path\x3d"+options.path:"";var domain=options.domain?"; domain\x3d"+options.domain:"";var secure=options.secure?"; secure":"";document.cookie=[name,"\x3d",encodeURIComponent(value),expires,path,domain,secure].join("")},get:function(name,part){var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookie=
jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==name+"\x3d"){var temp=decodeURIComponent(cookie.substring(name.length+1));if(!part)cookieValue=temp;else{var cookieElements=this.parseCookieHash(temp);cookieValue=cookieElements[part]}break}}}return cookieValue},parseCookieHash:function(text){var hashParts=text.split("\x26");var hashPart=null;var hash={};if(text.length>0){var i=0;for(var len=hashParts.length;i<len;i++){hashPart=hashParts[i].split("\x3d");hash[decodeURIComponent(hashPart[0])]=
decodeURIComponent(hashPart[1])}}return hash},createCookieHashString:function(hash){var text=[];for(var key in hash)text.push(key+"\x3d"+String(hash[key]));return text.join("\x26")}};if(typeof value!="undefined")helper.set(name,part,value,options);else return helper.get(name,part)};
jQuery("#sitenav ul ul").parent().addClass("hasdropdown");jQuery("#sitenav ul ul ul").each(function(){jQuery(this).css({left:jQuery(this).parent().parent().outerWidth()+2})});jQuery("#sitenav nav \x3e ul \x3e li \x3e a").wrapInner("\x3cb\x3e\x3c/b\x3e");
jQuery("#sitenav nav ul section").each(function(){jQuery(this).attr({id:"glance"});jQuery("#sitenav .menu-heading + ul \x3e li:nth-child(2) \x3e a").addClass("features").append("\x3cs\x3e\x3c/s\x3e");jQuery(this).insertAfter("#sitenav");jQuery(this).find("li").each(function(){jQuery(this).find("a").clone().empty().insertBefore(this);jQuery(this).appendTo(jQuery(this).prev());jQuery(this).before("\x3cspan\x3e\x3c/span\x3e");jQuery(this).find("a").removeAttr("href").insertAfter(this);var alink=jQuery(this).parent().attr("href");
alink=alink.slice(alink.indexOf("#")+1);jQuery(this).parent().addClass(alink);if(jQuery.browser.version.substring(0,1)<9)jQuery(this).parent().hover(function(){jQuery(this).css({behavior:"url(/js/lib/css3pie/1.0beta4/PIE.htc)"})},function(){jQuery(this).css({behavior:"none"})})});var featuresDropDown=jQuery("#featuresdropdown");featuresDropDown.after('\x3cb class\x3d"preload"\x3e\x3ci\x3e\x3c/i\x3e\x3c/b\x3e').hide().prev().mouseup(function(){featuresDropDown.prev().blur()}).click(function(){featuresDropDown.parent().toggleClass("show");
featuresDropDown.toggle();return false});jQuery("#featuresdetail").attr({href:featuresDropDown.prev().attr("href")});var glance=jQuery(this);glance.after('\x3cb class\x3d"preload"\x3e\x3ci\x3e\x3cs\x3e\x3c/s\x3e\x3c/i\x3e\x3c/b\x3e').hide();jQuery("#openglance").click(function(){if(glance.css("display")=="block")return;glance.slideToggle(500,"easeInOutCubic");featuresDropDown.toggle();featuresDropDown.parent().toggleClass("show")});jQuery("#clsglance").click(function(){glance.slideToggle(500,"easeInOutCubic");
featuresDropDown.hide();featuresDropDown.parent().removeClass("show")})});
if(jQuery("#intro").length){jQuery("#intro").prepend('\x3cdiv id\x3d"laptop"\x3e\x3c/div\x3e');jQuery("#deep section").each(function(){jQuery(this).insertBefore(jQuery(this).prev().prev());var LIs=jQuery(this).find("li");LIs.slice(0,2).wrapAll("\x3cdiv\x3e\x3c/div\x3e");LIs.slice(2,5).wrapAll("\x3cdiv\x3e\x3c/div\x3e");LIs.slice(5).wrapAll("\x3cdiv\x3e\x3c/div\x3e");LIs.last().append(jQuery(this).find("span"))});jQuery("#tracker aside").each(function(){var text=jQuery(this).find("p").text();jQuery(this).prependTo(this.parentNode).find("p").text(text.replace(text.charAt(0),
""));jQuery(this).nextUntil("section").wrapAll("\x3cdiv\x3e\x3c/div\x3e");jQuery(this).parent().find("section").children("a").each(function(){jQuery(this).prependTo(this.parentNode)})})}
if(jQuery("#fit").length){jQuery("#fit").each(function(){jQuery(this).find("ul").addClass("thumbs").before('\x3cdiv id\x3d"fitslides"\x3e\x3c/div\x3e');jQuery(this).find("img").each(function(){jQuery(this).wrap('\x3ca class\x3d"thumb"\x3e\x3c/a\x3e').parent().attr({href:jQuery(this).attr("src")})}).eq(0).clone().attr({id:"fitslidesfirst"}).appendTo(this)}).galleriffic({delay:7E3,autoStart:true,preloadAhead:-1,syncTransitions:true,imageContainerSel:"#fitslides",defaultTransitionDuration:600});jQuery("#fit aside a").each(function(){jQuery(this).parent().wrapInner('\x3ca class\x3d"wrapper"\x3e\x3c/a\x3e');
jQuery(this).parent().attr({href:jQuery(this).attr("href")})});jQuery("#major li").each(function(){jQuery(this).find("img").wrap("\x3cb\x3e\x3c/b\x3e");jQuery(this).wrapInner('\x3cspan class\x3d"wrapper"\x3e\x3c/span\x3e')});jQuery("#major ul").jcarousel({scroll:4,animation:750,easing:"easeInOutCubic",initCallback:function(thisCarousel,initState){jQuery(".jcarousel-item").each(function(index){var newATag=jQuery(this).find("a.wrapper");var origATagClass=jQuery(this).find("a.wrapper a").attr("class");
newATag.addClass(origATagClass);jQuery(this).find("a.wrapper a").attr("class","")})}});jQuery("#stories, #press").each(function(){jQuery(this).find("p").each(function(){jQuery(this).html(jQuery(this).html().replace(jQuery(this).html().charAt(0),"\x3cb\x3e\x3c/b\x3e"))});jQuery(this).find("cite").each(function(){if(jQuery(this).html().indexOf("|")!=-1)jQuery(this).html(jQuery(this).html().replace("|","\x3cb\x3e|\x3c/b\x3e"));else jQuery(this).addClass("notperson")});jQuery(this).wrapInner('\x3cspan class\x3d"wrapper"\x3e\x3c/span\x3e');
jQuery(this).find("h3");jQuery(this).find("img").wrap("\x3ctable\x3e\x3ctd style\x3d'padding:0;'\x3e\x3c/td\x3e\x3c/table\x3e")}).wrapAll('\x3cdiv id\x3d"ravespair"\x3e\x3c/div\x3e').parent().css({behavior:"url(/js/lib/css3pie/1.0beta4/PIE.htc)"});jQuery("#press ul").galleryView({transition_speed:600,transition_interval:7E3,easing:"easeInOutQuad"});jQuery("#prodnav ul").prepend("\x3cli\x3e\x3c/li\x3e");jQuery("a.wrapper").click(function(e){e.preventDefault()})}
if(jQuery("#gallery").length){jQuery("#gallery").each(function(){jQuery(this).find("ul").addClass("thumbs").before('\x3cdiv id\x3d"galleryslides"\x3e\x3c/div\x3e').find("a").addClass("thumb").each(function(){this.onmousedown=function(){this.blur();this.hideFocus=true;this.style.outline="none"};this.onmouseout=this.onmouseup=function(){this.blur();this.hideFocus=false;this.style.outline=""}})}).galleriffic({preloadAhead:-1,syncTransitions:true,imageContainerSel:"#galleryslides",defaultTransitionDuration:600});
jQuery("#testimonials p").each(function(){var text=jQuery(this).text();jQuery(this).text(text.replace(text.charAt(0),""))});jQuery("#res").each(function(){jQuery(this).appendTo("#custquote").addClass("moved").css({behavior:"url(/js/lib/css3pie/1.0beta4/PIE.htc)"})})}else if(jQuery("section.activity").length){jQuery("section.activity aside").each(function(){jQuery(this).addClass("moved").parent().prepend(this)});jQuery("section.prog ul, section.wearable ul").initMenu();jQuery(".tools").prepend('\x3cdiv id\x3d"laptop"\x3e\x3c/div\x3e');
jQuery("section.wireless, section.social, section.logging, section.mobile").wrapAll('\x3cdiv id\x3d"quat"\x3e\x3c/div\x3e').first().before('\x3cdiv id\x3d"quatbtmbg"\x3e\x3c/div\x3e');jQuery("section.apps ul").each(function(){jQuery(this).addClass("moved").parent().prepend(this)})}
if(jQuery("#media").length){if(jQuery("#custstories").length){var storiesUL=jQuery("#custstories ul");storiesUL.append('\x3col id\x3d"custstoriesnav" class\x3d"filmstrip"\x3e\x3c/ol\x3e');var storiesNav=jQuery("#custstoriesnav");storiesUL.find("li").each(function(i){jQuery(this).css({visibility:"visible"}).find("p").each(function(){jQuery(this).html(jQuery(this).html().replace(jQuery(this).html().charAt(0),""))});storiesNav.append('\x3cli index\x3d"'+(i+1)+'" class\x3d"'+jQuery(this).attr("class")+
'"\x3e\x3cb\x3e\x3c/b\x3e\x3c/li\x3e')});storiesUL.galleryView({transition_speed:400,transition_interval:36E5,easing:"easeInOutCubic"})}jQuery("#media ul + ul").attr({id:"mediaacc"});jQuery("#mediaacc").each(function(){jQuery(this).find("h3").each(function(){jQuery(this).appendTo(this.parentNode).prev().wrap("\x3cb\x3e\x3c/b\x3e")})}).initMenu();jQuery("#awards").each(function(){var UL=jQuery(this).find("ul");var LI=jQuery(this).find("li");var numPerGroup=Math.ceil(LI.length/3);for(var i=0;i<3;i++){UL.append("\x3cdiv\x3e\x3c/div\x3e");
for(var j=0;j<LI.length;j++){if(jQuery(this).find("li").eq(0).parent().get(0).tagName.match(/ul/i))jQuery(this).find("li").eq(0).appendTo(UL.get(0).lastChild);if((j+1)%numPerGroup===0)break}}})}else if(jQuery("#specshdr").length){jQuery("#specshdr nav li.cur").append("\x3cspan\x3e\x3c/span\x3e");jQuery(".batt th, .browsers th, .env th").each(function(){jQuery(this).addClass(this.innerHTML.toLowerCase())})}
if(jQuery.browser.msie)jQuery("#fit a.wrapper").live("click",function(e){var href=jQuery(this).attr("href");window.location=href;e.preventDefault()});
if(jQuery.browser.msie&&jQuery.browser.version.substring(0,1)<9){jQuery("#sitenav li").each(function(){var UL=jQuery(this).children("ul");var styleTop;if(typeof jQuery(this).parent().parent().attr("id")!="undefined"&&jQuery(this).parent().parent().attr("id")=="sitenav")styleTop=38;else styleTop=-1;UL.css({display:"none",top:-5E3});jQuery(this).hover(function(){UL.css({display:"block",behavior:"url(/js/lib/css3pie/1.0beta4/PIE.htc)"});UL.each(function(){jQuery(this).children("li").css({width:jQuery(this).width()})});
ULTimeout=setTimeout(function(){UL.css({top:styleTop})},350)},function(){UL.css({top:-5E3,display:"none",behavior:"none"});clearTimeout(ULTimeout)})});jQuery("#sitenav li ul a, #major a.wrapper").css({behavior:"url(/js/lib/css3pie/1.0beta4/PIE.htc)"});jQuery("#incl").css({backgroundColor:"white",backgroundImage:"none"});jQuery("html").addClass("ie7-8");jQuery("#major a.wrapper, #press a.wrapper, #stories a.wrapper").live("click",function(e){var href=jQuery(this).attr("href");window.location=href;
e.preventDefault()});if(jQuery.browser.version.substring(0,2)=="7."){jQuery("#specshdr h2").each(function(){jQuery(this).addClass("moved").appendTo(this.parentNode)});jQuery("#browsers th").each(function(){jQuery('\x3cb style\x3d"width: '+jQuery(this).outerWidth()+'px"\x3e\x3c/b\x3e').appendTo(this)})}else if(jQuery.browser.version.substring(0,2)=="8.")jQuery("html").addClass("ie8")}else{jQuery("html").addClass("not-ie7-8");if(jQuery.browser.mozilla)jQuery("html").addClass("ff");else if(jQuery.browser.webkit){jQuery("html").addClass("webkit");
if(/Chrome/.test(navigator.userAgent))jQuery("html").addClass("chrome");else jQuery("html").addClass("safari")}};
