function getUrlVars(){"use strict";for(var e,t=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;il?h-l:1,t(function(){e.loadingEvents=!1,$.merge(e.events,n),e.events.length===u&&(e.allEventsLoaded=!0),e.currentPage++},d)})};var i={lines:10,length:10,width:5,radius:10,color:"#00223e",speed:1.15,trail:40,shadow:!1,hwaccel:!0,className:"spinner"},s=document.getElementById("eventListLoader");new Spinner(i).spin(s)}]),app.controller("EventsUploadController",["$scope","$compile","$attrs",function(e,t,n){"use strict";var i=getUrlVars().id;$("#Uploader").pluploadQueue({runtimes:"html5,silverlight,flash,html4",url:"/Handlers/FileUploadHandler.ashx?id="+i,max_file_size:"256mb",chunk_size:"64kb",unique_names:!1,filters:{mime_types:"image/*,application/zip,video/x-ms-wmv,video/mp4"},flash_swf_url:"/resources/plUpload/Scripts/plupload/plupload.flash.swf",silverlight_xap_url:"/resources/plUpload/Scripts/plupload/plupload.silverlight.xap",multiple_queues:!0,init:{FilesAdded:function(e,t){var n=/(?:\.([^.]+))?$/,i=["exe","bat"],s=$(".upload-error");plupload.each(t,function(t){var a,r=n.exec(t.name)[1];$.inArray(r,i)>-1&&(e.removeFile(t),a=$("
  • ").text(t.name),s.show().find("ul").append(a),setTimeout(function(){s.fadeOut("slow",function(){a.remove()})},1e4))})}}});var s=$("#Uploader").pluploadQueue();$("#btnStopUpload").click(function(){s.stop()}),$("#btnStartUpload").click(function(){s.start()}),s.bind("FileUploaded",function(s,a,r){if(s.removeFile(a),r.response.length>0){var o=''+a.name+""+a.name.substr(a.name.lastIndexOf("."))+""+Math.floor(a.size/1024)+' KBAdd MetaData',l=$("#divAssociatedFiles tbody");l.append(o),$("#divNoFiles").hide(),$("#divAssociatedFiles").show(),$("#ImageContainer > strong").hide();var d=l.find("tr:last-child");t(d.children())(e),e.$apply()}}),s.bind("Error",function(e,t){console.debug(t.message)}),s.bind("FilesAdded",function(e){return e.files.length>5?(e.files.splice(4,e.files.length-5),!1):!0}),setTimeout(function(){$(".plupload_header_title").text("Upload Files"),$(".plupload_header_text").html("Add files to upload and click start. Max file size: 256mb.")},200)}]),app.controller("PageRatingController",["$scope","$attrs","epaFeedback",function(e,t,n){"use strict";e.feedback={rating:void 0,comments:"",recaptcha:!1},e.characterLimit=500,e.feedbackSent=!1,e.alreadyRated=angular.isString($.cookie("PageRating"))&&-1!==$.cookie("PageRating").indexOf(t.guid),e.pageRating=function(t,n){t.preventDefault(),e.feedback.rating=n},e.$watch("feedback.comments",function(t,n){void 0!==t&&t.length>e.characterLimit&&(e.feedback.comments=n)}),e.$watch("feedback.rating",function(i,s){if(void 0!==i){var a={guid:t.guid,rating:i,"switch":void 0!==s};n.sendRating(a).then(function(){var n=$.cookie("PageRating")||"";-1===n.indexOf(t.guid)&&$.cookie("PageRating",n+"["+e.feedback.rating+t.guid+"]",{expires:30,path:"/"})})}}),e.setResponse=function(t){e.feedback.recaptcha=t},e.sendFeedback=function(i){i.preventDefault();var s={guid:t.guid,comments:e.feedback.comments,recaptcha:e.feedback.recaptcha};n.sendFeedback(s).then(function(){e.feedbackSent=!0})}}]),app.directive("epaDatepicker",["$timeout",function(e){"use strict";return{restrict:"EA",scope:{minDate:"@",defaultDate:"@"},link:function(t,n,i){var s=!1,a=n.val(),r=""===a.trim()?new Date:moment(a).toDate();window.picker=window.picker||{};var o=function(t){if("undefined"!=typeof Sys){var n=Sys.WebForms.PageRequestManager.getInstance();n&&"undefined"!=typeof i.async&&s&&(t||"txtStartDate"===i.id&&"object"==typeof window.picker.txtEndDate&&e(function(){window.picker.txtEndDate.setMinDate(moment(window.picker.txtStartDate.getDate()).toDate())},1),n.beginAsyncPostBack())}};angular.element(document).ready(function(){if($("html").hasClass("is_mobile")){var e=$(n).clone().attr("type","date");e.insertAfter(n).prev().remove(),e.attr("min",moment(r).format("YYYY-MM-DD")),e.attr("value",moment(r).format("YYYY-MM-DD")),e.blur(function(){o()})}else window.picker[i.id]=new Pikaday({defaultDate:r,field:n[0],format:"dddd, D MMMM YYYY",minDate:t.minDate?moment(t.minDate).toDate():null,onSelect:o}),window.picker[i.id].setMoment(moment(r))}),e(function(){s=!0},1)}}}]),$.fn.datepicker=$.fn.datepicker||function(){},app.directive("epaEvent",[function(){"use strict";return{restrict:"A",link:function(e,t){var n=$(t).find(".event-stub");t.bind("click",function(e){e.target.hasAttribute("epa-event")&&(e.preventDefault(),$(".event-stub").hide(),$(this).find(".event-stub").fadeIn(50))}),$(".close",n).bind("click",function(){return $(this).closest(".event-stub").hide(),!1})}}}]),app.directive("glossaryList",[function(){"use strict";return{restrict:"A",link:function(e,t){var n=$(t),i=n.find(".module_content li:first"),s=e.$watch(function(){return i.attr("class")},function(t){"active"===t&&(e.hideAllElements(),e.showElement(decodeURI(window.location.hash.replace("#",""))),s())});$(window).bind("hashchange",function(){e.showElement(decodeURI(window.location.hash.replace("#","")))}),e.hideAllElements=function(){n.find(".accordion_content").hide(),n.find(".accordion_header").removeClass("on")},e.showElement=function(t){if(angular.isString(t)&&t.length){var i=n.find("#"+t.toLowerCase().replace(new RegExp("\\s","g"),"-"));1===i.length&&(e.hideAllElements(),i.find(".accordion_content").show(),i.find(".accordion_header").addClass("on"))}}}}}]),app.directive("highlightTerms",["$http","$compile",function(e,t){"use strict";return{restrict:"A",scope:{highlightTerms:"=",jsonSrc:"@"},link:function(n,i){n.getTermObject=function(e){var t;return angular.forEach(n.data.Results,function(n){n.Term.toLowerCase()===e.toLowerCase()&&(t=n)}),t},n.findAndReplace=function(e,i){var s,a=(i.html(),[]);if(angular.isArray(e)?s=e:angular.isObject(e)&&angular.isArray(e.Terms)&&(s=e.Terms),angular.isArray(s)){s.sort(function(e,t){return t.length-e.length});var r=i.find("p"),o=i.find("li"),l=new RegExp("\\b("+s.join("|")+")\\b","gi");angular.forEach(r,function(e){n.replaceHtml(e,l,a)}),angular.forEach(o,function(e){n.replaceHtml(e,l,a)}),t(i.contents())(n)}},n.replaceHtml=function(e,t,i){var s=$(e).html();$(e).html(s.replace(t,function(e,t){if(i.indexOf(t.toLowerCase())<=-1&&angular.isString(t)){var s=e.length>t.length?e[0]:"",a=n.getTermObject(t);if(angular.isObject(a))return i.push(t.toLowerCase()),s+' '+t+""}return e}))},angular.isString(n.jsonSrc)?e.get(n.jsonSrc).success(function(e){n.data=e,n.findAndReplace(n.data,$(i))}):(n.data=n.highlightTerms,n.findAndReplace(n.data,$(i)))}}}]),app.directive("epaInput",["$timeout",function(e){"use strict";return{restrict:"A",require:"?ngModel",link:function(t,n,i,s){return $.inArray(n[0].type,["radio","checkbox"])>-1?e(function(){var e=i.value;return t.$watch(i.ngModel,function(){$jn(n).iCheck("update")}),$jn(n).iCheck({aria:!0}).bind("ifClicked",function(){$jn(n).trigger("click")}).bind("ifChanged",function(a){return"checkbox"===$(n).attr("type")&&i.ngModel&&t.$apply(function(){return s.$setViewValue(a.target.checked)}),"radio"===$(n).attr("type")&&i.ngModel?t.$apply(function(){return s.$setViewValue(e)}):void 0})},1):$.inArray(n[0].type,["file"])>-1?e(function(){var e=$jn(n);e.addClass("ng-hide");var t=e.value?e.value.replace(/C:\\fakepath\\/i,""):e.attr("title"),i=$jn(''),s=$jn(''),a=$jn(''+("undefined"==typeof t?"":t)+"");e.wrap(i).parents(".file-field").append(s).append(a),e.on("change",function(){a.text(this.value.replace(/C:\\fakepath\\/i,""))}),s.on("click",function(){e.click()})},1):void 0}}}]),app.directive("epaModal",["ngDialog","$sce",function(e,t){"use strict";return{restrict:"A",link:function(n,i,s){i.bind("click",function(i){function a(){var e=document.body,t=document.documentElement,n=Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight);$jn(".ngdialog").find("iframe").attr("height",n-60)}function r(){a(),$jn(window).on("resize",function(){a()})}i.preventDefault(),n.url=t.trustAsResourceUrl(s.href);var o=n.$on("ngDialog.opened",r);return n.$on("ngDialog.closed",function(){o()}),e.open({template:"/resources/ng/modal-iframe.tpl.html",className:"ngdialog-theme-default ngdialog-theme-hazelwood",scope:n,showClose:!1,preCloseCallback:function(){window.location.reload()}}),!1}),i.attr("aria-haspopup","true")}}}]),function(e){"use strict";e.module("vcRecaptcha",[])}(angular),function(e){"use strict";var t=e.module("vcRecaptcha");t.service("vcRecaptchaService",["$window","$q",function(t,n){function i(){return a?n.when(a):o}function s(){if(!a)throw new Error("reCaptcha has not been loaded yet.")}var a,r=n.defer(),o=r.promise;return t.vcRecaptchaApiLoaded=function(){a=t.grecaptcha,r.resolve(a)},e.isDefined(t.grecaptcha)&&t.vcRecaptchaApiLoaded(),{create:function(e,t,n,s){return s.callback=n,s.sitekey=t,i().then(function(t){return t.render(e,s)})},reload:function(e){s(),a.reset(e)},getResponse:function(e){return s(),a.getResponse(e)}}}])}(angular),function(e){"use strict";function t(){throw new Error('You need to set the "key" attribute to your public reCaptcha key. If you don\'t have a key, please get one from https://www.google.com/recaptcha/admin/create')}var n=e.module("vcRecaptcha");n.directive("vcRecaptcha",["$document","$timeout","vcRecaptchaService",function(e,n,i){return{restrict:"A",require:"?^^form",scope:{response:"=?ngModel",key:"=",theme:"=?",tabindex:"=?",onCreate:"&",onSuccess:"&",onExpire:"&"},link:function(s,a,r,o){function l(){angular.element(e[0].querySelectorAll(".pls-container")).parent().remove()}r.hasOwnProperty("key")||t(),s.widgetId=null;var d=s.$watch("key",function(e){if(e){40!==e.length&&t();var u=function(e){n(function(){o&&o.$setValidity("recaptcha",!0),s.response=e,s.onSuccess({response:e,widgetId:s.widgetId}),l()}),n(function(){o&&o.$setValidity("recaptcha",!1),s.response="",s.onExpire({widgetId:s.widgetId})},12e4)};i.create(a[0],e,u,{theme:s.theme||r.theme||null,tabindex:s.tabindex||r.tabindex||null}).then(function(e){o&&o.$setValidity("recaptcha",!1),s.widgetId=e,s.onCreate({widgetId:e}),s.$on("$destroy",l)}),d()}})}}}])}(angular),app.directive("epaSelect",[function(){"use strict";return{restrict:"A",link:function(e,t){$jn(t).chosen({disable_search:!0,inherit_select_classes:!0,max_selected_options:1,width:"100%"})}}}]),app.directive("tooltip",function(){"use strict";return{restrict:"A",scope:{heading:"@",desc:"@",url:"@"},transclude:!0,template:' {{heading}} {{desc}} Full description ',link:function(e,t,n,i,s){var a=$(t);a.find(".transclude").replaceWith(s()),a.hover(function(){a.find(".tooltip").removeClass("ng-hide")},function(){a.find(".tooltip").addClass("ng-hide")})}}}),app.run(["$rootScope",function(e){"use strict";e.shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],e.fullMonths=["January","February","March","April","May","June","July","August","September","October","November","December"]}]),app.factory("epaEvents",["$http","$q","$resource",function(e,t,n){"use strict";function i(e,i,a,r){a=a||10,r=r||"all";var o=t.defer(),l={rootCalendarId:e,startPage:i,pageSize:a,show:r},d=n(s+"/getevents/:rootCalendarId/:startPage/:pageSize/:show",l);return d.get(function(e){e.Results?($.each(e.Results,function(e,t){t.StartDateDay=parseInt(t.StartDate.substr(6,2)),t.StartDateMonth=parseInt(t.StartDate.substr(4,2)),t.EndDateDay=parseInt(t.EndDate.substr(6,2)),t.EndDateMonth=parseInt(t.EndDate.substr(4,2)),t.EndDateYear=parseInt(t.EndDate.substr(0,4))}),o.resolve(e.Results)):o.reject("No results returned")},function(){o.reject("Service call failed.")}),o.promise}var s="/services/calendarservice.svc";return{getEvents:function(e,t,n,s){return i(e,t,n,s)}}}]),app.factory("epaFeedback",["$http","$q","$resource",function(e,t,n){"use strict";function i(e){var i=t.defer(),s=n(a+"/rate"),r={Rating:e.rating,Id:e.guid,Change:e.switch};return s.save(r,function(e){e.Success?i.resolve(e.Success):i.reject("Rating failed to return success from server.")},function(){i.reject("Service call failed.")}),i.promise}function s(e){var i=t.defer(),s=n(a+"/comment"),r={Comment:e.comments,Id:e.guid};return s.save(r,function(e){e.Success?i.resolve(e.Success):i.reject("Rating failed to return success from server.")},function(){i.reject("Service call failed.")}),i.promise}var a="/services/proxyservice.svc/pagerating";return{sendRating:function(e){return i(e)},sendFeedback:function(e){return s(e)}}}]),$jn.fn.anchorAnimate=function(e){"use strict";return e=jQuery.extend({speed:500},e),this.each(function(){var t=this;$(t).click(function(n){n.preventDefault();var i=$(t).attr("href"),s=$(i).offset().top;return $("html:not(:animated),body:not(:animated)").animate({scrollTop:s},e.speed,function(){window.location.hash=i}),!1})})};var matched,browser;$jn.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},matched=$jn.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),$jn.browser=browser,function(){var e,t,n,i,s,a={}.hasOwnProperty,r=function(e,t){function n(){this.constructor=e}for(var i in t)a.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},t.prototype.add_group=function(e){var t,n,i,s,a,r;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled}),a=e.childNodes,r=[],i=0,s=a.length;s>i;i++)n=a[i],r.push(this.add_option(n,t,e.disabled));return r},t.prototype.add_option=function(t,n,i){return"OPTION"===t.nodeName.toUpperCase()?(""!==t.text?(null!=n&&(this.parsed[n].children+=1),"master"===e(t).data("type")&&-1===t.className.indexOf("master-val")&&(t.className=[t.className,"master-val"].join(" ")),"child"===e(t).data("type")&&-1===t.className.indexOf("child-val")&&(t.className=[t.className,"child-val"].join(" ")),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,selected:t.selected,disabled:i===!0?i:t.disabled,group_array_index:n,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},t.prototype.escapeExpression=function(e){var t,n;return null==e||e===!1?"":/[\&\<\>\"\'\`]/.test(e)?(t={"<":"<",">":">",'"':""","'":"'","`":"`"},n=/&(?!\w+;)|[\<\>\"\'\`]/g,e.replace(n,function(e){return t[e]||"&"})):e},t}(),i.select_to_array=function(e){var t,n,s,a,r;for(n=new i,r=e.childNodes,s=0,a=r.length;a>s;s++)t=r[s],n.add_node(t);return n.parsed},t=function(){function e(t,n){this.form_field=t,this.options=null!=n?n:{},e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},e.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(){var e=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return e.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(){var e=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return e.blur_test()},100))},e.prototype.results_option_build=function(e){var t,n,i,s,a;for(t="",a=this.results_data,i=0,s=a.length;s>i;i++)n=a[i],t+=n.group?this.result_add_group(n):this.result_add_option(n),(null!=e?e.first:void 0)&&(n.selected&&this.is_multiple?this.choice_build(n):n.selected&&!this.is_multiple&&this.single_set_selected_text(n.text));return t},e.prototype.result_add_option=function(e){var t,n;return e.search_match?this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.style.cssText=e.style,n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.search_text,this.outerHTML(n)):"":""},e.prototype.result_add_group=function(e){var t;return e.search_match||e.group_match?e.active_options>0?(t=document.createElement("li"),t.className="group-result",t.innerHTML=e.search_text,this.outerHTML(t)):"":""},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},e.prototype.reset_single_select_options=function(){var e,t,n,i,s;for(i=this.results_data,s=[],t=0,n=i.length;n>t;t++)e=i[t],e.selected?s.push(e.selected=!1):s.push(void 0);return s},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(){var e,t,n,i,s,a,r,o,l,d,u,c;for(this.no_results_clear(),i=0,a=this.get_search_text(),e=a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),l=new RegExp(e,"i"),n=this.get_search_regex(e),c=this.results_data,d=0,u=c.length;u>d;d++)t=c[d],t.search_match=!1,s=null,this.include_option_in_results(t)&&(t.group&&(t.group_match=!1,t.active_options=0),null!=t.group_array_index&&this.results_data[t.group_array_index]&&(s=this.results_data[t.group_array_index],0===s.active_options&&s.search_match&&(i+=1),s.active_options+=1),(!t.group||this.group_search)&&(t.search_text=t.group?t.label:t.text,t.search_match=this.search_string_match(t.search_text,n),t.search_match&&!t.group&&(i+=1),t.search_match?(a.length&&(r=t.search_text.search(l),o=t.search_text.substr(0,r+a.length)+""+t.search_text.substr(r+a.length),t.search_text=o.substr(0,r)+""+o.substr(r)),null!=s&&(s.group_match=!0)):null!=t.group_array_index&&this.results_data[t.group_array_index].search_match&&(t.search_match=!0)));return this.result_clear_highlight(),1>i&&a.length?(this.update_results_content(""),this.no_results(a)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t;return t=this.search_contains?"":"^",new RegExp(t+e,"i")},e.prototype.search_string_match=function(e,t){var n,i,s,a;if(t.test(e))return!0;if(this.enable_split_word_search&&(e.indexOf(" ")>=0||0===e.indexOf("["))&&(i=e.replace(/\[|\]/g,"").split(" "),i.length))for(s=0,a=i.length;a>s;s++)if(n=i[s],t.test(n))return!0},e.prototype.choices_count=function(){var e,t,n,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,i=this.form_field.options,t=0,n=i.length;n>t;t++)e=i[t],e.selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){return e.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},e.prototype.keyup_checker=function(e){var t,n;switch(t=null!=(n=e.which)?n:e.keyCode,this.search_field_scale(),t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(e.preventDefault(),this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return this.is_multiple&&!this.display_selected_options&&e.selected?!1:!this.display_disabled_options&&e.disabled?!1:e.empty?!1:!0},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){return this.touch_started?this.search_results_mouseup(e):void 0},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:(t=document.createElement("div"),t.appendChild(e),t.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)?!1:Modernizr.touch?!1:!0},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),e=$jn,e.fn.extend({chosen:function(i){return t.browser_is_supported()?this.each(function(){var t,s;t=e(this),s=t.data("chosen"),"destroy"===i&&s instanceof n?s.destroy():s instanceof n||t.data("chosen",new n(this,i))}):this}}),n=function(t){function n(){return s=n.__super__.constructor.apply(this,arguments)}return r(n,t),n.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},n.prototype.set_up_html=function(){var t,n,i="complete"+Math.floor(100*Math.random()+1);for(t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl");e("#"+i).length;)i="complete"+Math.floor(100*Math.random()+1);return n={"class":t.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(n.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=e("
    ",n),this.is_multiple?this.container.html('
      '):this.container.html(''+this.default_text+'
        '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){var e=this;return this.container.bind("touchstart.chosen",function(t){e.container_mousedown(t)}),this.container.bind("touchend.chosen",function(t){e.container_mouseup(t)}),this.container.bind("mousedown.chosen",function(t){e.container_mousedown(t)}),this.container.bind("mouseup.chosen",function(t){e.container_mouseup(t)}),this.container.bind("mouseenter.chosen",function(t){e.mouse_enter(t)}),this.container.bind("mouseleave.chosen",function(t){e.mouse_leave(t)}),this.search_results.bind("mouseup.chosen",function(t){e.search_results_mouseup(t)}),this.search_results.bind("mouseover.chosen",function(t){e.search_results_mouseover(t)}),this.search_results.bind("mouseout.chosen",function(t){e.search_results_mouseout(t)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(t){e.search_results_mousewheel(t)}),this.search_results.bind("touchstart.chosen",function(t){e.search_results_touchstart(t)}),this.search_results.bind("touchmove.chosen",function(t){e.search_results_touchmove(t)}),this.search_results.bind("touchend.chosen",function(t){e.search_results_touchend(t)}),this.form_field_jq.bind("chosen:updated.chosen",function(t){e.results_update_field(t)}),this.form_field_jq.bind("chosen:activate.chosen",function(t){e.activate_field(t)}),this.form_field_jq.bind("chosen:open.chosen",function(t){e.container_mousedown(t)}),this.form_field_jq.bind("chosen:close.chosen",function(t){e.input_blur(t)}),this.search_field.bind("blur.chosen",function(t){e.input_blur(t)}),this.search_field.bind("keyup.chosen",function(t){e.keyup_checker(t)}),this.search_field.bind("keydown.chosen",function(t){e.keydown_checker(t)}),this.search_field.bind("focus.chosen",function(t){e.input_focus(t)}),this.search_field.bind("cut.chosen",function(t){e.clipboard_event_checker(t)}),this.search_field.bind("paste.chosen",function(t){e.clipboard_event_checker(t)}),this.is_multiple?this.search_choices.bind("click.chosen",function(t){e.choices_click(t)}):this.container.bind("click.chosen",function(e){e.preventDefault()})},n.prototype.destroy=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},n.prototype.container_mousedown=function(t){return this.is_disabled||(t&&"mousedown"===t.type&&!this.results_showing&&t.preventDefault(),null!=t&&e(t.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(e){return"ABBR"!==e.target.nodeName||this.is_disabled?void 0:this.results_reset(e)},n.prototype.search_results_mousewheel=function(e){var t;return e.originalEvent&&(t=e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail),null!=t?(e.preventDefault(),"DOMMouseScroll"===e.type&&(t=40*t),this.search_results.scrollTop(t+this.search_results.scrollTop())):void 0},n.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},n.prototype.close_field=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale() },n.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(t){var n;return n=e(t.target).closest(".chosen-container"),n.length&&this.container[0]===n[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(e){var t,n,i,s,a;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),a=this.search_results.scrollTop(),s=i+a,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight(),t>=s)return this.search_results.scrollTop(t-i>0?t-i:0);if(a>n)return this.search_results.scrollTop(n)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(e){return this.search_results.html(e)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(){var e;return this.form_field.tabIndex?(e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e):void 0},n.prototype.set_label_behavior=function(){var t=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=e("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(e){return t.is_multiple?t.container_mousedown(e):t.activate_field()}):void 0},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n.length?(this.result_highlight=n,this.result_select(t),this.search_field.focus()):void 0},n.prototype.search_results_mouseover=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n?this.result_do_highlight(n):void 0},n.prototype.search_results_mouseout=function(t){return e(t.target).hasClass("active-result")?this.result_clear_highlight():void 0},n.prototype.choice_build=function(t){var n,i,s=this;return n=e("
      • ",{"class":"search-choice"}).html(""+t.html+""),t.disabled?n.addClass("search-choice-disabled"):(i=e("",{"class":"search-choice-close","data-option-array-index":t.array_index}),i.bind("click.chosen",function(e){return s.choice_destroy_link_click(e)}),n.append(i)),this.search_container.before(n)},n.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),t.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(e(t.target))},n.prototype.choice_destroy=function(e){return this.result_deselect(e[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()):void 0},n.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(e){var t,n;return this.result_highlight?(t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),n=this.results_data[t[0].getAttribute("data-option-array-index")],n.selected=!0,this.form_field.options[n.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(n):this.single_set_selected_text(n.text),(e.metaKey||e.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[n.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},n.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(e)},n.prototype.result_deselect=function(e){var t;return t=this.results_data[e],this.form_field.options[t.options_index].disabled?!1:(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},n.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":e("
        ").text(e.trim(this.search_field.val())).html()},n.prototype.winnow_results_set_highlight=function(){var e,t;return t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first(),null!=e?this.result_do_highlight(e):void 0},n.prototype.no_results=function(t){var n;return n=e('
      • '+this.results_none_found+' ""
      • '),n.find("span").first().html(t),this.search_results.append(n),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last(),e.length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.keydown_checker=function(e){var t,n;switch(t=null!=(n=e.which)?n:e.keyCode,this.search_field_scale(),8!==t&&this.pending_backstroke&&this.clear_backstroke(),t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},n.prototype.search_field_scale=function(){var t,n,i,s,a,r,o,l,d;if(this.is_multiple){for(i=0,o=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",r=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,d=r.length;d>l;l++)s=r[l],a+=s+":"+this.search_field.css(s)+";";return t=e("
        ",{style:a}),t.text(this.search_field.val()),e("body").append(t),o=t.width()+25,t.remove(),n=this.container.outerWidth(),o>n-10&&(o=n-10),this.search_field.css({width:o+"px"})}},n}(t)}.call(this),function(e){function t(e,t,s){var a=e[0],r=/er/.test(s)?g:/bl/.test(s)?p:h,o=s==_?{checked:a[h],disabled:a[p],indeterminate:"true"==e.attr(g)||"false"==e.attr(m)}:a[r];if(/^(ch|di|in)/.test(s)&&!o)n(e,r);else if(/^(un|en|de)/.test(s)&&o)i(e,r);else if(s==_)for(var l in o)o[l]?n(e,l,!0):i(e,l,!0);else t&&"toggle"!=s||(t||e[D]("ifClicked"),o?a[v]!==c&&i(e,r):n(e,r))}function n(t,n,s){var u=t[0],_=t.parent(),y=n==h,b=n==g,D=n==p,x=b?m:y?f:"enabled",S=a(t,x+r(u[v])),E=a(t,n+r(u[v]));if(u[n]!==!0){if(!s&&n==h&&u[v]==c&&u.name){var M=t.closest("form"),T='input[name="'+u.name+'"]';T=M.length?M.find(T):e(T),T.each(function(){this!==u&&e(this).data(l)&&i(e(this),n)})}b?(u[n]=!0,u[h]&&i(t,h,"force")):(s||(u[n]=!0),y&&u[g]&&i(t,g,!1)),o(t,y,n,s)}u[p]&&a(t,k,!0)&&_.find("."+d).css(k,"default"),_[w](E||a(t,n)||""),_.attr("role")&&!b&&_.attr("aria-"+(D?p:h),"true"),_[C](S||a(t,x)||"")}function i(e,t,n){var i=e[0],s=e.parent(),l=t==h,u=t==g,c=t==p,_=u?m:l?f:"enabled",y=a(e,_+r(i[v])),b=a(e,t+r(i[v]));i[t]!==!1&&((u||!n||"force"==n)&&(i[t]=!1),o(e,l,_,n)),!i[p]&&a(e,k,!0)&&s.find("."+d).css(k,"pointer"),s[C](b||a(e,t)||""),s.attr("role")&&!u&&s.attr("aria-"+(c?p:h),"false"),s[w](y||a(e,_)||"")}function s(t,n){t.data(l)&&(t.parent().html(t.attr("style",t.data(l).s||"")),n&&t[D](n),t.off(".i").unwrap(),e(x+'[for="'+t[0].id+'"]').add(t.closest(x)).off(".i"))}function a(e,t,n){return e.data(l)?e.data(l).o[t+(n?"":"Class")]:void 0}function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e,t,n,i){i||(t&&e[D]("ifToggled"),e[D]("ifChanged")[D]("if"+r(n)))}e=$jn;var l="iCheck",d=l+"-helper",u="checkbox",c="radio",h="checked",f="un"+h,p="disabled",m="determinate",g="in"+m,_="update",v="type",y="click",b="touchbegin.i touchend.i",w="addClass",C="removeClass",D="trigger",x="label",k="cursor",S=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);$jn.fn[l]=function(a,r){var o='input[type="'+u+'"], input[type="'+c+'"]',f=e(),m=function(t){t.each(function(){var t=e(this);f=t.is(o)?f.add(t):f.add(t.find(o))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),m(this),f.each(function(){var n=e(this);"destroy"==a?s(n,"ifDestroyed"):t(n,!0,a),e.isFunction(r)&&r()});if("object"!=typeof a&&a)return this;var k=e.extend({checkedClass:h,disabledClass:p,indeterminateClass:g,labelHover:!0},a),E=k.handle,M=k.hoverClass||"hover",T=k.focusClass||"focus",F=k.activeClass||"active",I=!!k.labelHover,O=k.labelHoverClass||"hover",A=0|(""+k.increaseArea).replace("%","");return(E==u||E==c)&&(o='input[type="'+E+'"]'),-50>A&&(A=-50),m(this),f.each(function(){var a=e(this);s(a);var r,o=this,f=o.id,m=-A+"%",g=100+2*A+"%",E={position:"absolute",top:m,left:m,display:"block",width:g,height:g,margin:0,padding:0,background:"#fff",border:0,opacity:0},R=S?{position:"absolute",visibility:"hidden"}:A?E:{position:"absolute",opacity:0},P=o[v]==u?k.checkboxClass||"i"+u:k.radioClass||"i"+c,N=e(x+'[for="'+f+'"]').add(a.closest(x)),Y=!!k.aria,L=l+"-"+Math.random().toString(36).substr(2,6),$='
        ")[D]("ifCreated").parent().append(k.insert),r=e('').css(E).appendTo($),a.data(l,{o:k,s:a.attr("style")}).css(R),!!k.inheritClass&&$[w](o.className||""),!!k.inheritID&&f&&$.attr("id",l+"-"+f),"static"==$.css("position")&&$.css("position","relative"),t(a,!0,_),N.length&&N.on(y+".i mouseover.i mouseout.i "+b,function(n){var i=n[v],s=e(this);if(!o[p]){if(i==y){if(e(n.target).is("a"))return;t(a,!1,!0)}else I&&(/ut|nd/.test(i)?($[C](M),s[C](O)):($[w](M),s[w](O)));if(!S)return!1;n.stopPropagation()}}),a.on(y+".i focus.i blur.i keyup.i keydown.i keypress.i",function(e){var t=e[v],s=e.keyCode;return t==y?!1:"keydown"==t&&32==s?(o[v]==c&&o[h]||(o[h]?i(a,h):n(a,h)),!1):("keyup"==t&&o[v]==c?!o[h]&&n(a,h):/us|ur/.test(t)&&$["blur"==t?C:w](T),void 0)}),r.on(y+" mousedown mouseup mouseover mouseout "+b,function(e){var n=e[v],i=/wn|up/.test(n)?F:M;if(!o[p]){if(n==y?t(a,!1,!0):(/wn|er|in/.test(n)?$[w](i):$[C](i+" "+F),N.length&&I&&i==M&&N[/ut|nd/.test(n)?C:w](O)),!S)return!1;e.stopPropagation()}})})}}(window.jQuery||window.Zepto),function(e){e.cookie=function(t,n,i){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(n))||null===n||void 0===n)){if(i=e.extend({},i),(null===n||void 0===n)&&(i.expires=-1),"number"==typeof i.expires){var s=i.expires,a=i.expires=new Date;a.setDate(a.getDate()+s)}return n=String(n),document.cookie=[encodeURIComponent(t),"=",i.raw?n:encodeURIComponent(n),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}i=n||{};for(var r,o=i.raw?function(e){return e}:decodeURIComponent,l=document.cookie.split("; "),d=0;r=l[d]&&l[d].split("=");d++)if(o(r[0])===t)return o(r[1]||"");return null}}($jn),function(e){e.flexslider=function(t,n){var i=t;i.init=function(){function t(e){if(!i.animating&&(39==e.keyCode||37==e.keyCode)){if(39==e.keyCode)var t=i.getTarget("next");else if(37==e.keyCode)var t=i.getTarget("prev");i.canAdvance(t)&&i.flexAnimate(t,i.vars.pauseOnAction)}}function s(e){i.animating?e.preventDefault():1==e.touches.length&&(i.pause(),_=i.vertical?i.height():i.width(),y=Number(new Date),g=i.vertical?(i.currentSlide+i.cloneOffset)*i.height():(i.currentSlide+i.cloneOffset)*i.width(),p=i.vertical?e.touches[0].pageY:e.touches[0].pageX,m=i.vertical?e.touches[0].pageX:e.touches[0].pageY,i.setTransition(0),this.addEventListener("touchmove",a,!1),this.addEventListener("touchend",r,!1))}function a(e){v=i.vertical?p-e.touches[0].pageY:p-e.touches[0].pageX,b=i.vertical?Math.abs(v)v||i.currentSlide==i.count-1&&v>0?Math.abs(v)/_+2:1),i.args[i.prop]=i.vertical?"translate3d(0,"+(-g-v)+"px,0)":"translate3d("+(-g-v)+"px,0,0)",i.container.css(i.args)))}function r(){if(i.animating=!1,i.animatingTo==i.currentSlide&&!b&&null!=v){var e=v>0?i.getTarget("next"):i.getTarget("prev");i.canAdvance(e)&&Number(new Date)-y<550&&Math.abs(v)>20||Math.abs(v)>_/2?i.flexAnimate(e,i.vars.pauseOnAction):i.flexAnimate(i.currentSlide,i.vars.pauseOnAction)}this.removeEventListener("touchmove",a,!1),this.removeEventListener("touchend",r,!1),p=null,m=null,v=null,g=null}if(i.vars=e.extend({},e.flexslider.defaults,n),i.data("flexslider",!0),i.container=e(".slides",i).first(),i.slides=e(".slides:first > li",i),i.count=i.slides.length,i.animating=!1,i.currentSlide=i.vars.slideToStart,i.animatingTo=i.currentSlide,i.atEnd=0==i.currentSlide?!0:!1,i.eventType="ontouchstart"in document.documentElement?"touchstart":"click",i.cloneCount=0,i.cloneOffset=0,i.manualPause=!1,i.vertical="vertical"==i.vars.slideDirection,i.prop=i.vertical?"top":"marginLeft",i.args={},i.transitions="webkitTransition"in document.body.style,i.transitions&&(i.prop="-webkit-transform"),""!=i.vars.controlsContainer&&(i.controlsContainer=e(i.vars.controlsContainer).eq(e(".slides").index(i.container)),i.containerExists=i.controlsContainer.length>0),""!=i.vars.manualControls&&(i.manualControls=e(i.vars.manualControls,i.containerExists?i.controlsContainer:i),i.manualExists=i.manualControls.length>0),i.vars.randomize&&(i.slides.sort(function(){return Math.round(Math.random())-.5}),i.container.empty().append(i.slides)),"slide"==i.vars.animation.toLowerCase()){i.transitions&&i.setTransition(0),i.css({overflow:"hidden"}),i.vars.animationLoop&&(i.cloneCount=2,i.cloneOffset=1,i.container.append(i.slides.filter(":first").clone().addClass("clone")).prepend(i.slides.filter(":last").clone().addClass("clone"))),i.newSlides=e(".slides:first > li",i);var o=-1*(i.currentSlide+i.cloneOffset);i.vertical?(i.newSlides.css({display:"block",width:"100%","float":"left"}),i.container.height(200*(i.count+i.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){i.css({position:"relative"}).height(i.slides.filter(":first").height()),i.args[i.prop]=i.transitions?"translate3d(0,"+o*i.height()+"px,0)":o*i.height()+"px",i.container.css(i.args)},100)):(i.args[i.prop]=i.transitions?"translate3d("+o*i.width()+"px,0,0)":o*i.width()+"px",i.container.width(200*(i.count+i.cloneCount)+"%").css(i.args),setTimeout(function(){i.newSlides.width(i.width()).css({"float":"left",display:"block"})},100))}else i.transitions=!1,i.slides.css({width:"100%","float":"left",marginRight:"-100%"}).eq(i.currentSlide).fadeIn(i.vars.animationDuration);if(i.vars.controlNav){if(i.manualExists)i.controlNav=i.manualControls;else{for(var l=e('
          '),d=1,u=0;u
          "+d+""),d++;i.containerExists?(e(i.controlsContainer).append(l),i.controlNav=e(".flex-control-nav li a",i.controlsContainer)):(i.append(l),i.controlNav=e(".flex-control-nav li a",i))}i.controlNav.eq(i.currentSlide).addClass("active"),i.controlNav.bind(i.eventType,function(t){t.preventDefault(),e(this).hasClass("active")||(i.direction=i.controlNav.index(e(this))>i.currentSlide?"next":"prev",i.flexAnimate(i.controlNav.index(e(this)),i.vars.pauseOnAction))})}if(i.vars.directionNav){var c=e('");i.containerExists?(e(i.controlsContainer).append(c),i.directionNav=e(".flex-direction-nav li a",i.controlsContainer)):(i.append(c),i.directionNav=e(".flex-direction-nav li a",i)),i.vars.animationLoop||(0==i.currentSlide?i.directionNav.filter(".prev").addClass("disabled"):i.currentSlide==i.count-1&&i.directionNav.filter(".next").addClass("disabled")),i.directionNav.bind(i.eventType,function(t){t.preventDefault();var n=e(this).hasClass("next")?i.getTarget("next"):i.getTarget("prev");i.canAdvance(n)&&i.flexAnimate(n,i.vars.pauseOnAction)})}if(i.vars.keyboardNav&&1==e("ul.slides").length&&e(document).bind("keyup",t),i.vars.mousewheel&&(i.mousewheelEvent=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel",i.bind(i.mousewheelEvent,function(e){e.preventDefault(),e=e?e:window.event;var t=e.detail?-1*e.detail:e.wheelDelta/40,n=0>t?i.getTarget("next"):i.getTarget("prev");i.canAdvance(n)&&i.flexAnimate(n,i.vars.pauseOnAction)})),i.vars.slideshow&&(i.vars.pauseOnHover&&i.vars.slideshow&&i.hover(function(){i.pause()},function(){i.manualPause||i.resume()}),i.animatedSlides=setInterval(i.animateSlides,i.vars.slideshowSpeed)),i.vars.pausePlay){var h=e('
          ');i.containerExists?(i.controlsContainer.append(h),i.pausePlay=e(".flex-pauseplay span",i.controlsContainer)):(i.append(h),i.pausePlay=e(".flex-pauseplay span",i));var f=i.vars.slideshow?"pause":"play";i.pausePlay.addClass(f).text("pause"==f?i.vars.pauseText:i.vars.playText),i.pausePlay.bind(i.eventType,function(t){t.preventDefault(),e(this).hasClass("pause")?(i.pause(),i.manualPause=!0):(i.resume(),i.manualPause=!1)})}if("ontouchstart"in document.documentElement){var p,m,g,_,v,y,b=!1;i.each(function(){"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",s,!1)})}"slide"==i.vars.animation.toLowerCase()&&e(window).resize(function(){i.animating||(i.vertical?(i.height(i.slides.filter(":first").height()),i.args[i.prop]=-1*(i.currentSlide+i.cloneOffset)*i.slides.filter(":first").height()+"px",i.transitions&&(i.setTransition(0),i.args[i.prop]=i.vertical?"translate3d(0,"+i.args[i.prop]+",0)":"translate3d("+i.args[i.prop]+",0,0)"),i.container.css(i.args)):(i.newSlides.width(i.width()),i.args[i.prop]=-1*(i.currentSlide+i.cloneOffset)*i.width()+"px",i.transitions&&(i.setTransition(0),i.args[i.prop]=i.vertical?"translate3d(0,"+i.args[i.prop]+",0)":"translate3d("+i.args[i.prop]+",0,0)"),i.container.css(i.args)))}),i.vars.start(i)},i.flexAnimate=function(e,t){if(!i.animating)if(i.animating=!0,i.animatingTo=e,i.vars.before(i),t&&i.pause(),i.vars.controlNav&&i.controlNav.removeClass("active").eq(e).addClass("active"),i.atEnd=0==e||e==i.count-1?!0:!1,!i.vars.animationLoop&&i.vars.directionNav&&(0==e?i.directionNav.removeClass("disabled").filter(".prev").addClass("disabled"):e==i.count-1?i.directionNav.removeClass("disabled").filter(".next").addClass("disabled"):i.directionNav.removeClass("disabled")),i.vars.animationLoop||e!=i.count-1||(i.pause(),i.vars.end(i)),"slide"==i.vars.animation.toLowerCase()){var n=i.vertical?i.slides.filter(":first").height():i.slides.filter(":first").width();i.slideString=0==i.currentSlide&&e==i.count-1&&i.vars.animationLoop&&"next"!=i.direction?"0px":i.currentSlide==i.count-1&&0==e&&i.vars.animationLoop&&"prev"!=i.direction?-1*(i.count+1)*n+"px":-1*(e+i.cloneOffset)*n+"px",i.args[i.prop]=i.slideString,i.transitions?(i.setTransition(i.vars.animationDuration),i.args[i.prop]=i.vertical?"translate3d(0,"+i.slideString+",0)":"translate3d("+i.slideString+",0,0)",i.container.css(i.args).one("webkitTransitionEnd transitionend",function(){i.wrapup(n)})):i.container.animate(i.args,i.vars.animationDuration,function(){i.wrapup(n)})}else i.slides.eq(i.currentSlide).fadeOut(i.vars.animationDuration),i.slides.eq(e).fadeIn(i.vars.animationDuration,function(){i.wrapup()})},i.wrapup=function(e){"slide"==i.vars.animation&&(0==i.currentSlide&&i.animatingTo==i.count-1&&i.vars.animationLoop?(i.args[i.prop]=-1*i.count*e+"px",i.transitions&&(i.setTransition(0),i.args[i.prop]=i.vertical?"translate3d(0,"+i.args[i.prop]+",0)":"translate3d("+i.args[i.prop]+",0,0)"),i.container.css(i.args)):i.currentSlide==i.count-1&&0==i.animatingTo&&i.vars.animationLoop&&(i.args[i.prop]=-1*e+"px",i.transitions&&(i.setTransition(0),i.args[i.prop]=i.vertical?"translate3d(0,"+i.args[i.prop]+",0)":"translate3d("+i.args[i.prop]+",0,0)"),i.container.css(i.args))),i.animating=!1,i.currentSlide=i.animatingTo,i.vars.after(i)},i.animateSlides=function(){i.animating||i.flexAnimate(i.getTarget("next"))},i.pause=function(){clearInterval(i.animatedSlides),i.vars.pausePlay&&i.pausePlay.removeClass("pause").addClass("play").text(i.vars.playText)},i.resume=function(){i.animatedSlides=setInterval(i.animateSlides,i.vars.slideshowSpeed),i.vars.pausePlay&&i.pausePlay.removeClass("play").addClass("pause").text(i.vars.pauseText)},i.canAdvance=function(e){return!i.vars.animationLoop&&i.atEnd?0==i.currentSlide&&e==i.count-1&&"next"!=i.direction?!1:i.currentSlide==i.count-1&&0==e&&"next"==i.direction?!1:!0:!0},i.getTarget=function(e){return i.direction=e,"next"==e?i.currentSlide==i.count-1?0:i.currentSlide+1:0==i.currentSlide?i.count-1:i.currentSlide-1},i.setTransition=function(e){i.container.css({"-webkit-transition-duration":e/1e3+"s"})},i.init()},e.flexslider.defaults={animation:"fade",slideDirection:"horizontal",slideshow:!0,slideshowSpeed:7e3,animationDuration:600,directionNav:!0,controlNav:!0,keyboardNav:!0,mousewheel:!1,prevText:"Previous",nextText:"Next",pausePlay:!1,pauseText:"Pause",playText:"Play",randomize:!1,slideToStart:0,animationLoop:!0,pauseOnAction:!0,pauseOnHover:!1,controlsContainer:"",manualControls:"",start:function(){},before:function(){},after:function(){},end:function(){}},e.fn.flexslider=function(t){return this.each(function(){1==e(this).find(".slides li").length?e(this).find(".slides li").fadeIn(400):1!=e(this).data("flexslider")&&new e.flexslider(e(this),t)})}}($jn),function(e){function t(e){return plupload.translate(e)||e}function n(n,i){i.contents().each(function(t,n){n=e(n),n.is(".plupload")||n.remove()}),i.prepend('
          '+t("Select files")+'
          '+t("Add files to the upload queue and click the start button.")+'
          '+t("Filename")+'
           
          '+t("Status")+'
          '+t("Size")+'
           
            ')}var i={};e.fn.pluploadQueue=function(s){return s?(this.each(function(){function a(t){var n;t.status==plupload.DONE&&(n="plupload_done"),t.status==plupload.FAILED&&(n="plupload_failed"),t.status==plupload.QUEUED&&(n="plupload_delete"),t.status==plupload.UPLOADING&&(n="plupload_uploading");var i=e("#"+t.id).attr("class",n).find("a").css("display","block");t.hint&&i.attr("title",t.hint)}function r(){e("span.plupload_total_status",d).html(l.total.percent+"%"),e("div.plupload_progress_bar",d).css("width",l.total.percent+"%"),e("span.plupload_upload_status",d).html(t("Uploaded %d/%d files").replace(/%d\/%d/,l.total.uploaded+"/"+l.files.length))}function o(){var n,i=e("ul.plupload_filelist",d).html(""),s=0;e.each(l.files,function(t,r){n="",r.status==plupload.DONE&&(r.target_name&&(n+=''),n+='',n+='',s++,e("#"+u+"_count").val(s)),i.append('
          • '+r.name+'
            '+r.percent+'%
            '+plupload.formatSize(r.size)+'
             
            '+n+"
          • "),a(r),e("#"+r.id+".plupload_delete a").click(function(t){e("#"+r.id).remove(),l.removeFile(r),t.preventDefault()})}),e("span.plupload_total_file_size",d).html(plupload.formatSize(l.total.size)),0===l.total.queued?e("span.plupload_add_text",d).html(t("Add files.")):e("span.plupload_add_text",d).html(l.total.queued+" files queued."),e("a.plupload_start",d).toggleClass("plupload_disabled",l.files.length==l.total.uploaded+l.total.failed),i[0].scrollTop=i[0].scrollHeight,r(),!l.files.length&&l.features.dragdrop&&l.settings.dragdrop&&e("#"+u+"_filelist").append('
          • '+t("Drag files here.")+"
          • ")}var l,d,u;d=e(this),u=d.attr("id"),u||(u=plupload.guid(),d.attr("id",u)),l=new plupload.Uploader(e.extend({dragdrop:!0,container:u},s)),i[u]=l,l.bind("UploadFile",function(t,n){e("#"+n.id).addClass("plupload_current_file")}),l.bind("Init",function(i,a){n(u,d),!s.unique_names&&s.rename&&d.on("click","#"+u+"_filelist div.plupload_file_name span",function(t){var n,s,a,r=e(t.target),o="";n=i.getFile(r.parents("li")[0].id),a=n.name,s=/^(.+)(\.[^.]+)$/.exec(a),s&&(a=s[1],o=s[2]),r.hide().after(''),r.next().val(a).focus().blur(function(){r.show().next().remove()}).keydown(function(t){var i=e(this);-1!==e.inArray(t.keyCode,[13,27])&&(t.preventDefault(),13===t.keyCode&&(n.name=i.val()+o,r.html(n.name)),i.blur())})}),e("a.plupload_add",d).attr("id",u+"_browse"),i.settings.browse_button=u+"_browse",i.features.dragdrop&&i.settings.dragdrop&&(i.settings.drop_element=u+"_filelist",e("#"+u+"_filelist").append('
          • '+t("Drag files here.")+"
          • ")),e("#"+u+"_container").attr("title","Using runtime: "+a.runtime),e("a.plupload_start",d).click(function(t){e(this).hasClass("plupload_disabled")||l.start(),t.preventDefault()}),e("a.plupload_stop",d).click(function(e){e.preventDefault(),l.stop()}),e("a.plupload_start",d).addClass("plupload_disabled")}),l.init(),l.bind("Error",function(n,i){var s,a=i.file;a&&(s=i.message,i.details&&(s+=" ("+i.details+")"),i.code==plupload.FILE_SIZE_ERROR&&alert(t("Error: File too large: ")+a.name),i.code==plupload.FILE_EXTENSION_ERROR&&alert(t("Error: Invalid file extension: ")+a.name),a.hint=s,e("#"+a.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",s))}),l.bind("StateChanged",function(){l.state===plupload.STARTED?(e("li.plupload_delete a,div.plupload_buttons",d).hide(),e("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",d).css("display","block"),e("span.plupload_upload_status",d).html("Uploaded "+l.total.uploaded+"/"+l.files.length+" files"),s.multiple_queues&&e("span.plupload_total_status,span.plupload_total_file_size",d).show()):(o(),e("a.plupload_stop,div.plupload_progress",d).hide(),e("a.plupload_delete",d).css("display","block"))}),l.bind("QueueChanged",o),l.bind("FileUploaded",function(e,t){a(t)}),l.bind("UploadProgress",function(t,n){e("#"+n.id+" div.plupload_file_status",d).html(n.percent+"%"),a(n),r(),s.multiple_queues&&l.total.uploaded+l.total.failed==l.files.length&&(e(".plupload_buttons,.plupload_upload_status",d).css("display","inline"),e(".plupload_start",d).addClass("plupload_disabled"),e("span.plupload_total_status,span.plupload_total_file_size",d).hide())}),s.setup&&s.setup(l)}),this):i[e(this[0]).attr("id")] }}(jQuery),function(e){e.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",buttonClass:"button",activeClass:"active",hoverClass:"hover",useID:!0,idPrefix:"uniform",resetSelector:!1,autoHide:!0},elements:[]},e.support.selectOpacity=e.browser.msie&&e.browser.version<7?!1:!0,e.fn.uniform=function(t){function n(t){$el=e(t),$el.addClass($el.attr("type")),d(t)}function i(t){e(t).addClass("uniform"),d(t)}function s(n){var i=e(n),s=e("
            "),a=e("");s.addClass(t.buttonClass),t.useID&&""!=i.attr("id")&&s.attr("id",t.idPrefix+"-"+i.attr("id"));var r;i.is("a")||i.is("button")?r=i.text():(i.is(":submit")||i.is(":reset")||i.is("input[type=button]"))&&(r=i.attr("value")),r=""==r?i.is(":reset")?"Reset":"Submit":r,a.html(r),i.css("opacity",0),i.wrap(s),i.wrap(a),s=i.closest("div"),a=i.closest("span"),i.is(":disabled")&&s.addClass(t.disabledClass),s.bind({"mouseenter.uniform":function(){s.addClass(t.hoverClass)},"mouseleave.uniform":function(){s.removeClass(t.hoverClass),s.removeClass(t.activeClass)},"mousedown.uniform touchbegin.uniform":function(){s.addClass(t.activeClass)},"mouseup.uniform touchend.uniform":function(){s.removeClass(t.activeClass)},"click.uniform touchend.uniform":function(t){if(e(t.target).is("span")||e(t.target).is("div"))if(n[0].dispatchEvent){var i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),n[0].dispatchEvent(i)}else n[0].click()}}),n.bind({"focus.uniform":function(){s.addClass(t.focusClass)},"blur.uniform":function(){s.removeClass(t.focusClass)}}),e.uniform.noSelect(s),d(n)}function a(n){var i=e(n),s=e("
            "),a=e("");"none"==!i.css("display")&&t.autoHide&&s.hide(),s.addClass(t.selectClass),t.useID&&""!=n.attr("id")&&s.attr("id",t.idPrefix+"-"+n.attr("id"));var r=n.find(":selected:first");0==r.length&&(r=n.find("option:first")),a.html(r.html()),n.css("opacity",0),n.wrap(s),n.before(a),s=n.parent("div"),a=n.siblings("span"),n.bind({"change.uniform":function(){a.text(n.find(":selected").html()),s.removeClass(t.activeClass)},"focus.uniform":function(){s.addClass(t.focusClass)},"blur.uniform":function(){s.removeClass(t.focusClass),s.removeClass(t.activeClass)},"mousedown.uniform touchbegin.uniform":function(){s.addClass(t.activeClass)},"mouseup.uniform touchend.uniform":function(){s.removeClass(t.activeClass)},"click.uniform touchend.uniform":function(){s.removeClass(t.activeClass)},"mouseenter.uniform":function(){s.addClass(t.hoverClass)},"mouseleave.uniform":function(){s.removeClass(t.hoverClass),s.removeClass(t.activeClass)},"keyup.uniform":function(){a.text(n.find(":selected").html())}}),e(n).attr("disabled")&&s.addClass(t.disabledClass),e.uniform.noSelect(a),d(n)}function r(n){var i=e(n),s=e("
            "),a=e("");"none"==!i.css("display")&&t.autoHide&&s.hide(),s.addClass(t.checkboxClass),t.useID&&""!=n.attr("id")&&s.attr("id",t.idPrefix+"-"+n.attr("id")),e(n).wrap(s),e(n).wrap(a),a=n.parent(),s=a.parent(),e(n).css("opacity",0).bind({"focus.uniform":function(){s.addClass(t.focusClass)},"blur.uniform":function(){s.removeClass(t.focusClass)},"click.uniform touchend.uniform":function(){e(n).attr("checked")?a.addClass(t.checkedClass):a.removeClass(t.checkedClass)},"mousedown.uniform touchbegin.uniform":function(){s.addClass(t.activeClass)},"mouseup.uniform touchend.uniform":function(){s.removeClass(t.activeClass)},"mouseenter.uniform":function(){s.addClass(t.hoverClass)},"mouseleave.uniform":function(){s.removeClass(t.hoverClass),s.removeClass(t.activeClass)}}),e(n).attr("checked")&&a.addClass(t.checkedClass),e(n).attr("disabled")&&s.addClass(t.disabledClass),d(n)}function o(n){var i=e(n),s=e("
            "),a=e("");"none"==!i.css("display")&&t.autoHide&&s.hide(),s.addClass(t.radioClass),t.useID&&""!=n.attr("id")&&s.attr("id",t.idPrefix+"-"+n.attr("id")),e(n).wrap(s),e(n).wrap(a),a=n.parent(),s=a.parent(),e(n).css("opacity",0).bind({"focus.uniform":function(){s.addClass(t.focusClass)},"blur.uniform":function(){s.removeClass(t.focusClass)},"click.uniform touchend.uniform":function(){if(e(n).attr("checked")){var i=t.radioClass.split(" ")[0];e("."+i+" span."+t.checkedClass+":has([name='"+e(n).attr("name")+"'])").removeClass(t.checkedClass),a.addClass(t.checkedClass)}else a.removeClass(t.checkedClass)},"mousedown.uniform touchend.uniform":function(){e(n).is(":disabled")||s.addClass(t.activeClass)},"mouseup.uniform touchbegin.uniform":function(){s.removeClass(t.activeClass)},"mouseenter.uniform touchend.uniform":function(){s.addClass(t.hoverClass)},"mouseleave.uniform":function(){s.removeClass(t.hoverClass),s.removeClass(t.activeClass)}}),e(n).attr("checked")&&a.addClass(t.checkedClass),e(n).attr("disabled")&&s.addClass(t.disabledClass),d(n)}function l(n){var i=e(n),s=e("
            "),a=e(""+t.fileDefaultText+""),r=e(""+t.fileBtnText+"");if("none"==!i.css("display")&&t.autoHide&&s.hide(),s.addClass(t.fileClass),a.addClass(t.filenameClass),r.addClass(t.fileBtnClass),t.useID&&""!=i.attr("id")&&s.attr("id",t.idPrefix+"-"+i.attr("id")),i.wrap(s),i.after(r),i.after(a),s=i.closest("div"),a=i.siblings("."+t.filenameClass),r=i.siblings("."+t.fileBtnClass),!i.attr("size")){var o=s.width();i.attr("size",o/10)}var l=function(){var e=i.val();""===e?e=t.fileDefaultText:(e=e.split(/[\/\\]+/),e=e[e.length-1]),a.text(e)};l(),i.css("opacity",0).bind({"focus.uniform":function(){s.addClass(t.focusClass)},"blur.uniform":function(){s.removeClass(t.focusClass)},"mousedown.uniform":function(){e(n).is(":disabled")||s.addClass(t.activeClass)},"mouseup.uniform":function(){s.removeClass(t.activeClass)},"mouseenter.uniform":function(){s.addClass(t.hoverClass)},"mouseleave.uniform":function(){s.removeClass(t.hoverClass),s.removeClass(t.activeClass)}}),e.browser.msie?i.bind("click.uniform.ie7",function(){setTimeout(l,0)}):i.bind("change.uniform",l),i.attr("disabled")&&s.addClass(t.disabledClass),e.uniform.noSelect(a),e.uniform.noSelect(r),d(n)}function d(t){t=e(t).get(),t.length>1?e.each(t,function(t,n){e.uniform.elements.push(n)}):e.uniform.elements.push(t)}t=e.extend(e.uniform.options,t);var u=this;return 0!=t.resetSelector&&e(t.resetSelector).mouseup(function(){function t(){e.uniform.update(u)}setTimeout(t,10)}),e.uniform.restore=function(t){void 0==t&&(t=e(e.uniform.elements)),e(t).each(function(){e(this).is(":checkbox")?e(this).unwrap().unwrap():e(this).is("select")?(e(this).siblings("span").remove(),e(this).unwrap()):e(this).is(":radio")?e(this).unwrap().unwrap():e(this).is(":file")?(e(this).siblings("span").remove(),e(this).unwrap()):e(this).is("button, :submit, :reset, a, input[type='button']")&&e(this).unwrap().unwrap(),e(this).unbind(".uniform"),e(this).css("opacity","1");var n=e.inArray(e(t),e.uniform.elements);e.uniform.elements.splice(n,1)})},e.uniform.noSelect=function(t){function n(){return!1}e(t).each(function(){this.onselectstart=this.ondragstart=n,e(this).mousedown(n).css({MozUserSelect:"none"})})},e.uniform.update=function(n){void 0==n&&(n=e(e.uniform.elements)),n=e(n),n.each(function(){var i=e(this);if(i.is("select")){var s=i.siblings("span"),a=i.parent("div");a.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass),s.html(i.find(":selected").html()),i.is(":disabled")?a.addClass(t.disabledClass):a.removeClass(t.disabledClass)}else if(i.is(":checkbox")){var s=i.closest("span"),a=i.closest("div");a.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass),s.removeClass(t.checkedClass),i.is(":checked")&&s.addClass(t.checkedClass),i.is(":disabled")?a.addClass(t.disabledClass):a.removeClass(t.disabledClass)}else if(i.is(":radio")){var s=i.closest("span"),a=i.closest("div");a.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass),s.removeClass(t.checkedClass),i.is(":checked")&&s.addClass(t.checkedClass),i.is(":disabled")?a.addClass(t.disabledClass):a.removeClass(t.disabledClass)}else if(i.is(":file")){var a=i.parent("div"),r=i.siblings(t.filenameClass);btnTag=i.siblings(t.fileBtnClass),a.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass),r.text(i.val()),i.is(":disabled")?a.addClass(t.disabledClass):a.removeClass(t.disabledClass)}else if(i.is(":submit")||i.is(":reset")||i.is("button")||i.is("a")||n.is("input[type=button]")){var a=i.closest("div");a.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass),i.is(":disabled")?a.addClass(t.disabledClass):a.removeClass(t.disabledClass)}})},this.each(function(){if(e.support.selectOpacity){var t=e(this);t.is("select")?1!=t.attr("multiple")&&(void 0==t.attr("size")||t.attr("size")<=1)&&a(t):t.is(":checkbox")?r(t):t.is(":radio")?o(t):t.is(":file")?l(t):t.is(":text, :password, input[type='email']")?n(t):t.is("textarea")?i(t):(t.is("a")||t.is(":submit")||t.is(":reset")||t.is("button")||t.is("input[type=button]"))&&s(t)}})}}($jn),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return Ei.apply(null,arguments)}function t(e){Ei=e}function n(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function s(e){return"[object Date]"===Object.prototype.toString.call(e)||e instanceof Date}function a(e,t){var n,i=[];for(n=0;n0)for(n in Ti)i=Ti[n],s=t[i],"undefined"!=typeof s&&(e[i]=s);return e}function h(t){c(this,t),this._d=new Date(+t._d),Fi===!1&&(Fi=!0,e.updateOffset(this),Fi=!1)}function f(e){return e instanceof h||null!=e&&r(e,"_isAMomentObject")}function p(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=t>=0?Math.floor(t):Math.ceil(t)),n}function m(e,t,n){var i,s=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),r=0;for(i=0;s>i;i++)(n&&e[i]!==t[i]||!n&&p(e[i])!==p(t[i]))&&r++;return r+a}function g(){}function _(e){return e?e.toLowerCase().replace("_","-"):e}function v(e){for(var t,n,i,s,a=0;a0;){if(i=y(s.slice(0,t).join("-")))return i;if(n&&n.length>=t&&m(s,n,!0)>=t-1)break;t--}a++}return null}function y(e){var t=null;if(!Ii[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Mi._abbr,require("./locale/"+e),b(t)}catch(n){}return Ii[e]}function b(e,t){var n;return e&&(n="undefined"==typeof t?C(e):w(e,t),n&&(Mi=n)),Mi._abbr}function w(e,t){return null!==t?(t.abbr=e,Ii[e]||(Ii[e]=new g),Ii[e].set(t),b(e),Ii[e]):(delete Ii[e],null)}function C(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Mi;if(!i(e)){if(t=y(e))return t;e=[e]}return v(e)}function D(e,t){var n=e.toLowerCase();Oi[n]=Oi[n+"s"]=Oi[t]=e}function x(e){return"string"==typeof e?Oi[e]||Oi[e.toLowerCase()]:void 0}function k(e){var t,n,i={};for(n in e)r(e,n)&&(t=x(n),t&&(i[t]=e[n]));return i}function S(t,n){return function(i){return null!=i?(M(this,t,i),e.updateOffset(this,n),this):E(this,t)}}function E(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function M(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function T(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=x(e),"function"==typeof this[e])return this[e](t);return this}function F(e,t,n){for(var i=""+Math.abs(e),s=e>=0;i.lengtht;t++)i[t]=Ni[i[t]]?Ni[i[t]]:O(i[t]);return function(s){var a="";for(t=0;n>t;t++)a+=i[t]instanceof Function?i[t].call(s,e):i[t];return a}}function R(e,t){return e.isValid()?(t=P(t,e.localeData()),Pi[t]||(Pi[t]=A(t)),Pi[t](e)):e.localeData().invalidDate()}function P(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for(Ri.lastIndex=0;i>=0&&Ri.test(e);)e=e.replace(Ri,n),Ri.lastIndex=0,i-=1;return e}function N(e,t,n){Qi[e]="function"==typeof t?t:function(e){return e&&n?n:t}}function Y(e,t){return r(Qi,e)?Qi[e](t._strict,t._locale):new RegExp(L(e))}function L(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,s){return t||n||i||s}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(i=function(e,n){n[t]=p(e)}),n=0;ni;i++){if(s=l([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(a="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[i]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}}function q(e,t){var n;return"string"==typeof t&&(t=e.localeData().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),j(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function W(t){return null!=t?(q(this,t),e.updateOffset(this,!0),this):E(this,"Month")}function V(){return j(this.year(),this.month())}function Z(e){var t,n=e._a;return n&&-2===e._pf.overflow&&(t=n[es]<0||n[es]>11?es:n[ts]<1||n[ts]>j(n[Ki],n[es])?ts:n[ns]<0||n[ns]>24||24===n[ns]&&(0!==n[is]||0!==n[ss]||0!==n[as])?ns:n[is]<0||n[is]>59?is:n[ss]<0||n[ss]>59?ss:n[as]<0||n[as]>999?as:-1,e._pf._overflowDayOfYear&&(Ki>t||t>ts)&&(t=ts),e._pf.overflow=t),e}function X(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function Q(e,t){var n=!0;return o(function(){return n&&(X(e),n=!1),t.apply(this,arguments)},t)}function J(e,t){ls[e]||(X(t),ls[e]=!0)}function K(e){var t,n,i=e._i,s=ds.exec(i);if(s){for(e._pf.iso=!0,t=0,n=us.length;n>t;t++)if(us[t][1].exec(i)){e._f=us[t][0]+(s[6]||" ");break}for(t=0,n=cs.length;n>t;t++)if(cs[t][1].exec(i)){e._f+=cs[t][0];break}i.match(Vi)&&(e._f+="Z"),vt(e)}else e._isValid=!1}function et(t){var n=hs.exec(t._i);return null!==n?(t._d=new Date(+n[1]),void 0):(K(t),t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t)),void 0)}function tt(e,t,n,i,s,a,r){var o=new Date(e,t,n,i,s,a,r);return 1970>e&&o.setFullYear(e),o}function nt(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function it(e){return st(e)?366:365}function st(e){return e%4===0&&e%100!==0||e%400===0}function at(){return st(this.year())}function rt(e,t,n){var i,s=n-t,a=n-e.day();return a>s&&(a-=7),s-7>a&&(a+=7),i=kt(e).add(a,"d"),{week:Math.ceil(i.dayOfYear()/7),year:i.year()}}function ot(e){return rt(e,this._week.dow,this._week.doy).week}function lt(){return this._week.dow}function dt(){return this._week.doy}function ut(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function ct(e){var t=rt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function ht(e,t,n,i,s){var a,r,o=nt(e,0,1).getUTCDay();return o=0===o?7:o,n=null!=n?n:s,a=s-o+(o>i?7:0)-(s>o?7:0),r=7*(t-1)+(n-s)+a+1,{year:r>0?e:e-1,dayOfYear:r>0?r:it(e-1)+r}}function ft(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function pt(e,t,n){return null!=e?e:null!=t?t:n}function mt(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function gt(e){var t,n,i,s,a=[];if(!e._d){for(i=mt(e),e._w&&null==e._a[ts]&&null==e._a[es]&&_t(e),e._dayOfYear&&(s=pt(e._a[Ki],i[Ki]),e._dayOfYear>it(s)&&(e._pf._overflowDayOfYear=!0),n=nt(s,0,e._dayOfYear),e._a[es]=n.getUTCMonth(),e._a[ts]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=a[t]=i[t];for(;7>t;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ns]&&0===e._a[is]&&0===e._a[ss]&&0===e._a[as]&&(e._nextDay=!0,e._a[ns]=0),e._d=(e._useUTC?nt:tt).apply(null,a),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ns]=24)}}function _t(e){var t,n,i,s,a,r,o;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(a=1,r=4,n=pt(t.GG,e._a[Ki],rt(kt(),1,4).year),i=pt(t.W,1),s=pt(t.E,1)):(a=e._locale._week.dow,r=e._locale._week.doy,n=pt(t.gg,e._a[Ki],rt(kt(),a,r).year),i=pt(t.w,1),null!=t.d?(s=t.d,a>s&&++i):s=null!=t.e?t.e+a:a),o=ht(n,i,s,r,a),e._a[Ki]=o.year,e._dayOfYear=o.dayOfYear}function vt(t){if(t._f===e.ISO_8601)return K(t),void 0;t._a=[],t._pf.empty=!0;var n,i,s,a,r,o=""+t._i,l=o.length,d=0;for(s=P(t._f,t._locale).match(Ai)||[],n=0;n0&&t._pf.unusedInput.push(r),o=o.slice(o.indexOf(i)+i.length),d+=i.length),Ni[a]?(i?t._pf.empty=!1:t._pf.unusedTokens.push(a),z(a,i,t)):t._strict&&!i&&t._pf.unusedTokens.push(a);t._pf.charsLeftOver=l-d,o.length>0&&t._pf.unusedInput.push(o),t._pf.bigHour===!0&&t._a[ns]<=12&&(t._pf.bigHour=void 0),t._a[ns]=yt(t._locale,t._a[ns],t._meridiem),gt(t),Z(t)}function yt(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(i=e.isPM(n),i&&12>t&&(t+=12),i||12!==t||(t=0),t):t}function bt(e){var t,i,s,a,r;if(0===e._f.length)return e._pf.invalidFormat=!0,e._d=new Date(0/0),void 0;for(a=0;ar)&&(s=r,i=t));o(e,i||t)}function wt(e){if(!e._d){var t=k(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],gt(e)}}function Ct(e){var t,n=e._i,s=e._f;return e._locale=e._locale||C(e._l),null===n||void 0===s&&""===n?u({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),f(n)?new h(Z(n)):(i(s)?bt(e):s?vt(e):Dt(e),t=new h(Z(e)),t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t))}function Dt(t){var n=t._i;void 0===n?t._d=new Date:s(n)?t._d=new Date(+n):"string"==typeof n?et(t):i(n)?(t._a=a(n.slice(0),function(e){return parseInt(e,10)}),gt(t)):"object"==typeof n?wt(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function xt(e,t,i,s,a){var r={};return"boolean"==typeof i&&(s=i,i=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=a,r._l=i,r._i=e,r._f=t,r._strict=s,r._pf=n(),Ct(r)}function kt(e,t,n,i){return xt(e,t,n,i,!1)}function St(e,t){var n,s;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return kt();for(n=t[0],s=1;se&&(e=-e,n="-"),n+F(~~(e/60),2)+t+F(~~e%60,2)})}function Ot(e){var t=(e||"").match(Vi)||[],n=t[t.length-1]||[],i=(n+"").match(_s)||["-",0,0],s=+(60*i[1])+p(i[2]);return"+"===i[0]?s:-s}function At(t,n){var i,a;return n._isUTC?(i=n.clone(),a=(f(t)||s(t)?+t:+kt(t))-+i,i._d.setTime(+i._d+a),e.updateOffset(i,!1),i):kt(t).local()}function Rt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Pt(t,n){var i,s=this._offset||0;return null!=t?("string"==typeof t&&(t=Ot(t)),Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(i=Rt(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==t&&(!n||this._changeInProgress?Qt(this,qt(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:Rt(this)}function Nt(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Yt(e){return this.utcOffset(0,e)}function Lt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Rt(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ot(this._i)),this}function Ut(e){return e=e?kt(e).utcOffset():0,(this.utcOffset()-e)%60===0}function zt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function jt(){if(this._a){var e=this._isUTC?l(this._a):kt(this._a);return this.isValid()&&m(this._a,e.toArray())>0}return!1}function Bt(){return!this._isUTC}function Ht(){return this._isUTC}function Gt(){return this._isUTC&&0===this._offset}function qt(e,t){var n,i,s,a=e,o=null;return Ft(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(a={},t?a[t]=e:a.milliseconds=e):(o=vs.exec(e))?(n="-"===o[1]?-1:1,a={y:0,d:p(o[ts])*n,h:p(o[ns])*n,m:p(o[is])*n,s:p(o[ss])*n,ms:p(o[as])*n}):(o=ys.exec(e))?(n="-"===o[1]?-1:1,a={y:Wt(o[2],n),M:Wt(o[3],n),d:Wt(o[4],n),h:Wt(o[5],n),m:Wt(o[6],n),s:Wt(o[7],n),w:Wt(o[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(s=Zt(kt(a.from),kt(a.to)),a={},a.ms=s.milliseconds,a.M=s.months),i=new Tt(a),Ft(e)&&r(e,"_locale")&&(i._locale=e._locale),i}function Wt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Vt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Zt(e,t){var n;return t=At(t,e),e.isBefore(t)?n=Vt(e,t):(n=Vt(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n}function Xt(e,t){return function(n,i){var s,a;return null===i||isNaN(+i)||(J(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),a=n,n=i,i=a),n="string"==typeof n?+n:n,s=qt(n,i),Qt(this,s,e),this}}function Qt(t,n,i,s){var a=n._milliseconds,r=n._days,o=n._months;s=null==s?!0:s,a&&t._d.setTime(+t._d+a*i),r&&M(t,"Date",E(t,"Date")+r*i),o&&q(t,E(t,"Month")+o*i),s&&e.updateOffset(t,r||o)}function Jt(e){var t=e||kt(),n=At(t,this).startOf("day"),i=this.diff(n,"days",!0),s=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse";return this.format(this.localeData().calendar(s,this,kt(t)))}function Kt(){return new h(this)}function en(e,t){var n;return t=x("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=f(e)?e:kt(e),+this>+e):(n=f(e)?+e:+kt(e),n<+this.clone().startOf(t))}function tn(e,t){var n;return t=x("undefined"!=typeof t?t:"millisecond"),"millisecond"===t?(e=f(e)?e:kt(e),+e>+this):(n=f(e)?+e:+kt(e),+this.clone().endOf(t)e?Math.ceil(e):Math.floor(e)}function rn(e,t,n){var i,s,a=At(e,this),r=6e4*(a.utcOffset()-this.utcOffset());return t=x(t),"year"===t||"month"===t||"quarter"===t?(s=on(this,a),"quarter"===t?s/=3:"year"===t&&(s/=12)):(i=this-a,s="second"===t?i/1e3:"minute"===t?i/6e4:"hour"===t?i/36e5:"day"===t?(i-r)/864e5:"week"===t?(i-r)/6048e5:i),n?s:an(s)}function on(e,t){var n,i,s=12*(t.year()-e.year())+(t.month()-e.month()),a=e.clone().add(s,"months");return 0>t-a?(n=e.clone().add(s-1,"months"),i=(t-a)/(a-n)):(n=e.clone().add(s+1,"months"),i=(t-a)/(n-a)),-(s+i)}function ln(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function dn(){var e=this.clone().utc();return 0t;t++)if(this._weekdaysParse[t]||(n=kt([2e3,1]).day(t),i="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(i.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function Nn(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=In(e,this.localeData()),this.add(e-t,"d")):t}function Yn(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Ln(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function $n(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Un(e,t){return t._meridiemParse}function zn(e){return"p"===(e+"").toLowerCase().charAt(0)}function jn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Bn(e){I(0,[e,3],0,"millisecond")}function Hn(){return this._isUTC?"UTC":""}function Gn(){return this._isUTC?"Coordinated Universal Time":""}function qn(e){return kt(1e3*e)}function Wn(){return kt.apply(null,arguments).parseZone()}function Vn(e,t,n){var i=this._calendar[e];return"function"==typeof i?i.call(t,n):i}function Zn(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t}function Xn(){return this._invalidDate}function Qn(e){return this._ordinal.replace("%d",e)}function Jn(e){return e}function Kn(e,t,n,i){var s=this._relativeTime[n];return"function"==typeof s?s(e,t,n,i):s.replace(/%d/i,e)}function ei(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)}function ti(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ni(e,t,n,i){var s=C(),a=l().set(i,t);return s[n](a,e)}function ii(e,t,n,i,s){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return ni(e,t,n,s);var a,r=[];for(a=0;i>a;a++)r[a]=ni(e,a,n,s);return r}function si(e,t){return ii(e,t,"months",12,"month")}function ai(e,t){return ii(e,t,"monthsShort",12,"month")}function ri(e,t){return ii(e,t,"weekdays",7,"day")}function oi(e,t){return ii(e,t,"weekdaysShort",7,"day")}function li(e,t){return ii(e,t,"weekdaysMin",7,"day")}function di(){var e=this._data;return this._milliseconds=zs(this._milliseconds),this._days=zs(this._days),this._months=zs(this._months),e.milliseconds=zs(e.milliseconds),e.seconds=zs(e.seconds),e.minutes=zs(e.minutes),e.hours=zs(e.hours),e.months=zs(e.months),e.years=zs(e.years),this}function ui(e,t,n,i){var s=qt(t,n);return e._milliseconds+=i*s._milliseconds,e._days+=i*s._days,e._months+=i*s._months,e._bubble()}function ci(e,t){return ui(this,e,t,1)}function hi(e,t){return ui(this,e,t,-1)}function fi(){var e,t,n,i=this._milliseconds,s=this._days,a=this._months,r=this._data,o=0;return r.milliseconds=i%1e3,e=an(i/1e3),r.seconds=e%60,t=an(e/60),r.minutes=t%60,n=an(t/60),r.hours=n%24,s+=an(n/24),o=an(pi(s)),s-=an(mi(o)),a+=an(s/30),s%=30,o+=an(a/12),a%=12,r.days=s,r.months=a,r.years=o,this}function pi(e){return 400*e/146097}function mi(e){return 146097*e/400}function gi(e){var t,n,i=this._milliseconds;if(e=x(e),"month"===e||"year"===e)return t=this._days+i/864e5,n=this._months+12*pi(t),"month"===e?n:n/12;switch(t=this._days+Math.round(mi(this._months/12)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 24*t*60+i/6e4;case"second":return 24*t*60*60+i/1e3;case"millisecond":return Math.floor(24*t*60*60*1e3)+i;default:throw new Error("Unknown unit "+e)}}function _i(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)}function vi(e){return function(){return this.as(e)}}function yi(e){return e=x(e),this[e+"s"]()}function bi(e){return function(){return this._data[e]}}function wi(){return an(this.days()/7)}function Ci(e,t,n,i,s){return s.relativeTime(t||1,!!n,e,i)}function Di(e,t,n){var i=qt(e).abs(),s=ia(i.as("s")),a=ia(i.as("m")),r=ia(i.as("h")),o=ia(i.as("d")),l=ia(i.as("M")),d=ia(i.as("y")),u=s0,u[4]=n,Ci.apply(null,u)}function xi(e,t){return void 0===sa[e]?!1:void 0===t?sa[e]:(sa[e]=t,!0)}function ki(e){var t=this.localeData(),n=Di(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Si(){var e=aa(this.years()),t=aa(this.months()),n=aa(this.days()),i=aa(this.hours()),s=aa(this.minutes()),a=aa(this.seconds()+this.milliseconds()/1e3),r=this.asSeconds();return r?(0>r?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(n?n+"D":"")+(i||s||a?"T":"")+(i?i+"H":"")+(s?s+"M":"")+(a?a+"S":""):"P0D"}var Ei,Mi,Ti=e.momentProperties=[],Fi=!1,Ii={},Oi={},Ai=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Ri=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pi={},Ni={},Yi=/\d/,Li=/\d\d/,$i=/\d{3}/,Ui=/\d{4}/,zi=/[+-]?\d{6}/,ji=/\d\d?/,Bi=/\d{1,3}/,Hi=/\d{1,4}/,Gi=/[+-]?\d{1,6}/,qi=/\d+/,Wi=/[+-]?\d+/,Vi=/Z|[+-]\d\d:?\d\d/gi,Zi=/[+-]?\d+(\.\d{1,3})?/,Xi=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Qi={},Ji={},Ki=0,es=1,ts=2,ns=3,is=4,ss=5,as=6;I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),D("month","M"),N("M",ji),N("MM",ji,Li),N("MMM",Xi),N("MMMM",Xi),$(["M","MM"],function(e,t){t[es]=p(e)-1}),$(["MMM","MMMM"],function(e,t,n,i){var s=n._locale.monthsParse(e,i,n._strict);null!=s?t[es]=s:n._pf.invalidMonth=e});var rs="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),os="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ls={};e.suppressDeprecationWarnings=!1;var ds=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,us=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],cs=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],hs=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=Q("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),D("year","y"),N("Y",Wi),N("YY",ji,Li),N("YYYY",Hi,Ui),N("YYYYY",Gi,zi),N("YYYYYY",Gi,zi),$(["YYYY","YYYYY","YYYYYY"],Ki),$("YY",function(t,n){n[Ki]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return p(e)+(p(e)>68?1900:2e3)};var fs=S("FullYear",!1);I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),D("week","w"),D("isoWeek","W"),N("w",ji),N("ww",ji,Li),N("W",ji),N("WW",ji,Li),U(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=p(e)});var ps={dow:0,doy:6};I("DDD",["DDDD",3],"DDDo","dayOfYear"),D("dayOfYear","DDD"),N("DDD",Bi),N("DDDD",$i),$(["DDD","DDDD"],function(e,t,n){n._dayOfYear=p(e)}),e.ISO_8601=function(){};var ms=Q("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=kt.apply(null,arguments);return this>e?this:e}),gs=Q("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=kt.apply(null,arguments);return e>this?this:e});It("Z",":"),It("ZZ",""),N("Z",Vi),N("ZZ",Vi),$(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ot(e)});var _s=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var vs=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ys=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;qt.fn=Tt.prototype;var bs=Xt(1,"add"),ws=Xt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Cs=Q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),xn("gggg","weekYear"),xn("ggggg","weekYear"),xn("GGGG","isoWeekYear"),xn("GGGGG","isoWeekYear"),D("weekYear","gg"),D("isoWeekYear","GG"),N("G",Wi),N("g",Wi),N("GG",ji,Li),N("gg",ji,Li),N("GGGG",Hi,Ui),N("gggg",Hi,Ui),N("GGGGG",Gi,zi),N("ggggg",Gi,zi),U(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=p(e)}),U(["gg","GG"],function(t,n,i,s){n[s]=e.parseTwoDigitYear(t)}),I("Q",0,0,"quarter"),D("quarter","Q"),N("Q",Yi),$("Q",function(e,t){t[es]=3*(p(e)-1)}),I("D",["DD",2],"Do","date"),D("date","D"),N("D",ji),N("DD",ji,Li),N("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),$(["D","DD"],ts),$("Do",function(e,t){t[ts]=p(e.match(ji)[0],10)});var Ds=S("Date",!0);I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),D("day","d"),D("weekday","e"),D("isoWeekday","E"),N("d",ji),N("e",ji),N("E",ji),N("dd",Xi),N("ddd",Xi),N("dddd",Xi),U(["dd","ddd","dddd"],function(e,t,n){var i=n._locale.weekdaysParse(e);null!=i?t.d=i:n._pf.invalidWeekday=e}),U(["d","e","E"],function(e,t,n,i){t[i]=p(e)});var xs="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ks="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ss="Su_Mo_Tu_We_Th_Fr_Sa".split("_");I("H",["HH",2],0,"hour"),I("h",["hh",2],0,function(){return this.hours()%12||12}),$n("a",!0),$n("A",!1),D("hour","h"),N("a",Un),N("A",Un),N("H",ji),N("h",ji),N("HH",ji,Li),N("hh",ji,Li),$(["H","HH"],ns),$(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),$(["h","hh"],function(e,t,n){t[ns]=p(e),n._pf.bigHour=!0});var Es=/[ap]\.?m?\.?/i,Ms=S("Hours",!0);I("m",["mm",2],0,"minute"),D("minute","m"),N("m",ji),N("mm",ji,Li),$(["m","mm"],is);var Ts=S("Minutes",!1);I("s",["ss",2],0,"second"),D("second","s"),N("s",ji),N("ss",ji,Li),$(["s","ss"],ss);var Fs=S("Seconds",!1);I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Bn("SSS"),Bn("SSSS"),D("millisecond","ms"),N("S",Bi,Yi),N("SS",Bi,Li),N("SSS",Bi,$i),N("SSSS",qi),$(["S","SS","SSS","SSSS"],function(e,t){t[as]=p(1e3*("0."+e))});var Is=S("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var Os=h.prototype;Os.add=bs,Os.calendar=Jt,Os.clone=Kt,Os.diff=rn,Os.endOf=gn,Os.format=un,Os.from=cn,Os.fromNow=hn,Os.get=T,Os.invalidAt=Dn,Os.isAfter=en,Os.isBefore=tn,Os.isBetween=nn,Os.isSame=sn,Os.isValid=wn,Os.lang=Cs,Os.locale=fn,Os.localeData=pn,Os.max=gs,Os.min=ms,Os.parsingFlags=Cn,Os.set=T,Os.startOf=mn,Os.subtract=ws,Os.toArray=bn,Os.toDate=yn,Os.toISOString=dn,Os.toJSON=dn,Os.toString=ln,Os.unix=vn,Os.valueOf=_n,Os.year=fs,Os.isLeapYear=at,Os.weekYear=Sn,Os.isoWeekYear=En,Os.quarter=Os.quarters=Fn,Os.month=W,Os.daysInMonth=V,Os.week=Os.weeks=ut,Os.isoWeek=Os.isoWeeks=ct,Os.weeksInYear=Tn,Os.isoWeeksInYear=Mn,Os.date=Ds,Os.day=Os.days=Nn,Os.weekday=Yn,Os.isoWeekday=Ln,Os.dayOfYear=ft,Os.hour=Os.hours=Ms,Os.minute=Os.minutes=Ts,Os.second=Os.seconds=Fs,Os.millisecond=Os.milliseconds=Is,Os.utcOffset=Pt,Os.utc=Yt,Os.local=Lt,Os.parseZone=$t,Os.hasAlignedHourOffset=Ut,Os.isDST=zt,Os.isDSTShifted=jt,Os.isLocal=Bt,Os.isUtcOffset=Ht,Os.isUtc=Gt,Os.isUTC=Gt,Os.zoneAbbr=Hn,Os.zoneName=Gn,Os.dates=Q("dates accessor is deprecated. Use date instead.",Ds),Os.months=Q("months accessor is deprecated. Use month instead",W),Os.years=Q("years accessor is deprecated. Use year instead",fs),Os.zone=Q("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Nt);var As=Os,Rs={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ps={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},Ns="Invalid date",Ys="%d",Ls=/\d{1,2}/,$s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Us=g.prototype;Us._calendar=Rs,Us.calendar=Vn,Us._longDateFormat=Ps,Us.longDateFormat=Zn,Us._invalidDate=Ns,Us.invalidDate=Xn,Us._ordinal=Ys,Us.ordinal=Qn,Us._ordinalParse=Ls,Us.preparse=Jn,Us.postformat=Jn,Us._relativeTime=$s,Us.relativeTime=Kn,Us.pastFuture=ei,Us.set=ti,Us.months=B,Us._months=rs,Us.monthsShort=H,Us._monthsShort=os,Us.monthsParse=G,Us.week=ot,Us._week=ps,Us.firstDayOfYear=dt,Us.firstDayOfWeek=lt,Us.weekdays=On,Us._weekdays=xs,Us.weekdaysMin=Rn,Us._weekdaysMin=Ss,Us.weekdaysShort=An,Us._weekdaysShort=ks,Us.weekdaysParse=Pn,Us.isPM=zn,Us._meridiemParse=Es,Us.meridiem=jn,b("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===p(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=Q("moment.lang is deprecated. Use moment.locale instead.",b),e.langData=Q("moment.langData is deprecated. Use moment.localeData instead.",C);var zs=Math.abs,js=vi("ms"),Bs=vi("s"),Hs=vi("m"),Gs=vi("h"),qs=vi("d"),Ws=vi("w"),Vs=vi("M"),Zs=vi("y"),Xs=bi("milliseconds"),Qs=bi("seconds"),Js=bi("minutes"),Ks=bi("hours"),ea=bi("days"),ta=bi("months"),na=bi("years"),ia=Math.round,sa={s:45,m:45,h:22,d:26,M:11},aa=Math.abs,ra=Tt.prototype;ra.abs=di,ra.add=ci,ra.subtract=hi,ra.as=gi,ra.asMilliseconds=js,ra.asSeconds=Bs,ra.asMinutes=Hs,ra.asHours=Gs,ra.asDays=qs,ra.asWeeks=Ws,ra.asMonths=Vs,ra.asYears=Zs,ra.valueOf=_i,ra._bubble=fi,ra.get=yi,ra.milliseconds=Xs,ra.seconds=Qs,ra.minutes=Js,ra.hours=Ks,ra.days=ea,ra.weeks=wi,ra.months=ta,ra.years=na,ra.humanize=ki,ra.toISOString=Si,ra.toString=Si,ra.toJSON=Si,ra.locale=fn,ra.localeData=pn,ra.toIsoString=Q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Si),ra.lang=Cs,I("X",0,0,"unix"),I("x",0,0,"valueOf"),N("x",Wi),N("X",Zi),$("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),$("x",function(e,t,n){n._d=new Date(p(e))}),e.version="2.10.2",t(kt),e.fn=As,e.min=Et,e.max=Mt,e.utc=l,e.unix=qn,e.months=si,e.isDate=s,e.locale=b,e.invalid=u,e.duration=qt,e.isMoment=f,e.weekdays=ri,e.parseZone=Wn,e.localeData=C,e.isDuration=Ft,e.monthsShort=ai,e.weekdaysMin=li,e.defineLocale=w,e.weekdaysShort=oi,e.normalizeUnits=x,e.relativeTimeThreshold=xi;var oa=e;return oa}),function(e,t){"use strict";var n=t.module("ngDialog",[]),i=t.element,s=t.isDefined,a=(document.body||document.documentElement).style,r=s(a.animation)||s(a.WebkitAnimation)||s(a.MozAnimation)||s(a.MsAnimation)||s(a.OAnimation),o="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",l=!1;n.provider("ngDialog",function(){var n=this.defaults={className:"ngdialog-theme-default",plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0,appendTo:!1,preCloseCallback:!1,cache:!0};this.setForceBodyReload=function(e){l=e||!1},this.setDefaults=function(e){t.extend(n,e)};var s,a=0,d=0,u={};this.$get=["$document","$templateCache","$compile","$q","$http","$rootScope","$timeout","$window","$controller",function(c,h,f,p,m,g,_,v,y){var b=c.find("body");l&&g.$on("$locationChangeSuccess",function(){b=c.find("body")});var w={onDocumentKeydown:function(e){27===e.keyCode&&C.close("$escape")},setBodyPadding:function(e){var t=parseInt(b.css("padding-right")||0,10);b.css("padding-right",t+e+"px"),b.data("ng-dialog-original-padding",t)},resetBodyPadding:function(){var e=b.data("ng-dialog-original-padding");e?b.css("padding-right",e+"px"):b.css("padding-right","")},performCloseDialog:function(t,n){var i=t.attr("id");"undefined"!=typeof e.Hammer?e.Hammer(t[0]).off("tap",s):t.unbind("click"),1===d&&b.unbind("keydown"),t.hasClass("ngdialog-closing")||(d-=1),r?t.unbind(o).bind(o,function(){t.scope().$destroy(),t.remove(),0===d&&(b.removeClass("ngdialog-open"),w.resetBodyPadding()),g.$broadcast("ngDialog.closed",t)}).addClass("ngdialog-closing"):(t.scope().$destroy(),t.remove(),0===d&&(b.removeClass("ngdialog-open"),w.resetBodyPadding()),g.$broadcast("ngDialog.closed",t)),u[i]&&(u[i].resolve({id:i,value:n,$dialog:t,remainingDialogs:d}),delete u[i])},closeDialog:function(e,n){var i=e.data("$ngDialogPreCloseCallback");if(i&&t.isFunction(i)){var s=i.call(e,n);t.isObject(s)?s.closePromise?s.closePromise.then(function(){w.performCloseDialog(e,n)}):s.then(function(){w.performCloseDialog(e,n)},function(){}):s!==!1&&w.performCloseDialog(e,n)}else w.performCloseDialog(e,n)}},C={open:function(r){function o(e){return e?t.isString(e)&&c.plain?e:"boolean"!=typeof c.cache||c.cache?h.get(e)||m.get(e,{cache:!0}):m.get(e,{cache:!1}):"Empty template"}var l=this,c=t.copy(n);r=r||{},t.extend(c,r),a+=1,l.latestID="ngdialog"+a;var D;u[l.latestID]=D=p.defer();var x,k,S=t.isObject(c.scope)?c.scope.$new():g.$new();return p.when(o(c.template)).then(function(n){if(n=t.isString(n)?n:n.data&&t.isString(n.data)?n.data:"",h.put(c.template,n),c.showClose&&(n+='
            '),l.$result=x=i('
            '),x.html('
            '+n+"
            "),c.data&&t.isString(c.data)){var r=c.data.replace(/^\s*/,"")[0];S.ngDialogData="{"===r||"["===r?t.fromJson(c.data):c.data}else c.data&&t.isObject(c.data)&&(S.ngDialogData=t.fromJson(t.toJson(c.data)));if(c.controller&&(t.isString(c.controller)||t.isArray(c.controller)||t.isFunction(c.controller))){var o=y(c.controller,{$scope:S,$element:x});x.data("$ngDialogControllerController",o)}if(c.className&&x.addClass(c.className),k=c.appendTo&&t.isString(c.appendTo)?t.element(document.querySelector(c.appendTo)):b,c.preCloseCallback){var u;t.isFunction(c.preCloseCallback)?u=c.preCloseCallback:t.isString(c.preCloseCallback)&&S&&(t.isFunction(S[c.preCloseCallback])?u=S[c.preCloseCallback]:S.$parent&&t.isFunction(S.$parent[c.preCloseCallback])?u=S.$parent[c.preCloseCallback]:g&&t.isFunction(g[c.preCloseCallback])&&(u=g[c.preCloseCallback])),u&&x.data("$ngDialogPreCloseCallback",u)}return S.closeThisDialog=function(e){w.closeDialog(x,e)},_(function(){f(x)(S);var e=v.innerWidth-b.prop("clientWidth");b.addClass("ngdialog-open");var t=e-(v.innerWidth-b.prop("clientWidth"));t>0&&w.setBodyPadding(t),k.append(x),c.name?g.$broadcast("ngDialog.opened",{dialog:x,name:c.name}):g.$broadcast("ngDialog.opened",x)}),c.closeByEscape&&b.bind("keydown",w.onDocumentKeydown),s=function(e){var t=c.closeByDocument?i(e.target).hasClass("ngdialog-overlay"):!1,n=i(e.target).hasClass("ngdialog-close");(t||n)&&C.close(x.attr("id"),n?"$closeButton":"$document")},"undefined"!=typeof e.Hammer?e.Hammer(x[0]).on("tap",s):x.bind("click",s),d+=1,C}),{id:"ngdialog"+a,closePromise:D.promise,close:function(e){w.closeDialog(x,e)}}},openConfirm:function(e){var n=p.defer(),s={closeByEscape:!1,closeByDocument:!1};t.extend(s,e),s.scope=t.isObject(s.scope)?s.scope.$new():g.$new(),s.scope.confirm=function(e){n.resolve(e);var t=i(document.getElementById(a.id));w.performCloseDialog(t,e)};var a=C.open(s);return a.closePromise.then(function(e){return e?n.reject(e.value):n.reject()}),n.promise},close:function(e,t){var n=i(document.getElementById(e));return n.length?w.closeDialog(n,t):C.closeAll(t),C},closeAll:function(e){var n=document.querySelectorAll(".ngdialog");t.forEach(n,function(t){w.closeDialog(i(t),e)})},getDefaults:function(){return n}};return C}]}),n.directive("ngDialog",["ngDialog",function(e){return{restrict:"A",scope:{ngDialogScope:"="},link:function(n,i,s){i.on("click",function(i){i.preventDefault();var a=t.isDefined(n.ngDialogScope)?n.ngDialogScope:"noScope";t.isDefined(s.ngDialogClosePrevious)&&e.close(s.ngDialogClosePrevious);var r=e.getDefaults();e.open({template:s.ngDialog,className:s.ngDialogClass||r.className,controller:s.ngDialogController,scope:a,data:s.ngDialogData,showClose:"false"===s.ngDialogShowClose?!1:"true"===s.ngDialogShowClose?!0:r.showClose,closeByDocument:"false"===s.ngDialogCloseByDocument?!1:"true"===s.ngDialogCloseByDocument?!0:r.closeByDocument,closeByEscape:"false"===s.ngDialogCloseByEscape?!1:"true"===s.ngDialogCloseByEscape?!0:r.closeByEscape,preCloseCallback:s.ngDialogPreCloseCallback||r.preCloseCallback})})}}}])}(window,window.angular),function(e,t){"use strict";var n;if("object"==typeof exports){try{n=require("moment")}catch(i){}module.exports=t(n)}else"function"==typeof define&&define.amd?define(function(e){var i="moment";try{n=e(i)}catch(s){}return t(n)}):e.Pikaday=t(e.moment)}(this,function(e){"use strict";var t="function"==typeof e,n=!!window.addEventListener,i=window.document,s=window.setTimeout,a=function(e,t,i,s){n?e.addEventListener(t,i,!!s):e.attachEvent("on"+t,i)},r=function(e,t,i,s){n?e.removeEventListener(t,i,!!s):e.detachEvent("on"+t,i)},o=function(e,t,n){var s;i.createEvent?(s=i.createEvent("HTMLEvents"),s.initEvent(t,!0,!1),s=y(s,n),e.dispatchEvent(s)):i.createEventObject&&(s=i.createEventObject(),s=y(s,n),e.fireEvent("on"+t,s))},l=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},d=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e,t){d(e,t)||(e.className=""===e.className?t:e.className+" "+t)},c=function(e,t){e.className=l((" "+e.className+" ").replace(" "+t+" "," "))},h=function(e){return/Array/.test(Object.prototype.toString.call(e))},f=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},p=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4===0&&e%100!==0||e%400===0},g=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},_=function(e){f(e)&&e.setHours(0,0,0,0)},v=function(e,t){return e.getTime()===t.getTime()},y=function(e,t,n){var i,s;for(i in t)s=void 0!==e[i],s&&"object"==typeof t[i]&&null!==t[i]&&void 0===t[i].nodeName?f(t[i])?n&&(e[i]=new Date(t[i].getTime())):h(t[i])?n&&(e[i]=t[i].slice(0)):e[i]=y({},t[i],n):(n||!s)&&(e[i]=t[i]);return e},b=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},w={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},onSelect:null,onOpen:null,onClose:null,onDraw:null},C=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},D=function(e,t,n,i,s,a,r){if(r)return'';var o=[];return a&&o.push("is-disabled"),s&&o.push("is-today"),i&&o.push("is-selected"),'"},x=function(e,t,n){var i=new Date(n,0,1),s=Math.ceil(((new Date(n,t,e)-i)/864e5+i.getDay()+1)/7);return''+s+""},k=function(e,t){return""+(t?e.reverse():e).join("")+""},S=function(e){return""+e.join("")+""},E=function(e){var t,n=[];for(e.showWeekNumber&&n.push(""),t=0;7>t;t++)n.push(''+C(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},M=function(e,t,n,i,s){var a,r,o,l,d,u=e._o,c=n===u.minYear,f=n===u.maxYear,p='
            ',m=!0,g=!0;for(o=[],a=0;12>a;a++)o.push('");for(l='
            '+u.i18n.months[i]+'
            ",h(u.yearRange)?(a=u.yearRange[0],r=u.yearRange[1]+1):(a=n-u.yearRange,r=1+n+u.yearRange),o=[];r>a&&a<=u.maxYear;a++)a>=u.minYear&&o.push('");return d='
            '+n+u.yearSuffix+'
            ",p+=u.showMonthAfterYear?d+l:l+d,c&&(0===i||u.minMonth>=i)&&(m=!1),f&&(11===i||u.maxMonth<=i)&&(g=!1),0===t&&(p+='"),t===e._o.numberOfMonths-1&&(p+='"),p+="
            "},T=function(e,t){return''+E(e)+S(t)+"
            "},F=function(r){var o=this,l=o.config(r);o._onMouseDown=function(e){if(o._v){e=e||window.event;var t=e.target||e.srcElement;if(t){if(!d(t,"is-disabled")){if(d(t,"pika-button")&&!d(t,"is-empty"))return o.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),l.bound&&s(function(){o.hide(),l.field&&l.field.blur()},100),void 0;d(t,"pika-prev")?o.prevMonth():d(t,"pika-next")&&o.nextMonth()}if(d(t,"pika-select"))o._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}}},o._onChange=function(e){e=e||window.event;var t=e.target||e.srcElement;t&&(d(t,"pika-select-month")?o.gotoMonth(t.value):d(t,"pika-select-year")&&o.gotoYear(t.value))},o._onInputChange=function(n){var i;n.firedBy!==o&&(t?(i=e(l.field.value,l.format),i=i&&i.isValid()?i.toDate():null):i=new Date(Date.parse(l.field.value)),o.setDate(f(i)?i:null),o._v||o.show())},o._onInputFocus=function(){o.show()},o._onInputClick=function(){o.show()},o._onInputBlur=function(){var e=i.activeElement;do if(d(e,"pika-single"))return;while(e=e.parentNode);o._c||(o._b=s(function(){o.hide()},50)),o._c=!1},o._onClick=function(e){e=e||window.event;var t=e.target||e.srcElement,i=t;if(t){!n&&d(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),a(t,"change",o._onChange)));do if(d(i,"pika-single")||i===l.trigger)return;while(i=i.parentNode);o._v&&t!==l.trigger&&i!==l.trigger&&o.hide()}},o.el=i.createElement("div"),o.el.className="pika-single"+(l.isRTL?" is-rtl":""),a(o.el,"mousedown",o._onMouseDown,!0),a(o.el,"change",o._onChange),l.field&&(l.container?l.container.appendChild(o.el):l.bound?i.body.appendChild(o.el):l.field.parentNode.insertBefore(o.el,l.field.nextSibling),a(l.field,"change",o._onInputChange),l.defaultDate||(l.defaultDate=t&&l.field.value?e(l.field.value,l.format).toDate():new Date(Date.parse(l.field.value)),l.setDefaultDate=!0));var u=l.defaultDate;f(u)?l.setDefaultDate?o.setDate(u,!0):o.gotoDate(u):o.gotoDate(new Date),l.bound?(this.hide(),o.el.className+=" is-bound",a(l.trigger,"click",o._onInputClick),a(l.trigger,"focus",o._onInputFocus),a(l.trigger,"blur",o._onInputBlur)):this.show()};return F.prototype={config:function(e){this._o||(this._o=y({},w,!0));var t=y(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,f(t.minDate)||(t.minDate=!1),f(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(n){return f(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,i){t&&e.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return f(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",o(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),f(e)){var n=this._o.minDate,i=this._o.maxDate;f(n)&&n>e?e=n:f(i)&&e>i&&(e=i),this._d=new Date(e.getTime()),_(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),o(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(f(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),s=e.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),t=s=i&&(this._y=i,!isNaN(r)&&this._m>r&&(this._m=r));for(var l=0;l'+M(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year)+this.render(this.calendars[l].year,this.calendars[l].month)+"
            ";if(this.el.innerHTML=o,t.bound&&"hidden"!==t.field.type&&s(function(){t.trigger.focus()},1),"function"==typeof this._o.onDraw){var d=this;s(function(){d._o.onDraw.call(d)},0)}}},adjustPosition:function(){if(!this._o.container){var e,t,n,s=this._o.trigger,a=s,r=this.el.offsetWidth,o=this.el.offsetHeight,l=window.innerWidth||i.documentElement.clientWidth,d=window.innerHeight||i.documentElement.clientHeight,u=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop;if("function"==typeof s.getBoundingClientRect)n=s.getBoundingClientRect(),e=n.left+window.pageXOffset,t=n.bottom+window.pageYOffset;else for(e=a.offsetLeft,t=a.offsetTop+a.offsetHeight;a=a.offsetParent;)e+=a.offsetLeft,t+=a.offsetTop;(this._o.reposition&&e+r>l||this._o.position.indexOf("right")>-1&&e-r+s.offsetWidth>0)&&(e=e-r+s.offsetWidth),(this._o.reposition&&t+o>d+u||this._o.position.indexOf("top")>-1&&t-o-s.offsetHeight>0)&&(t=t-o-s.offsetHeight),this.el.style.cssText=["position: absolute","left: "+e+"px","top: "+t+"px"].join(";")}},render:function(e,t){var n=this._o,i=new Date,s=g(e,t),a=new Date(e,t,1).getDay(),r=[],o=[];_(i),n.firstDay>0&&(a-=n.firstDay,0>a&&(a+=7));for(var l=s+a,d=l;d>7;)d-=7;l+=7-d;for(var u=0,c=0;l>u;u++){var h=new Date(e,t,1+(u-a)),m=f(this._d)?v(h,this._d):!1,y=v(h,i),b=a>u||u>=s+a,w=n.minDate&&hn.maxDate||n.disableWeekends&&p(h)||n.disableDayFn&&n.disableDayFn(h);o.push(D(1+(u-a),t,e,m,y,w,b)),7===++c&&(n.showWeekNumber&&o.unshift(x(u-a,t,e)),r.push(k(o,n.isRTL)),o=[],c=0)}return T(n,r)},isVisible:function(){return this._v},show:function(){this._v||(c(this.el,"is-hidden"),this._v=!0,this.draw(),this._o.bound&&(a(i,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e=this._v;e!==!1&&(this._o.bound&&r(i,"click",this._onClick),this.el.style.cssText="",u(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),r(this.el,"mousedown",this._onMouseDown,!0),r(this.el,"change",this._onChange),this._o.field&&(r(this._o.field,"change",this._onInputChange),this._o.bound&&(r(this._o.trigger,"click",this._onInputClick),r(this._o.trigger,"focus",this._onInputFocus),r(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},F}),function(){function e(){this.returnValue=!1}function t(){this.cancelBubble=!0}var n,i,s=0,a=[],r={},o={},l={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},d=/[<>&\"\']/g,u=window.setTimeout,c={};!function(e){var t,n,i,s=e.split(/,/);for(t=0;t0&&h.each(t,function(t,n){e[n]=t})}),e},cleanName:function(e){var t,n;for(n=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;te;e++)t+=Math.floor(65535*Math.random()).toString(32);return(h.guidPrefix||"p")+t+(s++).toString(32)},buildUrl:function(e,t){var n="";return h.each(t,function(e,t){n+=(n?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),n&&(e+=(e.indexOf("?")>0?"&":"?")+n),e},each:function(e,t){var i,s,a;if(e)if(i=e.length,i===n){for(s in e)if(e.hasOwnProperty(s)&&t(e[s],s)===!1)return}else for(a=0;i>a;a++)if(t(e[a],a)===!1)return},formatSize:function(e){return e===n||/\D/.test(e)?h.translate("N/A"):e>1073741824?Math.round(e/1073741824,1)+" GB":e>1048576?Math.round(e/1048576,1)+" MB":e>1024?Math.round(e/1024,1)+" KB":e+" b"},getPos:function(e,t){function n(e){var t,n,i=0,s=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===l.compatMode?l.documentElement:l.body,i=n.left+t.scrollLeft,s=n.top+t.scrollTop),{x:i,y:s}}var i,s,a,r=0,o=0,l=document;if(e=e,t=t||l.body,e&&e.getBoundingClientRect&&h.ua.ie&&(!l.documentMode||l.documentMode<8))return s=n(e),a=n(t),{x:s.x-a.x,y:s.y-a.y};for(i=e;i&&i!=t&&i.nodeType;)r+=i.offsetLeft||0,o+=i.offsetTop||0,i=i.offsetParent;for(i=e.parentNode;i&&i!=t&&i.nodeType;)r-=i.scrollLeft||0,o-=i.scrollTop||0,i=i.parentNode;return{x:r,y:o}},getSize:function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}},parseSize:function(e){var t;return"string"==typeof e&&(e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),t=e[2],e=+e[1],"g"==t&&(e*=1073741824),"m"==t&&(e*=1048576),"k"==t&&(e*=1024)),e},xmlEncode:function(e){return e?(""+e).replace(d,function(e){return l[e]?"&"+l[e]+";":e}):e},toArray:function(e){var t,n=[];for(t=0;tn;n++)if(t[n]===e)return n}return-1},addI18n:function(e){return h.extend(r,e)},translate:function(e){return r[e]||e},isEmptyObj:function(e){if(e===n)return!0;for(var t in e)return!1;return!0},hasClass:function(e,t){var n;return""==e.className?!1:(n=new RegExp("(^|\\s+)"+t+"(\\s+|$)"),n.test(e.className))},addClass:function(e,t){h.hasClass(e,t)||(e.className=""==e.className?t:e.className.replace(/\s+$/,"")+" "+t)},removeClass:function(e,t){var n=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})},getStyle:function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},addEvent:function(s,a,r){var o,l,d;d=arguments[3],a=a.toLowerCase(),i===n&&(i="Plupload_"+h.guid()),s.addEventListener?(o=r,s.addEventListener(a,o,!1)):s.attachEvent&&(o=function(){var n=window.event;n.target||(n.target=n.srcElement),n.preventDefault=e,n.stopPropagation=t,r(n)},s.attachEvent("on"+a,o)),s[i]===n&&(s[i]=h.guid()),c.hasOwnProperty(s[i])||(c[s[i]]={}),l=c[s[i]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:o,orig:r,key:d})},removeEvent:function(e,t){var s,a,r;if("function"==typeof arguments[2]?a=arguments[2]:r=arguments[2],t=t.toLowerCase(),e[i]&&c[e[i]]&&c[e[i]][t]){s=c[e[i]][t];for(var o=s.length-1;o>=0&&(s[o].key!==r&&s[o].orig!==a||(e.removeEventListener?e.removeEventListener(t,s[o].func,!1):e.detachEvent&&e.detachEvent("on"+t,s[o].func),s[o].orig=null,s[o].func=null,s.splice(o,1),a===n));o--);if(s.length||delete c[e[i]][t],h.isEmptyObj(c[e[i]])){delete c[e[i]];try{delete e[i]}catch(l){e[i]=n}}}},removeAllEvents:function(e){var t=arguments[1];e[i]!==n&&e[i]&&h.each(c[e[i]],function(n,i){h.removeEvent(e,i,t)})}};h.Uploader=function(e){function t(){var e,t,n=0;if(this.state==h.STARTED){for(t=0;t0?Math.ceil(s.uploaded/l.length*100):0:(s.bytesPerSec=Math.ceil(s.loaded/((+new Date-r||1)/1e3)),s.percent=s.size>0?Math.ceil(s.loaded/s.size*100):0)}var s,r,o={},l=[],d=!1;s=new h.QueueProgress,e=h.extend({chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",filters:[]},e),h.extend(this,{state:h.STOPPED,runtime:"",features:{},files:l,settings:e,total:s,id:h.guid(),init:function(){function s(){var e,t,n,i=d[p++];if(i){if(e=i.getFeatures(),t=f.settings.required_features)for(t=t.split(","),n=0;ne.max_file_size?t.trigger("Error",{code:h.FILE_SIZE_ERROR,message:h.translate("File size error."),file:a}):(l.push(a),o++):t.trigger("Error",{code:h.FILE_EXTENSION_ERROR,message:h.translate("File extension error."),file:a});return o?(u(function(){f.trigger("QueueChanged"),f.refresh()},1),void 0):!1}),e.unique_names&&f.bind("UploadFile",function(e,t){var n=t.name.match(/\.([^.]+)$/),i="tmp";n&&(i=n[1]),t.target_name=t.id+"."+i}),f.bind("UploadProgress",function(e,t){t.percent=t.size>0?Math.ceil(t.loaded/t.size*100):100,i()}),f.bind("StateChanged",function(e){if(e.state==h.STARTED)r=+new Date;else if(e.state==h.STOPPED)for(o=e.files.length-1;o>=0;o--)e.files[o].status==h.UPLOADING&&(e.files[o].status=h.QUEUED,i())}),f.bind("QueueChanged",i),f.bind("Error",function(e,n){n.file&&(n.file.status=h.FAILED,i(),e.state==h.STARTED&&u(function(){t.call(f)},1))}),f.bind("FileUploaded",function(e,n){n.status=h.DONE,n.loaded=n.size,e.trigger("UploadProgress",n),u(function(){t.call(f)},1)}),e.runtimes)for(d=[],c=e.runtimes.split(/\s?,\s?/),o=0;o=0;t--)if(l[t].id===e)return l[t]},removeFile:function(e){var t;for(t=l.length-1;t>=0;t--)if(l[t].id===e.id)return this.splice(t,1)[0]},splice:function(e,t){var i;return i=l.splice(e===n?0:e,t===n?l.length:t),this.trigger("FilesRemoved",i),this.trigger("QueueChanged"),i},trigger:function(e){var t,n,i=o[e.toLowerCase()];if(i)for(n=Array.prototype.slice.call(arguments),n[0]=this,t=0;t=0;t--)if(i[t].func===s){i.splice(t,1);break}}else i=[];i.length||delete o[e]}},unbindAll:function(){var e=this;h.each(o,function(t,n){e.unbind(n)})},destroy:function(){this.stop(),this.trigger("Destroy"),this.unbindAll()}})},h.File=function(e,t,n){var i=this;i.id=e,i.name=t,i.size=n,i.loaded=0,i.percent=0,i.status=0},h.Runtime=function(){this.getFeatures=function(){},this.init=function(){}},h.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},h.runtimes={},window.plupload=h}(),function(){if(!window.google||!google.gears){var e=null;if("undefined"!=typeof GearsFactory)e=new GearsFactory;else try{e=new ActiveXObject("Gears.Factory"),-1!=e.getBuildInfo().indexOf("ie_mobile")&&e.privateSetGlobalObject(this)}catch(t){"undefined"!=typeof navigator.mimeTypes&&navigator.mimeTypes["application/x-googlegears"]&&(e=document.createElement("object"),e.style.display="none",e.width=0,e.height=0,e.type="application/x-googlegears",document.documentElement.appendChild(e))}e&&(window.google||(window.google={}),google.gears||(google.gears={factory:e}))}}(),function(e,t,n){function i(e,t,n){var i,s;i=google.gears.factory.create("beta.canvas");try{if(i.decode(e),t.width||(t.width=i.width),t.height||(t.height=i.height),s=Math.min(t.width/i.width,t.height/i.height),1>s)i.resize(Math.round(i.width*s),Math.round(i.height*s));else if(!t.quality||"image/jpeg"!==n)return e;return t.quality?i.encode(n,{quality:t.quality/100}):i.encode(n)}catch(a){}return e}var s={};n.runtimes.Gears=n.addRuntime("gears",{getFeatures:function(){return{dragdrop:!0,jpgresize:!0,pngresize:!0,chunks:!0,progress:!0,multipart:!0,multi_selection:!0}},init:function(a,r){function o(e){var t,i,r,o=[];for(i=0;i=r?(t.status=n.DONE,e.trigger("FileUploaded",t,{response:d.responseText,status:d.status})):a()}else{var s="HTTP Error.",o=this;try{var l=o.responseText,f=JSON.parse(l);s=f.error.message}catch(p){}e.trigger("Error",{code:n.HTTP_ERROR,message:n.translate(s),file:t,chunk:u,chunks:r,status:d.status})}},r>u&&i(s[t.id].slice(u*o,h)))}var r,o,l,u=0,c=0,h=e.settings.resize;h&&/\.(png|jpg|jpeg)$/i.test(t.name)&&(s[t.id]=i(s[t.id],h,/\.png$/i.test(t.name)?"image/png":"image/jpeg")),t.size=s[t.id].length,o=e.settings.chunk_size,l=o>0,r=Math.ceil(t.size/o),l||(o=t.size,r=1),a()}),a.bind("DisableBrowse",function(e,t){u=t}),a.bind("Destroy",function(e){var i,s,a={browseButton:e.settings.browse_button,dropElm:e.settings.drop_element};for(i in a)s=t.getElementById(a[i]),s&&n.removeAllEvents(s,e.id)}),r({success:!0})}})}(window,document,plupload),function(e,t,n,i){function s(e){var t,n,a,r,o=typeof e;if(e===i||null===e)return"null";if("string"===o)return t="\bb t\nn\ff\rr\"\"''\\\\",'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(e,n){var i=t.indexOf(n);return i+1?"\\"+t.charAt(i+1):(e=n.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+'"';if("object"==o){if(n=e.length!==i,t="",n){for(a=0;a3;)n.pop();for(;n.length<4;)n.push(0);for(i=e.split(".");i.length>4;)i.pop();do s=parseInt(i[l],10),a=parseInt(n[l],10),l++;while(l=s&&!isNaN(s)&&(r=!0)}}}catch(c){r=!1}return r}var r={},o={};n.silverlight={trigger:function(e,t){var i,s=r[e];s&&(i=n.toArray(arguments).slice(1),i[0]="Silverlight:"+t,setTimeout(function(){s.trigger.apply(s,i)},0))}},n.runtimes.Silverlight=n.addRuntime("silverlight",{getFeatures:function(){return{jpgresize:!0,pngresize:!0,chunks:!0,progress:!0,multipart:!0,multi_selection:!0}},init:function(i,l){function d(){return t.getElementById(i.id+"_silverlight").content.Upload}var u,c,h="",f=i.settings.filters,p=t.body;if(!a("2.0.31005.0")||e.opera&&e.opera.buildNumber)return l({success:!1}),void 0;for(o[i.id]=!1,r[i.id]=i,u=t.createElement("div"),u.id=i.id+"_silverlight_container",n.extend(u.style,{position:"absolute",top:"0px",background:i.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100px",height:"100px",overflow:"hidden",opacity:i.settings.shim_bgcolor||t.documentMode>8?"":.01}),u.className="plupload silverlight",i.settings.container&&(p=t.getElementById(i.settings.container),"static"===n.getStyle(p,"position")&&(p.style.position="relative")),p.appendChild(u),c=0;c',i.bind("Silverlight:Init",function(){var e,a={};o[i.id]||(o[i.id]=!0,i.bind("Silverlight:StartSelectFiles",function(){e=[]}),i.bind("Silverlight:SelectFile",function(t,i,s,r){var o;o=n.guid(),a[o]=i,a[i]=o,e.push(new n.File(o,s,r))}),i.bind("Silverlight:SelectSuccessful",function(){e.length&&i.trigger("FilesAdded",e)}),i.bind("Silverlight:UploadChunkError",function(e,t,s,r,o){i.trigger("Error",{code:n.IO_ERROR,message:"IO Error.",details:o,file:e.getFile(a[t])})}),i.bind("Silverlight:UploadFileProgress",function(e,t,i,s){var r=e.getFile(a[t]);r.status!=n.FAILED&&(r.size=s,r.loaded=i,e.trigger("UploadProgress",r))}),i.bind("Refresh",function(e){var i,s,a;i=t.getElementById(e.settings.browse_button),i&&(s=n.getPos(i,t.getElementById(e.settings.container)),a=n.getSize(i),n.extend(t.getElementById(e.id+"_silverlight_container").style,{top:s.y+"px",left:s.x+"px",width:a.w+"px",height:a.h+"px"}))}),i.bind("Silverlight:UploadChunkSuccessful",function(e,t,i,s,r){var o,l=e.getFile(a[t]);o={chunk:i,chunks:s,response:r},e.trigger("ChunkUploaded",l,o),l.status!=n.FAILED&&e.state!==n.STOPPED&&d().UploadNextChunk(),i==s-1&&(l.status=n.DONE,e.trigger("FileUploaded",l,{response:r}))}),i.bind("Silverlight:UploadSuccessful",function(e,t,i){var s=e.getFile(a[t]);s.status=n.DONE,e.trigger("FileUploaded",s,{response:i})}),i.bind("FilesRemoved",function(e,t){var n;for(n=0;n5e3?(r({success:!1}),void 0):(a[e.id]===!1&&setTimeout(l,1),void 0)}var d,u,c=0,h=t.body;return i()<10?(r({success:!1}),void 0):(a[e.id]=!1,s[e.id]=e,d=t.getElementById(e.settings.browse_button),u=t.createElement("div"),u.id=e.id+"_flash_container",n.extend(u.style,{position:"absolute",top:"0px",background:e.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"}),u.className="plupload flash",e.settings.container&&(h=t.getElementById(e.settings.container),"static"===n.getStyle(h,"position")&&(h.style.position="relative")),h.appendChild(u),function(){var i,s;i='',n.ua.ie?(s=t.createElement("div"),u.appendChild(s),s.outerHTML=i,s=null):u.innerHTML=i}(),l(),d=u=null,e.bind("Destroy",function(e){var i;n.removeAllEvents(t.body,e.id),delete a[e.id],delete s[e.id],i=t.getElementById(e.id+"_flash_container"),i&&i.parentNode.removeChild(i)}),e.bind("Flash:Init",function(){var i={};try{o().setFileFilters(e.settings.filters,e.settings.multi_selection)}catch(s){return r({success:!1}),void 0}a[e.id]||(a[e.id]=!0,e.bind("UploadFile",function(t,s){var a=t.settings,r=e.settings.resize||{};o().uploadFile(i[s.id],a.url,{name:s.target_name||s.name,mime:n.mimeTypes[s.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:a.chunk_size,width:r.width,height:r.height,quality:r.quality,multipart:a.multipart,multipart_params:a.multipart_params||{},file_data_name:a.file_data_name,format:/\.(jpg|jpeg)$/i.test(s.name)?"jpg":"png",headers:a.headers,urlstream_upload:a.urlstream_upload})}),e.bind("CancelUpload",function(){o().cancelUpload()}),e.bind("Flash:UploadProcess",function(e,t){var s=e.getFile(i[t.id]);s.status!=n.FAILED&&(s.loaded=t.loaded,s.size=t.size,e.trigger("UploadProgress",s))}),e.bind("Flash:UploadChunkComplete",function(e,t){var s,a=e.getFile(i[t.id]);s={chunk:t.chunk,chunks:t.chunks,response:t.text},e.trigger("ChunkUploaded",a,s),a.status!==n.FAILED&&e.state!==n.STOPPED&&o().uploadNextChunk(),t.chunk==t.chunks-1&&(a.status=n.DONE,e.trigger("FileUploaded",a,{response:t.text}))}),e.bind("Flash:SelectFiles",function(t,s){var a,r,o,l=[];for(r=0;r0?i(++s,r):(n.status=e.DONE,t.trigger("FileUploaded",n,{response:a.value.body,status:o}),o>=400&&t.trigger("Error",{code:e.HTTP_ERROR,message:e.translate("HTTP Error."),file:n,status:o}))):t.trigger("Error",{code:e.GENERIC_ERROR,message:e.translate("Generic Error."),file:n,details:a.error})}))}function s(e){n.size=e.size,c?a.FileAccess.chunk({file:e,chunkSize:c},function(e){if(e.success){var t=e.value,n=t.length;o=Array(n);for(var s=0;n>s;s++)o[s]=0,h.push(t[s]);i(0,n)}}):(o=Array(1),h.push(e),i(0,1))}var o,d=r[n.id],u={},c=t.settings.chunk_size,h=[];l&&/\.(png|jpg|jpeg)$/i.test(n.name)?BrowserPlus.ImageAlter.transform({file:d,quality:l.quality||90,actions:[{scale:{maxwidth:l.width,maxheight:l.height}}]},function(e){e.success&&s(e.value.file)}):s(d)}),n({success:!0})}var a=window.BrowserPlus,r={},o=t.settings,l=o.resize;a?a.init(function(e){var t=[{service:"Uploader",version:"3"},{service:"DragAndDrop",version:"1"},{service:"FileBrowse",version:"1"},{service:"FileAccess",version:"2"}];l&&t.push({service:"ImageAlter",version:"4"}),e.success?a.require({services:t},function(e){e.success?s():n()}):n()}):n()}})}(plupload),function(e,t,n,s){function a(t,n){var i;return"FileReader"in e?(i=new FileReader,i.readAsDataURL(t),i.onload=function(){n(i.result)},void 0):n(t.getAsDataURL())}function r(t,n){var i;return"FileReader"in e?(i=new FileReader,i.readAsBinaryString(t),i.onload=function(){n(i.result)},void 0):n(t.getAsBinary())}function o(e,n,i,s){var r,o,l,c,f=this;a(h[e.id],function(a){r=t.createElement("canvas"),r.style.display="none",t.body.appendChild(r),o=r.getContext("2d"),l=new Image,l.onerror=l.onabort=function(){s({success:!1})},l.onload=function(){var t,h,p,m;if(n.width||(n.width=l.width),n.height||(n.height=l.height),c=Math.min(n.width/l.width,n.height/l.height),1>c)t=Math.round(l.width*c),h=Math.round(l.height*c);else{if(!n.quality||"image/jpeg"!==i)return s({success:!1}),void 0;t=l.width,h=l.height}if(r.width=t,r.height=h,o.drawImage(l,0,0,t,h),"image/jpeg"===i&&(p=new d(atob(a.substring(a.indexOf("base64,")+7))),p.headers&&p.headers.length&&(m=new u,m.init(p.get("exif")[0])&&(m.setExif("PixelXDimension",t),m.setExif("PixelYDimension",h),p.set("exif",m.getBinary()),f.hasEventListener("ExifData")&&f.trigger("ExifData",e,m.EXIF()),f.hasEventListener("GpsData")&&f.trigger("GpsData",e,m.GPS())))),n.quality&&"image/jpeg"===i)try{a=r.toDataURL(i,n.quality/100)}catch(g){a=r.toDataURL(i)}else a=r.toDataURL(i);a=a.substring(a.indexOf("base64,")+7),a=atob(a),p&&p.headers&&p.headers.length&&(a=p.restore(a),p.purge()),r.parentNode.removeChild(r),s({success:!0,data:a})},l.src=a})}function l(){function e(e,t){var n,s=a?0:-8*(t-1),r=0;for(n=0;t>n;n++)r|=i.charCodeAt(e+n)<s;s++)r+=String.fromCharCode(n>>Math.abs(o+8*s)&255);t(r,e,i)}var i,a=!1;return{II:function(e){return e===s?a:(a=e,void 0)},init:function(e){a=!1,i=e},SEGMENT:function(e,n,s){switch(arguments.length){case 1:return i.substr(e,i.length-e-1);case 2:return i.substr(e,n);case 3:t(s,e,n);break;default:return i}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(t,i){return i===s?e(t,4):(n(t,i,4),void 0)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}function d(e){var t,n,i,a={65505:{app:"EXIF",name:"APP1",signature:"Exif\x00"},65506:{app:"ICC",name:"APP2",signature:"ICC_PROFILE\x00"},65517:{app:"IPTC",name:"APP13",signature:"Photoshop 3.0\x00"}},r=[],o=s,u=0;if(t=new l,t.init(e),65496===t.SHORT(0)){for(n=2,i=Math.min(1048576,e.length);i>=n;)if(o=t.SHORT(n),o>=65488&&65495>=o)n+=2;else{if(65498===o||65497===o)break;u=t.SHORT(n+2)+2,a[o]&&t.STRING(n+4,a[o].signature.length)===a[o].signature&&r.push({hex:o,app:a[o].app.toUpperCase(),name:a[o].name.toUpperCase(),start:n,length:u,segment:t.SEGMENT(n,u)}),n+=u}return t.init(null),{headers:r,restore:function(e){t.init(e);var i=new d(e);if(!i.headers)return!1;for(var s=i.headers.length;s>0;s--){var a=i.headers[s-1];t.SEGMENT(a.start,a.length,"")}i.purge(),n=65504==t.SHORT(2)?4+t.SHORT(4):2;for(var s=0,o=r.length;o>s;s++)t.SEGMENT(n,0,r[s].segment),n+=r[s].length;return t.SEGMENT()},get:function(e){for(var t=[],n=0,i=r.length;i>n;n++)r[n].app===e.toUpperCase()&&t.push(r[n].segment);return t},set:function(e,t){var n=[];"string"==typeof t?n.push(t):n=t;for(var i=ii=0,s=r.length;s>i&&(r[i].app===e.toUpperCase()&&(r[i].segment=n[ii],r[i].length=n[ii].length,ii++),!(ii>=n.length));i++);},purge:function(){r=[],t.init(null)}}}}function u(){function e(e,t){var n,i,a,o,l,c,h,f,p=r.SHORT(e),m=[],g={};for(n=0;p>n;n++)if(h=c=e+12*n+2,a=t[r.SHORT(h)],a!==s){switch(o=r.SHORT(h+=2),l=r.LONG(h+=2),h+=4,m=[],o){case 1:case 7:for(l>4&&(h=r.LONG(h)+u.tiffHeader),i=0;l>i;i++)m[i]=r.BYTE(h+i);break;case 2:l>4&&(h=r.LONG(h)+u.tiffHeader),g[a]=r.STRING(h,l-1);continue;case 3:for(l>2&&(h=r.LONG(h)+u.tiffHeader),i=0;l>i;i++)m[i]=r.SHORT(h+2*i);break;case 4:for(l>1&&(h=r.LONG(h)+u.tiffHeader),i=0;l>i;i++)m[i]=r.LONG(h+4*i);break;case 5:for(h=r.LONG(h)+u.tiffHeader,i=0;l>i;i++)m[i]=r.LONG(h+4*i)/r.LONG(h+4*i+4);break;case 9:for(h=r.LONG(h)+u.tiffHeader,i=0;l>i;i++)m[i]=r.SLONG(h+4*i);break;case 10:for(h=r.LONG(h)+u.tiffHeader,i=0;l>i;i++)m[i]=r.SLONG(h+4*i)/r.SLONG(h+4*i+4);break;default:continue}f=1==l?m[0]:m,g[a]=d.hasOwnProperty(a)&&"object"!=typeof f?d[a][f]:f}return g}function t(){var t=s,n=u.tiffHeader; return r.II(18761==r.SHORT(n)),42!==r.SHORT(n+=2)?!1:(u.IFD0=u.tiffHeader+r.LONG(n+=2),t=e(u.IFD0,o.tiff),u.exifIFD="ExifIFDPointer"in t?u.tiffHeader+t.ExifIFDPointer:s,u.gpsIFD="GPSInfoIFDPointer"in t?u.tiffHeader+t.GPSInfoIFDPointer:s,!0)}function a(e,t,n){var s,a,l,d=0;if("string"==typeof t){var c=o[e.toLowerCase()];for(hex in c)if(c[hex]===t){t=hex;break}}for(s=u[e.toLowerCase()+"IFD"],a=r.SHORT(s),i=0;a>i;i++)if(l=s+12*i+2,r.SHORT(l)==t){d=l+8;break}return d?(r.LONG(d,n),!0):!1}var r,o,d,u={};return r=new l,o={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},d={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return u={tiffHeader:10},e!==s&&e.length?(r.init(e),65505===r.SHORT(0)&&"EXIF\x00"===r.STRING(4,5).toUpperCase()?t():!1):!1},EXIF:function(){var t;if(t=e(u.exifIFD,o.exif),t.ExifVersion&&"array"===n.typeOf(t.ExifVersion)){for(var i=0,s="";i",s.scrollTop=100,c=t.getElementById(i.id+"_html5"),e.features.triggerDialog?n.extend(c.style,{position:"absolute",width:"100%",height:"100%"}):n.extend(c.style,{cssFloat:"right",styleFloat:"right"}),c.onchange=function(){a(this.files),this.value=""},r=t.getElementById(e.settings.browse_button)){var m=e.settings.browse_button_hover,g=e.settings.browse_button_active,_=e.features.triggerDialog?r:s;m&&(n.addEvent(_,"mouseover",function(){n.addClass(r,m)},e.id),n.addEvent(_,"mouseout",function(){n.removeClass(r,m)},e.id)),g&&(n.addEvent(_,"mousedown",function(){n.addClass(r,g)},e.id),n.addEvent(t.body,"mouseup",function(){n.removeClass(r,g)},e.id)),e.features.triggerDialog&&n.addEvent(r,"click",function(n){var i=t.getElementById(e.id+"_html5");i&&!i.disabled&&i.click(),n.preventDefault()},e.id)}}),i.bind("PostInit",function(){var e=t.getElementById(i.settings.drop_element);if(e){if(c)return n.addEvent(e,"dragenter",function(){var s,r,o;s=t.getElementById(i.id+"_drop"),s||(s=t.createElement("input"),s.setAttribute("type","file"),s.setAttribute("id",i.id+"_drop"),s.setAttribute("multiple","multiple"),n.addEvent(s,"change",function(){a(this.files),n.removeEvent(s,"change",i.id),s.parentNode.removeChild(s)},i.id),n.addEvent(s,"dragover",function(e){e.stopPropagation()},i.id),e.appendChild(s)),r=n.getPos(e,t.getElementById(i.settings.container)),o=n.getSize(e),"static"===n.getStyle(e,"position")&&n.extend(e.style,{position:"relative"}),n.extend(s.style,{position:"absolute",display:"block",top:0,left:0,width:o.w+"px",height:o.h+"px",opacity:0})},i.id),void 0;n.addEvent(e,"dragover",function(e){e.preventDefault()},i.id),n.addEvent(e,"drop",function(e){var t=e.dataTransfer;t&&t.files&&a(t.files),e.preventDefault()},i.id)}}),i.bind("Refresh",function(e){var s,a,r,o,l;s=t.getElementById(i.settings.browse_button),s&&(a=n.getPos(s,t.getElementById(e.settings.container)),r=n.getSize(s),o=t.getElementById(i.id+"_html5_container"),n.extend(o.style,{top:a.y+"px",left:a.x+"px",width:r.w+"px",height:r.h+"px"}),i.features.triggerDialog&&("static"===n.getStyle(s,"position")&&n.extend(s.style,{position:"relative"}),l=parseInt(n.getStyle(s,"zIndex"),10),isNaN(l)&&(l=0),n.extend(s.style,{zIndex:l}),n.extend(o.style,{zIndex:l-1})))}),i.bind("DisableBrowse",function(e,n){var i=t.getElementById(e.id+"_html5");i&&(i.disabled=n)}),i.bind("CancelUpload",function(){d&&d.abort&&d.abort()}),i.bind("UploadFile",function(t,i){function s(e,t,n){var i;if(!File.prototype.slice)return(i=File.prototype.webkitSlice||File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(s){return e.slice(t,n-t)}}function a(a){function r(){function f(e){if(d.sendAsBinary)d.sendAsBinary(e);else if(t.features.canSendBinary){for(var n=new Uint8Array(e.length),i=0;i=400){var h="HTTP Error.",f=this;try{var p=f.responseText,_=JSON.parse(p);h=_.error.message}catch(b){}t.trigger("Error",{code:n.HTTP_ERROR,message:n.translate(h),file:i,status:e})}else{if(g){if(l={chunk:o,chunks:g,response:d.responseText,status:e},t.trigger("ChunkUploaded",i,l),u+=y,l.cancelled)return i.status=n.FAILED,void 0;i.loaded=Math.min(i.size,(o+1)*v)}else i.loaded=i.size;t.trigger("UploadProgress",i),s=m=a=D=null,!g||++o>=g?(i.status=n.DONE,t.trigger("FileUploaded",i,{response:d.responseText,status:e})):r()}}},t.settings.multipart&&l.multipart){if(_.name=i.target_name||i.name,d.open("post",w,!0),n.each(t.settings.headers,function(e,t){d.setRequestHeader(t,e)}),"string"!=typeof s&&e.FormData)return a=new FormData,n.each(n.extend(_,t.settings.multipart_params),function(e,t){a.append(t,e)}),a.append(t.settings.file_data_name,s),d.send(a),void 0;if("string"==typeof s)return d.setRequestHeader("Content-Type","multipart/form-data; boundary="+h),n.each(n.extend(_,t.settings.multipart_params),function(e,t){D+=p+h+C+'Content-Disposition: form-data; name="'+t+'"'+C+C,D+=unescape(encodeURIComponent(e))+C}),b=n.mimeTypes[i.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",D+=p+h+C+'Content-Disposition: form-data; name="'+t.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(i.name))+'"'+C+"Content-Type: "+b+C+C+s+C+p+h+p+C,c=D.length-s.length,s=D,f(s),void 0}w=n.buildUrl(t.settings.url,n.extend(_,t.settings.multipart_params)),d.open("post",w,!0),d.setRequestHeader("Content-Type","application/octet-stream"),n.each(t.settings.headers,function(e,t){d.setRequestHeader(t,e)}),"string"==typeof s?f(s):d.send(s)}var m,g,_,v,y,b,w=t.settings.url;i.status!=n.DONE&&i.status!=n.FAILED&&t.state!=n.STOPPED&&(_={name:i.target_name||i.name},c.chunk_size&&i.size>c.chunk_size&&(l.chunks||"string"==typeof a)?(v=c.chunk_size,g=Math.ceil(i.size/v),y=Math.min(v,i.size-o*v),m="string"==typeof a?a.substring(o*v,o*v+y):s(a,o*v,o*v+y),_.chunk=o,_.chunks=g):(y=i.size,m=a),t.settings.multipart&&l.multipart&&"string"!=typeof m&&h&&l.cantSendBlobInFormData&&l.chunks&&t.settings.chunk_size?(h.onload=function(){p(h.result)},h.readAsBinaryString(m)):p(m))}var o=0,u=0,h="FileReader"in e?new FileReader:null;r()}var u,c=t.settings;u=h[i.id],l.jpgresize&&t.settings.resize&&/\.(png|jpg|jpeg)$/i.test(i.name)?o.call(t,i,t.settings.resize,/\.png$/i.test(i.name)?"image/png":"image/jpeg",function(e){e.success?(i.size=e.data.length,a(e.data)):l.chunks?a(u):r(u,a)}):!l.chunks&&l.jpgresize?r(u,a):a(u)}),i.bind("Destroy",function(e){var i,s,a=t.body,r={inputContainer:e.id+"_html5_container",inputFile:e.id+"_html5",browseButton:e.settings.browse_button,dropElm:e.settings.drop_element};for(i in r)s=t.getElementById(r[i]),s&&n.removeAllEvents(s,e.id);n.removeAllEvents(t.body,e.id),e.settings.container&&(a=t.getElementById(e.settings.container)),a.removeChild(t.getElementById(r.inputContainer))}),s({success:!0}),void 0):(s({success:!1}),void 0)}})}(window,document,plupload),function(e,t,n){function i(e){return t.getElementById(e)}n.runtimes.Html4=n.addRuntime("html4",{getFeatures:function(){return{multipart:!0,triggerDialog:n.ua.gecko&&e.FormData||n.ua.webkit}},init:function(s,a){s.bind("Init",function(a){function r(){var e,o,l,d;u=n.guid(),_.push(u),e=t.createElement("form"),e.setAttribute("id","form_"+u),e.setAttribute("method","post"),e.setAttribute("enctype","multipart/form-data"),e.setAttribute("encoding","multipart/form-data"),e.setAttribute("target",a.id+"_iframe"),e.style.position="absolute",o=t.createElement("input"),o.setAttribute("id","input_"+u),o.setAttribute("type","file"),o.setAttribute("accept",y),o.setAttribute("size",1),d=i(a.settings.browse_button),a.features.triggerDialog&&d&&n.addEvent(i(a.settings.browse_button),"click",function(e){o.disabled||o.click(),e.preventDefault()},a.id),n.extend(o.style,{width:"100%",height:"100%",opacity:0,fontSize:"99px",cursor:"pointer"}),n.extend(e.style,{overflow:"hidden"}),l=a.settings.shim_bgcolor,l&&(e.style.background=l),v&&n.extend(o.style,{filter:"alpha(opacity=0)"}),n.addEvent(o,"change",function(t){var l,c=t.target,h=[];c.value&&(i("form_"+u).style.top="-1048575px",l=c.value.replace(/\\/g,"/"),l=l.substring(l.length,l.lastIndexOf("/")+1),h.push(new n.File(u,l)),a.features.triggerDialog?n.removeEvent(d,"click",a.id):n.removeAllEvents(e,a.id),n.removeEvent(o,"change",a.id),r(),h.length&&s.trigger("FilesAdded",h))},a.id),e.appendChild(o),m.appendChild(e),a.refresh()}function o(){var i=t.createElement("div");i.innerHTML='',l=i.firstChild,m.appendChild(l),n.addEvent(l,"load",function(t){var i,s,r=t.target;if(d){try{i=r.contentWindow.document||r.contentDocument||e.frames[r.id].document}catch(o){return a.trigger("Error",{code:n.SECURITY_ERROR,message:n.translate("Security error."),file:d}),void 0}s=i.documentElement.innerText||i.documentElement.textContent,s&&(d.status=n.DONE,d.loaded=1025,d.percent=100,a.trigger("UploadProgress",d),a.trigger("FileUploaded",d,{response:s}))}},a.id)}var l,d,u,c,h,f,p,m=t.body,g="javascript",_=[],v=/MSIE/.test(navigator.userAgent),y=[],b=a.settings.filters;e:for(c=0;ct;t++)e.appendChild(arguments[t]);return e}function n(e,t,n,i){var s=["opacity",t,~~(100*e),n,i].join("-"),a=.01+n/i*100,r=Math.max(1-(1-e)/t*(100-a),e),o=d.substring(0,d.indexOf("Animation")).toLowerCase(),l=o&&"-"+o+"-"||"";return c[s]||(h.insertRule("@"+l+"keyframes "+s+"{0%{opacity:"+r+"}"+a+"%{opacity:"+e+"}"+(a+.01)+"%{opacity:1}"+(a+t)%100+"%{opacity:"+e+"}100%{opacity:"+r+"}}",h.cssRules.length),c[s]=1),s}function i(e,t){var n,i,s=e.style;for(t=t.charAt(0).toUpperCase()+t.slice(1),i=0;i',n)}h.addRule(".spin-vml","behavior:url(#default#VML)"),o.prototype.lines=function(e,i){function a(){return s(n("group",{coordsize:u+" "+u,coordorigin:-d+" "+-d}),{width:u,height:u})}function o(e,o,l){t(h,t(s(a(),{rotation:360/i.lines*e+"deg",left:~~o}),t(s(n("roundrect",{arcsize:i.corners}),{width:d,height:i.width,left:i.radius,top:-i.width>>1,filter:l}),n("fill",{color:r(i.color,e),opacity:i.opacity}),n("stroke",{opacity:0}))))}var l,d=i.length+i.width,u=2*d,c=2*-(i.width+i.length)+"px",h=s(a(),{position:"absolute",top:c,left:c});if(i.shadow)for(l=1;l<=i.lines;l++)o(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=i.lines;l++)o(l);return t(e,h)},o.prototype.opacity=function(e,t,n,i){var s=e.firstChild;i=i.shadow&&i.lines||0,s&&t+i>1)+"px"})}for(var l,u=0,c=(a.lines-1)*(1-a.direction)/2;u