// jquery.cluetip.1.2.5.min.js
// Serving code from the file
// jquery.sticky-kit.min.js
// Serving code from the file
// jquery.scrollto.min.js
// Serving code from the file
(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'&&typeof require==='function'){factory(require('jquery'));}else{factory(jQuery);}}(function($){'use strict';var
utils=(function(){return{escapeRegExChars:function(value){return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");},createNode:function(containerClass){var div=document.createElement('div');div.className=containerClass;div.style.position='absolute';div.style.display='none';return div;}};}()),keys={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};function Autocomplete(el,options){var noop=function(){},that=this,defaults={ajaxSettings:{},autoSelectFirst:false,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,width:'auto',minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:Autocomplete.formatResult,delimiter:null,zIndex:9999,type:'GET',noCache:false,onSearchStart:noop,onSearchComplete:noop,onSearchError:noop,preserveInput:false,containerClass:'autocomplete-suggestions',tabDisabled:false,dataType:'text',currentRequest:null,triggerSelectOnValidInput:true,preventBadQueries:true,lookupFilter:function(suggestion,originalQuery,queryLowerCase){return suggestion.value.toLowerCase().indexOf(queryLowerCase)!==-1;},paramName:'query',transformResult:function(response){return typeof response==='string'?$.parseJSON(response):response;},showNoSuggestionNotice:false,noSuggestionNotice:'No results',orientation:'bottom',forceFixPosition:false};that.element=el;that.el=$(el);that.suggestions=[];that.badQueries=[];that.selectedIndex=-1;that.currentValue=that.element.value;that.intervalId=0;that.cachedResponse={};that.onChangeInterval=null;that.onChange=null;that.isLocal=false;that.suggestionsContainer=null;that.noSuggestionsContainer=null;that.options=$.extend({},defaults,options);that.classes={selected:'autocomplete-selected',suggestion:'autocomplete-suggestion'};that.hint=null;that.hintValue='';that.selection=null;that.initialize();that.setOptions(options);}
Autocomplete.utils=utils;$.Autocomplete=Autocomplete;Autocomplete.formatResult=function(suggestion,currentValue){var pattern='('+utils.escapeRegExChars(currentValue)+')';return suggestion.value.replace(new RegExp(pattern,'gi'),'<strong>$1<\/strong>').replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/&lt;(\/?strong)&gt;/g,'<$1>');};Autocomplete.prototype={killerFn:null,initialize:function(){var that=this,suggestionSelector='.'+that.classes.suggestion,selected=that.classes.selected,options=that.options,container;that.element.setAttribute('autocomplete','off');that.killerFn=function(e){if($(e.target).closest('.'+that.options.containerClass).length===0){that.killSuggestions();that.disableKillerFn();}};that.noSuggestionsContainer=$('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0);that.suggestionsContainer=Autocomplete.utils.createNode(options.containerClass);container=$(that.suggestionsContainer);container.appendTo(options.appendTo);if(options.width!=='auto'){container.width(options.width);}
container.on('mouseover.autocomplete',suggestionSelector,function(){that.activate($(this).data('index'));});container.on('mouseout.autocomplete',function(){that.selectedIndex=-1;container.children('.'+selected).removeClass(selected);});container.on('click.autocomplete',suggestionSelector,function(){that.select($(this).data('index'));});that.fixPositionCapture=function(){if(that.visible){that.fixPosition();}};$(window).on('resize.autocomplete',that.fixPositionCapture);that.el.on('keydown.autocomplete',function(e){that.onKeyPress(e);});that.el.on('keyup.autocomplete',function(e){that.onKeyUp(e);});that.el.on('blur.autocomplete',function(){that.onBlur();});that.el.on('focus.autocomplete',function(){that.onFocus();});that.el.on('change.autocomplete',function(e){that.onKeyUp(e);});that.el.on('input.autocomplete',function(e){that.onKeyUp(e);});},onFocus:function(){var that=this;that.fixPosition();if(that.options.minChars===0&&that.el.val().length===0){that.onValueChange();}},onBlur:function(){this.enableKillerFn();},abortAjax:function(){var that=this;if(that.currentRequest){that.currentRequest.abort();that.currentRequest=null;}},setOptions:function(suppliedOptions){var that=this,options=that.options;$.extend(options,suppliedOptions);that.isLocal=$.isArray(options.lookup);if(that.isLocal){options.lookup=that.verifySuggestionsFormat(options.lookup);}
options.orientation=that.validateOrientation(options.orientation,'bottom');$(that.suggestionsContainer).css({'max-height':options.maxHeight+'px','width':options.width+'px','z-index':options.zIndex});},clearCache:function(){this.cachedResponse={};this.badQueries=[];},clear:function(){this.clearCache();this.currentValue='';this.suggestions=[];},disable:function(){var that=this;that.disabled=true;clearInterval(that.onChangeInterval);that.abortAjax();},enable:function(){this.disabled=false;},fixPosition:function(){var that=this,$container=$(that.suggestionsContainer),containerParent=$container.parent().get(0);if(containerParent!==document.body&&!that.options.forceFixPosition){return;}
var orientation=that.options.orientation,containerHeight=$container.outerHeight(),height=that.el.outerHeight(),offset=that.el.offset(),styles={'top':offset.top,'left':offset.left};if(orientation==='auto'){var viewPortHeight=$(window).height(),scrollTop=$(window).scrollTop(),topOverflow=-scrollTop+offset.top-containerHeight,bottomOverflow=scrollTop+viewPortHeight-(offset.top+height+containerHeight);orientation=(Math.max(topOverflow,bottomOverflow)===topOverflow)?'top':'bottom';}
if(orientation==='top'){styles.top+=-containerHeight;}else{styles.top+=height;}
if(containerParent!==document.body){var opacity=$container.css('opacity'),parentOffsetDiff;if(!that.visible){$container.css('opacity',0).show();}
parentOffsetDiff=$container.offsetParent().offset();styles.top-=parentOffsetDiff.top;styles.left-=parentOffsetDiff.left;if(!that.visible){$container.css('opacity',opacity).hide();}}
if(that.options.width==='auto'){styles.width=(that.el.outerWidth()-2)+'px';}
$container.css(styles);},enableKillerFn:function(){var that=this;$(document).on('click.autocomplete',that.killerFn);},disableKillerFn:function(){var that=this;$(document).off('click.autocomplete',that.killerFn);},killSuggestions:function(){var that=this;that.stopKillSuggestions();that.intervalId=window.setInterval(function(){if(that.visible){that.el.val(that.currentValue);that.hide();}
that.stopKillSuggestions();},50);},stopKillSuggestions:function(){window.clearInterval(this.intervalId);},isCursorAtEnd:function(){var that=this,valLength=that.el.val().length,selectionStart=that.element.selectionStart,range;if(typeof selectionStart==='number'){return selectionStart===valLength;}
if(document.selection){range=document.selection.createRange();range.moveStart('character',-valLength);return valLength===range.text.length;}
return true;},onKeyPress:function(e){var that=this;if(!that.disabled&&!that.visible&&e.which===keys.DOWN&&that.currentValue){that.suggest();return;}
if(that.disabled||!that.visible){return;}
switch(e.which){case keys.ESC:that.el.val(that.currentValue);that.hide();break;case keys.RIGHT:if(that.hint&&that.options.onHint&&that.isCursorAtEnd()){that.selectHint();break;}
return;case keys.TAB:if(that.hint&&that.options.onHint){that.selectHint();return;}
if(that.selectedIndex===-1){that.hide();return;}
that.select(that.selectedIndex);if(that.options.tabDisabled===false){return;}
break;case keys.RETURN:if(that.selectedIndex===-1){that.hide();return;}
that.select(that.selectedIndex);break;case keys.UP:that.moveUp();break;case keys.DOWN:that.moveDown();break;default:return;}
e.stopImmediatePropagation();e.preventDefault();},onKeyUp:function(e){var that=this;if(that.disabled){return;}
switch(e.which){case keys.UP:case keys.DOWN:return;}
clearInterval(that.onChangeInterval);if(that.currentValue!==that.el.val()){that.findBestHint();if(that.options.deferRequestBy>0){that.onChangeInterval=setInterval(function(){that.onValueChange();},that.options.deferRequestBy);}else{that.onValueChange();}}},onValueChange:function(){var that=this,options=that.options,value=that.el.val(),query=that.getQuery(value);if(that.selection&&that.currentValue!==query){that.selection=null;(options.onInvalidateSelection||$.noop).call(that.element);}
clearInterval(that.onChangeInterval);that.currentValue=value;that.selectedIndex=-1;if(options.triggerSelectOnValidInput&&that.isExactMatch(query)){that.select(0);return;}
if(query.length<options.minChars){that.hide();}else{that.getSuggestions(query);}},isExactMatch:function(query){var suggestions=this.suggestions;return(suggestions.length===1&&suggestions[0].value.toLowerCase()===query.toLowerCase());},getQuery:function(value){var delimiter=this.options.delimiter,parts;if(!delimiter){return value;}
parts=value.split(delimiter);return $.trim(parts[parts.length-1]);},getSuggestionsLocal:function(query){var that=this,options=that.options,queryLowerCase=query.toLowerCase(),filter=options.lookupFilter,limit=parseInt(options.lookupLimit,10),data;data={suggestions:$.grep(options.lookup,function(suggestion){return filter(suggestion,query,queryLowerCase);})};if(limit&&data.suggestions.length>limit){data.suggestions=data.suggestions.slice(0,limit);}
return data;},getSuggestions:function(q){var response,that=this,options=that.options,serviceUrl=options.serviceUrl,params,cacheKey,ajaxSettings;options.params[options.paramName]=q;params=options.ignoreParams?null:options.params;if(options.onSearchStart.call(that.element,options.params)===false){return;}
if($.isFunction(options.lookup)){options.lookup(q,function(data){that.suggestions=data.suggestions;that.suggest();options.onSearchComplete.call(that.element,q,data.suggestions);});return;}
if(that.isLocal){response=that.getSuggestionsLocal(q);}else{if($.isFunction(serviceUrl)){serviceUrl=serviceUrl.call(that.element,q);}
cacheKey=serviceUrl+'?'+$.param(params||{});response=that.cachedResponse[cacheKey];}
if(response&&$.isArray(response.suggestions)){that.suggestions=response.suggestions;that.suggest();options.onSearchComplete.call(that.element,q,response.suggestions);}else if(!that.isBadQuery(q)){that.abortAjax();ajaxSettings={url:serviceUrl,data:params,type:options.type,dataType:options.dataType};$.extend(ajaxSettings,options.ajaxSettings);that.currentRequest=$.ajax(ajaxSettings).done(function(data){var result;that.currentRequest=null;result=options.transformResult(data,q);that.processResponse(result,q,cacheKey);options.onSearchComplete.call(that.element,q,result.suggestions);}).fail(function(jqXHR,textStatus,errorThrown){options.onSearchError.call(that.element,q,jqXHR,textStatus,errorThrown);});}else{options.onSearchComplete.call(that.element,q,[]);}},isBadQuery:function(q){if(!this.options.preventBadQueries){return false;}
var badQueries=this.badQueries,i=badQueries.length;while(i--){if(q.indexOf(badQueries[i])===0){return true;}}
return false;},hide:function(){var that=this,container=$(that.suggestionsContainer);if($.isFunction(that.options.onHide)&&that.visible){that.options.onHide.call(that.element,container);}
that.visible=false;that.selectedIndex=-1;clearInterval(that.onChangeInterval);$(that.suggestionsContainer).hide();that.signalHint(null);},suggest:function(){if(this.suggestions.length===0){if(this.options.showNoSuggestionNotice){this.noSuggestions();}else{this.hide();}
return;}
var that=this,options=that.options,groupBy=options.groupBy,formatResult=options.formatResult,value=that.getQuery(that.currentValue),className=that.classes.suggestion,classSelected=that.classes.selected,container=$(that.suggestionsContainer),noSuggestionsContainer=$(that.noSuggestionsContainer),beforeRender=options.beforeRender,html='',category,formatGroup=function(suggestion,index){var currentCategory=suggestion.data[groupBy];if(category===currentCategory){return'';}
category=currentCategory;return'<div class="autocomplete-group"><strong>'+category+'</strong></div>';};if(options.triggerSelectOnValidInput&&that.isExactMatch(value)){that.select(0);return;}
$.each(that.suggestions,function(i,suggestion){if(groupBy){html+=formatGroup(suggestion,value,i);}
html+='<div class="'+className+'" data-index="'+i+'">'+formatResult(suggestion,value)+'</div>';});this.adjustContainerWidth();noSuggestionsContainer.detach();container.html(html);if($.isFunction(beforeRender)){beforeRender.call(that.element,container);}
that.fixPosition();container.show();if(options.autoSelectFirst){that.selectedIndex=0;container.scrollTop(0);container.children('.'+className).first().addClass(classSelected);}
that.visible=true;that.findBestHint();},noSuggestions:function(){var that=this,container=$(that.suggestionsContainer),noSuggestionsContainer=$(that.noSuggestionsContainer);this.adjustContainerWidth();noSuggestionsContainer.detach();container.empty();container.append(noSuggestionsContainer);that.fixPosition();container.show();that.visible=true;},adjustContainerWidth:function(){var that=this,options=that.options,width,container=$(that.suggestionsContainer);if(options.width==='auto'){width=that.el.outerWidth()-2;container.width(width>0?width:300);}},findBestHint:function(){var that=this,value=that.el.val().toLowerCase(),bestMatch=null;if(!value){return;}
$.each(that.suggestions,function(i,suggestion){var foundMatch=suggestion.value.toLowerCase().indexOf(value)===0;if(foundMatch){bestMatch=suggestion;}
return!foundMatch;});that.signalHint(bestMatch);},signalHint:function(suggestion){var hintValue='',that=this;if(suggestion){hintValue=that.currentValue+suggestion.value.substr(that.currentValue.length);}
if(that.hintValue!==hintValue){that.hintValue=hintValue;that.hint=suggestion;(this.options.onHint||$.noop)(hintValue);}},verifySuggestionsFormat:function(suggestions){if(suggestions.length&&typeof suggestions[0]==='string'){return $.map(suggestions,function(value){return{value:value,data:null};});}
return suggestions;},validateOrientation:function(orientation,fallback){orientation=$.trim(orientation||'').toLowerCase();if($.inArray(orientation,['auto','bottom','top'])===-1){orientation=fallback;}
return orientation;},processResponse:function(result,originalQuery,cacheKey){var that=this,options=that.options;result.suggestions=that.verifySuggestionsFormat(result.suggestions);if(!options.noCache){that.cachedResponse[cacheKey]=result;if(options.preventBadQueries&&result.suggestions.length===0){that.badQueries.push(originalQuery);}}
if(originalQuery!==that.getQuery(that.currentValue)){return;}
that.suggestions=result.suggestions;that.suggest();},activate:function(index){var that=this,activeItem,selected=that.classes.selected,container=$(that.suggestionsContainer),children=container.find('.'+that.classes.suggestion);container.find('.'+selected).removeClass(selected);that.selectedIndex=index;if(that.selectedIndex!==-1&&children.length>that.selectedIndex){activeItem=children.get(that.selectedIndex);$(activeItem).addClass(selected);return activeItem;}
return null;},selectHint:function(){var that=this,i=$.inArray(that.hint,that.suggestions);that.select(i);},select:function(i){var that=this;that.hide();that.onSelect(i);},moveUp:function(){var that=this;if(that.selectedIndex===-1){return;}
if(that.selectedIndex===0){$(that.suggestionsContainer).children().first().removeClass(that.classes.selected);that.selectedIndex=-1;that.el.val(that.currentValue);that.findBestHint();return;}
that.adjustScroll(that.selectedIndex-1);},moveDown:function(){var that=this;if(that.selectedIndex===(that.suggestions.length-1)){return;}
that.adjustScroll(that.selectedIndex+1);},adjustScroll:function(index){var that=this,activeItem=that.activate(index);if(!activeItem){return;}
var offsetTop,upperBound,lowerBound,heightDelta=$(activeItem).outerHeight();offsetTop=activeItem.offsetTop;upperBound=$(that.suggestionsContainer).scrollTop();lowerBound=upperBound+that.options.maxHeight-heightDelta;if(offsetTop<upperBound){$(that.suggestionsContainer).scrollTop(offsetTop);}else if(offsetTop>lowerBound){$(that.suggestionsContainer).scrollTop(offsetTop-that.options.maxHeight+heightDelta);}
if(!that.options.preserveInput){that.el.val(that.getValue(that.suggestions[index].value));}
that.signalHint(null);},onSelect:function(index){var that=this,onSelectCallback=that.options.onSelect,suggestion=that.suggestions[index];that.currentValue=that.getValue(suggestion.value);if(that.currentValue!==that.el.val()&&!that.options.preserveInput){that.el.val(that.currentValue);}
that.signalHint(null);that.suggestions=[];that.selection=suggestion;if($.isFunction(onSelectCallback)){onSelectCallback.call(that.element,suggestion);}},getValue:function(value){var that=this,delimiter=that.options.delimiter,currentValue,parts;if(!delimiter){return value;}
currentValue=that.currentValue;parts=currentValue.split(delimiter);if(parts.length===1){return value;}
return currentValue.substr(0,currentValue.length-parts[parts.length-1].length)+value;},dispose:function(){var that=this;that.el.off('.autocomplete').removeData('autocomplete');that.disableKillerFn();$(window).off('resize.autocomplete',that.fixPositionCapture);$(that.suggestionsContainer).remove();}};$.fn.autocomplete=$.fn.devbridgeAutocomplete=function(options,args){var dataKey='autocomplete';if(arguments.length===0){return this.first().data(dataKey);}
return this.each(function(){var inputElement=$(this),instance=inputElement.data(dataKey);if(typeof options==='string'){if(instance&&typeof instance[options]==='function'){instance[options](args);}}else{if(instance&&instance.dispose){instance.dispose();}
instance=new Autocomplete(this,options);inputElement.data(dataKey,instance);}});};}));
(function($){$.widget("ui.multiselect",{options:{sortable:true,searchable:true,doubleClickable:true,animated:'fast',show:'slideDown',hide:'slideUp',dividerLocation:0.6,nodeComparator:function(node1,node2){var text1=node1.text(),text2=node2.text();return text1==text2?0:(text1<text2?-1:1);}},_create:function(){this.element.hide();this.id=this.element.attr("id");this.container=$('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);this.count=0;this.selectedContainer=$('<div class="selected"></div>').appendTo(this.container);this.availableContainer=$('<div class="available"></div>').appendTo(this.container);this.selectedActions=$('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);this.availableActions=$('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);this.selectedList=$('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart',function(){return false;}).appendTo(this.selectedContainer);this.availableList=$('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart',function(){return false;}).appendTo(this.availableContainer);var that=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));if(!this.options.animated){this.options.show='show';this.options.hide='hide';}
this._populateLists(this.element.find('option'));if(this.options.sortable){this.selectedList.sortable({placeholder:'ui-state-highlight',axis:'y',update:function(event,ui){that.selectedList.find('li').each(function(){if($(this).data('optionLink'))
$(this).data('optionLink').remove().appendTo(that.element);});},receive:function(event,ui){ui.item.data('optionLink').attr('selected',true);that.count+=1;that._updateCount();that.selectedList.children('.ui-draggable').each(function(){$(this).removeClass('ui-draggable');$(this).data('optionLink',ui.item.data('optionLink'));$(this).data('idx',ui.item.data('idx'));that._applyItemState($(this),true);});setTimeout(function(){ui.item.remove();},1);}});}
if(this.options.searchable){this._registerSearchEvents(this.availableContainer.find('input.search'));}else{$('.search').hide();}
this.container.find(".remove-all").click(function(){that._populateLists(that.element.find('option').removeAttr('selected'));return false;});this.container.find(".add-all").click(function(){var options=that.element.find('option').not(":selected");if(that.availableList.children('li:hidden').length>1){that.availableList.children('li').each(function(i){if($(this).is(":visible"))$(options[i-1]).attr('selected','selected');});}else{options.attr('selected','selected');}
that._populateLists(that.element.find('option'));return false;});},destroy:function(){this.element.show();this.container.remove();$.Widget.prototype.destroy.apply(this,arguments);},_populateLists:function(options){this.selectedList.children('.ui-element').remove();this.availableList.children('.ui-element').remove();this.count=0;var that=this;var items=$(options.map(function(i){var item=that._getOptionNode(this).appendTo(this.selected?that.selectedList:that.availableList).show();if(this.selected)that.count+=1;that._applyItemState(item,this.selected);item.data('idx',i);return item[0];}));this._updateCount();that._filter.apply(this.availableContainer.find('input.search'),[that.availableList]);},_updateCount:function(){this.element.trigger('change');this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);},_getOptionNode:function(option){option=$(option);var node=$('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();node.data('optionLink',option);return node;},_cloneWithData:function(clonee){var clone=clonee.clone(false,false);clone.data('optionLink',clonee.data('optionLink'));clone.data('idx',clonee.data('idx'));return clone;},_setSelected:function(item,selected){item.data('optionLink').attr('selected',selected);if(selected){var selectedItem=this._cloneWithData(item);item[this.options.hide](this.options.animated,function(){$(this).remove();});selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(selectedItem,true);return selectedItem;}else{var items=this.availableList.find('li'),comparator=this.options.nodeComparator;var succ=null,i=item.data('idx'),direction=comparator(item,$(items[i]));if(direction){while(i>=0&&i<items.length){direction>0?i++:i--;if(direction!=comparator(item,$(items[i]))){succ=items[direction>0?i:i+1];break;}}}else{succ=items[i];}
var availableItem=this._cloneWithData(item);succ?availableItem.insertBefore($(succ)):availableItem.appendTo(this.availableList);item[this.options.hide](this.options.animated,function(){$(this).remove();});availableItem.hide()[this.options.show](this.options.animated);this._applyItemState(availableItem,false);return availableItem;}},_applyItemState:function(item,selected){if(selected){if(this.options.sortable)
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');else
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');this._registerRemoveEvents(item.find('a.action'));}else{item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');this._registerAddEvents(item.find('a.action'));}
this._registerDoubleClickEvents(item);this._registerHoverEvents(item);},_filter:function(list){var input=$(this);var rows=list.children('li'),cache=rows.map(function(){return $(this).text().toLowerCase();});var term=$.trim(input.val().toLowerCase()),scores=[];if(!term){rows.show();}else{rows.hide();cache.each(function(i){if(this.indexOf(term)>-1){scores.push(i);}});$.each(scores,function(){$(rows[this]).show();});}},_registerDoubleClickEvents:function(elements){if(!this.options.doubleClickable)return;elements.dblclick(function(){elements.find('a.action').click();});},_registerHoverEvents:function(elements){elements.removeClass('ui-state-hover');elements.mouseover(function(){$(this).addClass('ui-state-hover');});elements.mouseout(function(){$(this).removeClass('ui-state-hover');});},_registerAddEvents:function(elements){var that=this;elements.click(function(){var item=that._setSelected($(this).parent(),true);that.count+=1;that._updateCount();return false;});if(this.options.sortable){elements.each(function(){$(this).parent().draggable({connectToSortable:that.selectedList,helper:function(){var selectedItem=that._cloneWithData($(this)).width($(this).width()-50);selectedItem.width($(this).width());return selectedItem;},appendTo:that.container,containment:that.container,revert:'invalid'});});}},_registerRemoveEvents:function(elements){var that=this;elements.click(function(){that._setSelected($(this).parent(),false);that.count-=1;that._updateCount();return false;});},_registerSearchEvents:function(input){var that=this;input.focus(function(){$(this).addClass('ui-state-active');}).blur(function(){$(this).removeClass('ui-state-active');}).keypress(function(e){if(e.keyCode==13)
return false;}).keyup(function(){that._filter.apply(this,[that.availableList]);});}});$.extend($.ui.multiselect,{locale:{addAll:'Add all',removeAll:'Remove all',itemsCount:'items selected'}});})(jQuery);
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
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*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{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+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};
/*!
 * jQuery clueTip plugin v1.2.5
 *
 * Date: Sat Feb 04 22:52:27 2012 EST
 * Requires: jQuery v1.3+
 *
 * Copyright 2011, Karl Swedberg
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 *
 * Examples can be found at http://plugins.learningjquery.com/cluetip/demo/
 *
*/
(function(c){c.cluetip={version:"1.2.5",template:'<div><div class="cluetip-outer"><h3 class="cluetip-title ui-widget-header ui-cluetip-header"></h3><div class="cluetip-inner ui-widget-content ui-cluetip-content"></div></div><div class="cluetip-extra"></div><div class="cluetip-arrows ui-state-default"></div></div>',setup:{insertionType:"appendTo",insertionElement:"body"},defaults:{multiple:false,width:275,height:"auto",cluezIndex:97,positionBy:"auto",topOffset:15,leftOffset:15,local:false,localPrefix:null,
localIdSuffix:null,hideLocal:true,attribute:"rel",titleAttribute:"title",splitTitle:"",escapeTitle:false,showTitle:true,cluetipClass:"default",hoverClass:"",waitImage:true,cursor:"help",arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:"hover",clickThrough:true,tracking:false,delayedClose:0,closePosition:"top",closeText:"Close",truncate:0,fx:{open:"show",openSpeed:""},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(){return true},onShow:function(){},
onHide:function(){},ajaxCache:true,ajaxProcess:function(j){return j=j.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,"").replace(/<(link|meta)[^>]+>/g,"")},ajaxSettings:{dataType:"html"},debug:false}};var C,K={},ha=0,Q=0;c.fn.attrProp=c.fn.prop||c.fn.attr;c.fn.cluetip=function(j,q){function R(S,s,n){n="";s=s.dropShadow&&s.dropShadowSteps?+s.dropShadowSteps:0;if(c.support.boxShadow){if(s)n="1px 1px "+s+"px rgba(0,0,0,0.5)";S.css(c.support.boxShadow,n);return false}n=S.find(".cluetip-drop-shadow");
if(s==n.length)return n;n.remove();n=[];for(var k=0;k<s;)n[k++]='<div style="top:'+k+"px;left:"+k+'px;"></div>';return n=c(n.join("")).css({position:"absolute",backgroundColor:"#000",zIndex:T-1,opacity:0.1}).addClass("cluetip-drop-shadow").prependTo(S)}var d,h,r,D,t,U;if(typeof j=="object"){q=j;j=null}if(j=="destroy"){var V=this.data("cluetip");if(V){c(V.selector).remove();c.removeData(this,"title");c.removeData(this,"cluetip");c(document).unbind(".cluetip");return this.unbind(".cluetip")}}q=c.extend(true,
{},c.cluetip.defaults,q||{});ha++;var T;V=c.cluetip.backCompat||!q.multiple?"cluetip":"cluetip-"+ha;var da="#"+V,w=c.cluetip.backCompat?"#":".",Y=c.cluetip.setup.insertionType,ma=c.cluetip.setup.insertionElement||"body";Y=/appendTo|prependTo|insertBefore|insertAfter/.test(Y)?Y:"appendTo";d=c(da);if(!d.length){d=c(c.cluetip.template)[Y](ma).attr("id",V).css({position:"absolute",display:"none"});T=+q.cluezIndex;r=d.find(w+"cluetip-outer").css({position:"relative",zIndex:T});h=d.find(w+"cluetip-inner");
D=d.find(w+"cluetip-title")}C=c("#cluetip-waitimage");C.length||(C=c("<div></div>").attr("id","cluetip-waitimage").css({position:"absolute"}));C.insertBefore(d).hide();var na=(parseInt(d.css("paddingLeft"),10)||0)+(parseInt(d.css("paddingRight"),10)||0);this.each(function(S){function s(){return false}function n(b,f){var g=b.status;f.beforeSend(b.xhr,f);if(g=="error")f[g](b.xhr,b.textStatus);else g=="success"&&f[g](b.data,b.textStatus,b.xhr);f.complete(b.xhr,f.textStatus)}var k=this,e=c(this),a=c.extend(true,
{},q,c.metadata?e.metadata():c.meta?e.data():e.data("cluetip")||{}),G=false,L=false,ia=0,i=a[a.attribute]||e.attrProp(a.attribute)||e.attr(a.attribute),W=a.cluetipClass;T=+a.cluezIndex;e.data("cluetip",{title:k.title,zIndex:T,selector:da});if(!i&&!a.splitTitle&&!j)return true;if(a.local&&a.localPrefix)i=a.localPrefix+i;a.local&&a.hideLocal&&i&&c(i+":first").hide();var u=parseInt(a.topOffset,10),E=parseInt(a.leftOffset,10),F,ea,Z=isNaN(parseInt(a.height,10))?"auto":/\D/g.test(a.height)?a.height:a.height+
"px",$,x,y,M,aa,fa=parseInt(a.width,10)||275,o=fa+na+a.dropShadowSteps,H=this.offsetWidth,z,l,p,N,I,A=a.attribute!="title"?e.attrProp(a.titleAttribute)||"":"";if(a.splitTitle){I=A.split(a.splitTitle);A=a.showTitle||I[0]===""?I.shift():""}if(a.escapeTitle)A=A.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;");var ba=function(b){var f;if(a.onActivate(e)===false)return false;L=true;d=c(da).css({position:"absolute"});r=d.find(w+"cluetip-outer");h=d.find(w+"cluetip-inner");D=d.find(w+"cluetip-title");
t=d.find(w+"cluetip-arrows");d.removeClass().css({width:fa});i==e.attr("href")&&e.css("cursor",a.cursor);a.hoverClass&&e.addClass(a.hoverClass);x=e.offset().top;z=e.offset().left;H=e.innerWidth();if(b.type==focus){p=z+H/2+E;d.css({left:l});M=x+u}else{p=b.pageX;M=b.pageY}if(k.tagName.toLowerCase()!="area"){$=c(document).scrollTop();N=c(window).width()}if(a.positionBy=="fixed"){l=H+z+E;d.css({left:l})}else{l=H>z&&z>o||z+H+o+E>N?z-o-E:H+z+E;if(k.tagName.toLowerCase()=="area"||a.positionBy=="mouse"||
H+o>N)if(p+20+o>N){d.addClass("cluetip-"+W);l=p-o-E>=0?p-o-E-parseInt(d.css("marginLeft"),10)+parseInt(h.css("marginRight"),10):p-o/2}else l=p+E;f=l<0?b.pageY+u:b.pageY;if(l<0||a.positionBy=="bottomTop")l=p+o/2>N?N/2-o/2:Math.max(p-o/2,0)}t.css({zIndex:e.data("cluetip").zIndex+1});d.css({left:l,zIndex:e.data("cluetip").zIndex});ea=c(window).height();if(j){if(typeof j=="function")j=j.call(k);h.html(j);O(f)}else if(I){b=I.length;h.html(b?I[0]:"");if(b>1)for(var g=1;g<b;g++)h.append('<div class="split-body">'+
I[g]+"</div>");O(f)}else if(!a.local&&i.indexOf("#")!==0)if(/\.(jpe?g|tiff?|gif|png)(?:\?.*)?$/i.test(i)){h.html('<img src="'+i+'" alt="'+A+'" />');O(f)}else{var m=a.ajaxSettings.beforeSend,P=a.ajaxSettings.error,ja=a.ajaxSettings.success,ka=a.ajaxSettings.complete;b=c.extend(true,{},a.ajaxSettings,{cache:a.ajaxCache,url:i,beforeSend:function(v,B){m&&m.call(k,v,d,h,B);r.children().empty();a.waitImage&&C.css({top:M+20,left:p+20,zIndex:e.data("cluetip").zIndex-1}).show()},error:function(v,B){if(q.ajaxCache&&
!K[i])K[i]={status:"error",textStatus:B,xhr:v};if(L)P?P.call(k,v,B,d,h):h.html("<i>sorry, the contents could not be loaded</i>")},success:function(v,B,J){if(q.ajaxCache&&!K[i])K[i]={status:"success",data:v,textStatus:B,xhr:J};G=a.ajaxProcess.call(k,v);if(typeof G=="object"&&G!==null){A=G.title;G=G.content}if(L){ja&&ja.call(k,v,B,d,h);h.html(G)}},complete:function(v,B){ka&&ka.call(k,v,B,d,h);var J=h[0].getElementsByTagName("img");Q=J.length;for(var ga=0,oa=J.length;ga<oa;ga++)J[ga].complete&&Q--;if(Q&&
!c.browser.opera)c(J).bind("load.ct error.ct",function(){Q--;if(Q===0){C.hide();c(J).unbind(".ct");L&&O(f)}});else{C.hide();L&&O(f)}}});K[i]?n(K[i],b):c.ajax(b)}else if(a.local){b=c(i+(/^#\S+$/.test(i)?"":":eq("+S+")")).clone(true).show();a.localIdSuffix&&b.attr("id",b[0].id+a.localIdSuffix);h.html(b);O(f)}},O=function(b){var f,g;f=A||a.showTitle&&"&nbsp;";var m="";g="";d.addClass("cluetip-"+W);if(a.truncate){var P=h.text().slice(0,a.truncate)+"...";h.html(P)}f?D.show().html(f):D.hide();if(a.sticky){f=
c('<div class="cluetip-close"><a href="#">'+a.closeText+"</a></div>");a.closePosition=="bottom"?f.appendTo(h):a.closePosition=="title"?f.prependTo(D):f.prependTo(h);f.bind("click.cluetip",function(){X();return false});a.mouseOutClose?d.bind("mouseleave.cluetip",function(){X()}):d.unbind("mouseleave.cluetip")}r.css({zIndex:e.data("cluetip").zIndex,overflow:Z=="auto"?"visible":"auto",height:Z});F=Z=="auto"?Math.max(d.outerHeight(),d.height()):parseInt(Z,10);y=x;aa=$+ea;if(a.positionBy=="fixed")y=x-
a.dropShadowSteps+u;else if(l<p&&Math.max(l,0)+o>p||a.positionBy=="bottomTop")if(x+F+u>aa&&M-$>F+u){y=M-F-u;g="top"}else{y=M+u;g="bottom"}else y=x+F+u>aa?F>=ea?$:aa-F-u:e.css("display")=="block"||k.tagName.toLowerCase()=="area"||a.positionBy=="mouse"?b-u:x-a.dropShadowSteps;if(g==="")g=l<z?"left":"right";f=" clue-"+g+"-"+W+" cluetip-"+W;if(W=="rounded")f+=" ui-corner-all";d.css({top:y+"px"}).attrProp({className:"cluetip ui-widget ui-widget-content ui-cluetip"+f});if(a.arrows){if(/(left|right)/.test(g)){g=
d.height()-t.height();m=l>=0&&b>0?x-y-a.dropShadowSteps:0;m=g>m?m:g;m+="px"}t.css({top:m}).show()}else t.hide();(U=R(d,a))&&U.length&&U.hide().css({height:F,width:fa,zIndex:e.data("cluetip").zIndex-1}).show();d.hide()[a.fx.open](a.fx.openSpeed||0);c.fn.bgiframe&&d.bgiframe();if(a.delayedClose>0)ia=setTimeout(X,a.delayedClose);a.onShow.call(k,d,h)},ca=function(){L=false;C.hide();if(!a.sticky||/click|toggle/.test(a.activation)){X();clearTimeout(ia)}a.hoverClass&&e.removeClass(a.hoverClass)},X=function(b){b=
b&&b.data("cluetip")?b:e;var f=b.data("cluetip")&&b.data("cluetip").selector,g=c(f||"div.cluetip"),m=g.find(w+"cluetip-inner"),P=g.find(w+"cluetip-arrows");g.hide().removeClass();a.onHide.call(b[0],g,m);if(f){b.removeClass("cluetip-clicked");b.css("cursor","")}f&&A&&b.attrProp(a.titleAttribute,A);a.arrows&&P.css({top:""})};c(document).unbind("hideCluetip.cluetip").bind("hideCluetip.cluetip",function(b){X(c(b.target))});if(/click|toggle/.test(a.activation))e.bind("click.cluetip",function(b){if(d.is(":hidden")||
!e.is(".cluetip-clicked")){ba(b);c(".cluetip-clicked").removeClass("cluetip-clicked");e.addClass("cluetip-clicked")}else ca(b);return false});else if(a.activation=="focus"){e.bind("focus.cluetip",function(b){e.attrProp("title","");ba(b)});e.bind("blur.cluetip",function(b){e.attrProp("title",e.data("cluetip").title);ca(b)})}else{e[a.clickThrough?"unbind":"bind"]("click.cluetip",s);var la=function(b){if(a.tracking){var f=l-b.pageX,g=y?y-b.pageY:x-b.pageY;e.bind("mousemove.cluetip",function(m){d.css({left:m.pageX+
f,top:m.pageY+g})})}};c.fn.hoverIntent&&a.hoverIntent?e.hoverIntent({sensitivity:a.hoverIntent.sensitivity,interval:a.hoverIntent.interval,over:function(b){ba(b);la(b)},timeout:a.hoverIntent.timeout,out:function(b){ca(b);e.unbind("mousemove.cluetip")}}):e.bind("mouseenter.cluetip",function(b){ba(b);la(b)}).bind("mouseleave.cluetip",function(b){ca(b);e.unbind("mousemove.cluetip")});e.bind("mouseover.cluetip",function(){e.attrProp("title","")}).bind("mouseleave.cluetip",function(){e.attrProp("title",
e.data("cluetip").title)})}});return this};(function(){c.support=c.support||{};for(var j=document.createElement("div").style,q=["boxShadow"],R=["moz","Moz","webkit","o"],d=0,h=q.length;d<h;d++){var r=q[d],D=r.charAt(0).toUpperCase()+r.slice(1);if(typeof j[r]!=="undefined")c.support[r]=r;else for(var t=0,U=R.length;t<U;t++)if(typeof j[R[t]+D]!=="undefined"){c.support[r]=R[t]+D;break}}})();c.fn.cluetip.defaults=c.cluetip.defaults})(jQuery);

(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(b){var j=[],n=b(document),k=navigator.userAgent.toLowerCase(),l=b(window),g=[],o=null,p=/msie/.test(k)&&!/opera/.test(k),q=/opera/.test(k),m,r;m=p&&/msie 6./.test(k)&&"object"!==typeof window.XMLHttpRequest;r=p&&/msie 7.0/.test(k);b.modal=function(a,h){return b.modal.impl.init(a,h)};b.modal.close=function(){b.modal.impl.close()};b.modal.focus=function(a){b.modal.impl.focus(a)};b.modal.setContainerDimensions=function(){b.modal.impl.setContainerDimensions()};b.modal.setPosition=function(){b.modal.impl.setPosition()};b.modal.update=function(a,h){b.modal.impl.update(a,h)};b.fn.modal=function(a){return b.modal.impl.init(this,a)};b.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1E3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null};b.modal.impl={d:{},init:function(a,h){if(this.d.data)return!1;o=p&&!b.support.boxModel;this.o=b.extend({},b.modal.defaults,h);this.zIndex=this.o.zIndex;this.occb=!1;if("object"===typeof a){if(a=a instanceof b?a:b(a),this.d.placeholder=!1,0<a.parent().parent().size()&&(a.before(b("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),this.d.placeholder=!0,this.display=a.css("display"),!this.o.persist))this.d.orig=a.clone(!0)}else if("string"===typeof a||"number"===typeof a)a=b("<div></div>").html(a);else return alert("SimpleModal Error: Unsupported data type: "+typeof a),this;this.create(a);this.open();b.isFunction(this.o.onShow)&&this.o.onShow.apply(this,[this.d]);return this},create:function(a){this.getDimensions();if(this.o.modal&&m)this.d.iframe=b('<iframe src="javascript:false;"></iframe>').css(b.extend(this.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:g[0],width:g[1],zIndex:this.o.zIndex,top:0,left:0})).appendTo(this.o.appendTo);this.d.overlay=b("<div></div>").attr("id",this.o.overlayId).addClass("simplemodal-overlay").css(b.extend(this.o.overlayCss,{display:"none",opacity:this.o.opacity/100,height:this.o.modal?j[0]:0,width:this.o.modal?j[1]:0,position:"fixed",left:0,top:0,zIndex:this.o.zIndex+1})).appendTo(this.o.appendTo);this.d.container=b("<div></div>").attr("id",this.o.containerId).addClass("simplemodal-container").css(b.extend({position:this.o.fixed?"fixed":"absolute"},this.o.containerCss,{display:"none",zIndex:this.o.zIndex+2})).append(this.o.close&&this.o.closeHTML?b(this.o.closeHTML).addClass(this.o.closeClass):"").appendTo(this.o.appendTo);this.d.wrap=b("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(this.d.container);this.d.data=a.attr("id",a.attr("id")||this.o.dataId).addClass("simplemodal-data").css(b.extend(this.o.dataCss,{display:"none"})).appendTo("body");this.setContainerDimensions();this.d.data.appendTo(this.d.wrap);(m||o)&&this.fixIE()},bindEvents:function(){var a=this;b("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});n.bind("keydown.simplemodal",function(b){a.o.modal&&9===b.keyCode?a.watchTab(b):a.o.close&&a.o.escClose&&27===b.keyCode&&(b.preventDefault(),a.close())});l.bind("resize.simplemodal orientationchange.simplemodal",function(){a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();m||o?a.fixIE():a.o.modal&&(a.d.iframe&&a.d.iframe.css({height:g[0],width:g[1]}),a.d.overlay.css({height:j[0],width:j[1]}))})},unbindEvents:function(){b("."+this.o.closeClass).unbind("click.simplemodal");n.unbind("keydown.simplemodal");l.unbind(".simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this.o.position;b.each([this.d.iframe||null,!this.o.modal?null:this.d.overlay,"fixed"===this.d.container.css("position")?this.d.container:null],function(b,e){if(e){var f=e[0].style;f.position="absolute";if(2>b)f.removeExpression("height"),f.removeExpression("width"),f.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"'),f.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"');else{var c,d;a&&a.constructor===Array?(c=a[0]?"number"===typeof a[0]?a[0].toString():a[0].replace(/px/,""):e.css("top").replace(/px/,""),c=-1===c.indexOf("%")?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',a[1]&&(d="number"===typeof a[1]?a[1].toString():a[1].replace(/px/,""),d=-1===d.indexOf("%")?d+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(d.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"')):(c='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"',d='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"');f.removeExpression("top");f.removeExpression("left");f.setExpression("top",c);f.setExpression("left",d)}}})},focus:function(a){var h=this,a=a&&-1!==b.inArray(a,["first","last"])?a:"first",e=b(":input:enabled:visible:"+a,h.d.wrap);setTimeout(function(){0<e.length?e.focus():h.d.wrap.focus()},10)},getDimensions:function(){var a="undefined"===typeof window.innerHeight?l.height():window.innerHeight;j=[n.height(),n.width()];g=[a,l.width()]},getVal:function(a,b){return a?"number"===typeof a?a:"auto"===a?0:0<a.indexOf("%")?parseInt(a.replace(/%/,""))/100*("h"===b?g[0]:g[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){if(!this.d.data)return!1;this.d.origHeight=this.getVal(a,"h");this.d.origWidth=this.getVal(b,"w");this.d.data.hide();a&&this.d.container.css("height",a);b&&this.d.container.css("width",b);this.setContainerDimensions();this.d.data.show();this.o.focus&&this.focus();this.unbindEvents();this.bindEvents()},setContainerDimensions:function(){var a=m||r,b=this.d.origHeight?this.d.origHeight:q?this.d.container.height():this.getVal(a?this.d.container[0].currentStyle.height:this.d.container.css("height"),"h"),a=this.d.origWidth?this.d.origWidth:q?this.d.container.width():this.getVal(a?this.d.container[0].currentStyle.width:this.d.container.css("width"),"w"),e=this.d.data.outerHeight(!0),f=this.d.data.outerWidth(!0);this.d.origHeight=this.d.origHeight||b;this.d.origWidth=this.d.origWidth||a;var c=this.o.maxHeight?this.getVal(this.o.maxHeight,"h"):null,d=this.o.maxWidth?this.getVal(this.o.maxWidth,"w"):null,c=c&&c<g[0]?c:g[0],d=d&&d<g[1]?d:g[1],i=this.o.minHeight?this.getVal(this.o.minHeight,"h"):"auto",b=b?this.o.autoResize&&b>c?c:b<i?i:b:e?e>c?c:this.o.minHeight&&"auto"!==i&&e<i?i:e:i,c=this.o.minWidth?this.getVal(this.o.minWidth,"w"):"auto",a=a?this.o.autoResize&&a>d?d:a<c?c:a:f?f>d?d:this.o.minWidth&&"auto"!==c&&f<c?c:f:c;this.d.container.css({height:b,width:a});this.d.wrap.css({overflow:e>b||f>a?"auto":"visible"});this.o.autoPosition&&this.setPosition()},setPosition:function(){var a,b;a=g[0]/2-this.d.container.outerHeight(!0)/2;b=g[1]/2-this.d.container.outerWidth(!0)/2;var e="fixed"!==this.d.container.css("position")?l.scrollTop():0;this.o.position&&"[object Array]"===Object.prototype.toString.call(this.o.position)?(a=e+(this.o.position[0]||a),b=this.o.position[1]||b):a=e+a;this.d.container.css({left:b,top:a})},watchTab:function(a){if(0<b(a.target).parents(".simplemodal-container").length){if(this.inputs=b(":input:enabled:visible:first, :input:enabled:visible:last",this.d.data[0]),!a.shiftKey&&a.target===this.inputs[this.inputs.length-1]||a.shiftKey&&a.target===this.inputs[0]||0===this.inputs.length)a.preventDefault(),this.focus(a.shiftKey?"last":"first")}else a.preventDefault(),this.focus()},open:function(){this.d.iframe&&this.d.iframe.show();b.isFunction(this.o.onOpen)?this.o.onOpen.apply(this,[this.d]):(this.d.overlay.show(),this.d.container.show(),this.d.data.show());this.o.focus&&this.focus();this.bindEvents()},close:function(){if(!this.d.data)return!1;this.unbindEvents();if(b.isFunction(this.o.onClose)&&!this.occb)this.occb=!0,this.o.onClose.apply(this,[this.d]);else{if(this.d.placeholder){var a=b("#simplemodal-placeholder");this.o.persist?a.replaceWith(this.d.data.removeClass("simplemodal-data").css("display",this.display)):(this.d.data.hide().remove(),a.replaceWith(this.d.orig))}else this.d.data.hide().remove();this.d.container.hide().remove();this.d.overlay.hide();this.d.iframe&&this.d.iframe.hide().remove();this.d.overlay.remove();this.d={}}}}});
(function($){var methods,utils,SIDES={center:'center',left:'left',right:'right'},WIDTH={auto:'auto'};function trunk8(element){this.$element=$(element);this.original_text=this.$element.html();this.settings=$.extend({},$.fn.trunk8.defaults);}
trunk8.prototype.updateSettings=function(options){this.settings=$.extend(this.settings,options);};function truncate(){var data=this.data('trunk8'),settings=data.settings,width=settings.width,side=settings.side,fill=settings.fill,line_height=utils.getLineHeight(this)*settings.lines,str=data.original_text,length=str.length,max_bite='',lower,upper,bite_size,bite;this.html(str);if(width===WIDTH.auto){if(this.height()<=line_height){return;}
lower=0;upper=length-1;while(lower<=upper){bite_size=lower+((upper-lower)>>1);bite=utils.eatStr(str,side,length-bite_size,fill);this.html(bite);if(this.height()>line_height){upper=bite_size-1;}
else{lower=bite_size+1;max_bite=(max_bite.length>bite.length)?max_bite:bite;}}
this.html('');this.html(max_bite);if(settings.tooltip){this.attr('title',str);}}
else if(!isNaN(width)){bite_size=length-width;bite=utils.eatStr(str,side,bite_size,fill);this.html(bite);if(settings.tooltip){this.attr('title',str);}}
else{$.error('Invalid width "'+width+'".');}}
methods={init:function(options){return this.each(function(){var $this=$(this),data=$this.data('trunk8');if(!data){$this.data('trunk8',(data=new trunk8(this)));}
data.updateSettings(options);truncate.call($this);});},update:function(new_string){return this.each(function(){var $this=$(this);if(new_string){$this.data('trunk8').original_text=new_string;}
truncate.call($this);});},revert:function(){return this.each(function(){var text=$(this).data('trunk8').original_text;$(this).html(text);});},getSettings:function(){return this.get(0).data('trunk8').settings;}};utils={eatStr:function(str,side,bite_size,fill){var length=str.length,key=utils.eatStr.generateKey.apply(null,arguments),half_length,half_bite_size;if(utils.eatStr.cache[key]){return utils.eatStr.cache[key];}
if((typeof str!=='string')||(length===0)){$.error('Invalid source string "'+str+'".');}
if((bite_size<0)||(bite_size>length)){$.error('Invalid bite size "'+bite_size+'".');}
else if(bite_size===0){return str;}
if(typeof(fill+'')!=='string'){$.error('Fill unable to be converted to a string.');}
switch(side){case SIDES.right:return utils.eatStr.cache[key]=$.trim(str.substr(0,length-bite_size))+fill;case SIDES.left:return utils.eatStr.cache[key]=fill+$.trim(str.substr(bite_size));case SIDES.center:half_length=length>>1;half_bite_size=bite_size>>1;return utils.eatStr.cache[key]=$.trim(utils.eatStr(str.substr(0,length-half_length),SIDES.right,bite_size-half_bite_size,''))+
fill+
$.trim(utils.eatStr(str.substr(length-half_length),SIDES.left,half_bite_size,''));default:$.error('Invalid side "'+side+'".');}},getLineHeight:function(elem){var $elem=$(elem),floats=$elem.css('float'),position=$elem.css('position'),html=$elem.html(),wrapper_id='line-height-test',line_height;if(floats!=='none'){$elem.css('float','none');}
if(position==='absolute'){$elem.css('position','static');}
$elem.html('i').wrap('<div id="'+wrapper_id+'" />');line_height=$('#'+wrapper_id).innerHeight();$elem.html(html).css({'float':floats,'position':position}).unwrap();return line_height;}};utils.eatStr.cache={};utils.eatStr.generateKey=function(){return Array.prototype.join.call(arguments,'');};$.fn.trunk8=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}
else if(typeof method==='object'||!method){return methods.init.apply(this,arguments);}
else{$.error('Method '+method+' does not exist on jQuery.trunk8');}};$.fn.trunk8.defaults={fill:'&hellip;',lines:1,side:SIDES.right,tooltip:true,width:WIDTH.auto};})(jQuery);
/*
 Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
*/
(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));
if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,
u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),
h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),
a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",
y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);

/**
 * Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
 * Licensed under MIT
 * @author Ariel Flesler
 * @version 2.1.2
 */
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);case "object":if(e.length===0)return;if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});
'use strict';(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory(require('jquery'));}else{factory(jQuery||Zepto);}}(function($){var Mask=function(el,mask,options){el=$(el);var jMask=this,oldValue=el.val(),regexMask;mask=typeof mask==='function'?mask(el.val(),undefined,el,options):mask;var p={invalid:[],getCaret:function(){try{var sel,pos=0,ctrl=el.get(0),dSel=document.selection,cSelStart=ctrl.selectionStart;if(dSel&&navigator.appVersion.indexOf('MSIE 10')===-1){sel=dSel.createRange();sel.moveStart('character',el.is('input')?-el.val().length:-el.text().length);pos=sel.text.length;}
else if(cSelStart||cSelStart==='0'){pos=cSelStart;}
return pos;}catch(e){}},setCaret:function(pos){try{if(el.is(':focus')){var range,ctrl=el.get(0);if(ctrl.setSelectionRange){ctrl.setSelectionRange(pos,pos);}else if(ctrl.createTextRange){range=ctrl.createTextRange();range.collapse(true);range.moveEnd('character',pos);range.moveStart('character',pos);range.select();}}}catch(e){}},events:function(){el.on('input.mask keyup.mask',p.behaviour).on('paste.mask drop.mask',function(){setTimeout(function(){el.keydown().keyup();},100);}).on('change.mask',function(){el.data('changed',true);}).on('blur.mask',function(){if(oldValue!==el.val()&&!el.data('changed')){el.triggerHandler('change');}
el.data('changed',false);}).on('blur.mask',function(){oldValue=el.val();}).on('focus.mask',function(e){if(options.selectOnFocus===true){$(e.target).select();}}).on('focusout.mask',function(){if(options.clearIfNotMatch&&!regexMask.test(p.val())){p.val('');}});},getRegexMask:function(){var maskChunks=[],translation,pattern,optional,recursive,oRecursive,r;for(var i=0;i<mask.length;i++){translation=jMask.translation[mask.charAt(i)];if(translation){pattern=translation.pattern.toString().replace(/.{1}$|^.{1}/g,'');optional=translation.optional;recursive=translation.recursive;if(recursive){maskChunks.push(mask.charAt(i));oRecursive={digit:mask.charAt(i),pattern:pattern};}else{maskChunks.push(!optional&&!recursive?pattern:(pattern+'?'));}}else{maskChunks.push(mask.charAt(i).replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&'));}}
r=maskChunks.join('');if(oRecursive){r=r.replace(new RegExp('('+oRecursive.digit+'(.*'+oRecursive.digit+')?)'),'($1)?').replace(new RegExp(oRecursive.digit,'g'),oRecursive.pattern);}
return new RegExp(r);},destroyEvents:function(){el.off(['input','keydown','keyup','paste','drop','blur','focusout',''].join('.mask '));},val:function(v){var isInput=el.is('input'),method=isInput?'val':'text',r;if(arguments.length>0){if(el[method]()!==v){el[method](v);}
r=el;}else{r=el[method]();}
return r;},getMCharsBeforeCount:function(index,onCleanVal){for(var count=0,i=0,maskL=mask.length;i<maskL&&i<index;i++){if(!jMask.translation[mask.charAt(i)]){index=onCleanVal?index+1:index;count++;}}
return count;},caretPos:function(originalCaretPos,oldLength,newLength,maskDif){var translation=jMask.translation[mask.charAt(Math.min(originalCaretPos-1,mask.length-1))];return!translation?p.caretPos(originalCaretPos+1,oldLength,newLength,maskDif):Math.min(originalCaretPos+newLength-oldLength-maskDif,newLength);},behaviour:function(e){e=e||window.event;p.invalid=[];var keyCode=e.keyCode||e.which;if($.inArray(keyCode,jMask.byPassKeys)===-1){var caretPos=p.getCaret(),currVal=p.val(),currValL=currVal.length,changeCaret=caretPos<currValL,newVal=p.getMasked(),newValL=newVal.length,maskDif=p.getMCharsBeforeCount(newValL-1)-p.getMCharsBeforeCount(currValL-1);p.val(newVal);if(changeCaret&&!(keyCode===65&&e.ctrlKey)){if(!(keyCode===8||keyCode===46)){caretPos=p.caretPos(caretPos,currValL,newValL,maskDif);}
p.setCaret(caretPos);}
return p.callbacks(e);}},getMasked:function(skipMaskChars){var buf=[],value=p.val(),m=0,maskLen=mask.length,v=0,valLen=value.length,offset=1,addMethod='push',resetPos=-1,lastMaskChar,check;if(options.reverse){addMethod='unshift';offset=-1;lastMaskChar=0;m=maskLen-1;v=valLen-1;check=function(){return m>-1&&v>-1;};}else{lastMaskChar=maskLen-1;check=function(){return m<maskLen&&v<valLen;};}
while(check()){var maskDigit=mask.charAt(m),valDigit=value.charAt(v),translation=jMask.translation[maskDigit];if(translation){if(valDigit.match(translation.pattern)){buf[addMethod](valDigit);if(translation.recursive){if(resetPos===-1){resetPos=m;}else if(m===lastMaskChar){m=resetPos-offset;}
if(lastMaskChar===resetPos){m-=offset;}}
m+=offset;}else if(translation.optional){m+=offset;v-=offset;}else if(translation.fallback){buf[addMethod](translation.fallback);m+=offset;v-=offset;}else{p.invalid.push({p:v,v:valDigit,e:translation.pattern});}
v+=offset;}else{if(!skipMaskChars){buf[addMethod](maskDigit);}
if(valDigit===maskDigit){v+=offset;}
m+=offset;}}
var lastMaskCharDigit=mask.charAt(lastMaskChar);if(maskLen===valLen+1&&!jMask.translation[lastMaskCharDigit]){buf.push(lastMaskCharDigit);}
return buf.join('');},callbacks:function(e){var val=p.val(),changed=val!==oldValue,defaultArgs=[val,e,el,options],callback=function(name,criteria,args){if(typeof options[name]==='function'&&criteria){options[name].apply(this,args);}};callback('onChange',changed===true,defaultArgs);callback('onKeyPress',changed===true,defaultArgs);callback('onComplete',val.length===mask.length,defaultArgs);callback('onInvalid',p.invalid.length>0,[val,e,el,p.invalid,options]);}};jMask.mask=mask;jMask.options=options;jMask.remove=function(){var caret=p.getCaret();p.destroyEvents();p.val(jMask.getCleanVal());p.setCaret(caret-p.getMCharsBeforeCount(caret));return el;};jMask.getCleanVal=function(){return p.getMasked(true);};jMask.init=function(onlyMask){onlyMask=onlyMask||false;options=options||{};jMask.byPassKeys=$.jMaskGlobals.byPassKeys;jMask.translation=$.jMaskGlobals.translation;jMask.translation=$.extend({},jMask.translation,options.translation);jMask=$.extend(true,{},jMask,options);regexMask=p.getRegexMask();if(onlyMask===false){if(options.placeholder){el.attr('placeholder',options.placeholder);}
if($('input').length&&'oninput'in $('input')[0]===false&&el.attr('autocomplete')==='on'){el.attr('autocomplete','off');}
p.destroyEvents();p.events();var caret=p.getCaret();p.val(p.getMasked());p.setCaret(caret+p.getMCharsBeforeCount(caret,true));}else{p.events();p.val(p.getMasked());}};jMask.init(!el.is('input'));};$.maskWatchers={};var HTMLAttributes=function(){var input=$(this),options={},prefix='data-mask-',mask=input.attr('data-mask');if(input.attr(prefix+'reverse')){options.reverse=true;}
if(input.attr(prefix+'clearifnotmatch')){options.clearIfNotMatch=true;}
if(input.attr(prefix+'selectonfocus')==='true'){options.selectOnFocus=true;}
if(notSameMaskObject(input,mask,options)){return input.data('mask',new Mask(this,mask,options));}},notSameMaskObject=function(field,mask,options){options=options||{};var maskObject=$(field).data('mask'),stringify=JSON.stringify,value=$(field).val()||$(field).text();try{if(typeof mask==='function'){mask=mask(value);}
return typeof maskObject!=='object'||stringify(maskObject.options)!==stringify(options)||maskObject.mask!==mask;}catch(e){}};$.fn.mask=function(mask,options){options=options||{};var selector=this.selector,globals=$.jMaskGlobals,interval=$.jMaskGlobals.watchInterval,maskFunction=function(){if(notSameMaskObject(this,mask,options)){return $(this).data('mask',new Mask(this,mask,options));}};$(this).each(maskFunction);if(selector&&selector!==''&&globals.watchInputs){clearInterval($.maskWatchers[selector]);$.maskWatchers[selector]=setInterval(function(){$(document).find(selector).each(maskFunction);},interval);}
return this;};$.fn.unmask=function(){clearInterval($.maskWatchers[this.selector]);delete $.maskWatchers[this.selector];return this.each(function(){var dataMask=$(this).data('mask');if(dataMask){dataMask.remove().removeData('mask');}});};$.fn.cleanVal=function(){return this.data('mask').getCleanVal();};$.applyDataMask=function(selector){selector=selector||$.jMaskGlobals.maskElements;var $selector=(selector instanceof $)?selector:$(selector);$selector.filter($.jMaskGlobals.dataMaskAttr).each(HTMLAttributes);};var globals={maskElements:'input,td,span,div',dataMaskAttr:'*[data-mask]',dataMask:true,watchInterval:300,watchInputs:true,watchDataMask:false,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{'0':{pattern:/\d/},'9':{pattern:/\d/,optional:true},'#':{pattern:/\d/,recursive:true},'A':{pattern:/[a-zA-Z0-9]/},'S':{pattern:/[a-zA-Z]/}}};$.jMaskGlobals=$.jMaskGlobals||{};globals=$.jMaskGlobals=$.extend(true,{},globals,$.jMaskGlobals);if(globals.dataMask){$.applyDataMask();}
setInterval(function(){if($.jMaskGlobals.watchDataMask){$.applyDataMask();}},globals.watchInterval);}));
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
if(p==this){return false;}
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
(function(global){'use strict';var
DATA_ATTR='data-highlighted',TIMESTAMP_ATTR='data-timestamp',NODE_TYPE={ELEMENT_NODE:1,TEXT_NODE:3},IGNORE_TAGS=['SCRIPT','STYLE','SELECT','OPTION','BUTTON','OBJECT','APPLET','VIDEO','AUDIO','CANVAS','EMBED','PARAM','METER','PROGRESS'];function haveSameColor(a,b){return dom(a).color()===dom(b).color();}
function defaults(obj,source){obj=obj||{};for(var prop in source){if(source.hasOwnProperty(prop)&&obj[prop]===void 0){obj[prop]=source[prop];}}
return obj;}
function unique(arr){return arr.filter(function(value,idx,self){return self.indexOf(value)===idx;});}
function refineRangeBoundaries(range){var startContainer=range.startContainer,endContainer=range.endContainer,ancestor=range.commonAncestorContainer,goDeeper=true;if(range.endOffset===0){while(!endContainer.previousSibling&&endContainer.parentNode!==ancestor){endContainer=endContainer.parentNode;}
endContainer=endContainer.previousSibling;}else if(endContainer.nodeType===NODE_TYPE.TEXT_NODE){if(range.endOffset<endContainer.nodeValue.length){endContainer.splitText(range.endOffset);}}else if(range.endOffset>0){endContainer=endContainer.childNodes.item(range.endOffset-1);}
if(startContainer.nodeType===NODE_TYPE.TEXT_NODE){if(range.startOffset===startContainer.nodeValue.length){goDeeper=false;}else if(range.startOffset>0){startContainer=startContainer.splitText(range.startOffset);if(endContainer===startContainer.previousSibling){endContainer=startContainer;}}}else if(range.startOffset<startContainer.childNodes.length){startContainer=startContainer.childNodes.item(range.startOffset);}else{startContainer=startContainer.nextSibling;}
return{startContainer:startContainer,endContainer:endContainer,goDeeper:goDeeper};}
function sortByDepth(arr,descending){arr.sort(function(a,b){return dom(descending?b:a).parents().length-dom(descending?a:b).parents().length;});}
function groupHighlights(highlights){var order=[],chunks={},grouped=[];highlights.forEach(function(hl){var timestamp=hl.getAttribute(TIMESTAMP_ATTR);if(typeof chunks[timestamp]==='undefined'){chunks[timestamp]=[];order.push(timestamp);}
chunks[timestamp].push(hl);});order.forEach(function(timestamp){var group=chunks[timestamp];grouped.push({chunks:group,timestamp:timestamp,toString:function(){return group.map(function(h){return h.textContent;}).join('');}});});return grouped;}
var dom=function(el){return{addClass:function(className){if(el.classList){el.classList.add(className);}else{el.className+=' '+className;}},removeClass:function(className){if(el.classList){el.classList.remove(className);}else{el.className=el.className.replace(new RegExp('(^|\\b)'+className+'(\\b|$)','gi'),' ');}},prepend:function(nodesToPrepend){var nodes=Array.prototype.slice.call(nodesToPrepend),i=nodes.length;while(i--){el.insertBefore(nodes[i],el.firstChild);}},append:function(nodesToAppend){var nodes=Array.prototype.slice.call(nodesToAppend);for(var i=0,len=nodes.length;i<len;++i){el.appendChild(nodes[i]);}},insertAfter:function(refEl){return refEl.parentNode.insertBefore(el,refEl.nextSibling);},insertBefore:function(refEl){return refEl.parentNode.insertBefore(el,refEl);},remove:function(){el.parentNode.removeChild(el);el=null;},contains:function(child){return el!==child&&el.contains(child);},wrap:function(wrapper){if(el.parentNode){el.parentNode.insertBefore(wrapper,el);}
wrapper.appendChild(el);return wrapper;},unwrap:function(){var nodes=Array.prototype.slice.call(el.childNodes),wrapper;nodes.forEach(function(node){wrapper=node.parentNode;dom(node).insertBefore(node.parentNode);dom(wrapper).remove();});return nodes;},parents:function(){var parent,path=[];while(!!(parent=el.parentNode)){path.push(parent);el=parent;}
return path;},normalizeTextNodes:function(){if(!el){return;}
if(el.nodeType===NODE_TYPE.TEXT_NODE){while(el.nextSibling&&el.nextSibling.nodeType===NODE_TYPE.TEXT_NODE){el.nodeValue+=el.nextSibling.nodeValue;el.parentNode.removeChild(el.nextSibling);}}else{dom(el.firstChild).normalizeTextNodes();}
dom(el.nextSibling).normalizeTextNodes();},color:function(){return el.style.backgroundColor;},fromHTML:function(html){var div=document.createElement('div');div.innerHTML=html;return div.childNodes;},getRange:function(){var selection=dom(el).getSelection(),range;if(selection.rangeCount>0){range=selection.getRangeAt(0);}
return range;},removeAllRanges:function(){var selection=dom(el).getSelection();selection.removeAllRanges();},getSelection:function(){return dom(el).getWindow().getSelection();},getWindow:function(){return dom(el).getDocument().defaultView;},getDocument:function(){return el.ownerDocument||el;}};};function bindEvents(el,scope){el.addEventListener('mouseup',scope.highlightHandler.bind(scope));el.addEventListener('touchend',scope.highlightHandler.bind(scope));}
function unbindEvents(el,scope){el.removeEventListener('mouseup',scope.highlightHandler.bind(scope));el.removeEventListener('touchend',scope.highlightHandler.bind(scope));}
function TextHighlighter(element,options){if(!element){throw'Missing anchor element';}
this.el=element;this.options=defaults(options,{color:'#ffff7b',highlightedClass:'highlighted',contextClass:'highlighter-context',onRemoveHighlight:function(){return true;},onBeforeHighlight:function(){return true;},onAfterHighlight:function(){}});dom(this.el).addClass(this.options.contextClass);bindEvents(this.el,this);}
TextHighlighter.prototype.destroy=function(){unbindEvents(this.el,this);dom(this.el).removeClass(this.options.contextClass);};TextHighlighter.prototype.highlightHandler=function(){this.doHighlight();};TextHighlighter.prototype.doHighlight=function(keepRange){var range=dom(this.el).getRange(),wrapper,createdHighlights,normalizedHighlights,timestamp;if(!range||range.collapsed){return;}
if(this.options.onBeforeHighlight(range)===true){timestamp=+new Date();wrapper=TextHighlighter.createWrapper(this.options);wrapper.setAttribute(TIMESTAMP_ATTR,timestamp);createdHighlights=this.highlightRange(range,wrapper);normalizedHighlights=this.normalizeHighlights(createdHighlights);this.options.onAfterHighlight(range,normalizedHighlights,timestamp);}
if(!keepRange){dom(this.el).removeAllRanges();}};TextHighlighter.prototype.highlightRange=function(range,wrapper){if(!range||range.collapsed){return[];}
var result=refineRangeBoundaries(range),startContainer=result.startContainer,endContainer=result.endContainer,goDeeper=result.goDeeper,done=false,node=startContainer,highlights=[],highlight,wrapperClone,nodeParent;do{if(goDeeper&&node.nodeType===NODE_TYPE.TEXT_NODE){if(IGNORE_TAGS.indexOf(node.parentNode.tagName)===-1&&node.nodeValue.trim()!==''){wrapperClone=wrapper.cloneNode(true);wrapperClone.setAttribute(DATA_ATTR,true);nodeParent=node.parentNode;if(dom(this.el).contains(nodeParent)||nodeParent===this.el){highlight=dom(node).wrap(wrapperClone);highlights.push(highlight);}}
goDeeper=false;}
if(node===endContainer&&!(endContainer.hasChildNodes()&&goDeeper)){done=true;}
if(node.tagName&&IGNORE_TAGS.indexOf(node.tagName)>-1){if(endContainer.parentNode===node){done=true;}
goDeeper=false;}
if(goDeeper&&node.hasChildNodes()){node=node.firstChild;}else if(node.nextSibling){node=node.nextSibling;goDeeper=true;}else{node=node.parentNode;goDeeper=false;}}while(!done);return highlights;};TextHighlighter.prototype.normalizeHighlights=function(highlights){var normalizedHighlights;this.flattenNestedHighlights(highlights);this.mergeSiblingHighlights(highlights);normalizedHighlights=highlights.filter(function(hl){return hl.parentElement?hl:null;});normalizedHighlights=unique(normalizedHighlights);normalizedHighlights.sort(function(a,b){return a.offsetTop-b.offsetTop||a.offsetLeft-b.offsetLeft;});return normalizedHighlights;};TextHighlighter.prototype.flattenNestedHighlights=function(highlights){var again,self=this;sortByDepth(highlights,true);function flattenOnce(){var again=false;highlights.forEach(function(hl,i){var parent=hl.parentElement,parentPrev=parent.previousSibling,parentNext=parent.nextSibling;if(self.isHighlight(parent)){if(!haveSameColor(parent,hl)){if(!hl.nextSibling){dom(hl).insertBefore(parentNext||parent);again=true;}
if(!hl.previousSibling){dom(hl).insertAfter(parentPrev||parent);again=true;}
if(!parent.hasChildNodes()){dom(parent).remove();}}else{parent.replaceChild(hl.firstChild,hl);highlights[i]=parent;again=true;}}});return again;}
do{again=flattenOnce();}while(again);};TextHighlighter.prototype.mergeSiblingHighlights=function(highlights){var self=this;function shouldMerge(current,node){return node&&node.nodeType===NODE_TYPE.ELEMENT_NODE&&haveSameColor(current,node)&&self.isHighlight(node);}
highlights.forEach(function(highlight){var prev=highlight.previousSibling,next=highlight.nextSibling;if(shouldMerge(highlight,prev)){dom(highlight).prepend(prev.childNodes);dom(prev).remove();}
if(shouldMerge(highlight,next)){dom(highlight).append(next.childNodes);dom(next).remove();}
dom(highlight).normalizeTextNodes();});};TextHighlighter.prototype.setColor=function(color){this.options.color=color;};TextHighlighter.prototype.getColor=function(){return this.options.color;};TextHighlighter.prototype.removeHighlights=function(element){var container=element||this.el,highlights=this.getHighlights({container:container}),self=this;function mergeSiblingTextNodes(textNode){var prev=textNode.previousSibling,next=textNode.nextSibling;if(prev&&prev.nodeType===NODE_TYPE.TEXT_NODE){textNode.nodeValue=prev.nodeValue+textNode.nodeValue;dom(prev).remove();}
if(next&&next.nodeType===NODE_TYPE.TEXT_NODE){textNode.nodeValue=textNode.nodeValue+next.nodeValue;dom(next).remove();}}
function removeHighlight(highlight){var textNodes=dom(highlight).unwrap();textNodes.forEach(function(node){mergeSiblingTextNodes(node);});}
sortByDepth(highlights,true);highlights.forEach(function(hl){if(self.options.onRemoveHighlight(hl)===true){removeHighlight(hl);}});};TextHighlighter.prototype.getHighlights=function(params){params=defaults(params,{container:this.el,andSelf:true,grouped:false});var nodeList=params.container.querySelectorAll('['+DATA_ATTR+']'),highlights=Array.prototype.slice.call(nodeList);if(params.andSelf===true&&params.container.hasAttribute(DATA_ATTR)){highlights.push(params.container);}
if(params.grouped){highlights=groupHighlights(highlights);}
return highlights;};TextHighlighter.prototype.isHighlight=function(el){return el&&el.nodeType===NODE_TYPE.ELEMENT_NODE&&el.hasAttribute(DATA_ATTR);};TextHighlighter.prototype.serializeHighlights=function(){var highlights=this.getHighlights(),refEl=this.el,hlDescriptors=[];function getElementPath(el,refElement){var path=[],childNodes;do{childNodes=Array.prototype.slice.call(el.parentNode.childNodes);path.unshift(childNodes.indexOf(el));el=el.parentNode;}while(el!==refElement||!el);return path;}
sortByDepth(highlights,false);highlights.forEach(function(highlight){var offset=0,length=highlight.textContent.length,hlPath=getElementPath(highlight,refEl),wrapper=highlight.cloneNode(true);wrapper.innerHTML='';wrapper=wrapper.outerHTML;if(highlight.previousSibling&&highlight.previousSibling.nodeType===NODE_TYPE.TEXT_NODE){offset=highlight.previousSibling.length;}
hlDescriptors.push([wrapper,highlight.textContent,hlPath.join(':'),offset,length]);});return JSON.stringify(hlDescriptors);};TextHighlighter.prototype.deserializeHighlights=function(json){var hlDescriptors,highlights=[],self=this;if(!json){return highlights;}
try{hlDescriptors=JSON.parse(json);}catch(e){throw"Can't parse JSON: "+e;}
function deserializationFn(hlDescriptor){var hl={wrapper:hlDescriptor[0],text:hlDescriptor[1],path:hlDescriptor[2].split(':'),offset:hlDescriptor[3],length:hlDescriptor[4]},elIndex=hl.path.pop(),node=self.el,hlNode,highlight,idx;while(!!(idx=hl.path.shift())){node=node.childNodes[idx];}
if(node.childNodes[elIndex-1]&&node.childNodes[elIndex-1].nodeType===NODE_TYPE.TEXT_NODE){elIndex-=1;}
node=node.childNodes[elIndex];hlNode=node.splitText(hl.offset);hlNode.splitText(hl.length);if(hlNode.nextSibling&&!hlNode.nextSibling.nodeValue){dom(hlNode.nextSibling).remove();}
if(hlNode.previousSibling&&!hlNode.previousSibling.nodeValue){dom(hlNode.previousSibling).remove();}
highlight=dom(hlNode).wrap(dom().fromHTML(hl.wrapper)[0]);highlights.push(highlight);}
hlDescriptors.forEach(function(hlDescriptor){try{deserializationFn(hlDescriptor);}catch(e){if(console&&console.warn){console.warn("Can't deserialize highlight descriptor. Cause: "+e);}}});return highlights;};TextHighlighter.prototype.find=function(text,caseSensitive){var wnd=dom(this.el).getWindow(),scrollX=wnd.scrollX,scrollY=wnd.scrollY,caseSens=(typeof caseSensitive==='undefined'?true:caseSensitive);dom(this.el).removeAllRanges();if(wnd.find){while(wnd.find(text,caseSens)){this.doHighlight(true);}}else if(wnd.document.body.createTextRange){var textRange=wnd.document.body.createTextRange();textRange.moveToElementText(this.el);while(textRange.findText(text,1,caseSens?4:0)){if(!dom(this.el).contains(textRange.parentElement())&&textRange.parentElement()!==this.el){break;}
textRange.select();this.doHighlight(true);textRange.collapse(false);}}
dom(this.el).removeAllRanges();wnd.scrollTo(scrollX,scrollY);};TextHighlighter.createWrapper=function(options){var span=document.createElement('span');span.style.backgroundColor=options.color;span.className=options.highlightedClass;return span;};global.TextHighlighter=TextHighlighter;})(window);
Gettext=function(args){this.domain='messages';this.locale_data=undefined;var options=["domain","locale_data"];if(this.isValidObject(args)){for(var i in args){for(var j=0;j<options.length;j++){if(i==options[j]){if(this.isValidObject(args[i]))
this[i]=args[i];}}}}
this.try_load_lang();return this;}
Gettext.context_glue="\004";Gettext._locale_data={};Gettext.prototype.try_load_lang=function(){if(typeof(this.locale_data)!='undefined'){var locale_copy=this.locale_data;this.locale_data=undefined;this.parse_locale_data(locale_copy);if(typeof(Gettext._locale_data[this.domain])=='undefined'){throw new Error("Error: Gettext 'locale_data' does not contain the domain '"+this.domain+"'");}}
var lang_link=this.get_lang_refs();if(typeof(lang_link)=='object'&&lang_link.length>0){for(var i=0;i<lang_link.length;i++){var link=lang_link[i];if(link.type=='application/json'){if(!this.try_load_lang_json(link.href)){throw new Error("Error: Gettext 'try_load_lang_json' failed. Unable to exec xmlhttprequest for link ["+link.href+"]");}}else if(link.type=='application/x-po'){if(!this.try_load_lang_po(link.href)){throw new Error("Error: Gettext 'try_load_lang_po' failed. Unable to exec xmlhttprequest for link ["+link.href+"]");}}else{throw new Error("TODO: link type ["+link.type+"] found, and support is planned, but not implemented at this time.");}}}};Gettext.prototype.parse_locale_data=function(locale_data){if(typeof(Gettext._locale_data)=='undefined'){Gettext._locale_data={};}
for(var domain in locale_data){if((!locale_data.hasOwnProperty(domain))||(!this.isValidObject(locale_data[domain])))
continue;var has_msgids=false;for(var msgid in locale_data[domain]){has_msgids=true;break;}
if(!has_msgids)continue;var data=locale_data[domain];if(domain=="")domain="messages";if(!this.isValidObject(Gettext._locale_data[domain]))
Gettext._locale_data[domain]={};if(!this.isValidObject(Gettext._locale_data[domain].head))
Gettext._locale_data[domain].head={};if(!this.isValidObject(Gettext._locale_data[domain].msgs))
Gettext._locale_data[domain].msgs={};for(var key in data){if(key==""){var header=data[key];for(var head in header){var h=head.toLowerCase();Gettext._locale_data[domain].head[h]=header[head];}}else{Gettext._locale_data[domain].msgs[key]=data[key];}}}
for(var domain in Gettext._locale_data){if(this.isValidObject(Gettext._locale_data[domain].head['plural-forms'])&&typeof(Gettext._locale_data[domain].head.plural_func)=='undefined'){var plural_forms=Gettext._locale_data[domain].head['plural-forms'];var pf_re=new RegExp('^(\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;a-zA-Z0-9_\(\)])+)','m');if(pf_re.test(plural_forms)){var pf=Gettext._locale_data[domain].head['plural-forms'];if(!/;\s*$/.test(pf))pf=pf.concat(';');var code='var plural; var nplurals; '+pf+' return { "nplural" : nplurals, "plural" : (plural === true ? 1 : plural ? plural : 0) };';Gettext._locale_data[domain].head.plural_func=new Function("n",code);}else{throw new Error("Syntax error in language file. Plural-Forms header is invalid ["+plural_forms+"]");}}else if(typeof(Gettext._locale_data[domain].head.plural_func)=='undefined'){Gettext._locale_data[domain].head.plural_func=function(n){var p=(n!=1)?1:0;return{'nplural':2,'plural':p};};}}
return;};Gettext.prototype.try_load_lang_po=function(uri){var data=this.sjax(uri);if(!data)return;var domain=this.uri_basename(uri);var parsed=this.parse_po(data);var rv={};if(parsed){if(!parsed[""])parsed[""]={};if(!parsed[""]["domain"])parsed[""]["domain"]=domain;domain=parsed[""]["domain"];rv[domain]=parsed;this.parse_locale_data(rv);}
return 1;};Gettext.prototype.uri_basename=function(uri){var rv;if(rv=uri.match(/^(.*\/)?(.*)/)){var ext_strip;if(ext_strip=rv[2].match(/^(.*)\..+$/))
return ext_strip[1];else
return rv[2];}else{return"";}};Gettext.prototype.parse_po=function(data){var rv={};var buffer={};var lastbuffer="";var errors=[];var lines=data.split("\n");for(var i=0;i<lines.length;i++){lines[i]=lines[i].replace(/(\n|\r)+$/,'');var match;if(/^$/.test(lines[i])){if(typeof(buffer['msgid'])!='undefined'){var msg_ctxt_id=(typeof(buffer['msgctxt'])!='undefined'&&buffer['msgctxt'].length)?buffer['msgctxt']+Gettext.context_glue+buffer['msgid']:buffer['msgid'];var msgid_plural=(typeof(buffer['msgid_plural'])!='undefined'&&buffer['msgid_plural'].length)?buffer['msgid_plural']:null;var trans=[];for(var str in buffer){var match;if(match=str.match(/^msgstr_(\d+)/))
trans[parseInt(match[1])]=buffer[str];}
trans.unshift(msgid_plural);if(trans.length>1)rv[msg_ctxt_id]=trans;buffer={};lastbuffer="";}}else if(/^#/.test(lines[i])){continue;}else if(match=lines[i].match(/^msgctxt\s+(.*)/)){lastbuffer='msgctxt';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgid\s+(.*)/)){lastbuffer='msgid';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgid_plural\s+(.*)/)){lastbuffer='msgid_plural';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\s+(.*)/)){lastbuffer='msgstr_0';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\[0\]\s+(.*)/)){lastbuffer='msgstr_0';buffer[lastbuffer]=this.parse_po_dequote(match[1]);}else if(match=lines[i].match(/^msgstr\[(\d+)\]\s+(.*)/)){lastbuffer='msgstr_'+match[1];buffer[lastbuffer]=this.parse_po_dequote(match[2]);}else if(/^"/.test(lines[i])){buffer[lastbuffer]+=this.parse_po_dequote(lines[i]);}else{errors.push("Strange line ["+i+"] : "+lines[i]);}}
if(typeof(buffer['msgid'])!='undefined'){var msg_ctxt_id=(typeof(buffer['msgctxt'])!='undefined'&&buffer['msgctxt'].length)?buffer['msgctxt']+Gettext.context_glue+buffer['msgid']:buffer['msgid'];var msgid_plural=(typeof(buffer['msgid_plural'])!='undefined'&&buffer['msgid_plural'].length)?buffer['msgid_plural']:null;var trans=[];for(var str in buffer){var match;if(match=str.match(/^msgstr_(\d+)/))
trans[parseInt(match[1])]=buffer[str];}
trans.unshift(msgid_plural);if(trans.length>1)rv[msg_ctxt_id]=trans;buffer={};lastbuffer="";}
if(rv[""]&&rv[""][1]){var cur={};var hlines=rv[""][1].split(/\\n/);for(var i=0;i<hlines.length;i++){if(!hlines.length)continue;var pos=hlines[i].indexOf(':',0);if(pos!=-1){var key=hlines[i].substring(0,pos);var val=hlines[i].substring(pos+1);var keylow=key.toLowerCase();if(cur[keylow]&&cur[keylow].length){errors.push("SKIPPING DUPLICATE HEADER LINE: "+hlines[i]);}else if(/#-#-#-#-#/.test(keylow)){errors.push("SKIPPING ERROR MARKER IN HEADER: "+hlines[i]);}else{val=val.replace(/^\s+/,'');cur[keylow]=val;}}else{errors.push("PROBLEM LINE IN HEADER: "+hlines[i]);cur[hlines[i]]='';}}
rv[""]=cur;}else{rv[""]={};}
return rv;};Gettext.prototype.parse_po_dequote=function(str){var match;if(match=str.match(/^"(.*)"/)){str=match[1];}
str=str.replace(/\\"/g,"\"");return str;};Gettext.prototype.try_load_lang_json=function(uri){var data=this.sjax(uri);if(!data)return;var rv=this.JSON(data);this.parse_locale_data(rv);return 1;};Gettext.prototype.get_lang_refs=function(){var langs=new Array();var links=document.getElementsByTagName("link");for(var i=0;i<links.length;i++){if(links[i].rel=='gettext'&&links[i].href){if(typeof(links[i].type)=='undefined'||links[i].type==''){if(/\.json$/i.test(links[i].href)){links[i].type='application/json';}else if(/\.js$/i.test(links[i].href)){links[i].type='application/json';}else if(/\.po$/i.test(links[i].href)){links[i].type='application/x-po';}else if(/\.mo$/i.test(links[i].href)){links[i].type='application/x-mo';}else{throw new Error("LINK tag with rel=gettext found, but the type and extension are unrecognized.");}}
links[i].type=links[i].type.toLowerCase();if(links[i].type=='application/json'){links[i].type='application/json';}else if(links[i].type=='text/javascript'){links[i].type='application/json';}else if(links[i].type=='application/x-po'){links[i].type='application/x-po';}else if(links[i].type=='application/x-mo'){links[i].type='application/x-mo';}else{throw new Error("LINK tag with rel=gettext found, but the type attribute ["+links[i].type+"] is unrecognized.");}
langs.push(links[i]);}}
return langs;};Gettext.prototype.textdomain=function(domain){if(domain&&domain.length)this.domain=domain;return this.domain;}
Gettext.prototype.gettext=function(msgid){var msgctxt;var msgid_plural;var n;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dgettext=function(domain,msgid){var msgctxt;var msgid_plural;var n;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcgettext=function(domain,msgid,category){var msgctxt;var msgid_plural;var n;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.ngettext=function(msgid,msgid_plural,n){var msgctxt;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dngettext=function(domain,msgid,msgid_plural,n){var msgctxt;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcngettext=function(domain,msgid,msgid_plural,n,category){var msgctxt;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category,category);};Gettext.prototype.pgettext=function(msgctxt,msgid){var msgid_plural;var n;var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dpgettext=function(domain,msgctxt,msgid){var msgid_plural;var n;var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcpgettext=function(domain,msgctxt,msgid,category){var msgid_plural;var n;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.npgettext=function(msgctxt,msgid,msgid_plural,n){var category;return this.dcnpgettext(null,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dnpgettext=function(domain,msgctxt,msgid,msgid_plural,n){var category;return this.dcnpgettext(domain,msgctxt,msgid,msgid_plural,n,category);};Gettext.prototype.dcnpgettext=function(domain,msgctxt,msgid,msgid_plural,n,category){if(!this.isValidObject(msgid))return'';var plural=this.isValidObject(msgid_plural);var msg_ctxt_id=this.isValidObject(msgctxt)?msgctxt+Gettext.context_glue+msgid:msgid;var domainname=this.isValidObject(domain)?domain:this.isValidObject(this.domain)?this.domain:'messages';var category_name='LC_MESSAGES';var category=5;var locale_data=new Array();if(typeof(Gettext._locale_data)!='undefined'&&this.isValidObject(Gettext._locale_data[domainname])){locale_data.push(Gettext._locale_data[domainname]);}else if(typeof(Gettext._locale_data)!='undefined'){for(var dom in Gettext._locale_data){locale_data.push(Gettext._locale_data[dom]);}}
var trans=[];var found=false;var domain_used;if(locale_data.length){for(var i=0;i<locale_data.length;i++){var locale=locale_data[i];if(this.isValidObject(locale.msgs[msg_ctxt_id])){for(var j=0;j<locale.msgs[msg_ctxt_id].length;j++){trans[j]=locale.msgs[msg_ctxt_id][j];}
trans.shift();domain_used=locale;found=true;if(trans.length>0&&trans[0].length!=0)
break;}}}
if(trans.length==0||trans[0].length==0){trans=[msgid,msgid_plural];}
var translation=trans[0];if(plural){var p;if(found&&this.isValidObject(domain_used.head.plural_func)){var rv=domain_used.head.plural_func(n);if(!rv.plural)rv.plural=0;if(!rv.nplural)rv.nplural=0;if(rv.nplural<=rv.plural)rv.plural=0;p=rv.plural;}else{p=(n!=1)?1:0;}
if(this.isValidObject(trans[p]))
translation=trans[p];}
return translation;};Gettext.strargs=function(str,args){if(null==args||'undefined'==typeof(args)){args=[];}else if(args.constructor!=Array){args=[args];}
var newstr="";while(true){var i=str.indexOf('%');var match_n;if(i==-1){newstr+=str;break;}
newstr+=str.substr(0,i);if(str.substr(i,2)=='%%'){newstr+='%';str=str.substr((i+2));}else if(match_n=str.substr(i).match(/^%(\d+)/)){var arg_n=parseInt(match_n[1]);var length_n=match_n[1].length;if(arg_n>0&&args[arg_n-1]!=null&&typeof(args[arg_n-1])!='undefined')
newstr+=args[arg_n-1];str=str.substr((i+1+length_n));}else{newstr+='%';str=str.substr((i+1));}}
return newstr;}
Gettext.prototype.strargs=function(str,args){return Gettext.strargs(str,args);}
Gettext.prototype.isArray=function(thisObject){return this.isValidObject(thisObject)&&thisObject.constructor==Array;};Gettext.prototype.isValidObject=function(thisObject){if(null==thisObject){return false;}else if('undefined'==typeof(thisObject)){return false;}else{return true;}};Gettext.prototype.sjax=function(uri){var xmlhttp;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else if(navigator.userAgent.toLowerCase().indexOf('msie 5')!=-1){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}else{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
if(!xmlhttp)
throw new Error("Your browser doesn't do Ajax. Unable to support external language files.");xmlhttp.open('GET',uri,false);try{xmlhttp.send(null);}
catch(e){return;}
var sjax_status=xmlhttp.status;if(sjax_status==200||sjax_status==0){return xmlhttp.responseText;}else{var error=xmlhttp.statusText+" (Error "+xmlhttp.status+")";if(xmlhttp.responseText.length){error+="\n"+xmlhttp.responseText;}
alert(error);return;}}
Gettext.prototype.JSON=function(data){return eval('('+data+')');}