function getDateFromJSON(n){var t=new Date(parseInt(n.substr(6)));return new Date(t)}function readableDateDiff(n,t){var u=n,r=new Date,l,a;t&&(r=t);r<u&&(u=r);var h=r.getFullYear()-u.getFullYear(),f=r.getMonth()-u.getMonth(),e=r.getDate()-u.getDate(),o=r.getHours()-u.getHours(),s=r.getMinutes()-u.getMinutes(),c=r.getSeconds()-u.getSeconds(),i="";return c<0&&(s--,c+=60),s<0&&(o--,s+=60),o<0&&(e--,o+=24),e<0&&(f--,l=r.getMonth()==1?12:r.getMonth()-1,a=l==12?r.getFullYear()-1:r.getFullYear(),e+=30),f<0&&(h--,f+=12),h>0?(i=pluralize(h,"year"),f!=0&&(i+=", "+pluralize(f,"month")),i+=" ago"):f>0?(i=pluralize(f,"month"),e!=0&&(i+=", "+pluralize(e,"day")),i+=" ago"):e>0?(i=pluralize(e,"day"),o!=0&&(i+=", "+pluralize(o,"hour")),i+=" ago"):o>0?(i=pluralize(o,"hour"),s!=0&&(i+=", "+pluralize(s,"minute")),i+=" ago"):s>0?i=pluralize(s,"minute")+" ago":c<60&&(i="Less than a minute ago"),i}function pluralize(n,t){return n>1?n+(" "+t+"s"):"1 "+t}function linkify(n){return n.replace(/((href|src)=["']|)(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,function(){return arguments[1]?arguments[0]:'<a target="_blank" href="'+arguments[3]+'">'+arguments[3]+"<\/a>"}).replace(/(^|[^\/])(www\.[\S]+(\b|$))/gim,'$1<a target="_blank" href="http://$2">$2<\/a>').replace(/\w+@[a-zA-Z_]+?(?:\.[a-zA-Z]{2,6})+/gim,'<a target="_blank" href="mailto:$&">$&<\/a>')}function htmlEncode(n){return document.createElement("a").appendChild(document.createTextNode(n)).parentNode.innerHTML}function htmlDecode(n){var t=document.createElement("a");return t.innerHTML=n,t.textContent}function ShowNotification(n,t){t||(t="info");$("#notifier").notify({type:t,fadeOut:{enabled:!0},message:{html:"<strong>"+n+"<\/strong>"}}).show()}function ShowModalNotification(n,t){t||(t="info");$("#modal-notifier").notify({type:t,fadeOut:{enabled:!1},message:{html:"<strong>"+n+"<\/strong>"}}).show()}function SetupMultiselect(){$(".multicheck").multiselect({buttonWidth:"180",maxHeight:400,includeSelectAllOption:!0,selectAllText:"Select All",selectAllValue:"-ALL-",buttonText:function(n){var t,i;return n.length==0?'None selected <b class="caret"><\/b>':n.length>1?n.length+' selected  <b class="caret"><\/b>':(t="",n.each(function(){t+=$(this).text()+", "}),t.length>30?(i=t.substr(0,30)+".....",i+' <b class="caret"><\/b>'):t.substr(0,t.length-2)+' <b class="caret"><\/b>')}})}function getMultiCheckboxValues(n){var i=$(n).multiselect("getChecked"),t=[];return $.each(i,function(n,i){t[n]=$(i).attr("title")}),t.join(", ")}function DoBlockUI(n){n||(n="Please wait ...");$.blockUI({css:{border:"none",padding:"15px",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:.5,color:"#fff"},message:'<div class="message"><img src="/Public/Images/loading-horizontal-sm.gif" /> '+n+"<\/div>"})}function getParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.href);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function ReadableFileSize(n){for(var t=0;n>=1024;)n/=1024,++t;return n.toFixed(2)+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]}function AddLabelDetails(n,t,i){var r,u;jQuery.ajaxSettings.traditional=!0;r=[];r.push(n);u={submissions:r,labelid:t,labelname:i};$(".LabelsLoading").show();$.post("/BatchLabel",u,function(n){if(n==!1){OnLoadingComplete();return}UpdateSubmissionDetails()},"json")}function UpdateSubmissionDetails(){var n=$("#SubmissionID").val();n&&($("#pageHistory").load("/SubmissionHistoryFeed/"+n,function(){SetUpToolTips()}),$("#SubmissionGeneralInfo").load("/SubmissionGeneralInfo/"+n,function(){SetUpSubmissionDetails()}),$("#SubmissionEditActionsToolbar").load("/SubmissionEditActionsToolbar/"+n,function(){SetUpSubmissionDetails()}))}function DoDetailsAssign(n,t,i){var r,f,u,e,o;$(i).find("input[type=button]").attr("disabled","disabled");$("object").hide();DoBlockUI();r=[];t?r.push(t):(f=$(i).find("li.option input[type=checkbox]:checked"),$.each(f,function(){r.push($(this).val())}));u=[];u.push(n);e=$(i).find("#Note").val();o={staff:r,submissions:u,note:e};$.post("/AssignSubmission",o,function(){CloseAndResetAssignMenu();UpdateSubmissionDetails()},"json")}function SetUpSubmissionDetails(){SetUpToolTips();SetUpAssignMenu();SetUpStatusMenu();SetUpLabels();SetUpFullscreenToggle();$.unblockUI();$("object").show();$(".LabelsLoading").hide()}function SetUpCategoryDropdown(){$(".SubmissionCategory").unbind("hover");$(".SubmissionCategory").hover(function(){$(this).css("cursor","pointer");$(this).css("text-decoration","underline")},function(){$(this).css("cursor","default");$(this).css("text-decoration","none")});$(".SubmissionCategory").click(function(){var t=$(this).parent().find(".SubmissionCategoryList"),n=$(t).find("select"),i=$(n).val();$(this).hide();$(t).show();$(n).unbind("change");$(n).change(function(){if(confirm("Are you sure?")){var n=$(this).find("option:selected").text(),t=$(this).val(),r={ProductID:t,Name:n};$.post("/UpdateSubmissionCategory/"+$("#SubmissionID").val(),r,function(r){r=="True"||r=="true"?($(".SubmissionCategoryList").hide(),$(".SubmissionCategory").text(n),$(".SubmissionCategory").show(),$(".SubmissionCategoryDropdown").val(t)):(alert("There was a problem changing the category."),$(".SubmissionCategoryList").hide(),$(".SubmissionCategory").show(),$(".SubmissionCategoryDropdown").val(i))})}else $(".SubmissionCategoryList").hide(),$(".SubmissionCategory").show(),$(".SubmissionCategoryDropdown").val(i)})});$(".CancelCategories").unbind("click");$(".CancelCategories").click(function(){$(".SubmissionCategoryList").hide();$(".SubmissionCategory").show()})}function SetUpStatusMenu(){jQuery.ajaxSettings.traditional=!0;$(".StatusLink").unbind("hover");$(".StatusLink").hover(function(){$(this).css("cursor","pointer");$(this).css("text-decoration","underline")},function(){$(this).css("cursor","default");$(this).css("text-decoration","none")});$(".StatusLink").unbind("click");$(".StatusLink").click(function(n){var t=$(this).parent().find(".status_menu");$(t).css("left",$(this).position().left);$(t).css("top",$(this).position().top+30);$(t).css("display")=="none"?($(document).trigger("hideCluetip"),$(t).show()):$(t).hide();n.preventDefault();n.stopPropagation()})}function StartLoading(n){var t="loading...",i;n&&(t=n);i='<div id="global-loading">'+t+"<\/div>";$("#global-loading").remove();$("body").append(i)}function StopLoading(){$("#global-loading").remove()}function ShowTab(n){var i=$("#SubmissionEditTabs").find(n),r,t;$("#SubmissionEditTabs li").removeClass("active");$(i).addClass("active");r=$(i).attr("id").replace("tab","page");t=$("#"+r);$(t).attr("data-url")&&($(t).hide(),$(t).load($(t).attr("data-url"),function(){}));$(".page").hide();$(t).show()}function LoadSubmittableForm(){var n=$("#Submission_SubmittableID").val();n>0?($("#Submittable_Title").val("unused"),$("#Submittable_File").val(""),$("#SubmittableForm").hide(),$(".disableDuringUpload").removeAttr("disabled")):($("#SubmittableForm input").val(""),$("#SubmittableForm").show(),$(".disableDuringUpload").attr("disabled","disabled"))}function RestrictInputToNumbersAndLettersAndSpacesAllowingBackspaceAndTabAndEnter(n,t){var i=t.keyCode?t.keyCode:t.which;((i<48||i>57)&&(i<65||i>90)&&(i<97||i>122)&&(t.keyCode<37||t.keyCode>40)&&i!=8&&i!=9&&i!=13&&i!=23&&i!=32&&i!=33&&i!=35&&i!=38&&i!=45&&i!=46&&i!=47&&i!=39&&i!=64||$(n).val().length==0&&i==32)&&t.preventDefault()}function UpdateValidations(){$("span.field-validation-valid, span.field-validation-error").each(function(){$(this).addClass("help-block")})}function SetupFormValidations(){$(".validate-email").length>0&&$(".validate-email").each(function(){$(this).rules("add","email")});$(".validate-url").length>0&&$(".validate-url").each(function(){$(this).rules("add","url")});$(".validate-date").length>0&&$(".validate-date").each(function(){$(this).rules("add","date")});$(".validate-number").length>0&&$(".validate-number").each(function(){$(this).rules("add","number")});$(".validate-digits").length>0&&$(".validate-digits").each(function(){$(this).rules("add","digits")});$(".validate-usphone").length>0&&$(".validate-usphone").each(function(){$(this).rules("add","phoneUS")});$("input.checkboxlist-required").length>0&&$(".checkboxlist-required").each(function(){$(this).rules("add",{required:!0,minlength:1})});$("input.radiolist-required").length>0&&$(".radiolist-required").each(function(){$(this).rules("add",{required:!0,minlength:1})})}(function(n){(window.embedlyURLre=/(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/,n.embedly=n.embedly||{},n.embedly.version)||(n.extend({embedly:function(t,i,r){var s=[],e="http://api.embed.ly/",u,h,o,f;i=i?i:{};u=n.extend({},n.embedly.defaults,i);u.urlRe||(u.urlRe=window.embedlyURLre);typeof t=="string"&&(t=new Array(t));typeof r!="undefined"&&(u.success=r);u.secure&&(e="https://api.embed.ly/");u.success||(u.success=function(t,i){var r,f=n(i.node);return t?(r=u.method)==="replace"?f.replaceWith(t.code):r==="after"?f.after(t.code):r==="afterParent"?f.parent().after(t.code):r==="replaceParent"?f.parent().replaceWith(t.code):void 0:null});u.error||(u.error=function(){});var c=function(n){return u.urlRe.test(n)},a=function(n){var t="urls="+n;return u.maxWidth?t+="&maxwidth="+u.maxWidth:typeof dimensions!="undefined"&&(t+="&maxwidth="+dimensions.width),u.maxHeight&&(t+="&maxheight="+u.maxHeight),u.chars&&(t+="&chars="+u.chars),u.words&&(t+="&words="+u.words),u.secure&&(t+="&secure=true"),u.frame&&(t+="&frame=true"),t+="&wmode="+u.wmode,typeof u.key=="string"&&(t+="&key="+u.key),(typeof u.autoplay=="string"||typeof u.autoplay=="boolean")&&(t+="&autoplay="+u.autoplay),u.width&&(t+="&width="+u.width),t},v=function(){if(typeof u.key=="string"){if(u.endpoint.search(/objectify/i)>=0)return e+"2/objectify";if(u.endpoint.search(/preview/i)>=0)return e+"1/preview"}return e+"1/oembed"},l=function(){var n=[];return u.addImageStyles&&(u.maxWidth&&(units=isNaN(parseInt(u.maxWidth,10))?"":"px",n.push("max-width: "+u.maxWidth+units)),u.maxHeight&&(units=isNaN(parseInt(u.maxHeight,10))?"":"px",n.push("max-height: "+u.maxHeight+units))),n.join(";")},y=function(t,i){if(u.endpoint!=="oembed")return u.success(t,i);var e,r,f,o,s,h;return(e=t.type)==="photo"?(f=t.title||"",r="<a href='"+i.url+"' target='_blank'><img style='"+l()+"' src='"+t.url+"' alt='"+f+"' /><\/a>"):e==="video"?r=t.html:e==="rich"?r=t.html:(f=t.title||i.url,o=t.thumbnail_url?"<img src='"+t.thumbnail_url+"' class='thumb' style='"+l()+"'/>":"",h=t.description?'<div class="description">'+t.description+"<\/div>":"",s=t.provider_name?"<a href='"+t.provider_url+"' class='provider'>"+t.provider_name+"<\/a>":"",r=o+"<a href='"+i.url+"'>"+f+"<\/a>",r+=s,r+=h),u.wrapElement&&u.wrapElement==="div"&&n.browser.msie&&n.browser.version<9&&(u.wrapElement="span"),u.wrapElement&&(r="<"+u.wrapElement+' class="'+u.className+'">'+r+"<\/"+u.wrapElement+">"),t.code=r,typeof i.node!="undefined"&&n(i.node).data("oembed",t).trigger("embedly-oembed",[t]),u.success(t,i)},p=function(t){var r,f,i;r=n.map(t,function(t,r){return r===0&&t.node!==null&&(i=n(t.node),f={width:i.parent().width(),height:i.parent().height()}),encodeURIComponent(t.url)}).join(",");n.ajax({url:v(),dataType:"json",data:a(r),success:function(i){return n.each(i,function(n,i){return i.type!=="error"?y(i,t[n]):u.error(t[n].node,i)})}})};for(n.each(t,function(t,i){var r=typeof u.elems!="undefined"?u.elems[t]:null,f;return typeof r=="undefined"||c(i)||n(r).data("oembed",!1),f={url:i,error_code:400,error_message:"HTTP 400: Bad Request",type:"error"},i&&c(i)?s.push({url:i,node:r}):u.error(r,f)}),h=[],o=s.length,f=0;0<=o?f<o:f>o;f+=20)h=h.concat(p(s.slice(f,f+20)));return u.elems?u.elems:this}}),n.embedly.version="2.2.0",n.embedly.defaults={endpoint:"oembed",secure:!1,frame:!1,wmode:"opaque",method:"replace",addImageStyles:!0,wrapElement:"div",className:"embed",elems:[]},n.fn.embedly=function(t,i){var f=typeof t!="undefined"?t:{},r,u,e;return typeof i!="undefined"&&(t.success=i),r=[],u=[],this.each(function(){typeof n(this).attr("href")!="undefined"?(r.push(n(this).attr("href")),u.push(n(this))):n(this).find("a").each(function(){r.push(n(this).attr("href"));u.push(n(this))});f.elems=u}),e=n.embedly(r,f),this})})(jQuery),function(n,t,i,r){"use strict";var h=i(n),e=i(t),u=i.fancybox=function(){u.open.apply(this,arguments)},y=navigator.userAgent.match(/msie/),v=null,o=t.createTouch!==r,a=function(n){return n&&n.hasOwnProperty&&n instanceof i},c=function(n){return n&&i.type(n)==="string"},l=function(n){return c(n)&&n.indexOf("%")>0},p=function(n){return n&&!(n.style.overflow&&n.style.overflow==="hidden")&&(n.clientWidth&&n.scrollWidth>n.clientWidth||n.clientHeight&&n.scrollHeight>n.clientHeight)},f=function(n,t){var i=parseInt(n,10)||0;return t&&l(n)&&(i=u.getViewport()[t]/100*i),Math.ceil(i)},s=function(n,t){return f(n,t)+"px"};i.extend(u,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!o,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"><\/div><\/div><\/div><\/div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(y?' allowtransparency="true"':"")+"><\/iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.<\/p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><\/a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><\/span><\/a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><\/span><\/a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(n,t){if(n)return(i.isPlainObject(t)||(t={}),!1===u.close(!0))?void 0:(i.isArray(n)||(n=a(n)?i(n).get():[n]),i.each(n,function(f,e){var h={},s,p,l,o,v,y,w;i.type(e)==="object"&&(e.nodeType&&(e=i(e)),a(e)?(h={href:e.data("fancybox-href")||e.attr("href"),title:e.data("fancybox-title")||e.attr("title"),isDom:!0,element:e},i.metadata&&i.extend(!0,h,e.metadata())):h=e);s=t.href||h.href||(c(e)?e:null);p=t.title!==r?t.title:h.title||"";l=t.content||h.content;o=l?"html":t.type||h.type;!o&&h.isDom&&(o=e.data("fancybox-type"),o||(v=e.prop("class").match(/fancybox\.(\w+)/),o=v?v[1]:null));c(s)&&(o||(u.isImage(s)?o="image":u.isSWF(s)?o="swf":s.charAt(0)==="#"?o="inline":c(e)&&(o="html",l=e)),o==="ajax"&&(y=s.split(/\s+/,2),s=y.shift(),w=y.shift()));l||(o==="inline"?s?l=i(c(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):h.isDom&&(l=e):o==="html"?l=s:o||s||!h.isDom||(o="inline",l=e));i.extend(h,{href:s,type:o,content:l,title:p,selector:w});n[f]=h}),u.opts=i.extend(!0,{},u.defaults,t),t.keys!==r&&(u.opts.keys=t.keys?i.extend({},u.defaults.keys,t.keys):!1),u.group=n,u._start(u.opts.index))},cancel:function(){var n=u.coming;n&&!1!==u.trigger("onCancel")&&(u.hideLoading(),u.ajaxLoad&&u.ajaxLoad.abort(),u.ajaxLoad=null,u.imgPreload&&(u.imgPreload.onload=u.imgPreload.onerror=null),n.wrap&&n.wrap.stop(!0,!0).trigger("onReset").remove(),u.coming=null,u.current||u._afterZoomOut(n))},close:function(n){(u.cancel(),!1!==u.trigger("beforeClose"))&&(u.unbindEvents(),u.isActive)&&(u.isOpen&&n!==!0?(u.isOpen=u.isOpened=!1,u.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),u.wrap.stop(!0,!0).removeClass("fancybox-opened"),u.transitions[u.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),u._afterZoomOut()))},play:function(n){var t=function(){clearTimeout(u.player.timer)},r=function(){t();u.current&&u.player.isActive&&(u.player.timer=setTimeout(u.next,u.current.playSpeed))},f=function(){t();i("body").unbind(".player");u.player.isActive=!1;u.trigger("onPlayEnd")},e=function(){u.current&&(u.current.loop||u.current.index<u.group.length-1)&&(u.player.isActive=!0,i("body").bind({"afterShow.player onUpdate.player":r,"onCancel.player beforeClose.player":f,"beforeLoad.player":t}),r(),u.trigger("onPlayStart"))};n!==!0&&(u.player.isActive||n===!1)?f():e()},next:function(n){var t=u.current;t&&(c(n)||(n=t.direction.next),u.jumpto(t.index+1,n,"next"))},prev:function(n){var t=u.current;t&&(c(n)||(n=t.direction.prev),u.jumpto(t.index-1,n,"prev"))},jumpto:function(n,t,i){var e=u.current;e&&(n=f(n),u.direction=t||e.direction[n>=e.index?"next":"prev"],u.router=i||"jumpto",e.loop&&(n<0&&(n=e.group.length+n%e.group.length),n=n%e.group.length),e.group[n]!==r&&(u.cancel(),u._start(n)))},reposition:function(n,t){var f=u.current,e=f?f.wrap:null,r;e&&(r=u._getPosition(t),n&&n.type==="scroll"?(delete r.position,e.stop(!0,!0).animate(r,200)):(e.css(r),f.pos=i.extend({},f.dim,r)))},update:function(n){var t=n&&n.type,i=!t||t==="orientationchange";(i&&(clearTimeout(v),v=null),u.isOpen&&!v)&&(v=setTimeout(function(){var r=u.current;r&&!u.isClosing&&(u.wrap.removeClass("fancybox-tmp"),(i||t==="load"||t==="resize"&&r.autoResize)&&u._setDimension(),t==="scroll"&&r.canShrink||u.reposition(n),u.trigger("onUpdate"),v=null)},i&&!o?0:300))},toggle:function(n){u.isOpen&&(u.current.fitToView=i.type(n)==="boolean"?n:!u.current.fitToView,o&&(u.wrap.removeAttr("style").addClass("fancybox-tmp"),u.trigger("onUpdate")),u.update())},hideLoading:function(){e.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var t,n;u.hideLoading();t=i('<div id="fancybox-loading"><div><\/div><\/div>').click(u.cancel).appendTo("body");e.bind("keydown.loading",function(n){(n.which||n.keyCode)===27&&(n.preventDefault(),u.cancel())});u.defaults.fixed||(n=u.getViewport(),t.css({position:"absolute",top:n.h*.5+n.y,left:n.w*.5+n.x}))},getViewport:function(){var i=u.current&&u.current.locked||!1,t={x:h.scrollLeft(),y:h.scrollTop()};return i?(t.w=i[0].clientWidth,t.h=i[0].clientHeight):(t.w=o&&n.innerWidth?n.innerWidth:h.width(),t.h=o&&n.innerHeight?n.innerHeight:h.height()),t},unbindEvents:function(){u.wrap&&a(u.wrap)&&u.wrap.unbind(".fb");e.unbind(".fb");h.unbind(".fb")},bindEvents:function(){var n=u.current,t;n&&(h.bind("orientationchange.fb"+(o?"":" resize.fb")+(n.autoCenter&&!n.locked?" scroll.fb":""),u.update),t=n.keys,t&&e.bind("keydown.fb",function(f){var e=f.which||f.keyCode,o=f.target||f.srcElement;if(e===27&&u.coming)return!1;f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||o&&(o.type||i(o).is("[contenteditable]"))||i.each(t,function(t,o){return n.group.length>1&&o[e]!==r?(u[t](o[e]),f.preventDefault(),!1):i.inArray(e,o)>-1?(u[t](),f.preventDefault(),!1):void 0})}),i.fn.mousewheel&&n.mouseWheel&&u.wrap.bind("mousewheel.fb",function(t,r,f,e){for(var h=t.target||null,o=i(h),s=!1;o.length;){if(s||o.is(".fancybox-skin")||o.is(".fancybox-wrap"))break;s=p(o[0]);o=i(o).parent()}r===0||s||u.group.length>1&&!n.canShrink&&(e>0||f>0?u.prev(e>0?"down":"left"):(e<0||f<0)&&u.next(e<0?"up":"right"),t.preventDefault())}))},trigger:function(n,t){var f,r=t||u.coming||u.current;if(r){if(i.isFunction(r[n])&&(f=r[n].apply(r,Array.prototype.slice.call(arguments,1))),f===!1)return!1;r.helpers&&i.each(r.helpers,function(t,f){f&&u.helpers[t]&&i.isFunction(u.helpers[t][n])&&(f=i.extend(!0,{},u.helpers[t].defaults,f),u.helpers[t][n](f,r))});i.event.trigger(n+".fb")}},isImage:function(n){return c(n)&&n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(n){return c(n)&&n.match(/\.(swf)((\?|#).*)?$/i)},_start:function(n){var t={},c,l,r,e,h;if(n=f(n),c=u.group[n]||null,!c)return!1;if(t=i.extend(!0,{},u.opts,c),e=t.margin,h=t.padding,i.type(e)==="number"&&(t.margin=[e,e,e,e]),i.type(h)==="number"&&(t.padding=[h,h,h,h]),t.modal&&i.extend(!0,t,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),t.autoSize&&(t.autoWidth=t.autoHeight=!0),t.width==="auto"&&(t.autoWidth=!0),t.height==="auto"&&(t.autoHeight=!0),t.group=u.group,t.index=n,u.coming=t,!1===u.trigger("beforeLoad")){u.coming=null;return}if(r=t.type,l=t.href,!r)return(u.coming=null,u.current&&u.router&&u.router!=="jumpto")?(u.current.index=n,u[u.router](u.direction)):!1;if(u.isActive=!0,(r==="image"||r==="swf")&&(t.autoHeight=t.autoWidth=!1,t.scrolling="visible"),r==="image"&&(t.aspectRatio=!0),r==="iframe"&&o&&(t.scrolling="scroll"),t.wrap=i(t.tpl.wrap).addClass("fancybox-"+(o?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+t.wrapCSS).appendTo(t.parent||"body"),i.extend(t,{skin:i(".fancybox-skin",t.wrap),outer:i(".fancybox-outer",t.wrap),inner:i(".fancybox-inner",t.wrap)}),i.each(["Top","Right","Bottom","Left"],function(n,i){t.skin.css("padding"+i,s(t.padding[n]))}),u.trigger("onReady"),r==="inline"||r==="html"){if(!t.content||!t.content.length)return u._error("content")}else if(!l)return u._error("href");r==="image"?u._loadImage():r==="ajax"?u._loadAjax():r==="iframe"?u._loadIframe():u._afterLoad()},_error:function(n){i.extend(u.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:n,content:u.coming.tpl.error});u._afterLoad()},_loadImage:function(){var n=u.imgPreload=new Image;n.onload=function(){this.onload=this.onerror=null;u.coming.width=this.width;u.coming.height=this.height;u._afterLoad()};n.onerror=function(){this.onload=this.onerror=null;u._error("image")};n.src=u.coming.href;n.complete!==!0&&u.showLoading()},_loadAjax:function(){var n=u.coming;u.showLoading();u.ajaxLoad=i.ajax(i.extend({},n.ajax,{url:n.href,error:function(n,t){u.coming&&t!=="abort"?u._error("ajax",n):u.hideLoading()},success:function(t,i){i==="success"&&(n.content=t,u._afterLoad())}}))},_loadIframe:function(){var n=u.coming,t=i(n.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",o?"auto":n.iframe.scrolling).attr("src",n.href);if(i(n.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(n){}}),n.iframe.preload){u.showLoading();t.one("load",function(){i(this).data("ready",1);o||i(this).bind("load.fb",u.update);i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();u._afterLoad()})}n.content=t.appendTo(n.inner);n.iframe.preload||u._afterLoad()},_preloadImages:function(){for(var r=u.group,i=u.current,f=r.length,e=i.preload?Math.min(i.preload,f-1):0,n,t=1;t<=e;t+=1)n=r[(i.index+t)%f],n.type==="image"&&n.href&&((new Image).src=n.href)},_afterLoad:function(){var r=u.coming,f=u.current,e="fancybox-placeholder",t,n,c,o,s,h;if(u.hideLoading(),r&&u.isActive!==!1){if(!1===u.trigger("afterLoad",r,f)){r.wrap.stop(!0).trigger("onReset").remove();u.coming=null;return}f&&(u.trigger("beforeChange",f),f.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());u.unbindEvents();t=r;n=r.content;c=r.type;o=r.scrolling;i.extend(u,{wrap:t.wrap,skin:t.skin,outer:t.outer,inner:t.inner,current:t,previous:f});s=t.href;switch(c){case"inline":case"ajax":case"html":t.selector?n=i("<div>").html(n).find(t.selector):a(n)&&(n.data(e)||n.data(e,i('<div class="'+e+'"><\/div>').insertAfter(n).hide()),n=n.show().detach(),t.wrap.bind("onReset",function(){i(this).find(n).length&&n.hide().replaceAll(n.data(e)).data(e,!1)}));break;case"image":n=t.tpl.image.replace("{href}",s);break;case"swf":n='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+s+'"><\/param>';h="";i.each(t.swf,function(t,i){n+='<param name="'+t+'" value="'+i+'"><\/param>';h+=" "+t+'="'+i+'"'});n+='<embed src="'+s+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"><\/embed><\/object>"}a(n)&&n.parent().is(t.inner)||t.inner.append(n);u.trigger("beforeShow");t.inner.css("overflow",o==="yes"?"scroll":o==="no"?"hidden":o);u._setDimension();u.reposition();u.isOpen=!1;u.coming=null;u.bindEvents();u.isOpened?f.prevMethod&&u.transitions[f.prevMethod]():i(".fancybox-wrap").not(t.wrap).stop(!0).trigger("onReset").remove();u.transitions[u.isOpened?t.nextMethod:t.openMethod]();u._preloadImages()}},_setDimension:function(){var nt=u.getViewport(),wt=0,vt=!1,st=!1,v=u.wrap,k=u.skin,e=u.inner,r=u.current,n=r.width,t=r.height,o=r.minWidth,h=r.minHeight,c=r.maxWidth,a=r.maxHeight,bt=r.scrolling,ft=r.scrollOutside?r.scrollbarWidth:0,et=r.margin,yt=f(et[1]+et[3]),pt=f(et[0]+et[2]),d,ht,tt,it,p,y,ct,lt,w,g,b,rt,ot,ut,at;if(v.add(k).add(e).width("auto").height("auto").removeClass("fancybox-tmp"),d=f(k.outerWidth(!0)-k.width()),ht=f(k.outerHeight(!0)-k.height()),tt=yt+d,it=pt+ht,p=l(n)?(nt.w-tt)*f(n)/100:n,y=l(t)?(nt.h-it)*f(t)/100:t,r.type==="iframe"){if(ut=r.content,r.autoHeight&&ut.data("ready")===1)try{ut[0].contentWindow.document.location&&(e.width(p).height(9999),at=ut.contents().find("body"),ft&&at.css("overflow-x","hidden"),y=at.height())}catch(kt){}}else(r.autoWidth||r.autoHeight)&&(e.addClass("fancybox-tmp"),r.autoWidth||e.width(p),r.autoHeight||e.height(y),r.autoWidth&&(p=e.width()),r.autoHeight&&(y=e.height()),e.removeClass("fancybox-tmp"));if(n=f(p),t=f(y),w=p/y,o=f(l(o)?f(o,"w")-tt:o),c=f(l(c)?f(c,"w")-tt:c),h=f(l(h)?f(h,"h")-it:h),a=f(l(a)?f(a,"h")-it:a),ct=c,lt=a,r.fitToView&&(c=Math.min(nt.w-tt,c),a=Math.min(nt.h-it,a)),rt=nt.w-yt,ot=nt.h-pt,r.aspectRatio?(n>c&&(n=c,t=f(n/w)),t>a&&(t=a,n=f(t*w)),n<o&&(n=o,t=f(n/w)),t<h&&(t=h,n=f(t*w))):(n=Math.max(o,Math.min(n,c)),r.autoHeight&&r.type!=="iframe"&&(e.width(n),t=e.height()),t=Math.max(h,Math.min(t,a))),r.fitToView)if(e.width(n).height(t),v.width(n+d),g=v.width(),b=v.height(),r.aspectRatio)while((g>rt||b>ot)&&n>o&&t>h){if(wt++>19)break;t=Math.max(h,Math.min(a,t-10));n=f(t*w);n<o&&(n=o,t=f(n/w));n>c&&(n=c,t=f(n/w));e.width(n).height(t);v.width(n+d);g=v.width();b=v.height()}else n=Math.max(o,Math.min(n,n-(g-rt))),t=Math.max(h,Math.min(t,t-(b-ot)));ft&&bt==="auto"&&t<y&&n+d+ft<rt&&(n+=ft);e.width(n).height(t);v.width(n+d);g=v.width();b=v.height();vt=(g>rt||b>ot)&&n>o&&t>h;st=r.aspectRatio?n<ct&&t<lt&&n<p&&t<y:(n<ct||t<lt)&&(n<p||t<y);i.extend(r,{dim:{width:s(g),height:s(b)},origWidth:p,origHeight:y,canShrink:vt,canExpand:st,wPadding:d,hPadding:ht,wrapSpace:b-k.outerHeight(!0),skinSpace:k.height()-t});!ut&&r.autoHeight&&t>h&&t<a&&!st&&e.height("auto")},_getPosition:function(n){var i=u.current,r=u.getViewport(),f=i.margin,e=u.wrap.width()+f[1]+f[3],o=u.wrap.height()+f[0]+f[2],t={position:"absolute",top:f[0],left:f[3]};return i.autoCenter&&i.fixed&&!n&&o<=r.h&&e<=r.w?t.position="fixed":i.locked||(t.top+=r.y,t.left+=r.x),t.top=s(Math.max(t.top,t.top+(r.h-o)*i.topRatio)),t.left=s(Math.max(t.left,t.left+(r.w-e)*i.leftRatio)),t},_afterZoomIn:function(){var n=u.current;n&&(u.isOpen=u.isOpened=!0,u.wrap.css("overflow","visible").addClass("fancybox-opened"),u.update(),(n.closeClick||n.nextClick&&u.group.length>1)&&u.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),u[n.closeClick?"close":"next"]())}),n.closeBtn&&i(n.tpl.closeBtn).appendTo(u.skin).bind("click.fb",function(n){n.preventDefault();u.close()}),n.arrows&&u.group.length>1&&((n.loop||n.index>0)&&i(n.tpl.prev).appendTo(u.outer).bind("click.fb",u.prev),(n.loop||n.index<u.group.length-1)&&i(n.tpl.next).appendTo(u.outer).bind("click.fb",u.next)),u.trigger("afterShow"),n.loop||n.index!==n.group.length-1?u.opts.autoPlay&&!u.player.isActive&&(u.opts.autoPlay=!1,u.play()):u.play(!1))},_afterZoomOut:function(n){n=n||u.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(u,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});u.trigger("afterClose",n)}});u.transitions={getOrigPosition:function(){var n=u.current,f=n.element,t=n.orig,i={},e=50,o=50,h=n.hPadding,c=n.wPadding,r=u.getViewport();return!t&&n.isDom&&f.is(":visible")&&(t=f.find("img:first"),t.length||(t=f)),a(t)?(i=t.offset(),t.is("img")&&(e=t.outerWidth(),o=t.outerHeight())):(i.top=r.y+(r.h-o)*n.topRatio,i.left=r.x+(r.w-e)*n.leftRatio),(u.wrap.css("position")==="fixed"||n.locked)&&(i.top-=r.y,i.left-=r.x),{top:s(i.top-h*n.topRatio),left:s(i.left-c*n.leftRatio),width:s(e+c),height:s(o+h)}},step:function(n,t){var r,s,e,i=t.prop,o=u.current,h=o.wrapSpace,c=o.skinSpace;(i==="width"||i==="height")&&(r=t.end===t.start?1:(n-t.start)/(t.end-t.start),u.isClosing&&(r=1-r),s=i==="width"?o.wPadding:o.hPadding,e=n-s,u.skin[i](f(i==="width"?e:e-h*r)),u.inner[i](f(i==="width"?e:e-h*r-c*r)))},zoomIn:function(){var n=u.current,t=n.pos,r=n.openEffect,f=r==="elastic",e=i.extend({opacity:1},t);delete e.position;f?(t=this.getOrigPosition(),n.openOpacity&&(t.opacity=.1)):r==="fade"&&(t.opacity=.1);u.wrap.css(t).animate(e,{duration:r==="none"?0:n.openSpeed,easing:n.openEasing,step:f?this.step:null,complete:u._afterZoomIn})},zoomOut:function(){var n=u.current,i=n.closeEffect,r=i==="elastic",t={opacity:.1};r&&(t=this.getOrigPosition(),n.closeOpacity&&(t.opacity=.1));u.wrap.animate(t,{duration:i==="none"?0:n.closeSpeed,easing:n.closeEasing,step:r?this.step:null,complete:u._afterZoomOut})},changeIn:function(){var i=u.current,h=i.nextEffect,t=i.pos,o={opacity:1},r=u.direction,e=200,n;t.opacity=.1;h==="elastic"&&(n=r==="down"||r==="up"?"top":"left",r==="down"||r==="right"?(t[n]=s(f(t[n])-e),o[n]="+="+e+"px"):(t[n]=s(f(t[n])+e),o[n]="-="+e+"px"));h==="none"?u._afterZoomIn():u.wrap.css(t).animate(o,{duration:i.nextSpeed,easing:i.nextEasing,complete:u._afterZoomIn})},changeOut:function(){var n=u.previous,r=n.prevEffect,f={opacity:.1},t=u.direction;r==="elastic"&&(f[t==="down"||t==="up"?"top":"left"]=(t==="up"||t==="left"?"-":"+")+"=200px");n.wrap.animate(f,{duration:r==="none"?0:n.prevSpeed,easing:n.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};u.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!o,fixed:!0},overlay:null,fixed:!1,create:function(n){n=i.extend({},this.defaults,n);this.overlay&&this.close();this.overlay=i('<div class="fancybox-overlay"><\/div>').appendTo("body");this.fixed=!1;n.fixed&&u.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(n){var t=this;n=i.extend({},this.defaults,n);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(n);this.fixed||(h.bind("resize.overlay",i.proxy(this.update,this)),this.update());n.closeClick&&this.overlay.bind("click.overlay",function(n){i(n.target).hasClass("fancybox-overlay")&&(u.isActive?u.close():t.close())});this.overlay.css(n.css).show()},close:function(){i(".fancybox-overlay").remove();h.unbind("resize.overlay");this.overlay=null;this.margin!==!1&&(i("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var n="100%",i;this.overlay.width(n).height("100%");y?(i=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),e.width()>i&&(n=e.width())):e.width()>h.width()&&(n=e.width());this.overlay.width(n).height(e.height())},onReady:function(n,r){i(".fancybox-overlay").stop(!0,!0);this.overlay||(this.margin=e.height()>h.height()||i("body").css("overflow-y")==="scroll"?i("body").css("margin-right"):!1,this.el=t.all&&!t.querySelector?i("html"):i("body"),this.create(n));n.locked&&this.fixed&&(r.locked=this.overlay.append(r.wrap),r.fixed=!1);n.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(n,t){t.locked&&(this.el.addClass("fancybox-lock"),this.margin!==!1&&i("body").css("margin-right",f(this.margin)+t.scrollbarWidth));this.open(n)},onUpdate:function(){this.fixed||this.update()},afterClose:function(n){this.overlay&&!u.isActive&&this.overlay.fadeOut(n.speedOut,i.proxy(this.close,this))}};u.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(n){var o=u.current,r=o.title,s=n.type,t,e;if(i.isFunction(r)&&(r=r.call(o.element,o)),c(r)&&i.trim(r)!==""){t=i('<div class="fancybox-title fancybox-title-'+s+'-wrap">'+r+"<\/div>");switch(s){case"inside":e=u.skin;break;case"outside":e=u.wrap;break;case"over":e=u.inner;break;default:e=u.skin;t.appendTo("body");y&&t.width(t.width());t.wrapInner('<span class="child"><\/span>');u.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t[n.position==="top"?"prependTo":"appendTo"](e)}}};i.fn.fancybox=function(n){var r,f=i(this),t=this.selector||"",o=function(e){var o=i(this).blur(),c=r,h,s;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||o.is(".fancybox-wrap")||(h=n.groupAttr||"data-fancybox-group",s=o.attr(h),s||(h="rel",s=o.get(0)[h]),s&&s!==""&&s!=="nofollow"&&(o=t.length?i(t):f,o=o.filter("["+h+'="'+s+'"]'),c=o.index(this)),n.index=c,u.open(o,n)!==!1&&e.preventDefault())};return n=n||{},r=n.index||0,t&&n.live!==!1?e.undelegate(t,"click.fb-start").delegate(t+":not('.fancybox-item, .fancybox-nav')","click.fb-start",o):f.unbind("click.fb-start").bind("click.fb-start",o),this.filter("[data-fancybox-start=1]").trigger("click"),this};e.ready(function(){i.scrollbarWidth===r&&(i.scrollbarWidth=function(){var n=i('<div style="width:50px;height:50px;overflow:auto"><div/><\/div>').appendTo("body"),t=n.children(),r=t.innerWidth()-t.height(99).innerWidth();return n.remove(),r});i.support.fixedPosition===r&&(i.support.fixedPosition=function(){var n=i('<div style="position:fixed;top:20px;"><\/div>').appendTo("body"),t=n[0].offsetTop===20||n[0].offsetTop===15;return n.remove(),t}());i.extend(u.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})}(window,document,jQuery),function(n){n.fn.hoverIntent=function(t,i){var r={sensitivity:7,interval:100,timeout:0};r=n.extend(r,i?{over:t,out:i}:t);var u,f,e,o,s=function(n){u=n.pageX;f=n.pageY},h=function(t,i){if(i.hoverIntent_t=clearTimeout(i.hoverIntent_t),Math.abs(e-u)+Math.abs(o-f)<r.sensitivity)return n(i).unbind("mousemove",s),i.hoverIntent_s=1,r.over.apply(i,[t]);e=u;o=f;i.hoverIntent_t=setTimeout(function(){h(t,i)},r.interval)},l=function(n,t){return t.hoverIntent_t=clearTimeout(t.hoverIntent_t),t.hoverIntent_s=0,r.out.apply(t,[n])},c=function(t){for(var u=(t.type=="mouseover"?t.fromElement:t.toElement)||t.relatedTarget,f,i;u&&u!=this;)try{u=u.parentNode}catch(t){u=this}if(u==this)return!1;f=jQuery.extend({},t);i=this;i.hoverIntent_t&&(i.hoverIntent_t=clearTimeout(i.hoverIntent_t));t.type=="mouseover"?(e=f.pageX,o=f.pageY,n(i).bind("mousemove.cluetip",s),i.hoverIntent_s!=1&&(i.hoverIntent_t=setTimeout(function(){h(f,i)},r.interval))):(n(i).unbind("mousemove.cluetip",s),i.hoverIntent_s==1&&(i.hoverIntent_t=setTimeout(function(){l(f,i)},r.timeout)))};return this.bind("mouseover.cluetip",c).bind("mouseout.cluetip",c)}}(jQuery),function(n){function s(f,s){var l=f==window,h=s&&s.message!==undefined?s.message:undefined,nt,tt,b,w,rt,ut,ft,lt;s=n.extend({},n.blockUI.defaults,s||{});s.overlayCSS=n.extend({},n.blockUI.defaults.overlayCSS,s.overlayCSS||{});nt=n.extend({},n.blockUI.defaults.css,s.css||{});tt=n.extend({},n.blockUI.defaults.themedCSS,s.themedCSS||{});h=h===undefined?s.message:h;l&&t&&e(window,{fadeOut:0});h&&typeof h!="string"&&(h.parentNode||h.jquery)&&(b=h.jquery?h[0]:h,w={},n(f).data("blockUI.history",w),w.el=b,w.parent=b.parentNode,w.display=b.style.display,w.position=b.style.position,w.parent&&w.parent.removeChild(b));var k=s.baseZ,g=n.browser.msie||s.forceIframe?n('<iframe class="blockUI" style="z-index:'+k+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+s.iframeSrc+'"><\/iframe>'):n('<div class="blockUI" style="display:none"><\/div>'),d=n('<div class="blockUI blockOverlay" style="z-index:'+k+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"><\/div>'),p,it;if(it=s.theme&&l?'<div class="blockUI '+s.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+k+';display:none;position:fixed"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(s.title||"&nbsp;")+'<\/div><div class="ui-widget-content ui-dialog-content"><\/div><\/div>':s.theme?'<div class="blockUI '+s.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+k+';display:none;position:absolute"><div class="ui-widget-header ui-dialog-titlebar blockTitle">'+(s.title||"&nbsp;")+'<\/div><div class="ui-widget-content ui-dialog-content"><\/div><\/div>':l?'<div class="blockUI '+s.blockMsgClass+' blockPage" style="z-index:'+k+';display:none;position:fixed"><\/div>':'<div class="blockUI '+s.blockMsgClass+' blockElement" style="z-index:'+k+';display:none;position:absolute"><\/div>',p=n(it),h&&(s.theme?(p.css(tt),p.addClass("ui-widget-content")):p.css(nt)),s.applyPlatformOpacityRules&&n.browser.mozilla&&/Linux/.test(navigator.platform)||d.css(s.overlayCSS),d.css("position",l?"fixed":"absolute"),(n.browser.msie||s.forceIframe)&&g.css("opacity",0),rt=[g,d,p],ut=l?n("body"):n(f),n.each(rt,function(){this.appendTo(ut)}),s.theme&&s.draggable&&n.fn.draggable&&p.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),ft=v&&(!n.boxModel||n("object,embed",l?null:f).length>0),o||ft){if(l&&s.allowBodyStretch&&n.boxModel&&n("html,body").css("height","100%"),(o||!n.boxModel)&&!l)var et=r(f,"borderTopWidth"),ot=r(f,"borderLeftWidth"),st=et?"(0 - "+et+")":0,ht=ot?"(0 - "+ot+")":0;n.each([g,d,p],function(n,t){var i=t[0].style,r,u;i.position="absolute";n<2?(l?i.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+s.quirksmodeOffsetHack+') + "px"'):i.setExpression("height",'this.parentNode.offsetHeight + "px"'),l?i.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):i.setExpression("width",'this.parentNode.offsetWidth + "px"'),ht&&i.setExpression("left",ht),st&&i.setExpression("top",st)):s.centerY?(l&&i.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),i.marginTop=0):!s.centerY&&l&&(r=s.css&&s.css.top?parseInt(s.css.top):0,u="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+r+') + "px"',i.setExpression("top",u))})}if(h&&(s.theme?p.find(".ui-widget-content").append(h):p.append(h),(h.jquery||h.nodeType)&&n(h).show()),(n.browser.msie||s.forceIframe)&&s.showOverlay&&g.show(),s.fadeIn){var ct=s.onBlock?s.onBlock:u,at=s.showOverlay&&!h?ct:u,vt=h?ct:u;s.showOverlay&&d._fadeIn(s.fadeIn,at);h&&p._fadeIn(s.fadeIn,vt)}else s.showOverlay&&d.show(),h&&p.show(),s.onBlock&&s.onBlock();c(1,f,s);l?(t=p[0],i=n(":input:enabled:visible",t),s.focusInput&&setTimeout(a,20)):y(p[0],s.centerX,s.centerY);s.timeout&&(lt=setTimeout(function(){l?n.unblockUI(s):n(f).unblock(s)},s.timeout),n(f).data("blockUI.timeout",lt))}function e(r,u){var o=r==window,e=n(r),s=e.data("blockUI.history"),l=e.data("blockUI.timeout"),f;l&&(clearTimeout(l),e.removeData("blockUI.timeout"));u=n.extend({},n.blockUI.defaults,u||{});c(0,r,u);f=o?n("body").children().filter(".blockUI").add("body > .blockUI"):n(".blockUI",r);o&&(t=i=null);u.fadeOut?(f.fadeOut(u.fadeOut),setTimeout(function(){h(f,s,u,r)},u.fadeOut)):h(f,s,u,r)}function h(t,i,r,u){if(t.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),i&&i.el&&(i.el.style.display=i.display,i.el.style.position=i.position,i.parent&&i.parent.appendChild(i.el),n(u).removeData("blockUI.history")),typeof r.onUnblock=="function")r.onUnblock(u,r)}function c(i,r,u){var f=r==window,o=n(r),e;(i||(!f||t)&&(f||o.data("blockUI.isBlocked")))&&(f||o.data("blockUI.isBlocked",i),u.bindEvents&&(!i||u.showOverlay))&&(e="mousedown mouseup keydown keypress",i?n(document).bind(e,u,l):n(document).unbind(e,l))}function l(r){var e;if(r.keyCode&&r.keyCode==9&&t&&r.data.constrainTabKey){var u=i,o=!r.shiftKey&&r.target==u[u.length-1],f=r.shiftKey&&r.target==u[0];if(o||f)return setTimeout(function(){a(f)},10),!1}return(e=r.data,n(r.target).parents("div."+e.blockMsgClass).length>0)?!0:n(r.target).parents().children().filter("div.blockUI").length==0}function a(n){if(i){var t=i[n===!0?i.length-1:0];t&&t.focus()}}function y(n,t,i){var u=n.parentNode,f=n.style,e=(u.offsetWidth-n.offsetWidth)/2-r(u,"borderLeftWidth"),o=(u.offsetHeight-n.offsetHeight)/2-r(u,"borderTopWidth");t&&(f.left=e>0?e+"px":"0");i&&(f.top=o>0?o+"px":"0")}function r(t,i){return parseInt(n.css(t,i))||0}var t,i;if(/1\.(0|1|2)\.(0|1|2)/.test(n.fn.jquery)||/^1.1/.test(n.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+n.fn.jquery);return}n.fn._fadeIn=n.fn.fadeIn;var u=function(){},f=document.documentMode||0,v=n.browser.msie&&(n.browser.version<8&&!f||f<8),o=n.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!f;n.blockUI=function(n){s(window,n)};n.unblockUI=function(n){e(window,n)};n.growlUI=function(t,i,r,u){var f=n('<div class="growlUI"><\/div>');t&&f.append("<h1>"+t+"<\/h1>");i&&f.append("<h2>"+i+"<\/h2>");r==undefined&&(r=3e3);n.blockUI({message:f,fadeIn:700,fadeOut:1e3,centerY:!1,timeout:r,showOverlay:!1,onUnblock:u,css:n.blockUI.defaults.growlCSS})};n.fn.block=function(t){return this.unblock({fadeOut:0}).each(function(){n.css(this,"position")=="static"&&(this.style.position="relative");n.browser.msie&&(this.style.zoom=1);s(this,t)})};n.fn.unblock=function(n){return this.each(function(){e(this,n)})};n.blockUI.version=2.35;n.blockUI.defaults={message:"<h1>Please wait...<\/h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,applyPlatformOpacityRules:!0,onBlock:null,onUnblock:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg"};t=null;i=[]}(jQuery),function(n){n.fn.typeWatch=function(t){function r(t,r){var u=n(t.el).val();(u.length>i.captureLength&&u.toUpperCase()!=t.text||r&&u.length>i.captureLength)&&(t.text=u.toUpperCase(),t.cb(u))}function u(t){var u,f;(t.type.toUpperCase()=="TEXT"||t.nodeName.toUpperCase()=="TEXTAREA")&&(u={timer:null,text:n(t).val().toUpperCase(),cb:i.callback,el:t,wait:i.wait},i.highlight&&n(t).focus(function(){this.select()}),f=function(n){var t=u.wait,i=!1,f;n.keyCode==13&&this.type.toUpperCase()=="TEXT"&&(t=1,i=!0);f=function(){r(u,i)};clearTimeout(u.timer);u.timer=setTimeout(f,t)},n(t).unbind("keydown"),n(t).keydown(f))}var i=n.extend({wait:750,callback:function(){},highlight:!0,captureLength:2},t);return this.each(function(){u(this)})}}(jQuery);var JSON;JSON||(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var s,l,h,a,v=n,c,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i));typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";if(n+=r,c=[],Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,s=0;s<a;s+=1)c[s]=u(s,e)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));else for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",r="",typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),f.lastIndex=0,f.test(text)&&(text=text.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}();typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});jQuery.fn.extend({insertAtCaret:function(n){return this.each(function(){if(document.selection)this.focus(),sel=document.selection.createRange(),sel.text=n,this.focus();else if(this.selectionStart||this.selectionStart=="0"){var t=this.selectionStart,i=this.selectionEnd,r=this.scrollTop;this.value=this.value.substring(0,t)+n+this.value.substring(i,this.value.length);this.focus();this.selectionStart=t+n.length;this.selectionEnd=t+n.length;this.scrollTop=r}else this.value+=n,this.focus()})}});$.fn.shiftSelectable=function(){var n,t=this;t.click(function(i){if(!n){n=this;return}if(i.shiftKey){var r=t.index(this),u=t.index(n);t.slice(Math.min(r,u),Math.max(r,u)+1).attr("checked",n.checked).trigger("change")}n=this})};$(function(){typeof console=="undefined"&&(console={log:function(){}});$.ajaxSetup({jsonp:null,jsonpCallback:null});$.ajaxSettings.traditional=!0;$("a.fancybox").fancybox({openEffect:"none",closeEffect:"none",prevEffect:"none",nextEffect:"none",fitToView:!1});img1=new Image;img1.src="/Public/Images/loading-horizontal-sm.gif";$("body").on("click","a.load-modal",function(n){$("body").modalmanager("loading");n.preventDefault();$modal=$("#ajax-modal");var i=$(this).data("url"),t=$(this).data("init");$modal.load(i,function(){t=="InitReviewEntryDialog"?$modal.modal({backdrop:"static"}):$modal.modal();$.validator.unobtrusive.parse($("#ajax-modal"));SetupMultiselect();UpdateValidations();window[t]&&window[t]()})});$(".select-all").click(function(n){n.preventDefault();var t=$(this).attr("data-elemid");$("#"+t).find("option").each(function(){$(this).attr("selected","selected")})});$(".select-none").click(function(n){n.preventDefault();var t=$(this).attr("data-elemid");$("#"+t).find("option").each(function(){$(this).removeAttr("selected")})});$("input.click-select").on("click",function(){$(this).select()});$("a#dash-link").click(function(n){n.preventDefault()});$("[rel=score]").popoverx({placement:"right",onShown:function(){var n=this;this.$tip.attr("id","voteinfo-"+this.options.id);this.$tip.addClass("voteinfo");$.ajax({url:n.options.url,type:"GET",dataType:"html",success:function(t){$("#voteinfo-"+n.options.id).find("div.popover-content").html(t);n.resetPosition()}})}});$(".datepicker-selects").datepicker({todayHighlight:!0,constrainInput:!0,changeMonth:!0,changeYear:!0,yearRange:(new Date).getFullYear()-100+":"+(new Date).getFullYear()});$("body").on("click","input.datepicker",function(){$(this).datepicker({todayHighlight:!0,constrainInput:!0,autoclose:!0}).focus()});$("i.enablecalandar").datepicker({todayHighlight:!0,constrainInput:!0,autoclose:!0}).on("changeDate",function(n){var i=$(this).context.parentElement,t;i=$(i).context.previousElementSibling;t=new Date(n.date);t.setDate(t.getDate()+1);$(i).val(t.toLocaleDateString());$("i.enablecalandar").datepicker("hide")});SetupMultiselect();$("body").on("click","a.delete",function(n){n.preventDefault();var i=$(this).attr("href"),t="Are you sure you want to delete this item?";$(this).data("message")&&(t=$(this).data("message"));bootbox.confirm(t,function(n){n&&(window.location=i)})});$("body").on("click",".confirm",function(n){n.preventDefault();var i=$(this).attr("href"),t="Are you sure?";$(this).data("message")&&(t=$(this).data("message"));bootbox.confirm(t,function(n){n&&(window.location=i)})});$("#dismiss-message").on("click",function(n){n.preventDefault();$.get("/content/dismisssystemmessages",function(){$("#system-message").slideUp(function(){$("#message-headline").text("");$("#message-body").empty()})})})}),function(n){function t(n){return n.substr(0,n.lastIndexOf(".")+1)}function i(n,t){return n.indexOf("*.")==0&&(n=n.replace("*.",t)),n}n.validator.addMethod("wordcount",function(t,i){t=t.replace(/\s\–\s/g," ");t=t.replace(/\s\,\s/g," ");t=t.replace(/\s\.\s/g," ");var r=n.trim(t).split(/[\s\n\r]+/).length;return r>n(i).data("wordlimit")?(n.validator.messages.wordcount="You have entered "+r+" words. This field is limited to "+n(i).data("wordlimit")+" words.",!1):!0});n.validator.addClassRules("wordcount",{wordcount:!0});n.validator.unobtrusive.adapters.add("brequired",function(n){n.element.tagName.toUpperCase()=="INPUT"&&n.element.type.toUpperCase()=="CHECKBOX"&&(n.rules.required=!0,n.message&&(n.messages.required=n.message))});n.validator.addMethod("verifychecked",function(t,i,r){return!t&&n(r).is(":checked")?!1:!0});n.validator.unobtrusive.adapters.add("requiredifcheckboxchecked",["checkbox","enabled"],function(r){var f=t(r.element.name),e=r.params.checkbox,o=i(e,f),u;r.params.enabled!="False"&&r.params.enabled!="false"&&(u=n(r.form).find(":input[name="+o+"]")[0],r.rules.verifychecked=u,r.message&&(r.messages.verifychecked=r.message))})}(jQuery);jQuery.validator.setDefaults({highlight:function(n,t,i){n.type==="radio"?this.findByName(n.name).addClass(t).removeClass(i):($(n).addClass(t).removeClass(i),$(n).closest(".control-group").removeClass("success").addClass("error"))},unhighlight:function(n,t,i){n.type==="radio"?this.findByName(n.name).removeClass(t).addClass(i):($(n).removeClass(t).addClass(i),$(n).closest(".control-group").removeClass("error"))}});$(document).ready(function(){UpdateValidations()}),function(n){function i(n,t){return n.nodeType==3?e(n,t):f(n,t)}function f(t,r){var t=n(t),u=t.clone().empty(),f;return t.contents().each(function(){var n=r-u.text().length;n!=0&&(f=i(this,n),f&&u.append(f))}),u}function e(i,u){var f=r(i.data);return t&&(f=f.replace(/^ /,"")),t=!!f.match(/ $/),f=f.slice(0,u),n("<div/>").text(f).html()}function r(n){return n.replace(/\s+/g," ")}function u(t){var f=n(t),i=f.children(":last"),r;return i?(r=i.css("display"),!r||r=="inline")?f:u(i):t}function o(t){var r=n(t),i=r.children(":last");return i&&i.is("p")?i:t}var t=!0;n.fn.truncate=function(t){var f=n.extend({},n.fn.truncate.defaults,t);n(this).each(function(){var s;if(!n(this).hasClass("truncate")&&(n(this).addClass("truncate"),s=n.trim(r(n(this).text())).length,!(s<=f.max_length))){var h=f.max_length-f.more.length-3,t=i(this,h),e=n(this).hide();t.insertAfter(e);u(t).append(' (<a href="#">'+f.more+"<\/a>)");o(e).append(' (<a href="#">'+f.less+"<\/a>)");t.find("a:last").click(function(){return t.hide(),e.show(),!1});e.find("a:last").click(function(){return t.show(),e.hide(),!1})}})};n.fn.truncate.defaults={max_length:100,more:"more",less:"less"}}(jQuery);$(function(){SetupFormValidations()}),function(n){n.extend({tablesorter:new function(){function i(n,t){u(n+","+((new Date).getTime()-t.getTime())+"ms")}function u(n){typeof console!="undefined"&&typeof console.debug!="undefined"?console.log(n):alert(n)}function h(t,i){var o,e,r,f;if(t.config.debug&&(o=""),t.tBodies.length!=0){if(e=t.tBodies[0].rows,e[0]){var s=[],h=e[0].cells,l=h.length;for(r=0;r<l;r++)f=!1,n.metadata&&n(i[r]).metadata()&&n(i[r]).metadata().sorter?f=c(n(i[r]).metadata().sorter):t.config.headers[r]&&t.config.headers[r].sorter&&(f=c(t.config.headers[r].sorter)),f||(f=w(t,e,-1,r)),t.config.debug&&(o+="column:"+r+" parser:"+f.id+"\n"),s.push(f)}return t.config.debug&&u(o),s}}function w(n,i,r,f){for(var c=t.length,o=!1,s=!1,h=!0,e;s==""&&h;)r++,i[r]?(o=b(i,r,f),s=k(n.config,o),n.config.debug&&u("Checking if value was empty on row:"+r)):h=!1;for(e=1;e<c;e++)if(t[e].is(s,n,o))return t[e];return t[0]}function b(n,t,i){return n[t].cells[i]}function k(t,i){return n.trim(e(t,i))}function c(n){for(var r=t.length,i=0;i<r;i++)if(t[i].id.toLowerCase()==n.toLowerCase())return t[i];return!1}function l(t){var h,s,u,o,f;t.config.debug&&(h=new Date);var c=t.tBodies[0]&&t.tBodies[0].rows.length||0,l=t.tBodies[0].rows[0]&&t.tBodies[0].rows[0].cells.length||0,a=t.config.parsers,r={row:[],normalized:[]};for(s=0;s<c;++s){if(u=n(t.tBodies[0].rows[s]),o=[],u.hasClass(t.config.cssChildRow)){r.row[r.row.length-1]=r.row[r.row.length-1].add(u);continue}for(r.row.push(u),f=0;f<l;++f)o.push(a[f].format(e(t.config,u[0].cells[f]),t,u[0].cells[f]));o.push(r.normalized.length);r.normalized.push(o);o=null}return t.config.debug&&i("Building cache for "+c+" rows:",h),r}function e(t,i){return i?(t.supportsTextContent||(t.supportsTextContent=i.textContent||!1),t.textExtraction=="simple"?t.supportsTextContent?i.textContent:i.childNodes[0]&&i.childNodes[0].hasChildNodes()?i.childNodes[0].innerHTML:i.innerHTML:typeof t.textExtraction=="function"?t.textExtraction(i):n(i).text()):""}function o(t,r){var l,u,f,v,e;t.config.debug&&(l=new Date);var a=r,o=a.row,h=a.normalized,y=h.length,p=h[0].length-1,w=n(t.tBodies[0]),c=[];for(u=0;u<y;u++)if(f=h[u][p],c.push(o[f]),!t.config.appender)for(v=o[f].length,e=0;e<v;e++)w[0].appendChild(o[f][e]);t.config.appender&&t.config.appender(t,c);c=null;t.config.debug&&i("Rebuilt table:",l);s(t);setTimeout(function(){n(t).trigger("sortEnd")},0)}function d(t){var r,e,f;return t.config.debug&&(r=new Date),e=n.metadata?!0:!1,f=g(t),$tableHeaders=n(t.config.selectorHeaders,t).each(function(i){if(this.column=f[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=rt(t.config.sortInitialOrder),this.count=this.order,(tt(this)||it(t,i))&&(this.sortDisabled=!0),a(t,i)&&(this.order=this.lockedOrder=a(t,i)),!this.sortDisabled){var r=n(this).addClass(t.config.cssHeader);t.config.onRenderHeader&&t.config.onRenderHeader.apply(r)}t.config.headerList[i]=this}),t.config.debug&&(i("Built headers:",r),u($tableHeaders)),$tableHeaders}function g(n){for(var h,u,t,a,o,i=[],c={},v=n.getElementsByTagName("THEAD")[0],l=v.getElementsByTagName("TR"),s=0;s<l.length;s++)for(h=l[s].cells,u=0;u<h.length;u++){var f=h[u],r=f.parentNode.rowIndex,y=r+"-"+f.cellIndex,p=f.rowSpan||1,w=f.colSpan||1,e;for(typeof i[r]=="undefined"&&(i[r]=[]),t=0;t<i[r].length+1;t++)if(typeof i[r][t]=="undefined"){e=t;break}for(c[y]=e,t=r;t<r+p;t++)for(typeof i[t]=="undefined"&&(i[t]=[]),a=i[t],o=e;o<e+w;o++)a[o]="x"}return c}function tt(t){return n.metadata&&n(t).metadata().sorter===!1?!0:!1}function it(n,t){return n.config.headers[t]&&n.config.headers[t].sorter===!1?!0:!1}function a(n,t){return n.config.headers[t]&&n.config.headers[t].lockedOrder?n.config.headers[t].lockedOrder:!1}function s(n){for(var i=n.config.widgets,r=i.length,t=0;t<r;t++)v(i[t]).format(n)}function v(n){for(var i=r.length,t=0;t<i;t++)if(r[t].id.toLowerCase()==n.toLowerCase())return r[t]}function rt(n){return typeof n!="Number"?n.toLowerCase()=="desc"?1:0:n==1?1:0}function ut(n,t){for(var r=t.length,i=0;i<r;i++)if(t[i][0]==n)return!0;return!1}function y(t,i,r,u){var e,o,f;for(i.removeClass(u[0]).removeClass(u[1]),e=[],i.each(function(){this.sortDisabled||(e[this.column]=n(this))}),o=r.length,f=0;f<o;f++)e[r[f][0]].addClass(u[r[f][1]])}function ft(t){var r=t.config,i;r.widthFixed&&(i=n("<colgroup>"),n("tr:first td",t.tBodies[0]).each(function(){i.append(n("<col>").css("width",n(this).width()))}),n(t).prepend(i))}function et(n,t){for(var r,u,f=n.config,e=t.length,i=0;i<e;i++)r=t[i],u=f.headerList[r[0]],u.count=r[1],u.count++}function p(table,sortList,cache){var sortTime,dynamicExp,l,orgOrderCol,i;for(table.config.debug&&(sortTime=new Date),dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length,i=0;i<l;i++){var c=sortList[i][0],order=sortList[i][1],s=table.config.parsers[c].type=="text"?order==0?f("text","asc",c):f("text","desc",c):order==0?f("numeric","asc",c):f("numeric","desc",c),e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}for(orgOrderCol=cache.normalized[0].length-1,dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];",i=0;i<l;i++)dynamicExp+="}; ";return dynamicExp+="return 0; ",dynamicExp+="}; ",table.config.debug&&i("Evaling expression:"+dynamicExp,new Date),eval(dynamicExp),cache.normalized.sort(sortWrapper),table.config.debug&&i("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime),cache}function f(n,t,i){var r="a["+i+"]",u="b["+i+"]";return n=="text"&&t=="asc"?"("+r+" == "+u+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+u+" === null ? Number.NEGATIVE_INFINITY : ("+r+" < "+u+") ? -1 : 1 )));":n=="text"&&t=="desc"?"("+r+" == "+u+" ? 0 : ("+r+" === null ? Number.POSITIVE_INFINITY : ("+u+" === null ? Number.NEGATIVE_INFINITY : ("+u+" < "+r+") ? -1 : 1 )));":n=="numeric"&&t=="asc"?"("+r+" === null && "+u+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+u+" === null ? Number.NEGATIVE_INFINITY : "+r+" - "+u+"));":n=="numeric"&&t=="desc"?"("+r+" === null && "+u+" === null) ? 0 :("+r+" === null ? Number.POSITIVE_INFINITY : ("+u+" === null ? Number.NEGATIVE_INFINITY : "+u+" - "+r+"));":void 0}var t=[],r=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:!0,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:!1,cancelSelection:!0,sortList:[],headerList:[],dateFormat:"us",decimal:"/.|,/g",onRenderHeader:null,selectorHeaders:"thead th",debug:!1};this.benchmark=i;this.construct=function(t){return this.each(function(){var r,u,f,i,a,c;this.tHead&&this.tBodies&&(a=0,this.config={},i=n.extend(this.config,n.tablesorter.defaults,t),r=n(this),n.data(this,"tablesorter",i),u=d(this),this.config.parsers=h(this,u),f=l(this),c=[i.cssDesc,i.cssAsc],ft(this),u.click(function(t){var v=r[0].tBodies[0]&&r[0].tBodies[0].rows.length||0,w,s,l,e,h,a;if(!this.sortDisabled&&v>0){if(r.trigger("sortStart"),w=n(this),s=this.column,this.order=this.count++%2,this.lockedOrder&&(this.order=this.lockedOrder),t[i.sortMultiSortKey])if(ut(s,i.sortList))for(e=0;e<i.sortList.length;e++)h=i.sortList[e],a=i.headerList[h[0]],h[0]==s&&(a.count=h[1],a.count++,h[1]=a.count%2);else i.sortList.push([s,this.order]);else{if(i.sortList=[],i.sortForce!=null)for(l=i.sortForce,e=0;e<l.length;e++)l[e][0]!=s&&i.sortList.push(l[e]);i.sortList.push([s,this.order])}return setTimeout(function(){y(r[0],u,i.sortList,c);o(r[0],p(r[0],i.sortList,f))},1),!1}}).mousedown(function(){if(i.cancelSelection)return this.onselectstart=function(){return!1},!1}),r.bind("update",function(){var n=this;setTimeout(function(){n.config.parsers=h(n,u);f=l(n)},1)}).bind("updateCell",function(n,t){var r=this.config,i=[t.parentNode.rowIndex-1,t.cellIndex];f.normalized[i[0]][i[1]]=r.parsers[i[1]].format(e(r,t),t)}).bind("sorton",function(t,r){n(this).trigger("sortStart");i.sortList=r;var e=i.sortList;et(this,e);y(this,u,e,c);o(this,p(this,e,f))}).bind("appendCache",function(){o(this,f)}).bind("applyWidgetId",function(n,t){v(t).format(this)}).bind("applyWidgets",function(){s(this)}),n.metadata&&n(this).metadata()&&n(this).metadata().sortlist&&(i.sortList=n(this).metadata().sortlist),i.sortList.length>0&&r.trigger("sorton",[i.sortList]),s(this))})};this.addParser=function(n){for(var u=t.length,r=!0,i=0;i<u;i++)t[i].id.toLowerCase()==n.id.toLowerCase()&&(r=!1);r&&t.push(n)};this.addWidget=function(n){r.push(n)};this.formatFloat=function(n){var t=parseFloat(n);return isNaN(t)?0:t};this.formatInt=function(n){var t=parseInt(n);return isNaN(t)?0:t};this.isDigit=function(t){return/^[-+]?\d*$/.test(n.trim(t.replace(/[,.']/g,"")))};this.clearTableBody=function(t){if(n.browser.msie){function i(){while(this.firstChild)this.removeChild(this.firstChild)}i.apply(t.tBodies[0])}else t.tBodies[0].innerHTML=""}}});n.fn.extend({tablesorter:n.tablesorter.construct});var t=n.tablesorter;t.addParser({id:"text",is:function(){return!0},format:function(t){return n.trim(t.toLocaleLowerCase())},type:"text"});t.addParser({id:"digit",is:function(t,i){var r=i.config;return n.tablesorter.isDigit(t,r)},format:function(t){return n.tablesorter.formatFloat(t)},type:"numeric"});t.addParser({id:"currency",is:function(n){return/^[£$€?.]/.test(n)},format:function(t){return n.tablesorter.formatFloat(t.replace(new RegExp(/[£$€]/g),""))},type:"numeric"});t.addParser({id:"ipAddress",is:function(n){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(n)},format:function(t){for(var i,u=t.split("."),f="",e=u.length,r=0;r<e;r++)i=u[r],f+=i.length==2?"0"+i:i;return n.tablesorter.formatFloat(f)},type:"numeric"});t.addParser({id:"url",is:function(n){return/^(https?|ftp|file):\/\/$/.test(n)},format:function(n){return jQuery.trim(n.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});t.addParser({id:"isoDate",is:function(n){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(n)},format:function(t){return n.tablesorter.formatFloat(t!=""?new Date(t.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});t.addParser({id:"percent",is:function(t){return/\%$/.test(n.trim(t))},format:function(t){return n.tablesorter.formatFloat(t.replace(new RegExp(/%/g),""))},type:"numeric"});t.addParser({id:"usLongDate",is:function(n){return n.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(t){return n.tablesorter.formatFloat(new Date(t).getTime())},type:"numeric"});t.addParser({id:"shortDate",is:function(n){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(n)},format:function(t,i){var r=i.config;return t=t.replace(/\-/g,"/"),r.dateFormat=="us"?t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2"):r.dateFormat=="uk"?t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1"):(r.dateFormat=="dd/mm/yy"||r.dateFormat=="dd-mm-yy")&&(t=t.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")),n.tablesorter.formatFloat(new Date(t).getTime())},type:"numeric"});t.addParser({id:"time",is:function(n){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(n)},format:function(t){return n.tablesorter.formatFloat(new Date("2000/01/01 "+t).getTime())},type:"numeric"});t.addParser({id:"metadata",is:function(){return!1},format:function(t,i,r){var u=i.config,f=u.parserMetadataName?u.parserMetadataName:"sortValue";return n(r).metadata()[f]},type:"numeric"});t.addWidget({id:"zebra",format:function(t){var f,i,r,u;t.config.debug&&(f=new Date);r=-1;n("tr:visible",t.tBodies[0]).each(function(){i=n(this);i.hasClass(t.config.cssChildRow)||r++;u=r%2==0;i.removeClass(t.config.widgetZebra.css[u?0:1]).addClass(t.config.widgetZebra.css[u?1:0])});t.config.debug&&n.tablesorter.benchmark("Applying Zebra widget",f)}})}(jQuery),function(n){n.fn.autogrow=function(t){return this.filter("textarea").each(function(){var f=this,i=n(f),o=i.height(),e=i.hasClass("autogrow-short")?t&&t.noFlickerPad?t.noFlickerPad:0:parseInt(i.css("lineHeight"))||0,r=n(this).data("maxheight"),u=n("<div><\/div>").css({position:"absolute",top:-1e4,left:-1e4,width:i.width(),fontSize:i.css("fontSize"),fontFamily:i.css("fontFamily"),fontWeight:i.css("fontWeight"),lineHeight:i.css("lineHeight"),resize:"none","word-wrap":"break-word"}).appendTo(document.body);this.update=function(n){var a=function(n,t){for(var i=0,r="";i<t;i++)r+=n;return r},c=f.value.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/&/g,"&amp;").replace(/\n$/,"<br/>&nbsp;").replace(/\n/g,"<br/>").replace(/ {2,}/g,function(n){return a("&nbsp;",n.length-1)+" "}),h,s,l;if(n&&n.data&&n.data.event==="keydown"&&n.keyCode===13&&(c+="<br />"),h=i.height(),h<r&&(u.css("width",i.width()),u.html(c+(e===0?"...":"")),s=Math.max(u.height()+e,o),s=s>r?r:s,i.height(s),l=i.height(),l!=h&&t&&t.onGrow!==undefined))t.onGrow(n)};i.focusin(this.update).change(this.update).keyup(this.update).keydown({event:"keydown"},this.update);n(window).resize(this.update);this.update()})}}(jQuery),function(n){n.fn.numeric=function(t,i){typeof t=="boolean"&&(t={decimal:t});t=t||{};typeof t.negative=="undefined"&&(t.negative=!0);var r=t.decimal===!1?"":t.decimal||".",u=t.negative===!0?!0:!1;return i=typeof i=="function"?i:function(){},this.data("numeric.decimal",r).data("numeric.negative",u).data("numeric.callback",i).keypress(n.fn.numeric.keypress).keyup(n.fn.numeric.keyup).blur(n.fn.numeric.blur)};n.fn.numeric.keypress=function(t){var u=n.data(this,"numeric.decimal"),e=n.data(this,"numeric.negative"),i=t.charCode?t.charCode:t.keyCode?t.keyCode:0,r,f;if(i==13&&this.nodeName.toLowerCase()=="input")return!0;if(i==13)return!1;if((r=!1,t.ctrlKey&&i==97||t.ctrlKey&&i==65)||t.ctrlKey&&i==120||t.ctrlKey&&i==88||t.ctrlKey&&i==99||t.ctrlKey&&i==67||t.ctrlKey&&i==122||t.ctrlKey&&i==90||t.ctrlKey&&i==118||t.ctrlKey&&i==86||t.shiftKey&&i==45)return!0;if(i<48||i>57){if(f=n(this).val(),f.indexOf("-")!==0&&e&&i==45&&(f.length===0||parseInt(n.fn.getSelectionStart(this),10)===0))return!0;u&&i==u.charCodeAt(0)&&f.indexOf(u)!=-1&&(r=!1);i!=8&&i!=9&&i!=13&&i!=35&&i!=36&&i!=37&&i!=39&&i!=46?r=!1:typeof t.charCode!="undefined"&&(t.keyCode==t.which&&t.which!==0?(r=!0,t.which==46&&(r=!1)):t.keyCode!==0&&t.charCode===0&&t.which===0&&(r=!0));u&&i==u.charCodeAt(0)&&(r=f.indexOf(u)==-1?!0:!1)}else r=!0;return r};n.fn.numeric.keyup=function(){var t=n(this).val(),o,s,h,i,f,c,e,l,u,a;if(t&&t.length>0){var v=n.fn.getSelectionStart(this),y=n.fn.getSelectionEnd(this),r=n.data(this,"numeric.decimal"),p=n.data(this,"numeric.negative");for(r!==""&&r!==null&&(o=t.indexOf(r),o===0&&(this.value="0"+t),o==1&&t.charAt(0)=="-"&&(this.value="-0"+t.substring(1)),t=this.value),s=[0,1,2,3,4,5,6,7,8,9,"-",r],h=t.length,i=h-1;i>=0;i--){for(f=t.charAt(i),i!==0&&f=="-"?t=t.substring(0,i)+t.substring(i+1):i!==0||p||f!="-"||(t=t.substring(1)),c=!1,e=0;e<s.length;e++)if(f==s[e]){c=!0;break}c&&f!=" "||(t=t.substring(0,i)+t.substring(i+1))}if(l=t.indexOf(r),l>0)for(u=h-1;u>l;u--)a=t.charAt(u),a==r&&(t=t.substring(0,u)+t.substring(u+1));this.value=t;n.fn.setSelection(this,[v,y])}};n.fn.numeric.blur=function(){var r=n.data(this,"numeric.decimal"),u=n.data(this,"numeric.callback"),t=this.value,i;t!==""&&(i=new RegExp("^\\d+$|^\\d*"+r+"\\d+$"),i.exec(t)||u.apply(this))};n.fn.removeNumeric=function(){return this.data("numeric.decimal",null).data("numeric.negative",null).data("numeric.callback",null).unbind("keypress",n.fn.numeric.keypress).unbind("blur",n.fn.numeric.blur)};n.fn.getSelectionStart=function(n){if(n.createTextRange){var t=document.selection.createRange().duplicate();return(t.moveEnd("character",n.value.length),t.text==="")?n.value.length:n.value.lastIndexOf(t.text)}return n.selectionStart};n.fn.getSelectionEnd=function(n){if(n.createTextRange){var t=document.selection.createRange().duplicate();return t.moveStart("character",-n.value.length),t.text.length}return n.selectionEnd};n.fn.setSelection=function(n,t){if(typeof t=="number"&&(t=[t,t]),t&&t.constructor==Array&&t.length==2)if(n.createTextRange){var i=n.createTextRange();i.collapse(!0);i.moveStart("character",t[0]);i.moveEnd("character",t[1]);i.select()}else n.setSelectionRange&&(n.focus(),n.setSelectionRange(t[0],t[1]))}}(jQuery),function(n,t,i){function w(t,i){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(f)==="string"&&r.transports[f]||(i.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(i.log("No transports remain within the specified transport array."),t=null)}else if(r.transports[t]||t==="auto"){if(t==="auto"&&r._.ieVersion<=8)return["longPolling"]}else i.log("Invalid transport: "+t.toString()+"."),t=null;return t}function b(n){return n==="http:"?80:n==="https:"?443:void 0}function a(n,t){return t.match(/:\d+$/)?t:t+":"+b(n)}function k(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1};u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())};u.clear=function(){r=[]}}var f={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server.  Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if(typeof n!="function")throw new Error(f.nojQuery);var r,h,s=t.document.readyState==="complete",e=n(t),c="__Negotiate Aborted__",u={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},v=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},o=function(t,i,r){return i===t.state?(t.state=r,n(t).triggerHandler(u.onStateChanged,[{oldState:i,newState:r}]),!0):!1},y=function(n){return n.state===r.connectionState.disconnected},l=function(n){return n._.keepAliveData.activated&&n.transport.supportsKeepAlive(n)},p=function(i){var f,e;i._.configuredStopReconnectingTimeout||(e=function(t){var i=r._.format(r.resources.reconnectTimeout,t.disconnectTimeout);t.log(i);n(t).triggerHandler(u.onError,[r._.error(i,"TimeoutException")]);t.stop(!1,!1)},i.reconnecting(function(){var n=this;n.state===r.connectionState.reconnecting&&(f=t.setTimeout(function(){e(n)},n.disconnectTimeout))}),i.stateChanged(function(n){n.oldState===r.connectionState.reconnecting&&t.clearTimeout(f)}),i._.configuredStopReconnectingTimeout=!0)};r=function(n,t,i){return new r.fn.init(n,t,i)};r._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}(),error:function(n,t,i){var r=new Error(n);return r.source=t,typeof i!="undefined"&&(r.context=i),r},transportError:function(n,t,r,u){var f=this.error(n,r,u);return f.transport=t?t.name:i,f},format:function(){for(var t=arguments[0],n=0;n<arguments.length-1;n++)t=t.replace("{"+n+"}",arguments[n+1]);return t},firefoxMajorVersion:function(n){var t=n.match(/Firefox\/(\d+)/);return!t||!t.length||t.length<2?0:parseInt(t[1],10)},configurePingInterval:function(i){var f=i._.config,e=function(t){n(i).triggerHandler(u.onError,[t])};f&&!i._.pingIntervalId&&f.pingInterval&&(i._.pingIntervalId=t.setInterval(function(){r.transports._logic.pingServer(i).fail(e)},f.pingInterval))}};r.events=u;r.resources=f;r.ajaxDefaults={processData:!0,timeout:null,async:!0,global:!1,cache:!1};r.changeState=o;r.isDisconnecting=y;r.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4};r.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}};e.load(function(){s=!0});r.fn=r.prototype={init:function(t,i,r){var f=n(this);this.url=t;this.qs=i;this.lastError=null;this._={keepAliveData:{},connectingMessageBuffer:new k(this,function(n){f.triggerHandler(u.onReceived,[n])}),onFailedTimeoutHandle:null,lastMessageAt:(new Date).getTime(),lastActiveAt:(new Date).getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0};typeof r=="boolean"&&(this.logging=r)},_parseResponse:function(n){var t=this;return n?typeof n=="string"?t.json.parse(n):n:n},_originalJson:t.JSON,json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),r=r||t.location,i.indexOf("http")!==0)?!1:(u=t.document.createElement("a"),u.href=i,u.protocol+a(u.protocol,u.host)!==r.protocol+a(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:r.connectionState.disconnected,clientProtocol:"1.4",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(i,h){var a=this,v={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},d,y=a._deferral||n.Deferred(),b=t.document.createElement("a"),k,g;if(a.lastError=null,a._deferral=y,!a.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(i)==="function"?h=i:n.type(i)==="object"&&(n.extend(v,i),n.type(v.callback)==="function"&&(h=v.callback)),v.transport=w(v.transport,a),!v.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(a._.config=v,!s&&v.waitForPageLoad===!0)?(a._.deferredStartHandler=function(){a.start(i,h)},e.bind("load",a._.deferredStartHandler),y.promise()):a.state===r.connectionState.connecting?y.promise():o(a,r.connectionState.disconnected,r.connectionState.connecting)===!1?(y.resolve(a),y.promise()):(p(a),b.href=a.url,b.protocol&&b.protocol!==":"?(a.protocol=b.protocol,a.host=b.host):(a.protocol=t.document.location.protocol,a.host=b.host||t.document.location.host),a.baseUrl=a.protocol+"//"+a.host,a.wsProtocol=a.protocol==="https:"?"wss://":"ws://",v.transport==="auto"&&v.jsonp===!0&&(v.transport="longPolling"),a.url.indexOf("//")===0&&(a.url=t.location.protocol+a.url,a.log("Protocol relative URL detected, normalizing it to '"+a.url+"'.")),this.isCrossDomain(a.url)&&(a.log("Auto detected cross domain url."),v.transport==="auto"&&(v.transport=["webSockets","serverSentEvents","longPolling"]),typeof v.withCredentials=="undefined"&&(v.withCredentials=!0),v.jsonp||(v.jsonp=!n.support.cors,v.jsonp&&a.log("Using jsonp because this browser doesn't support CORS.")),a.contentType=r._.defaultContentType),a.withCredentials=v.withCredentials,a.ajaxDataType=v.jsonp?"jsonp":"text",n(a).bind(u.onStart,function(){n.type(h)==="function"&&h.call(a);y.resolve(a)}),d=function(i,s){var p=r._.error(f.noTransportOnInit);if(s=s||0,s>=i.length){n(a).triggerHandler(u.onError,[p]);y.reject(p);a.stop();return}if(a.state!==r.connectionState.disconnected){var w=i[s],h=r.transports[w],c=!1,v=function(){c||(c=!0,t.clearTimeout(a._.onFailedTimeoutHandle),h.stop(a),d(i,s+1))};a.transport=h;try{a._.onFailedTimeoutHandle=t.setTimeout(function(){a.log(h.name+" timed out when trying to connect.");v()},a._.totalTransportConnectTimeout);h.start(a,function(){var i=function(){var i=r._.firefoxMajorVersion(t.navigator.userAgent)>=11,f=!!a.withCredentials&&i;a.log("The start request succeeded. Transitioning to the connected state.");l(a)&&r.transports._logic.monitorKeepAlive(a);r.transports._logic.startHeartbeat(a);r._.configurePingInterval(a);o(a,r.connectionState.connecting,r.connectionState.connected)||a.log("WARNING! The connection was not in the connecting state.");a._.connectingMessageBuffer.drain();n(a).triggerHandler(u.onStart);e.bind("unload",function(){a.log("Window unloading, stopping the connection.");a.stop(f)});i&&e.bind("beforeunload",function(){t.setTimeout(function(){a.stop(f)},0)})};if(!c){if(c=!0,t.clearTimeout(a._.onFailedTimeoutHandle),a.state===r.connectionState.disconnected)return;a.log(h.name+" transport selected. Initiating start request.");r.transports._logic.ajaxStart(a,i)}},v)}catch(b){a.log(h.name+" transport threw '"+b.message+"' when attempting to start.");v()}}},k=a.url+"/negotiate",g=function(t,i){var e=r._.error(f.errorOnNegotiate,t,i._.negotiateRequest);n(i).triggerHandler(u.onError,e);y.reject(e);i.stop()},n(a).triggerHandler(u.onStarting),k=r.transports._logic.prepareQueryString(a,k),a.log("Negotiating with '"+k+"'."),a._.negotiateRequest=r.transports._logic.ajax(a,{url:k,error:function(n,t){t!==c?g(n,a):y.reject(r._.error(f.stoppedWhileNegotiating,null,a._.negotiateRequest))},success:function(t){var i,e,h,o=[],s=[];try{i=a._parseResponse(t)}catch(c){g(r._.error(f.errorParsingNegotiateResponse,c),a);return}if(e=a._.keepAliveData,a.appRelativeUrl=i.Url,a.id=i.ConnectionId,a.token=i.ConnectionToken,a.webSocketServerUrl=i.WebSocketServerUrl,a._.longPollDelay=i.LongPollDelay*1e3,a.disconnectTimeout=i.DisconnectTimeout*1e3,a._.totalTransportConnectTimeout=a.transportConnectTimeout+i.TransportConnectTimeout*1e3,i.KeepAliveTimeout?(e.activated=!0,e.timeout=i.KeepAliveTimeout*1e3,e.timeoutWarning=e.timeout*a.keepAliveWarnAt,a._.beatInterval=(e.timeout-e.timeoutWarning)/3):e.activated=!1,a.reconnectWindow=a.disconnectTimeout+(e.timeout||0),!i.ProtocolVersion||i.ProtocolVersion!==a.clientProtocol){h=r._.error(r._.format(f.protocolIncompatible,a.clientProtocol,i.ProtocolVersion));n(a).triggerHandler(u.onError,[h]);y.reject(h);return}n.each(r.transports,function(n){if(n.indexOf("_")===0||n==="webSockets"&&!i.TryWebSockets)return!0;s.push(n)});n.isArray(v.transport)?n.each(v.transport,function(t,i){n.inArray(i,s)>=0&&o.push(i)}):v.transport==="auto"?o=s:n.inArray(v.transport,s)>=0&&o.push(v.transport);d(o)}}),y.promise())},starting:function(t){var i=this;return n(i).bind(u.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===r.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===r.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(u.onReceived,function(n,r){t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(u.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(u.onError,function(n,r,u){i.lastError=r;t.call(i,r,u)}),i},disconnected:function(t){var i=this;return n(i).bind(u.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(u.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(u.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(u.onReconnect,function(){t.call(i)}),i},stop:function(i,h){var a=this,v=a._deferral;if(a._.deferredStartHandler&&e.unbind("load",a._.deferredStartHandler),delete a._.config,delete a._.deferredStartHandler,!s&&(!a._.config||a._.config.waitForPageLoad===!0)){a.log("Stopping connection prior to negotiate.");v&&v.reject(r._.error(f.stoppedWhileLoading));return}if(a.state!==r.connectionState.disconnected)return a.log("Stopping connection."),o(a,a.state,r.connectionState.disconnected),t.clearTimeout(a._.beatHandle),t.clearTimeout(a._.onFailedTimeoutHandle),t.clearInterval(a._.pingIntervalId),a.transport&&(a.transport.stop(a),h!==!1&&a.transport.abort(a,i),l(a)&&r.transports._logic.stopMonitoringKeepAlive(a),a.transport=null),a._.negotiateRequest&&(a._.negotiateRequest.abort(c),delete a._.negotiateRequest),r.transports._logic.tryAbortStartRequest(a),n(a).triggerHandler(u.onDisconnect),delete a._deferral,delete a.messageId,delete a.groupsToken,delete a.id,delete a._.pingIntervalId,delete a._.lastMessageAt,delete a._.lastActiveAt,delete a._.longPollDelay,a._.connectingMessageBuffer.clear(),a},log:function(n){v(n,this.logging)}};r.fn.init.prototype=r.fn;r.noConflict=function(){return n.connection===r&&(n.connection=h),r};n.connection&&(h=n.connection);n.connection=n.signalR=r}(window.jQuery,window),function(n,t){function o(n){n._.keepAliveData.monitoring&&h(n);r.markActive(n)&&(n._.beatHandle=t.setTimeout(function(){o(n)},n._.beatInterval))}function h(t){var r=t._.keepAliveData,f;t.state===i.connectionState.connected&&(f=(new Date).getTime()-t._.lastMessageAt,f>=r.timeout?(t.log("Keep alive timed out.  Notifying transport that connection has been lost."),t.transport.lostConnection(t)):f>=r.timeoutWarning?r.userNotified||(t.log("Keep alive has been missed, connection may be dead/slow."),n(t).triggerHandler(u.onConnectionSlow),r.userNotified=!0):r.userNotified=!1)}function f(n,t){var i=n.url+t;return n.transport&&(i+="?transport="+n.transport.name),r.prepareQueryString(n,i)}var i=n.signalR,u=n.signalR.events,s=n.signalR.changeState,e="__Start Aborted__",r;i.transports={};r=i.transports._logic={ajax:function(t,i){return n.ajax(n.extend(!0,{},n.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:t.withCredentials},contentType:t.contentType,dataType:t.ajaxDataType},i))},pingServer:function(t){var e,f,u=n.Deferred();return t.transport?(e=t.url+"/ping",e=r.addQs(e,t.qs),f=r.ajax(t,{url:e,success:function(n){var r;try{r=t._parseResponse(n)}catch(e){u.reject(i._.transportError(i.resources.pingServerFailedParse,t.transport,e,f));t.stop();return}r.Response==="pong"?u.resolve():u.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse,n),t.transport,null,f))},error:function(n){n.status===401||n.status===403?(u.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode,n.status),t.transport,n,f)),t.stop()):u.reject(i._.transportError(i.resources.pingServerFailed,t.transport,n,f))}})):u.reject(i._.transportError(i.resources.noConnectionTransport,t.transport)),u.promise()},prepareQueryString:function(n,i){var u;return u=r.addQs(i,"clientProtocol="+n.clientProtocol),u=r.addQs(u,n.qs),n.token&&(u+="&connectionToken="+t.encodeURIComponent(n.token)),n.data&&(u+="&connectionData="+t.encodeURIComponent(n.data)),u},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,u,f){var s=i==="webSockets"?"":n.baseUrl,e=s+n.appRelativeUrl,o="transport="+i;return n.groupsToken&&(o+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),u?(e+=f?"/poll":"/reconnect",n.messageId&&(o+="&messageId="+t.encodeURIComponent(n.messageId))):e+="/connect",e+="?"+o,e=r.prepareQueryString(n,e),e+("&tid="+Math.floor(Math.random()*11))},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,Disconnect:typeof n.D!="undefined"?!0:!1,ShouldReconnect:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},stringifySend:function(n,t){return typeof t=="string"||typeof t=="undefined"||t===null?t:n.json.stringify(t)},ajaxSend:function(t,e){var h=r.stringifySend(t,e),c=f(t,"/send"),o,s=function(t,r){n(r).triggerHandler(u.onError,[i._.transportError(i.resources.sendFailed,r.transport,t,o),e])};return o=r.ajax(t,{url:c,type:t.ajaxDataType==="jsonp"?"GET":"POST",contentType:i._.defaultContentType,data:{data:h},success:function(n){var i;if(n){try{i=t._parseResponse(n)}catch(u){s(u,t);t.stop();return}r.triggerReceived(t,i)}},error:function(n,i){i!=="abort"&&i!=="parsererror"&&s(n,t)}})},ajaxAbort:function(n,t){if(typeof n.transport!="undefined"){t=typeof t=="undefined"?!0:t;var i=f(n,"/abort");r.ajax(n,{url:i,async:t,timeout:1e3,type:"POST"});n.log("Fired ajax abort async = "+t+".")}},ajaxStart:function(t,o){var h=function(n){var i=t._deferral;i&&i.reject(n)},s=function(i){t.log("The start request failed. Stopping the connection.");n(t).triggerHandler(u.onError,[i]);h(i);t.stop()};t._.startRequest=r.ajax(t,{url:f(t,"/start"),success:function(n,r,u){var f;try{f=t._parseResponse(n)}catch(e){s(i._.error(i._.format(i.resources.errorParsingStartResponse,n),e,u));return}f.Response==="started"?o():s(i._.error(i._.format(i.resources.invalidStartResponse,n),null,u))},error:function(n,r,u){r!==e?s(i._.error(i.resources.errorDuringStartRequest,u,n)):(t.log("The start request aborted because connection.stop() was called."),h(i._.error(i.resources.stoppedDuringStartRequest,null,n)))}})},tryAbortStartRequest:function(n){n._.startRequest&&(n._.startRequest.abort(e),delete n._.startRequest)},tryInitialize:function(n,t){n.Initialized&&t()},triggerReceived:function(t,i){t._.connectingMessageBuffer.tryBuffer(i)||n(t).triggerHandler(u.onReceived,[i])},processMessages:function(t,i,u){var f;r.markLastMessage(t);i&&(f=r.maximizePersistentResponse(i),r.updateGroups(t,f.GroupsToken),f.MessageId&&(t.messageId=f.MessageId),f.Messages&&(n.each(f.Messages,function(n,i){r.triggerReceived(t,i)}),r.tryInitialize(f,u)))},monitorKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored."):(i.monitoring=!0,r.markLastMessage(t),t._.keepAliveData.reconnectKeepAliveUpdate=function(){r.markLastMessage(t)},n(t).bind(u.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+" and a connection lost timeout of "+i.timeout+"."))},stopMonitoringKeepAlive:function(t){var i=t._.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(u.onReconnect,t._.keepAliveData.reconnectKeepAliveUpdate),t._.keepAliveData={},t.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(n){n._.lastActiveAt=(new Date).getTime();o(n)},markLastMessage:function(n){n._.lastMessageAt=(new Date).getTime()},markActive:function(n){return r.verifyLastActive(n)?(n._.lastActiveAt=(new Date).getTime(),!0):!1},isConnectedOrReconnecting:function(n){return n.state===i.connectionState.connected||n.state===i.connectionState.reconnecting},ensureReconnectingState:function(t){return s(t,i.connectionState.connected,i.connectionState.reconnecting)===!0&&n(t).triggerHandler(u.onReconnecting),t.state===i.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},verifyLastActive:function(t){if((new Date).getTime()-t._.lastActiveAt>=t.reconnectWindow){var r=i._.format(i.resources.reconnectWindowTimeout,new Date(t._.lastActiveAt),t.reconnectWindow);return t.log(r),n(t).triggerHandler(u.onError,[i._.error(r,"TimeoutException")]),t.stop(!1,!1),!1}return!0},reconnect:function(n,u){var f=i.transports[u];if(r.isConnectedOrReconnecting(n)&&!n._.reconnectTimeout){if(!r.verifyLastActive(n))return;n._.reconnectTimeout=t.setTimeout(function(){r.verifyLastActive(n)&&(f.stop(n),r.ensureReconnectingState(n)&&(n.log(u+" reconnecting."),f.start(n)))},n.reconnectDelay)}},handleParseFailure:function(t,r,f,e,o){t.state===i.connectionState.connecting?(t.log("Failed to parse server response while attempting to connect."),e()):(n(t).triggerHandler(u.onError,[i._.transportError(i._.format(i.resources.parseFailed,r),t.transport,f,o)]),t.stop())},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(t,f){var e=i.stringifySend(t,f);try{t.socket.send(e)}catch(o){n(t).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketsInvalidState,t.transport,o,t.socket),f])}},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'."),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0;e.log("Websocket opened.");i.clearReconnectTimeout(e);f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){if(this===e.socket){if(c)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).triggerHandler(u.onError,[r._.transportError(r.resources.webSocketClosed,e.transport,t)]),e.log("Unclean disconnect from websocket: "+t.reason||"[no reason given].")):e.log("Websocket closed.");else{s?s():a&&l.reconnect(e);return}l.reconnect(e)}},e.socket.onmessage=function(t){var r;try{r=e._parseResponse(t.data)}catch(u){i.handleParseFailure(e,t.data,u,s,t);return}r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):i.triggerReceived(e,r))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n);n.socket&&(n.log("Closing the Websocket."),n.socket.close(),n.socket=null)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var i=n.signalR,u=n.signalR.events,e=n.signalR.changeState,r=i.transports._logic,f=function(n){t.clearTimeout(n._.reconnectAttemptTimeoutHandle);delete n._.reconnectAttemptTimeoutHandle};i.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(o,s,h){var c=this,l=!1,a=n(o),v=!s,y;if(o.eventSource&&(o.log("The connection already has an event source. Stopping it."),o.stop()),!t.EventSource){h&&(o.log("This browser doesn't support SSE."),h());return}y=r.getUrl(o,this.name,v);try{o.log("Attempting to connect to SSE endpoint '"+y+"'.");o.eventSource=new t.EventSource(y,{withCredentials:o.withCredentials})}catch(p){o.log("EventSource failed trying to connect with error "+p.Message+".");h?h():(a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceFailedToConnect,o.transport,p)]),v&&c.reconnect(o));return}v&&(o._.reconnectAttemptTimeoutHandle=t.setTimeout(function(){l===!1&&o.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(o)},c.timeOut));o.eventSource.addEventListener("open",function(){o.log("EventSource connected.");f(o);r.clearReconnectTimeout(o);l===!1&&(l=!0,e(o,i.connectionState.reconnecting,i.connectionState.connected)===!0&&a.triggerHandler(u.onReconnect))},!1);o.eventSource.addEventListener("message",function(n){var t;if(n.data!=="initialized"){try{t=o._parseResponse(n.data)}catch(i){r.handleParseFailure(o,n.data,i,h,n);return}r.processMessages(o,t,s)}},!1);o.eventSource.addEventListener("error",function(n){if(this===o.eventSource){if(!l){h&&h();return}o.log("EventSource readyState: "+o.eventSource.readyState+".");n.eventPhase===t.EventSource.CLOSED?(o.log("EventSource reconnecting due to the server connection ending."),c.reconnect(o)):(o.log("EventSource error."),a.triggerHandler(u.onError,[i._.transportError(i.resources.eventSourceError,o.transport,n)]))}},!1)},reconnect:function(n){r.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){r.ajaxSend(n,t)},stop:function(n){f(n);r.clearReconnectTimeout(n);n&&n.eventSource&&(n.log("EventSource calling close()."),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){r.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){var r=n.signalR,e=n.signalR.events,o=n.signalR.changeState,i=r.transports._logic,u=function(){var n=t.document.createElement("iframe");return n.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),n},f=function(){var i=null,f=1e3,n=0;return{prevent:function(){r._.ieVersion<=8&&(n===0&&(i=t.setInterval(function(){var n=u();t.document.body.appendChild(n);t.document.body.removeChild(n);n=null},f)),n++)},cancel:function(){n===1&&t.clearInterval(i);n>0&&n--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(n,r,e){var l=this,s=i.foreverFrame.count+=1,h,o=u(),c=function(){n.log("Forever frame iframe finished loading and is no longer receiving messages.");l.reconnect(n)};if(t.EventSource){e&&(n.log("This browser supports SSE, skipping Forever Frame."),e());return}o.setAttribute("data-signalr-connection-id",n.id);f.prevent();h=i.getUrl(n,this.name);h+="&frameId="+s;t.document.body.appendChild(o);n.log("Binding to iframe's load event.");o.addEventListener?o.addEventListener("load",c,!1):o.attachEvent&&o.attachEvent("onload",c);o.src=h;i.foreverFrame.connections[s]=n;n.frame=o;n.frameId=s;r&&(n.onSuccess=function(){n.log("Iframe transport started.");r()})},reconnect:function(n){var r=this;i.isConnectedOrReconnecting(n)&&i.verifyLastActive(n)&&t.setTimeout(function(){if(i.verifyLastActive(n)&&n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'.");u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,u){var f,e,o;if(t.json!==t._originalJson&&(u=t._originalJson.stringify(u)),o=t._parseResponse(u),i.processMessages(t,o,t.onSuccess),t.state===n.signalR.connectionState.connected&&(t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>r.transports.foreverFrame.iframeClearThreshold&&(t.frameMessageCount=0,f=t.frame.contentWindow||t.frame.contentDocument,f&&f.document&&f.document.body)))for(e=f.document.body;e.firstChild;)e.removeChild(e.firstChild)},stop:function(n){var r=null;if(f.cancel(),n.frame){if(n.frame.stop)n.frame.stop();else try{r=n.frame.contentWindow||n.frame.contentDocument;r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(u){n.log("Error occured when stopping foreverFrame transport. Message = "+u.message+".")}n.frame.parentNode===t.document.body&&t.document.body.removeChild(n.frame);delete i.foreverFrame.connections[n.frameId];n.frame=null;n.frameId=null;delete n.frame;delete n.frameId;delete n.onSuccess;delete n.frameMessageCount;n.log("Stopping forever frame.")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){o(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(e.onReconnect)}}}(window.jQuery,window),function(n,t){var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic,o=function(){try{return"onprogress"in new t.XMLHttpRequest}catch(n){return!1}}();r.transports.longPolling={name:"longPolling",supportsKeepAlive:function(n){return o&&n.ajaxDataType!=="jsonp"&&n._.longPollDelay===0},reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop;h=null;o.log("LongPolling connected.");s()},y=function(){return h?(h(),h=null,o.log("LongPolling failed to connect."),!0):!1},c=o._,l=0,p=function(i){t.clearTimeout(c.reconnectTimeoutId);c.reconnectTimeoutId=null;e(i,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(i.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop());o.messageId=null;c.reconnectTimeoutId=null;c.pollTimeoutId=t.setTimeout(function(){(function e(s,h){var d=s.messageId,g=d===null,b=!g,nt=!h,k=i.getUrl(s,a.name,b,nt);f(s)!==!0&&(o.log("Opening long polling request to '"+k+"'."),s.pollXhr=i.ajax(o,{xhrFields:{onprogress:function(){i.markLastMessage(o)}},url:k,success:function(r){var h,w=0,u,a;o.log("Long poll complete.");l=0;try{h=o._parseResponse(r)}catch(b){i.handleParseFailure(s,r,b,y,s.pollXhr);return}(c.reconnectTimeoutId!==null&&p(s),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(w=u.LongPollDelay),u&&u.Disconnect)||f(s)!==!0&&(a=u&&u.ShouldReconnect,!a||i.ensureReconnectingState(s))&&(w>0?c.pollTimeoutId=t.setTimeout(function(){e(s,a)},w):e(s,a))},error:function(f,h){if(t.clearTimeout(c.reconnectTimeoutId),c.reconnectTimeoutId=null,h==="abort"){o.log("Aborted xhr request.");return}if(!y()){if(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+".  Response = "+f.responseText+"."),n(s).triggerHandler(u.onError,[r._.transportError(r.resources.longPollFailed,o.transport,f,s.pollXhr)])),(o.state===r.connectionState.connected||o.state===r.connectionState.reconnecting)&&!i.verifyLastActive(o))return;if(!i.ensureReconnectingState(s))return;c.pollTimeoutId=t.setTimeout(function(){e(s,!0)},a.reconnectDelay)}}}),b&&h===!0&&(c.reconnectTimeoutId=t.setTimeout(function(){p(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(n){n.pollXhr&&n.pollXhr.abort("lostConnection")},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){t.clearTimeout(n._.pollTimeoutId);t.clearTimeout(n._.reconnectTimeoutId);delete n._.pollTimeoutId;delete n._.reconnectTimeoutId;n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){function r(n){return n+e}function s(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function h(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function u(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function f(n,t){var i=n._.invocationCallbacks,r,f;u(i)&&n.log("Clearing hub invocation callbacks with error: "+t+".");n._.invocationCallbackId=0;delete n._.invocationCallbacks;n._.invocationCallbacks={};for(f in i)r=i[f],r.method.call(r.scope,{E:t})}function i(n,t){return new i.fn.init(n,t)}function t(i,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!i||u.useDefaultPath)&&(i=(i||"")+"/signalr"),new t.fn.init(i,u)}var e=".hubProxy",o=n.signalR;i.fn=i.prototype={init:function(n,t){this.state={};this.connection=n;this.hubName=t;this._={callbackMap:{}}},hasSubscriptions:function(){return u(this._.callbackMap)},on:function(t,i){var u=this,f=u._.callbackMap;return t=t.toLowerCase(),f[t]||(f[t]={}),f[t][i]=function(n,t){i.apply(u,t)},n(u).bind(r(t),f[t][i]),u},off:function(t,i){var e=this,o=e._.callbackMap,f;return t=t.toLowerCase(),f=o[t],f&&(f[i]?(n(e).unbind(r(t),f[i]),delete f[i],u(f)||delete o[t]):i||(n(e).unbind(r(t)),delete o[t])),e},invoke:function(t){var i=this,r=i.connection,e=n.makeArray(arguments).slice(1),c=s(e,h),f={H:i.hubName,M:t,A:c,I:r._.invocationCallbackId},u=n.Deferred(),l=function(f){var e=i._maximizeHubResponse(f),h,s;n.extend(i.state,e.State);e.Progress?u.notifyWith?u.notifyWith(i,[e.Progress.Data]):r._.progressjQueryVersionLogged||(r.log("A hub method invocation progress update was received but the version of jQuery in use ("+n.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),r._.progressjQueryVersionLogged=!0):e.Error?(e.StackTrace&&r.log(e.Error+"\n"+e.StackTrace+"."),h=e.IsHubException?"HubException":"Exception",s=o._.error(e.Error,h),s.data=e.ErrorData,r.log(i.hubName+"."+t+" failed to execute. Error: "+s.message),u.rejectWith(i,[s])):(r.log("Invoked "+i.hubName+"."+t),u.resolveWith(i,[e.Result]))};return r._.invocationCallbacks[r._.invocationCallbackId.toString()]={scope:i,method:l},r._.invocationCallbackId+=1,n.isEmptyObject(i.state)||(f.S=i.state),r.log("Invoking "+i.hubName+"."+t),r.send(f),u.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Progress:n.P?{Id:n.P.I,Data:n.P.D}:null,Id:n.I,IsHubException:n.H,Error:n.E,StackTrace:n.T,ErrorData:n.D}}};i.fn.init.prototype=i.fn;t.fn=t.prototype=n.connection();t.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},u=this;n.extend(e,i);n.signalR.fn.init.call(u,t,e.qs,e.logging);u.proxies={};u._.invocationCallbackId=0;u._.invocationCallbacks={};u.received(function(t){var f,o,e,i,s,h;t&&(typeof t.P!="undefined"?(e=t.P.I.toString(),i=u._.invocationCallbacks[e],i&&i.method.call(i.scope,t)):typeof t.I!="undefined"?(e=t.I.toString(),i=u._.invocationCallbacks[e],i&&(u._.invocationCallbacks[e]=null,delete u._.invocationCallbacks[e],i.method.call(i.scope,t))):(f=this._maximizeClientHubInvocation(t),u.log("Triggering client hub event '"+f.Method+"' on hub '"+f.Hub+"'."),s=f.Hub.toLowerCase(),h=f.Method.toLowerCase(),o=this.proxies[s],n.extend(o.state,f.State),n(o).triggerHandler(r(h),[f.Args])))});u.error(function(n,t){var i,r;t&&(i=t.I,r=u._.invocationCallbacks[i],r&&(u._.invocationCallbacks[i]=null,delete u._.invocationCallbacks[i],r.method.call(r.scope,{E:n})))});u.reconnecting(function(){u.transport&&u.transport.name==="webSockets"&&f(u,"Connection started reconnecting before invocation result was received.")});u.disconnected(function(){f(u,"Connection was disconnected before invocation result was received.")})};t.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}};t.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&(i.push({name:n}),t.log("Client subscribed to hub '"+n+"'."))});i.length===0&&t.log("No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");t.data=t.json.stringify(i)}))};t.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=i(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t};t.fn.init.prototype=t.fn;n.hubConnection=t}(window.jQuery,window),function(n){n.signalR.version="2.1.1"}(window.jQuery),function(){var n=!0;(function(t,i,r,u,f){!function(n){if(typeof require=="function"&&typeof exports=="object"&&typeof module=="object"){var i=module.exports||exports;n(i)}else typeof define=="function"&&define.amd?define(["exports"],n):n(t.ko={})}(function(e){function k(n){var t=this,i,r;if(n)for(i in n)r=o.extenders[i],typeof r=="function"&&(t=r(t,n[i]));return t}function d(n){o.bindingHandlers[n]={init:function(t,i,r,u){var f=function(){var t={};return t[n]=i(),t};return o.bindingHandlers.event.init.call(this,t,f,r,u)}}}function p(n,t,i,r){o.bindingHandlers[n]={init:function(n){return o.utils.domData.set(n,y,{}),{controlsDescendantBindings:!0}},update:function(n,u,f,e,s){var h=o.utils.domData.get(n,y),a=o.utils.unwrapObservable(u()),c=!i!=!a,l=!h.savedNodes,v=l||t||c!==h.didDisplayOnLastUpdate;v&&(l&&(h.savedNodes=o.utils.cloneNodes(o.virtualElements.childNodes(n),!0)),c?(l||o.virtualElements.setDomNodeChildren(n,o.utils.cloneNodes(h.savedNodes)),o.applyBindingsToDescendants(r?r(s,a):s,n)):o.virtualElements.emptyNode(n),h.didDisplayOnLastUpdate=c)}};o.expressionRewriting.bindingRewriteValidators[n]=!1;o.virtualElements.allowedBindings[n]=!0}function b(n,t,i){i&&t!==o.selectExtensions.readValue(n)&&o.selectExtensions.writeValue(n,t);t!==o.selectExtensions.readValue(n)&&o.dependencyDetection.ignore(o.utils.triggerEvent,null,[n,"change"])}var o=typeof e!="undefined"?e:{},c,w,s,l,a,v,h,y;o.exportSymbol=function(n,t){for(var i=n.split("."),r=o,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};o.exportProperty=function(n,t,i){n[t]=i};o.version="2.2.0";o.exportSymbol("version",o.version);o.utils=new function(){function l(n,t){if(o.utils.tagNameLower(n)!=="input"||!n.type||t.toLowerCase()!="click")return!1;var i=n.type;return i=="checkbox"||i=="radio"}var y=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,e={},a={},p=/Firefox\/2/i.test(r.userAgent)?"KeyboardEvent":"UIEvents",c,s,h,v;e[p]=["keyup","keydown","keypress"];e.MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"];for(c in e)if(s=e[c],s.length)for(h=0,v=s.length;h<v;h++)a[s[h]]=c;var w={propertychange:!0},n=function(){for(var n=3,t=i.createElement("div"),r=t.getElementsByTagName("i");t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",r[0];);return n>4?n:f}(),b=n===6,k=n===7;return{fieldsIncludedWithJsonPost:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],arrayForEach:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i])},arrayIndexOf:function(n,t){if(typeof Array.prototype.indexOf=="function")return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},arrayFirst:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r]))return n[r];return null},arrayRemoveItem:function(n,t){var i=o.utils.arrayIndexOf(n,t);i>=0&&n.splice(i,1)},arrayGetDistinctValues:function(n){var i,t,r;for(n=n||[],i=[],t=0,r=n.length;t<r;t++)o.utils.arrayIndexOf(i,n[t])<0&&i.push(n[t]);return i},arrayMap:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i]));return r},arrayFilter:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)t(n[i])&&r.push(n[i]);return r},arrayPushAll:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},extend:function(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},emptyDomNode:function(n){while(n.firstChild)o.removeNode(n.firstChild)},moveCleanedNodesToContainerElement:function(n){for(var r=o.utils.makeArray(n),u=i.createElement("div"),t=0,f=r.length;t<f;t++)u.appendChild(o.cleanNode(r[t]));return u},cloneNodes:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?o.cleanNode(r):r);return u},setDomNodeChildren:function(n,t){if(o.utils.emptyDomNode(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},replaceDomNodes:function(n,t){var r=n.nodeType?[n]:n,f,e,i,u;if(r.length>0){for(f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)o.removeNode(r[i])}},setOptionNodeSelectionState:function(t,i){n<7?t.setAttribute("selected",i):t.selected=i},stringTrim:function(n){return(n||"").replace(y,"")},stringTokenize:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=o.utils.stringTrim(f[i]),r!==""&&u.push(r);return u},stringStartsWith:function(n,t){return(n=n||"",t.length>n.length)?!1:n.substring(0,t.length)===t},domNodeIsContainedBy:function(n,t){if(t.compareDocumentPosition)return(t.compareDocumentPosition(n)&16)==16;while(n!=null){if(n==t)return!0;n=n.parentNode}return!1},domNodeIsAttachedToDocument:function(n){return o.utils.domNodeIsContainedBy(n,n.ownerDocument)},tagNameLower:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},registerEventHandler:function(t,i,r){var f=n&&w[i],e;if(f||typeof u=="undefined")if(f||typeof t.addEventListener!="function")if(typeof t.attachEvent!="undefined")t.attachEvent("on"+i,function(n){r.call(t,n)});else throw new Error("Browser doesn't support addEventListener or attachEvent");else t.addEventListener(i,r,!1);else l(t,i)&&(e=r,r=function(n,t){var i=this.checked;t&&(this.checked=t.checkedStateBeforeEvent!==!0);e.call(this,n);this.checked=i}),u(t).bind(i,r)},triggerEvent:function(n,r){var f,o,e;if(!(n&&n.nodeType))throw new Error("element must be a DOM node when calling triggerEvent");if(typeof u!="undefined")f=[],l(n,r)&&f.push({checkedStateBeforeEvent:n.checked}),u(n).trigger(r,f);else if(typeof i.createEvent=="function")if(typeof n.dispatchEvent=="function")o=a[r]||"HTMLEvents",e=i.createEvent(o),e.initEvent(r,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(e);else throw new Error("The supplied element doesn't support dispatchEvent");else if(typeof n.fireEvent!="undefined")l(n,r)&&(n.checked=n.checked!==!0),n.fireEvent("on"+r);else throw new Error("Browser doesn't support triggering events");},unwrapObservable:function(n){return o.isObservable(n)?n():n},peekObservable:function(n){return o.isObservable(n)?n.peek():n},toggleDomNodeCssClass:function(n,t,i){if(t){var u=/[\w-]+/g,r=n.className.match(u)||[];o.utils.arrayForEach(t.match(u),function(n){var t=o.utils.arrayIndexOf(r,n);t>=0?i||r.splice(t,1):i&&r.push(n)});n.className=r.join(" ")}},setTextContent:function(n,t){var r=o.utils.unwrapObservable(t),u;(r===null||r===f)&&(r="");n.nodeType===3?n.data=r:(u=o.virtualElements.firstChild(n),!u||u.nodeType!=3||o.virtualElements.nextSibling(u)?o.virtualElements.setDomNodeChildren(n,[i.createTextNode(r)]):u.data=r,o.utils.forceRefresh(n))},setElementName:function(t,r){if(t.name=r,n<=7)try{t.mergeAttributes(i.createElement("<input name='"+t.name+"'/>"),!1)}catch(u){}},forceRefresh:function(t){if(n>=9){var i=t.nodeType==1?t:t.parentNode;i.style&&(i.style.zoom=i.style.zoom)}},ensureSelectElementIsRenderedCorrectly:function(t){if(n>=9){var i=t.style.width;t.style.width=0;t.style.width=i}},range:function(n,t){var r,i;for(n=o.utils.unwrapObservable(n),t=o.utils.unwrapObservable(t),r=[],i=n;i<=t;i++)r.push(i);return r},makeArray:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},isIe6:b,isIe7:k,ieVersion:n,getFormFields:function(n,t){for(var r=o.utils.makeArray(n.getElementsByTagName("input")).concat(o.utils.makeArray(n.getElementsByTagName("textarea"))),f=typeof t=="string"?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;i>=0;i--)f(r[i])&&u.push(r[i]);return u},parseJson:function(n){return typeof n=="string"&&(n=o.utils.stringTrim(n),n)?t.JSON&&t.JSON.parse?t.JSON.parse(n):new Function("return "+n)():null},stringifyJson:function(n,t,i){if(typeof JSON=="undefined"||typeof JSON.stringify=="undefined")throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return JSON.stringify(o.utils.unwrapObservable(n),t,i)},postJson:function(n,t,r){var a,h,c,s,u,e,f;r=r||{};var l=r.params||{},v=r.includeFields||this.fieldsIncludedWithJsonPost,y=n;if(typeof n=="object"&&o.utils.tagNameLower(n)==="form")for(a=n,y=a.action,h=v.length-1;h>=0;h--)for(c=o.utils.getFormFields(a,v[h]),s=c.length-1;s>=0;s--)l[c[s].name]=c[s].value;t=o.utils.unwrapObservable(t);u=i.createElement("form");u.style.display="none";u.action=y;u.method="post";for(e in t)f=i.createElement("input"),f.name=e,f.value=o.utils.stringifyJson(o.utils.unwrapObservable(t[e])),u.appendChild(f);for(e in l)f=i.createElement("input"),f.name=e,f.value=l[e],u.appendChild(f);i.body.appendChild(u);r.submitter?r.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}};o.exportSymbol("utils",o.utils);o.exportSymbol("utils.arrayForEach",o.utils.arrayForEach);o.exportSymbol("utils.arrayFirst",o.utils.arrayFirst);o.exportSymbol("utils.arrayFilter",o.utils.arrayFilter);o.exportSymbol("utils.arrayGetDistinctValues",o.utils.arrayGetDistinctValues);o.exportSymbol("utils.arrayIndexOf",o.utils.arrayIndexOf);o.exportSymbol("utils.arrayMap",o.utils.arrayMap);o.exportSymbol("utils.arrayPushAll",o.utils.arrayPushAll);o.exportSymbol("utils.arrayRemoveItem",o.utils.arrayRemoveItem);o.exportSymbol("utils.extend",o.utils.extend);o.exportSymbol("utils.fieldsIncludedWithJsonPost",o.utils.fieldsIncludedWithJsonPost);o.exportSymbol("utils.getFormFields",o.utils.getFormFields);o.exportSymbol("utils.peekObservable",o.utils.peekObservable);o.exportSymbol("utils.postJson",o.utils.postJson);o.exportSymbol("utils.parseJson",o.utils.parseJson);o.exportSymbol("utils.registerEventHandler",o.utils.registerEventHandler);o.exportSymbol("utils.stringifyJson",o.utils.stringifyJson);o.exportSymbol("utils.range",o.utils.range);o.exportSymbol("utils.toggleDomNodeCssClass",o.utils.toggleDomNodeCssClass);o.exportSymbol("utils.triggerEvent",o.utils.triggerEvent);o.exportSymbol("utils.unwrapObservable",o.utils.unwrapObservable);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments),n=t.shift();return function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});o.utils.domData=new function(){var i=0,n="__ko__"+(new Date).getTime(),t={};return{get:function(n,t){var i=o.utils.domData.getAll(n,!1);return i===f?f:i[t]},set:function(n,t,i){if(i!==f||o.utils.domData.getAll(n,!1)!==f){var r=o.utils.domData.getAll(n,!0);r[t]=i}},getAll:function(r,u){var e=r[n],o=e&&e!=="null"&&t[e];if(!o){if(!u)return f;e=r[n]="ko"+i++;t[e]={}}return t[e]},clear:function(i){var r=i[n];return r?(delete t[r],i[n]=null,!0):!1}}};o.exportSymbol("utils.domData",o.utils.domData);o.exportSymbol("utils.domData.clear",o.utils.domData.clear);o.utils.domNodeDisposal=new function(){function t(t,i){var r=o.utils.domData.get(t,n);return r===f&&i&&(r=[],o.utils.domData.set(t,n,r)),r}function s(t){o.utils.domData.set(t,n,f)}function i(n){var i=t(n,!1),f;if(i)for(i=i.slice(0),f=0;f<i.length;f++)i[f](n);o.utils.domData.clear(n);typeof u=="function"&&typeof u.cleanData=="function"&&u.cleanData([n]);r[n.nodeType]&&h(n)}function h(n){for(var t,r=n.firstChild;t=r;)r=t.nextSibling,t.nodeType===8&&i(t)}var n="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:!0,8:!0,9:!0},r={1:!0,9:!0};return{addDisposeCallback:function(n,i){if(typeof i!="function")throw new Error("Callback must be a function");t(n,!0).push(i)},removeDisposeCallback:function(n,i){var r=t(n,!1);r&&(o.utils.arrayRemoveItem(r,i),r.length==0&&s(n))},cleanNode:function(n){var t,u,f;if(e[n.nodeType]&&(i(n),r[n.nodeType]))for(t=[],o.utils.arrayPushAll(t,n.getElementsByTagName("*")),u=0,f=t.length;u<f;u++)i(t[u]);return n},removeNode:function(n){o.cleanNode(n);n.parentNode&&n.parentNode.removeChild(n)}}};o.cleanNode=o.utils.domNodeDisposal.cleanNode;o.removeNode=o.utils.domNodeDisposal.removeNode;o.exportSymbol("cleanNode",o.cleanNode);o.exportSymbol("removeNode",o.removeNode);o.exportSymbol("utils.domNodeDisposal",o.utils.domNodeDisposal);o.exportSymbol("utils.domNodeDisposal.addDisposeCallback",o.utils.domNodeDisposal.addDisposeCallback);o.exportSymbol("utils.domNodeDisposal.removeDisposeCallback",o.utils.domNodeDisposal.removeDisposeCallback),function(){function n(n){var u=o.utils.stringTrim(n).toLowerCase(),r=i.createElement("div"),f=u.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!u.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!u.indexOf("<td")||!u.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],e="ignored<div>"+f[1]+n+f[2]+"<\/div>";for(typeof t.innerShiv=="function"?r.appendChild(t.innerShiv(e)):r.innerHTML=e;f[0]--;)r=r.lastChild;return o.utils.makeArray(r.lastChild.childNodes)}function r(n){var i=u.clean([n]),t;if(i&&i[0]){for(t=i[0];t.parentNode&&t.parentNode.nodeType!==11;)t=t.parentNode;t.parentNode&&t.parentNode.removeChild(t)}return i}o.utils.parseHtmlFragment=function(t){return typeof u!="undefined"?r(t):n(t)};o.utils.setHtml=function(n,t){var r,i;if(o.utils.emptyDomNode(n),t=o.utils.unwrapObservable(t),t!==null&&t!==f)if(typeof t!="string"&&(t=t.toString()),typeof u!="undefined")u(n).html(t);else for(r=o.utils.parseHtmlFragment(t),i=0;i<r.length;i++)n.appendChild(r[i])}}();o.exportSymbol("utils.parseHtmlFragment",o.utils.parseHtmlFragment);o.exportSymbol("utils.setHtml",o.utils.setHtml);o.memoization=function(){function t(){return((1+Math.random())*4294967296|0).toString(16).substring(1)}function r(){return t()+t()}function i(n,t){var r;if(n)if(n.nodeType==8)r=o.memoization.parseMemoText(n.nodeValue),r!=null&&t.push({domNode:n,memoId:r});else if(n.nodeType==1)for(var u=0,f=n.childNodes,e=f.length;u<e;u++)i(f[u],t)}var n={};return{memoize:function(t){if(typeof t!="function")throw new Error("You can only pass a function to ko.memoization.memoize()");var i=r();return n[i]=t,"<!--[ko_memo:"+i+"]-->"},unmemoize:function(t,i){var r=n[t];if(r===f)throw new Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return r.apply(null,i||[]),!0}finally{delete n[t]}},unmemoizeDomNodeAndDescendants:function(n,t){var f=[],u,s,r,e;for(i(n,f),u=0,s=f.length;u<s;u++)r=f[u].domNode,e=[r],t&&o.utils.arrayPushAll(e,t),o.memoization.unmemoize(f[u].memoId,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},parseMemoText:function(n){var t=n.match(/^\[ko_memo\:(.*?)\]$/);return t?t[1]:null}}}();o.exportSymbol("memoization",o.memoization);o.exportSymbol("memoization.memoize",o.memoization.memoize);o.exportSymbol("memoization.unmemoize",o.memoization.unmemoize);o.exportSymbol("memoization.parseMemoText",o.memoization.parseMemoText);o.exportSymbol("memoization.unmemoizeDomNodeAndDescendants",o.memoization.unmemoizeDomNodeAndDescendants);o.extenders={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return o.dependentObservable({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},notify:function(n,t){return n.equalityComparer=t=="always"?function(){return!1}:o.observable.fn.equalityComparer,n}};o.exportSymbol("extenders",o.extenders);o.subscription=function(n,t,i){this.target=n;this.callback=t;this.disposeCallback=i;o.exportProperty(this,"dispose",this.dispose)};o.subscription.prototype.dispose=function(){this.isDisposed=!0;this.disposeCallback()};o.subscribable=function(){this._subscriptions={};o.utils.extend(this,o.subscribable.fn);o.exportProperty(this,"subscribe",this.subscribe);o.exportProperty(this,"extend",this.extend);o.exportProperty(this,"getSubscriptionsCount",this.getSubscriptionsCount)};c="change";o.subscribable.fn={subscribe:function(n,t,i){i=i||c;var u=t?n.bind(t):n,r=new o.subscription(this,u,function(){o.utils.arrayRemoveItem(this._subscriptions[i],r)}.bind(this));return this._subscriptions[i]||(this._subscriptions[i]=[]),this._subscriptions[i].push(r),r},notifySubscribers:function(n,t){t=t||c;this._subscriptions[t]&&o.dependencyDetection.ignore(function(){o.utils.arrayForEach(this._subscriptions[t].slice(0),function(t){t&&t.isDisposed!==!0&&t.callback(n)})},this)},getSubscriptionsCount:function(){var n=0;for(var t in this._subscriptions)this._subscriptions.hasOwnProperty(t)&&(n+=this._subscriptions[t].length);return n},extend:k};o.isSubscribable=function(n){return typeof n.subscribe=="function"&&typeof n.notifySubscribers=="function"};o.exportSymbol("subscribable",o.subscribable);o.exportSymbol("isSubscribable",o.isSubscribable);o.dependencyDetection=function(){var n=[];return{begin:function(t){n.push({callback:t,distinctDependencies:[]})},end:function(){n.pop()},registerDependency:function(t){if(!o.isSubscribable(t))throw new Error("Only subscribable things can act as dependencies");if(n.length>0){var i=n[n.length-1];if(!i||o.utils.arrayIndexOf(i.distinctDependencies,t)>=0)return;i.distinctDependencies.push(t);i.callback(t)}},ignore:function(t,i,r){try{return n.push(null),t.apply(i,r||[])}finally{n.pop()}}}}();w={undefined:!0,boolean:!0,number:!0,string:!0};o.observable=function(t){function i(){return arguments.length>0?(i.equalityComparer&&i.equalityComparer(r,arguments[0])||(i.valueWillMutate(),r=arguments[0],n&&(i._latestValue=r),i.valueHasMutated()),this):(o.dependencyDetection.registerDependency(i),r)}var r=t;return n&&(i._latestValue=r),o.subscribable.call(i),i.peek=function(){return r},i.valueHasMutated=function(){i.notifySubscribers(r)},i.valueWillMutate=function(){i.notifySubscribers(r,"beforeChange")},o.utils.extend(i,o.observable.fn),o.exportProperty(i,"peek",i.peek),o.exportProperty(i,"valueHasMutated",i.valueHasMutated),o.exportProperty(i,"valueWillMutate",i.valueWillMutate),i};o.observable.fn={equalityComparer:function(n,t){var i=n===null||typeof n in w;return i?n===t:!1}};s=o.observable.protoProperty="__ko_proto__";o.observable.fn[s]=o.observable;o.hasPrototype=function(n,t){return n===null||n===f||n[s]===f?!1:n[s]===t?!0:o.hasPrototype(n[s],t)};o.isObservable=function(n){return o.hasPrototype(n,o.observable)};o.isWriteableObservable=function(n){return typeof n=="function"&&n[s]===o.observable?!0:typeof n=="function"&&n[s]===o.dependentObservable&&n.hasWriteFunction?!0:!1};o.exportSymbol("observable",o.observable);o.exportSymbol("isObservable",o.isObservable);o.exportSymbol("isWriteableObservable",o.isWriteableObservable);o.observableArray=function(n){if(arguments.length==0&&(n=[]),n!==null&&n!==f&&!("length"in n))throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");var t=o.observable(n);return o.utils.extend(t,o.observableArray.fn),t};o.observableArray.fn={remove:function(n){for(var u,r=this.peek(),i=[],f=typeof n=="function"?n:function(t){return t===n},t=0;t<r.length;t++)u=r[t],f(u)&&(i.length===0&&this.valueWillMutate(),i.push(u),r.splice(t,1),t--);return i.length&&this.valueHasMutated(),i},removeAll:function(n){if(n===f){var t=this.peek(),i=t.slice(0);return this.valueWillMutate(),t.splice(0,t.length),this.valueHasMutated(),i}return n?this.remove(function(t){return o.utils.arrayIndexOf(n,t)>=0}):[]},destroy:function(n){var i=this.peek(),u=typeof n=="function"?n:function(t){return t===n},t,r;for(this.valueWillMutate(),t=i.length-1;t>=0;t--)r=i[t],u(r)&&(i[t]._destroy=!0);this.valueHasMutated()},destroyAll:function(n){return n===f?this.destroy(function(){return!0}):n?this.destroy(function(t){return o.utils.arrayIndexOf(n,t)>=0}):[]},indexOf:function(n){var t=this();return o.utils.arrayIndexOf(t,n)},replace:function(n,t){var i=this.indexOf(n);i>=0&&(this.valueWillMutate(),this.peek()[i]=t,this.valueHasMutated())}};o.utils.arrayForEach(["pop","push","reverse","shift","sort","splice","unshift"],function(n){o.observableArray.fn[n]=function(){var t=this.peek(),i;return this.valueWillMutate(),i=t[n].apply(t,arguments),this.valueHasMutated(),i}});o.utils.arrayForEach(["slice"],function(n){o.observableArray.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});o.exportSymbol("observableArray",o.observableArray);o.dependentObservable=function(t,i,r){function nt(n){s.push(n.subscribe(tt))}function w(){o.utils.arrayForEach(s,function(n){n.dispose()});s=[]}function tt(){var n=u.throttleEvaluation;n&&n>=0?(clearTimeout(d),d=setTimeout(l,n)):l()}function l(){var t,l,r;if(!y){if(c&&p()){a();return}y=!0;try{for(t=o.utils.arrayMap(s,function(n){return n.target}),o.dependencyDetection.begin(function(n){var i;(i=o.utils.arrayIndexOf(t,n))>=0?t[i]=f:nt(n)}),l=e.call(i),r=t.length-1;r>=0;r--)t[r]&&s.splice(r,1)[0].dispose();c=!0;u.notifySubscribers(h,"beforeChange");h=l;n&&(u._latestValue=h)}finally{o.dependencyDetection.end()}u.notifySubscribers(h);y=!1;s.length||a()}}function u(){if(arguments.length>0){if(typeof k=="function")k.apply(i,arguments);else throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return c||l(),o.dependencyDetection.registerDependency(u),h}function it(){return c||l(),h}function b(){return!c||s.length>0}var h,c=!1,y=!1,e=t,g;if(e&&typeof e=="object"?(r=e,e=r.read):(r=r||{},e||(e=r.read)),typeof e!="function")throw new Error("Pass a function that returns the value of the ko.computed");var k=r.write,v=r.disposeWhenNodeIsRemoved||r.disposeWhenNodeIsRemoved||null,p=r.disposeWhen||r.disposeWhen||function(){return!1},a=w,s=[],d=null;return i||(i=r.owner),u.peek=it,u.getDependenciesCount=function(){return s.length},u.hasWriteFunction=typeof r.write=="function",u.dispose=function(){a()},u.isActive=b,o.subscribable.call(u),o.utils.extend(u,o.dependentObservable.fn),o.exportProperty(u,"peek",u.peek),o.exportProperty(u,"dispose",u.dispose),o.exportProperty(u,"isActive",u.isActive),o.exportProperty(u,"getDependenciesCount",u.getDependenciesCount),r.deferEvaluation!==!0&&l(),v&&b()&&(a=function(){o.utils.domNodeDisposal.removeDisposeCallback(v,arguments.callee);w()},o.utils.domNodeDisposal.addDisposeCallback(v,a),g=p,p=function(){return!o.utils.domNodeIsAttachedToDocument(v)||g()}),u};o.isComputed=function(n){return o.hasPrototype(n,o.dependentObservable)};l=o.observable.protoProperty;o.dependentObservable[l]=o.observable;o.dependentObservable.fn={};o.dependentObservable.fn[l]=o.dependentObservable;o.exportSymbol("dependentObservable",o.dependentObservable);o.exportSymbol("computed",o.dependentObservable);o.exportSymbol("isComputed",o.isComputed),function(){function n(t,u,e){var s,o;return(e=e||new r,t=u(t),s=typeof t=="object"&&t!==null&&t!==f&&!(t instanceof Date),!s)?t:(o=t instanceof Array?[]:{},e.save(t,o),i(t,function(i){var r=u(t[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==f?s:n(r,u,e)}}),o)}function i(n,t){var i,r;if(n instanceof Array){for(i=0;i<n.length;i++)t(i);typeof n.toJSON=="function"&&t("toJSON")}else for(r in n)t(r)}function r(){var n=[],t=[];this.save=function(i,r){var u=o.utils.arrayIndexOf(n,i);u>=0?t[u]=r:(n.push(i),t.push(r))};this.get=function(i){var r=o.utils.arrayIndexOf(n,i);return r>=0?t[r]:f}}var t=10;o.toJS=function(i){if(arguments.length==0)throw new Error("When calling ko.toJS, pass the object you want to convert.");return n(i,function(n){for(var i=0;o.isObservable(n)&&i<t;i++)n=n();return n})};o.toJSON=function(n,t,i){var r=o.toJS(n);return o.utils.stringifyJson(r,t,i)}}();o.exportSymbol("toJS",o.toJS);o.exportSymbol("toJSON",o.toJSON),function(){var n="__ko__hasDomDataOptionValue__";o.selectExtensions={readValue:function(t){switch(o.utils.tagNameLower(t)){case"option":return t[n]===!0?o.utils.domData.get(t,o.bindingHandlers.options.optionValueDomDataKey):o.utils.ieVersion<=7?t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return t.selectedIndex>=0?o.selectExtensions.readValue(t.options[t.selectedIndex]):f;default:return t.value}},writeValue:function(t,i){switch(o.utils.tagNameLower(t)){case"option":switch(typeof i){case"string":o.utils.domData.set(t,o.bindingHandlers.options.optionValueDomDataKey,f);n in t&&delete t[n];t.value=i;break;default:o.utils.domData.set(t,o.bindingHandlers.options.optionValueDomDataKey,i);t[n]=!0;t.value=typeof i=="number"?i:""}break;case"select":for(var r=t.options.length-1;r>=0;r--)if(o.selectExtensions.readValue(t.options[r])==i){t.selectedIndex=r;break}break;default:(i===null||i===f)&&(i="");t.value=i}}}}();o.exportSymbol("selectExtensions",o.selectExtensions);o.exportSymbol("selectExtensions.readValue",o.selectExtensions.readValue);o.exportSymbol("selectExtensions.writeValue",o.selectExtensions.writeValue);o.expressionRewriting=function(){function n(n,i){for(var r=null;n!=r;)r=n,n=n.replace(t,function(n,t){return i[t]});return n}function u(n){if(o.utils.arrayIndexOf(i,o.utils.stringTrim(n).toLowerCase())>=0)return!1;var t=n.match(r);return t===null?!1:t[1]?"Object("+t[1]+")"+t[2]:n}function f(n){var t=o.utils.stringTrim(n);switch(t.length&&t.charAt(0)){case"'":case'"':return n;default:return"'"+t+"'"}}var t=/\@ko_token_(\d+)\@/g,i=["true","false"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;return{bindingRewriteValidators:[],parseObjectLiteral:function(t){var i=o.utils.stringTrim(t),e,u,s,y,a,r,f,h,c,p,b,w,k,l,v,d,g;if(i.length<3)return[];for(i.charAt(0)==="{"&&(i=i.substring(1,i.length-1)),e=[],u=null,r=0;r<i.length;r++)if(f=i.charAt(r),u===null)switch(f){case'"':case"'":case"/":u=r;s=f}else f==s&&i.charAt(r-1)!=="\\"&&(h=i.substring(u,r+1),e.push(h),c="@ko_token_"+(e.length-1)+"@",i=i.substring(0,u)+c+i.substring(r+1),r-=h.length-c.length,u=null);for(u=null,s=null,y=0,a=null,r=0;r<i.length;r++){if(f=i.charAt(r),u===null)switch(f){case"{":u=r;a=f;s="}";break;case"(":u=r;a=f;s=")";break;case"[":u=r;a=f;s="]"}f===a?y++:f===s&&(y--,y===0&&(h=i.substring(u,r+1),e.push(h),c="@ko_token_"+(e.length-1)+"@",i=i.substring(0,u)+c+i.substring(r+1),r-=h.length-c.length,u=null))}for(p=[],b=i.split(","),w=0,k=b.length;w<k;w++)l=b[w],v=l.indexOf(":"),v>0&&v<l.length-1?(d=l.substring(0,v),g=l.substring(v+1),p.push({key:n(d,e),value:n(g,e)})):p.push({unknown:n(l,e)});return p},preProcessBindings:function(n){for(var h,e,s,l,a=typeof n=="string"?o.expressionRewriting.parseObjectLiteral(n):n,t=[],r=[],i,c=0;i=a[c];c++)t.length>0&&t.push(","),i.key?(h=f(i.key),e=i.value,t.push(h),t.push(":"),t.push(e),(e=u(o.utils.stringTrim(e)))&&(r.length>0&&r.push(", "),r.push(h+" : function(__ko_value) { "+e+" = __ko_value; }"))):i.unknown&&t.push(i.unknown);return s=t.join(""),r.length>0&&(l=r.join(""),s=s+", '_ko_property_writers' : { "+l+" } "),s},keyValueArrayContainsKey:function(n,t){for(var i=0;i<n.length;i++)if(o.utils.stringTrim(n[i].key)==t)return!0;return!1},writeValueToProperty:function(n,t,i,r,u){if(n&&o.isWriteableObservable(n))u&&n.peek()===r||n(r);else{var f=t()._ko_property_writers;f&&f[i]&&f[i](r)}}}}();o.exportSymbol("expressionRewriting",o.expressionRewriting);o.exportSymbol("expressionRewriting.bindingRewriteValidators",o.expressionRewriting.bindingRewriteValidators);o.exportSymbol("expressionRewriting.parseObjectLiteral",o.expressionRewriting.parseObjectLiteral);o.exportSymbol("expressionRewriting.preProcessBindings",o.expressionRewriting.preProcessBindings);o.exportSymbol("jsonExpressionRewriting",o.expressionRewriting);o.exportSymbol("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",o.expressionRewriting.preProcessBindings),function(){function n(n){return n.nodeType==8&&(t?n.text:n.nodeValue).match(e)}function r(n){return n.nodeType==8&&(t?n.text:n.nodeValue).match(s)}function u(t,i){for(var u=t,f=1,e=[];u=u.nextSibling;){if(r(u)&&(f--,f===0))return e;e.push(u);n(u)&&f++}if(!i)throw new Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function f(n,t){var i=u(n,t);return i?i.length>0?i[i.length-1].nextSibling:n.nextSibling:null}function c(t){var i=t.firstChild,u=null,e;if(i)do u?u.push(i):n(i)?(e=f(i,!0),e?i=e:u=[i]):r(i)&&(u=[i]);while(i=i.nextSibling);return u}var t=i.createComment("test").text==="<!--test-->",e=t?/^<!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*-->$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,s=t?/^<!--\s*\/ko\s*-->$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};o.virtualElements={allowedBindings:{},childNodes:function(t){return n(t)?u(t):t.childNodes},emptyNode:function(t){var r,i,u;if(n(t))for(r=o.virtualElements.childNodes(t),i=0,u=r.length;i<u;i++)o.removeNode(r[i]);else o.utils.emptyDomNode(t)},setDomNodeChildren:function(t,i){var u,r,f;if(n(t))for(o.virtualElements.emptyNode(t),u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u);else o.utils.setDomNodeChildren(t,i)},prepend:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},insertAfter:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):o.virtualElements.prepend(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||r(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return(n(t)&&(t=f(t)),t.nextSibling&&r(t.nextSibling))?null:t.nextSibling},virtualNodeBindingValue:function(t){var i=n(t);return i?i[1]:null},normaliseVirtualElementDomStructure:function(n){var t,i,u,r;if(h[o.utils.tagNameLower(n)]&&(t=n.firstChild,t))do if(t.nodeType===1&&(i=c(t),i))for(u=t.nextSibling,r=0;r<i.length;r++)u?n.insertBefore(i[r],u):n.appendChild(i[r]);while(t=t.nextSibling)}}}();o.exportSymbol("virtualElements",o.virtualElements);o.exportSymbol("virtualElements.allowedBindings",o.virtualElements.allowedBindings);o.exportSymbol("virtualElements.emptyNode",o.virtualElements.emptyNode);o.exportSymbol("virtualElements.insertAfter",o.virtualElements.insertAfter);o.exportSymbol("virtualElements.prepend",o.virtualElements.prepend);o.exportSymbol("virtualElements.setDomNodeChildren",o.virtualElements.setDomNodeChildren),function(){function t(n,t){var r=n;return t[r]||(t[r]=i(n))}function i(n){var t=o.expressionRewriting.preProcessBindings(n),i="with($context){with($data||{}){return{"+t+"}}}";return new Function("$context","$element",i)}var n="data-bind";o.bindingProvider=function(){this.bindingCache={}};o.utils.extend(o.bindingProvider.prototype,{nodeHasBindings:function(t){switch(t.nodeType){case 1:return t.getAttribute(n)!=null;case 8:return o.virtualElements.virtualNodeBindingValue(t)!=null;default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingsString:function(t){switch(t.nodeType){case 1:return t.getAttribute(n);case 8:return o.virtualElements.virtualNodeBindingValue(t);default:return null}},parseBindingsString:function(n,i,r){try{var u=t(n,this.bindingCache);return u(i,r)}catch(f){throw new Error("Unable to parse bindings.\nMessage: "+f+";\nBindings value: "+n);}}});o.bindingProvider.instance=new o.bindingProvider}();o.exportSymbol("bindingProvider",o.bindingProvider),function(){function e(n){var t=o.virtualElements.allowedBindings[n];if(!t)throw new Error("The binding '"+n+"' cannot be used with virtual elements");}function n(n,t,r){for(var u,f=o.virtualElements.firstChild(t);u=f;)f=o.virtualElements.nextSibling(u),i(n,u,r)}function i(t,i,u){var e=!0,f=i.nodeType===1,s;f&&o.virtualElements.normaliseVirtualElementDomStructure(i);s=f&&u||o.bindingProvider.instance.nodeHasBindings(i);s&&(e=r(i,null,t,u).shouldBindDescendants);e&&n(t,i,!f)}function r(n,t,i,r){function c(n){return function(){return u[n]}}function l(){return u}var s=0,u,h;return o.dependentObservable(function(){var y=i&&i instanceof o.bindingContext?i:new o.bindingContext(o.utils.unwrapObservable(i)),w=y.$data,b,k,p,a,v,d;if(r&&o.storedBindingContextForNode(n,y),b=typeof t=="function"?t(y,n):t,u=b||o.bindingProvider.instance.getBindings(n,y),u){if(s===0){s=1;for(a in u)if(v=o.bindingHandlers[a],v&&n.nodeType===8&&e(a),v&&typeof v.init=="function"&&(k=v.init,p=k(n,c(a),l,w,y),p&&p.controlsDescendantBindings)){if(h!==f)throw new Error("Multiple bindings ("+h+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");h=a}s=2}if(s===2)for(a in u)v=o.bindingHandlers[a],v&&typeof v.update=="function"&&(d=v.update,d(n,c(a),l,w,y))}},null,{disposeWhenNodeIsRemoved:n}),{shouldBindDescendants:h===f}}o.bindingHandlers={};o.bindingContext=function(n,t,i){t?(o.utils.extend(this,t),this.$parentContext=t,this.$parent=t.$data,this.$parents=(t.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=n,this.ko=o);this.$data=n;i&&(this[i]=n)};o.bindingContext.prototype.createChildContext=function(n,t){return new o.bindingContext(n,this,t)};o.bindingContext.prototype.extend=function(n){var t=o.utils.extend(new o.bindingContext,this);return o.utils.extend(t,n)};var u="__ko_bindingContext__";o.storedBindingContextForNode=function(n,t){if(arguments.length==2)o.utils.domData.set(n,u,t);else return o.utils.domData.get(n,u)};o.applyBindingsToNode=function(n,t,i){return n.nodeType===1&&o.virtualElements.normaliseVirtualElementDomStructure(n),r(n,t,i,!0)};o.applyBindingsToDescendants=function(t,i){(i.nodeType===1||i.nodeType===8)&&n(t,i,!0)};o.applyBindings=function(n,r){if(r&&r.nodeType!==1&&r.nodeType!==8)throw new Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");r=r||t.document.body;i(n,r,!0)};o.contextFor=function(n){switch(n.nodeType){case 1:case 8:var t=o.storedBindingContextForNode(n);if(t)return t;if(n.parentNode)return o.contextFor(n.parentNode)}return f};o.dataFor=function(n){var t=o.contextFor(n);return t?t.$data:f};o.exportSymbol("bindingHandlers",o.bindingHandlers);o.exportSymbol("applyBindings",o.applyBindings);o.exportSymbol("applyBindingsToDescendants",o.applyBindingsToDescendants);o.exportSymbol("applyBindingsToNode",o.applyBindingsToNode);o.exportSymbol("contextFor",o.contextFor);o.exportSymbol("dataFor",o.dataFor)}();a={"class":"className","for":"htmlFor"};o.bindingHandlers.attr={update:function(n,t){var e=o.utils.unwrapObservable(t())||{},i,r,u;for(i in e)typeof i=="string"&&(r=o.utils.unwrapObservable(e[i]),u=r===!1||r===null||r===f,u&&n.removeAttribute(i),o.utils.ieVersion<=8&&i in a?(i=a[i],u?n.removeAttribute(i):n[i]=r):u||n.setAttribute(i,r.toString()),i==="name"&&o.utils.setElementName(n,u?"":r.toString()))}};o.bindingHandlers.checked={init:function(n,t,i){var r=function(){var f,r,e,u;if(n.type=="checkbox")f=n.checked;else if(n.type=="radio"&&n.checked)f=n.value;else return;r=t();e=o.utils.unwrapObservable(r);n.type=="checkbox"&&e instanceof Array?(u=o.utils.arrayIndexOf(e,n.value),n.checked&&u<0?r.push(n.value):!n.checked&&u>=0&&r.splice(u,1)):o.expressionRewriting.writeValueToProperty(r,i,"checked",f,!0)};o.utils.registerEventHandler(n,"click",r);n.type!="radio"||n.name||o.bindingHandlers.uniqueName.init(n,function(){return!0})},update:function(n,t){var i=o.utils.unwrapObservable(t());n.type=="checkbox"?n.checked=i instanceof Array?o.utils.arrayIndexOf(i,n.value)>=0:i:n.type=="radio"&&(n.checked=n.value==i)}};v="__ko__cssValue";o.bindingHandlers.css={update:function(n,t){var i=o.utils.unwrapObservable(t()),r,u;if(typeof i=="object")for(r in i)u=o.utils.unwrapObservable(i[r]),o.utils.toggleDomNodeCssClass(n,r,u);else i=String(i||""),o.utils.toggleDomNodeCssClass(n,n[v],!1),n[v]=i,o.utils.toggleDomNodeCssClass(n,i,!0)}};o.bindingHandlers.enable={update:function(n,t){var i=o.utils.unwrapObservable(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};o.bindingHandlers.disable={update:function(n,t){o.bindingHandlers.enable.update(n,function(){return!o.utils.unwrapObservable(t())})}};o.bindingHandlers.event={init:function(n,t,i,r){var u=t()||{};for(var f in u)(function(){var u=f;typeof u=="string"&&o.utils.registerEventHandler(n,u,function(n){var e,s=t()[u],h,f,c;if(s){h=i();try{f=o.utils.makeArray(arguments);f.unshift(r);e=s.apply(r,f)}finally{e!==!0&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}c=h[u+"Bubble"]!==!1;c||(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})()}};o.bindingHandlers.foreach={makeTemplateValueAccessor:function(n){return function(){var i=n(),t=o.utils.peekObservable(i);return!t||typeof t.length=="number"?{foreach:i,templateEngine:o.nativeTemplateEngine.instance}:(o.utils.unwrapObservable(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:o.nativeTemplateEngine.instance})}},init:function(n,t){return o.bindingHandlers.template.init(n,o.bindingHandlers.foreach.makeTemplateValueAccessor(t))},update:function(n,t,i,r,u){return o.bindingHandlers.template.update(n,o.bindingHandlers.foreach.makeTemplateValueAccessor(t),i,r,u)}};o.expressionRewriting.bindingRewriteValidators.foreach=!1;o.virtualElements.allowedBindings.foreach=!0;h="__ko_hasfocusUpdating";o.bindingHandlers.hasfocus={init:function(n,t,i){var r=function(r){var u,f;n[h]=!0;u=n.ownerDocument;"activeElement"in u&&(r=u.activeElement===n);f=t();o.expressionRewriting.writeValueToProperty(f,i,"hasfocus",r,!0);n[h]=!1},u=r.bind(null,!0),f=r.bind(null,!1);o.utils.registerEventHandler(n,"focus",u);o.utils.registerEventHandler(n,"focusin",u);o.utils.registerEventHandler(n,"blur",f);o.utils.registerEventHandler(n,"focusout",f)},update:function(n,t){var i=o.utils.unwrapObservable(t());n[h]||(i?n.focus():n.blur(),o.dependencyDetection.ignore(o.utils.triggerEvent,null,[n,i?"focusin":"focusout"]))}};o.bindingHandlers.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.utils.setHtml(n,t())}};y="__ko_withIfBindingData";p("if");p("ifnot",!1,!0);p("with",!0,!1,function(n,t){return n.createChildContext(t)});o.bindingHandlers.options={update:function(n,t,r){var e,y,c,s,v,w,a,k,u,l;if(o.utils.tagNameLower(n)!=="select")throw new Error("options binding applies only to SELECT elements");for(var d=n.length==0,g=o.utils.arrayMap(o.utils.arrayFilter(n.childNodes,function(n){return n.tagName&&o.utils.tagNameLower(n)==="option"&&n.selected}),function(n){return o.selectExtensions.readValue(n)||n.innerText||n.textContent}),nt=n.scrollTop,h=o.utils.unwrapObservable(t()),tt=n.value;n.length>0;)o.cleanNode(n.options[0]),n.remove(0);if(h){for(e=r(),y=e.optionsIncludeDestroyed,typeof h.length!="number"&&(h=[h]),e.optionsCaption&&(s=i.createElement("option"),o.utils.setHtml(s,e.optionsCaption),o.selectExtensions.writeValue(s,f),n.appendChild(s)),u=0,l=h.length;u<l;u++)if(c=h[u],!c||!c._destroy||y){s=i.createElement("option");function p(n,t,i){var r=typeof t;return r=="function"?t(n):r=="string"?n[t]:i}v=p(c,e.optionsValue,c);o.selectExtensions.writeValue(s,o.utils.unwrapObservable(v));w=p(c,e.optionsText,v);o.utils.setTextContent(s,w);n.appendChild(s)}for(a=n.getElementsByTagName("option"),k=0,u=0,l=a.length;u<l;u++)o.utils.arrayIndexOf(g,o.selectExtensions.readValue(a[u]))>=0&&(o.utils.setOptionNodeSelectionState(a[u],!0),k++);n.scrollTop=nt;d&&"value"in e&&b(n,o.utils.peekObservable(e.value),!0);o.utils.ensureSelectElementIsRenderedCorrectly(n)}}};o.bindingHandlers.options.optionValueDomDataKey="__ko.optionValueDomData__";o.bindingHandlers.selectedOptions={init:function(n,t,i){o.utils.registerEventHandler(n,"change",function(){var u=t(),r=[];o.utils.arrayForEach(n.getElementsByTagName("option"),function(n){n.selected&&r.push(o.selectExtensions.readValue(n))});o.expressionRewriting.writeValueToProperty(u,i,"value",r)})},update:function(n,t){if(o.utils.tagNameLower(n)!="select")throw new Error("values binding applies only to SELECT elements");var i=o.utils.unwrapObservable(t());i&&typeof i.length=="number"&&o.utils.arrayForEach(n.getElementsByTagName("option"),function(n){var t=o.utils.arrayIndexOf(i,o.selectExtensions.readValue(n))>=0;o.utils.setOptionNodeSelectionState(n,t)})}};o.bindingHandlers.style={update:function(n,t){var r=o.utils.unwrapObservable(t()||{}),i,u;for(i in r)typeof i=="string"&&(u=o.utils.unwrapObservable(r[i]),n.style[i]=u||"")}};o.bindingHandlers.submit={init:function(n,t,i,r){if(typeof t()!="function")throw new Error("The value for a submit binding must be a function");o.utils.registerEventHandler(n,"submit",function(i){var u,f=t();try{u=f.call(r,n)}finally{u!==!0&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};o.bindingHandlers.text={update:function(n,t){o.utils.setTextContent(n,t())}};o.virtualElements.allowedBindings.text=!0;o.bindingHandlers.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++o.bindingHandlers.uniqueName.currentIndex;o.utils.setElementName(n,i)}}};o.bindingHandlers.uniqueName.currentIndex=0;o.bindingHandlers.value={init:function(n,t,i){var r=["change"],u=i().valueUpdate,e=!1,f,s;u&&(typeof u=="string"&&(u=[u]),o.utils.arrayPushAll(r,u),r=o.utils.arrayGetDistinctValues(r));f=function(){e=!1;var r=t(),u=o.selectExtensions.readValue(n);o.expressionRewriting.writeValueToProperty(r,i,"value",u)};s=o.utils.ieVersion&&n.tagName.toLowerCase()=="input"&&n.type=="text"&&n.autocomplete!="off"&&(!n.form||n.form.autocomplete!="off");s&&o.utils.arrayIndexOf(r,"propertychange")==-1&&(o.utils.registerEventHandler(n,"propertychange",function(){e=!0}),o.utils.registerEventHandler(n,"blur",function(){e&&f()}));o.utils.arrayForEach(r,function(t){var i=f;o.utils.stringStartsWith(t,"after")&&(i=function(){setTimeout(f,0)},t=t.substring(5));o.utils.registerEventHandler(n,t,i)})},update:function(n,t){var f=o.utils.tagNameLower(n)==="select",i=o.utils.unwrapObservable(t()),r=o.selectExtensions.readValue(n),e=i!=r,u,s;i===0&&r!==0&&r!=="0"&&(e=!0);e&&(u=function(){o.selectExtensions.writeValue(n,i)},u(),s=f,s&&setTimeout(u,0));f&&n.length>0&&b(n,i,!1)}};o.bindingHandlers.visible={update:function(n,t){var i=o.utils.unwrapObservable(t()),r=!(n.style.display=="none");i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}};d("click");o.templateEngine=function(){};o.templateEngine.prototype.renderTemplateSource=function(){throw new Error("Override renderTemplateSource");};o.templateEngine.prototype.createJavaScriptEvaluatorBlock=function(){throw new Error("Override createJavaScriptEvaluatorBlock");};o.templateEngine.prototype.makeTemplateSource=function(n,t){if(typeof n=="string"){t=t||i;var r=t.getElementById(n);if(!r)throw new Error("Cannot find template with ID "+n);return new o.templateSources.domElement(r)}if(n.nodeType==1||n.nodeType==8)return new o.templateSources.anonymousTemplate(n);throw new Error("Unknown template type: "+n);};o.templateEngine.prototype.renderTemplate=function(n,t,i,r){var u=this.makeTemplateSource(n,r);return this.renderTemplateSource(u,t,i)};o.templateEngine.prototype.isTemplateRewritten=function(n,t){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(n,t).data("isRewritten")};o.templateEngine.prototype.rewriteTemplate=function(n,t,i){var r=this.makeTemplateSource(n,i),u=t(r.text());r.text(u);r.data("isRewritten",!0)};o.exportSymbol("templateEngine",o.templateEngine);o.templateRewriting=function(){function r(n){for(var i,r,u,f=o.expressionRewriting.bindingRewriteValidators,t=0;t<n.length;t++)if(i=n[t].key,f.hasOwnProperty(i))if(r=f[i],typeof r=="function"){if(u=r(n[t].value),u)throw new Error(u);}else if(!r)throw new Error("This template engine does not support the '"+i+"' binding within its templates");}function n(n,t,i){var u=o.expressionRewriting.parseObjectLiteral(n),f,e;return r(u),f=o.expressionRewriting.preProcessBindings(u),e="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f+" } })()})",i.createJavaScriptEvaluatorBlock(e)+t}var t=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi,i=/<!--\s*ko\b\s*([\s\S]*?)\s*-->/g;return{ensureTemplateIsRewritten:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return o.templateRewriting.memoizeBindingAttributeSyntax(n,t)},i)},memoizeBindingAttributeSyntax:function(r,u){return r.replace(t,function(){return n(arguments[6],arguments[1],u)}).replace(i,function(){return n(arguments[1],"<!-- ko -->",u)})},applyMemoizedBindingsToNextSibling:function(n){return o.memoization.memoize(function(t,i){t.nextSibling&&o.applyBindingsToNode(t.nextSibling,n,i)})}}}();o.exportSymbol("__tr_ambtns",o.templateRewriting.applyMemoizedBindingsToNextSibling),function(){o.templateSources={};o.templateSources.domElement=function(n){this.domElement=n};o.templateSources.domElement.prototype.text=function(){var i=o.utils.tagNameLower(this.domElement),n=i==="script"?"text":i==="textarea"?"value":"innerHTML",t;if(arguments.length==0)return this.domElement[n];t=arguments[0];n==="innerHTML"?o.utils.setHtml(this.domElement,t):this.domElement[n]=t};o.templateSources.domElement.prototype.data=function(n){if(arguments.length===1)return o.utils.domData.get(this.domElement,"templateSourceData_"+n);o.utils.domData.set(this.domElement,"templateSourceData_"+n,arguments[1])};var n="__ko_anon_template__";o.templateSources.anonymousTemplate=function(n){this.domElement=n};o.templateSources.anonymousTemplate.prototype=new o.templateSources.domElement;o.templateSources.anonymousTemplate.prototype.text=function(){var t,i;if(arguments.length==0)return t=o.utils.domData.get(this.domElement,n)||{},t.textData===f&&t.containerData&&(t.textData=t.containerData.innerHTML),t.textData;i=arguments[0];o.utils.domData.set(this.domElement,n,{textData:i})};o.templateSources.domElement.prototype.nodes=function(){var t,i;if(arguments.length==0)return t=o.utils.domData.get(this.domElement,n)||{},t.containerData;i=arguments[0];o.utils.domData.set(this.domElement,n,{containerData:i})};o.exportSymbol("templateSources",o.templateSources);o.exportSymbol("templateSources.domElement",o.templateSources.domElement);o.exportSymbol("templateSources.anonymousTemplate",o.templateSources.anonymousTemplate)}(),function(){function r(n,t,i){for(var r,u=n,f=o.virtualElements.nextSibling(t);u&&(r=u)!==f;)u=o.virtualElements.nextSibling(r),(r.nodeType===1||r.nodeType===8)&&i(r)}function u(n,t){if(n.length){var i=n[0],u=n[n.length-1];r(i,u,function(n){o.applyBindings(t,n)});r(i,u,function(n){o.memoization.unmemoizeDomNodeAndDescendants(n,[t])})}}function t(n){return n.nodeType?n:n.length>0?n[0]:null}function e(i,r,f,e,s){var h,c;s=s||{};var l=i&&t(i),a=l&&l.ownerDocument,v=s.templateEngine||n;if(o.templateRewriting.ensureTemplateIsRewritten(f,v,a),h=v.renderTemplate(f,e,s,a),typeof h.length!="number"||h.length>0&&typeof h[0].nodeType!="number")throw new Error("Template engine must return an array of DOM nodes");c=!1;switch(r){case"replaceChildren":o.virtualElements.setDomNodeChildren(i,h);c=!0;break;case"replaceNode":o.utils.replaceDomNodes(i,h);c=!0;break;case"ignoreTargetNode":break;default:throw new Error("Unknown renderMode: "+r);}return c&&(u(h,e),s.afterRender&&o.dependencyDetection.ignore(s.afterRender,null,[h,e.$data])),h}function s(n,t){var r=o.utils.domData.get(n,i);r&&typeof r.dispose=="function"&&r.dispose();o.utils.domData.set(n,i,t&&t.isActive()?t:f)}var n,i;o.setTemplateEngine=function(t){if(t!=f&&!(t instanceof o.templateEngine))throw new Error("templateEngine must inherit from ko.templateEngine");n=t};o.renderTemplate=function(i,r,u,s,h){if(u=u||{},(u.templateEngine||n)==f)throw new Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",s){var c=t(s),l=function(){return!c||!o.utils.domNodeIsAttachedToDocument(c)},a=c&&h=="replaceNode"?c.parentNode:c;return o.dependentObservable(function(){var n=r&&r instanceof o.bindingContext?r:new o.bindingContext(o.utils.unwrapObservable(r)),f=typeof i=="function"?i(n.$data,n):i,l=e(s,h,f,n,u);h=="replaceNode"&&(s=l,c=t(s))},null,{disposeWhen:l,disposeWhenNodeIsRemoved:a})}return o.memoization.memoize(function(n){o.renderTemplate(i,r,u,n,"replaceNode")})};o.renderTemplateForEach=function(n,t,i,r,s){var h,c=function(t,r){h=s.createChildContext(o.utils.unwrapObservable(t),i.as);h.$index=r;var u=typeof n=="function"?n(t,h):n;return e(null,"ignoreTargetNode",u,h,i)},l=function(n,t){u(t,h);i.afterRender&&i.afterRender(t,n)};return o.dependentObservable(function(){var n=o.utils.unwrapObservable(t)||[],u;typeof n.length=="undefined"&&(n=[n]);u=o.utils.arrayFilter(n,function(n){return i.includeDestroyed||n===f||n===null||!o.utils.unwrapObservable(n._destroy)});o.dependencyDetection.ignore(o.utils.setDomNodeChildrenFromArrayMapping,null,[r,u,c,i,l])},null,{disposeWhenNodeIsRemoved:r})};i="__ko__templateComputedDomDataKey__";o.bindingHandlers.template={init:function(n,t){var i=o.utils.unwrapObservable(t()),r,u;return typeof i=="string"||i.name||n.nodeType!=1&&n.nodeType!=8||(r=n.nodeType==1?n.childNodes:o.virtualElements.childNodes(n),u=o.utils.moveCleanedNodesToContainerElement(r),new o.templateSources.anonymousTemplate(n).nodes(u)),{controlsDescendantBindings:!0}},update:function(n,t,i,r,u){var e=o.utils.unwrapObservable(t()),f={},h=!0,l,c=null,a,v;typeof e!="string"&&(f=e,e=f.name,"if"in f&&(h=o.utils.unwrapObservable(f["if"])),h&&"ifnot"in f&&(h=!o.utils.unwrapObservable(f.ifnot)),l=o.utils.unwrapObservable(f.data));"foreach"in f?(a=h&&f.foreach||[],c=o.renderTemplateForEach(e||n,a,f,n,u)):h?(v="data"in f?u.createChildContext(l,f.as):u,c=o.renderTemplate(e||n,v,f,n)):o.virtualElements.emptyNode(n);s(n,c)}};o.expressionRewriting.bindingRewriteValidators.template=function(n){var t=o.expressionRewriting.parseObjectLiteral(n);return t.length==1&&t[0].unknown?null:o.expressionRewriting.keyValueArrayContainsKey(t,"name")?null:"This template engine does not support anonymous templates nested within its templates"};o.virtualElements.allowedBindings.template=!0}();o.exportSymbol("setTemplateEngine",o.setTemplateEngine);o.exportSymbol("renderTemplate",o.renderTemplate);o.utils.compareArrays=function(){function r(r,u,f){return r=r||[],u=u||[],r.length<=u.length?i(r,u,n,t,f):i(u,r,t,n,f)}function i(n,t,i,r,u){for(var nt=Math.min,ot=Math.max,l=[],c=n.length,f,a=t.length,st=a-c||1,tt=c+a+1,o,b,it,rt,ut,ft,et,y,g,h,p,w,e=0;e<=c;e++)for(b=o,l.push(o=[]),it=nt(a,e+st),rt=ot(0,e-1),f=rt;f<=it;f++)f?e?n[e-1]===t[f-1]?o[f]=b[f-1]:(ut=b[f]||tt,ft=o[f-1]||tt,o[f]=nt(ut,ft)+1):o[f]=f+1:o[f]=e+1;var s=[],k,d=[],v=[];for(e=c,f=a;e||f;)k=l[e][f]-1,f&&k===l[e][f-1]?d.push(s[s.length]={status:i,value:t[--f],index:f}):e&&k===l[e-1][f]?v.push(s[s.length]={status:r,value:n[--e],index:e}):(s.push({status:"retained",value:t[--f]}),--e);if(d.length&&v.length)for(et=c*10,y=g=0;(u||y<et)&&(p=d[g]);g++){for(h=0;w=v[h];h++)if(p.value===w.value){p.moved=w.index;w.moved=p.index;v.splice(h,1);y=h=0;break}y+=h}return s.reverse()}var n="added",t="deleted";return r}();o.exportSymbol("utils.compareArrays",o.utils.compareArrays),function(){function n(n){while(n.length&&!o.utils.domNodeIsAttachedToDocument(n[0]))n.splice(0,1);if(n.length>1){for(var t=n[0],r=n[n.length-1],i=[t];t!==r;){if(t=t.nextSibling,!t)return;i.push(t)}Array.prototype.splice.apply(n,[0,n.length].concat(i))}return n}function i(t,i,r,u,e){var s=[],h=o.dependentObservable(function(){var t=i(r,e)||[];s.length>0&&(o.utils.replaceDomNodes(n(s),t),u&&o.dependencyDetection.ignore(u,null,[r,t,e]));s.splice(0,s.length);o.utils.arrayPushAll(s,t)},null,{disposeWhenNodeIsRemoved:t,disposeWhen:function(){return s.length==0||!o.utils.domNodeIsAttachedToDocument(s[0])}});return{mappedNodes:s,dependentObservable:h.isActive()?h:f}}var t="setDomNodeChildrenFromArrayMapping_lastMappingResult";o.utils.setDomNodeChildrenFromArrayMapping=function(r,u,e,s,h){function et(t,i){c=b[i];g!==i&&(tt[t]=c);c.indexObservable(g++);n(c.mappedNodes);k.push(c);v.push(c)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&o.utils.arrayForEach(t[i].mappedNodes,function(r){n(r,i,t[i].arrayEntry)})}var p,w,l,it,ot,a,rt;u=u||[];s=s||{};var st=o.utils.domData.get(r,t)===f,b=o.utils.domData.get(r,t)||[],ht=o.utils.arrayMap(b,function(n){return n.arrayEntry}),ct=o.utils.compareArrays(ht,u),k=[],d=0,g=0,nt=[],v=[],ut=[],tt=[],ft=[],c;for(l=0;p=ct[l];l++){w=p.moved;switch(p.status){case"deleted":w===f&&(c=b[d],c.dependentObservable&&c.dependentObservable.dispose(),nt.push.apply(nt,n(c.mappedNodes)),s.beforeRemove&&(ut[l]=c,v.push(c)));d++;break;case"retained":et(l,d++);break;case"added":w!==f?et(l,w):(c={arrayEntry:p.value,indexObservable:o.observable(g++)},k.push(c),v.push(c),st||(ft[l]=c))}}for(y(s.beforeMove,tt),o.utils.arrayForEach(nt,s.beforeRemove?o.cleanNode:o.removeNode),l=0,it=o.virtualElements.firstChild(r);c=v[l];l++){for(c.mappedNodes||o.utils.extend(c,i(r,e,c.arrayEntry,h,c.indexObservable)),rt=0;a=c.mappedNodes[rt];it=a.nextSibling,ot=a,rt++)a!==it&&o.virtualElements.insertAfter(r,a,ot);!c.initialized&&h&&(h(c.arrayEntry,c.mappedNodes,c.indexObservable),c.initialized=!0)}y(s.beforeRemove,ut);y(s.afterMove,tt);y(s.afterAdd,ft);o.utils.domData.set(r,t,k)}}();o.exportSymbol("utils.setDomNodeChildrenFromArrayMapping",o.utils.setDomNodeChildrenFromArrayMapping);o.nativeTemplateEngine=function(){this.allowTemplateRewriting=!1};o.nativeTemplateEngine.prototype=new o.templateEngine;o.nativeTemplateEngine.prototype.renderTemplateSource=function(n){var r=!(o.utils.ieVersion<9),u=r?n.nodes:null,t=u?n.nodes():null,i;return t?o.utils.makeArray(t.cloneNode(!0).childNodes):(i=n.text(),o.utils.parseHtmlFragment(i))};o.nativeTemplateEngine.instance=new o.nativeTemplateEngine;o.setTemplateEngine(o.nativeTemplateEngine.instance);o.exportSymbol("nativeTemplateEngine",o.nativeTemplateEngine),function(){o.jqueryTmplTemplateEngine=function(){function t(){if(n<2)throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");}function r(n,t,i){return u.tmpl(n,t,i)}var n=this.jQueryTmplVersion=function(){if(typeof u=="undefined"||!u.tmpl)return 0;try{if(u.tmpl.tag.tmpl.open.toString().indexOf("__")>=0)return 2}catch(n){}return 1}();this.renderTemplateSource=function(n,f,e){var o,s;e=e||{};t();o=n.data("precompiled");o||(s=n.text()||"",s="{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}",o=u.template(null,s),n.data("precompiled",o));var c=[f.$data],l=u.extend({koBindingContext:f},e.templateOptions),h=r(o,c,l);return h.appendTo(i.createElement("div")),u.fragments={},h};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){i.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};n>0&&(u.tmpl.tag.ko_code={open:"__.push($1 || '');"},u.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};o.jqueryTmplTemplateEngine.prototype=new o.templateEngine;var n=new o.jqueryTmplTemplateEngine;n.jQueryTmplVersion>0&&o.setTemplateEngine(n);o.exportSymbol("jqueryTmplTemplateEngine",o.jqueryTmplTemplateEngine)}()})})(window,document,navigator,window.jQuery)}()