function _keyWordChanged(n,t){timerId=0,$.ajax({data:{keyword:$("#keyword").val()},url:n,type:"POST",success:function(n){$("#search-bar .loading").hide(),$("#"+t).html(n)},beforeSend:function(){$("#search-bar .loading").show()}})}function keyWordChanged(){timerId!=0&&clearTimeout(timerId),timerId=setTimeout("_keyWordChanged()",500)}function highlightMainPage(){_str=$("#q").val(),_str!=""&&(strhl=$.trim(_str),highlightText!=strhl&&($("#main").removeHighlight(),$("#main").highlight(strhl),highlightText=strhl))}function setCookie(n,t,i){var r,u;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="",document.cookie=n+"="+t+u+"; path=/"}function getCookie(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i";$("#message").addClass("alert-error").removeClass("alert-success").html("保存失败 - "+u),$("#message").fadeIn("fast")}else n.status==501&&($("#message").addClass("alert-error").removeClass("alert-success").html("保存失败 - 在您编辑期间,"+t.ShowName+" 于 "+t.EditedOn+' 修改了本文
查看本文的最新版本 - 保存当前副本到草稿箱'),$("#message").fadeIn("fast"))}function savefork(){$("#form-article #isntDraft").attr("disabled",!1).attr("checked",!1),$("#form-article #IsDraft").val(!0),$("#form-article").attr("action","/article/write").submit()}function onSaveArticleSuccess(n){$("#message").addClass("alert-success").removeClass("alert-error").html(""+(n.IsDraft?"草稿":"文章")+"成功保存于 "+n.SaveTime+' - 查看'),$("#message").fadeIn("fast"),$("#Id").val(n.Id),$("#TimeStamp").val(n.TimeStamp),$("#IsDraft").val(n.IsDraft),$(".validation-summary-errors").html(""),$(".input-validation-error").removeClass("input-validation-error")}function onSaveArticleComplete(){$("#btn-publish").attr("disabled",!1),$("#btn-draft").attr("disabled",!1)}function killBackSpace(n){var t,i;return(n=n?n:window.event,t=n.target?n.target:n.srcElement?n.srcElement:null,t&&t.tagName&&t.type&&/(password)|(text)|(file)|(search)/.test(t.type.toLowerCase())||t.tagName.toLowerCase()=="textarea")?!0:(i=n.keyCode?n.keyCode:n.which?n.which:null,i==8)?(n.preventDefault&&n.preventDefault(),!1):!0}function onErrataSuccess(n){$("#reporterrata").load("/bookcomment/reporterrata/"+n)}function onErrataFail(n){$("#CommentForm").html(n.responseText)}function onCommentSuccess(n){$("#comment").html(n),$("html,body").animate({scrollTop:$("#comment").offset().top+"px"},"fast"),$(".firstcomment").css({"background-color":"#eef"})}function onCommentFail(n){$("#CommentForm").html(n.responseText)}var q,Markdown,pp_alreadyInitialized,timerId,oldOnkeydown,_gaq;(function(n,t){function et(n){return i.isWindow(n)?n:n.nodeType===9?n.defaultView||n.parentWindow:!1}function li(n){if(!ft[n]){var e=r.body,t=i("<"+n+">").appendTo(e),u=t.css("display");t.remove(),(u==="none"||u==="")&&(f||(f=r.createElement("iframe"),f.frameBorder=f.width=f.height=0),e.appendChild(f),l&&f.createElement||(l=(f.contentWindow||f.contentDocument).document,l.write((r.compatMode==="CSS1Compat"?"":"")+""),l.close()),t=l.createElement(n),l.body.appendChild(t),u=i.css(t,"display"),e.removeChild(f)),ft[n]=u}return ft[n]}function v(n,t){var r={};return i.each(di.concat.apply([],di.slice(0,t)),function(){r[this]=n}),r}function ff(){k=t}function ur(){return setTimeout(ff,0),k=i.now()}function uf(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function gi(){try{return new n.XMLHttpRequest}catch(t){}}function rf(n,r){n.dataFilter&&(r=n.dataFilter(r,n.dataType));for(var v=n.dataTypes,s={},l,p=v.length,a,u=v[0],h,y,f,e,o,c=1;c0){if(r!=="border")for(;f=0===r})}function pi(n){return!n||!n.parentNode||n.parentNode.nodeType===11}function g(){return!0}function c(){return!1}function bi(n,t,r){var u=t+"defer",f=t+"queue",e=t+"mark",o=i._data(n,u);o&&(r==="queue"||!i._data(n,f))&&(r==="mark"||!i._data(n,e))&&setTimeout(function(){!i._data(n,f)&&!i._data(n,e)&&(i.removeData(n,u,!0),o.fire())},0)}function ot(n){for(var t in n)if((t!=="data"||!i.isEmptyObject(n[t]))&&t!=="toJSON")return!1;return!0}function ki(n,r,u){if(u===t&&n.nodeType===1){var f="data-"+r.replace(ar,"-$1").toLowerCase();if(u=n.getAttribute(f),typeof u=="string"){try{u=u==="true"?!0:u==="false"?!1:u==="null"?null:i.isNumeric(u)?parseFloat(u):rr.test(u)?i.parseJSON(u):u}catch(e){}i.data(n,r,u)}else u=t}return u}function ef(n){var i=ir[n]={},t,r;for(n=n.split(/\s+/),t=0,r=n.length;t)[^>]*$|#([\w\-]*)$)/,p=/\S/,w=/^\s+/,b=/\s+$/,st=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,it=/^[\],:{}\s]*$/,k=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,lt=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ct=/(?:^|:|,)(?:\s*\[)+/g,ht=/(webkit)[ \/]([\w.]+)/,vt=/(opera)(?:.*version)?[ \/]([\w.]+)/,ot=/(msie) ([\w.]+)/,et=/(mozilla)(?:.*? rv:([\w.]+))?/,ft=/-([a-z]|[0-9])/ig,ut=/^-ms-/,at=function(n,t){return(t+"").toUpperCase()},rt=ku.userAgent,o,e,u,tt=Object.prototype.toString,h=Object.prototype.hasOwnProperty,s=Array.prototype.push,f=Array.prototype.slice,l=String.prototype.trim,a=Array.prototype.indexOf,v={};return i.fn=i.prototype={constructor:i,init:function(n,u,f){var e,s,o,h;if(!n)return this;if(n.nodeType)return this.context=this[0]=n,this.length=1,this;if(n==="body"&&!u&&r.body)return this.context=r,this[0]=r.body,this.selector=n,this.length=1,this;if(typeof n=="string"){if(e=n.charAt(0)!=="<"||n.charAt(n.length-1)!==">"||n.length<3?nt.exec(n):[null,n,null],e&&(e[1]||!u)){if(e[1])return u=u instanceof i?u[0]:u,h=u?u.ownerDocument||u:r,o=st.exec(n),o?i.isPlainObject(u)?(n=[r.createElement(o[1])],i.fn.attr.call(n,u,!0)):n=[h.createElement(o[1])]:(o=i.buildFragment([e[1]],[h]),n=(o.cacheable?i.clone(o.fragment):o.fragment).childNodes),i.merge(this,n);if(s=r.getElementById(e[2]),s&&s.parentNode){if(s.id!==e[2])return f.find(n);this.length=1,this[0]=s}return this.context=r,this.selector=n,this}return!u||u.jquery?(u||f).find(n):this.constructor(u).find(n)}return i.isFunction(n)?f.ready(n):(n.selector!==t&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return f.call(this,0)},get:function(n){return n==null?this.toArray():n<0?this[this.length+n]:this[n]},pushStack:function(n,t,r){var u=this.constructor();return i.isArray(n)?s.apply(u,n):i.merge(u,n),u.prevObject=this,u.context=this.context,t==="find"?u.selector=this.selector+(this.selector?" ":"")+r:t&&(u.selector=this.selector+"."+t+"("+r+")"),u},each:function(n,t){return i.each(this,n,t)},ready:function(n){return i.bindReady(),e.add(n),this},eq:function(n){return n=+n,n===-1?this.slice(n):this.slice(n,n+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(f.apply(this,arguments),"slice",f.call(arguments).join(","))},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:s,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var o,e,u,r,s,h,n=arguments[0]||{},f=1,l=arguments.length,c=!1;for(typeof n=="boolean"&&(c=n,n=arguments[1]||{},f=2),typeof n!="object"&&!i.isFunction(n)&&(n={}),l===f&&(n=this,--f);f0)return;e.fireWith(r,[i]),i.fn.trigger&&i(r).trigger("ready").off("ready")}},bindReady:function(){if(!e){if(e=i.Callbacks("once memory"),r.readyState==="complete")return setTimeout(i.ready,1);if(r.addEventListener)r.addEventListener("DOMContentLoaded",u,!1),n.addEventListener("load",i.ready,!1);else if(r.attachEvent){r.attachEvent("onreadystatechange",u),n.attachEvent("onload",i.ready);var t=!1;try{t=n.frameElement==null}catch(f){}r.documentElement.doScroll&&t&&c()}}},isFunction:function(n){return i.type(n)==="function"},isArray:Array.isArray||function(n){return i.type(n)==="array"},isWindow:function(n){return n&&typeof n=="object"&&"setInterval"in n},isNumeric:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},type:function(n){return n==null?String(n):v[tt.call(n)]||"object"},isPlainObject:function(n){if(!n||i.type(n)!=="object"||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!h.call(n,"constructor")&&!h.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}var r;for(r in n);return r===t||h.call(n,r)},isEmptyObject:function(n){for(var t in n)return!1;return!0},error:function(n){throw new Error(n);},parseJSON:function(t){if(typeof t!="string"||!t)return null;if(t=i.trim(t),n.JSON&&n.JSON.parse)return n.JSON.parse(t);if(it.test(t.replace(k,"@").replace(lt,"]").replace(ct,"")))return new Function("return "+t)();i.error("Invalid JSON: "+t)},parseXML:function(r){var u,f;try{n.DOMParser?(f=new DOMParser,u=f.parseFromString(r,"text/xml")):(u=new ActiveXObject("Microsoft.XMLDOM"),u.async="false",u.loadXML(r))}catch(e){u=t}return(!u||!u.documentElement||u.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+r),u},noop:function(){},globalEval:function(t){t&&p.test(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(ut,"ms-").replace(ft,at)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toUpperCase()===t.toUpperCase()},each:function(n,r,u){var f,e=0,o=n.length,s=o===t||i.isFunction(n);if(u){if(s){for(f in n)if(r.apply(n[f],u)===!1)break}else for(;e0&&n[0]&&n[o-1]||o===0||i.isArray(n));if(c)for(;s1?b.call(arguments,0):i,t.notifyWith(s,o)}}function c(n){return function(i){r[n]=arguments.length>1?b.call(arguments,0):i,--e||t.resolveWith(t,r)}}var r=b.call(arguments,0),u=0,f=r.length,o=Array(f),e=f,l=f,t=f<=1&&n&&i.isFunction(n.promise)?n:i.Deferred(),s=t.promise();if(f>1){for(;u
a",y=t.getElementsByTagName("*"),o=t.getElementsByTagName("a")[0],!y||!y.length||!o)return{};l=r.createElement("select"),a=l.appendChild(r.createElement("option")),f=t.getElementsByTagName("input")[0],u={leadingWhitespace:t.firstChild.nodeType===3,tbody:!t.getElementsByTagName("tbody").length,htmlSerialize:!!t.getElementsByTagName("link").length,style:/top/.test(o.getAttribute("style")),hrefNormalized:o.getAttribute("href")==="/a",opacity:/^0.55/.test(o.style.opacity),cssFloat:!!o.style.cssFloat,checkOn:f.value==="on",optSelected:a.selected,getSetAttribute:t.className!=="t",enctype:!!r.createElement("form").enctype,html5Clone:r.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},f.checked=!0,u.noCloneChecked=f.cloneNode(!0).checked,l.disabled=!0,u.optDisabled=!a.disabled;try{delete t.test}catch(k){u.deleteExpando=!1}if(!t.addEventListener&&t.attachEvent&&t.fireEvent&&(t.attachEvent("onclick",function(){u.noCloneEvent=!1}),t.cloneNode(!0).fireEvent("onclick")),f=r.createElement("input"),f.value="t",f.setAttribute("type","radio"),u.radioValue=f.value==="t",f.setAttribute("checked","checked"),t.appendChild(f),e=r.createDocumentFragment(),e.appendChild(t.lastChild),u.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,u.appendChecked=f.checked,e.removeChild(f),e.appendChild(t),t.innerHTML="",n.getComputedStyle&&(s=r.createElement("div"),s.style.width="0",s.style.marginRight="0",t.style.width="2px",t.appendChild(s),u.reliableMarginRight=(parseInt((n.getComputedStyle(s,null)||{marginRight:0}).marginRight,10)||0)===0),t.attachEvent)for(p in{submit:1,change:1,focusin:1})v="on"+p,h=v in t,h||(t.setAttribute(v,"return;"),h=typeof t[v]=="function"),u[p+"Bubbles"]=h;return e.removeChild(t),e=l=a=s=t=f=null,i(function(){var f,e,n,b,p,o,l,a,v,y,w,s=r.getElementsByTagName("body")[0];!s||(l=1,a="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",v="visibility:hidden;border:0;",y="style='"+a+"border:5px solid #000;padding:0;'",w="
",f=r.createElement("div"),f.style.cssText=v+"width:0;height:0;position:static;top:0;margin-top:"+l+"px",s.insertBefore(f,s.firstChild),t=r.createElement("div"),f.appendChild(t),t.innerHTML="
t
",c=t.getElementsByTagName("td"),h=c[0].offsetHeight===0,c[0].style.display="",c[1].style.display="none",u.reliableHiddenOffsets=h&&c[0].offsetHeight===0,t.innerHTML="",t.style.width=t.style.paddingLeft="1px",i.boxModel=u.boxModel=t.offsetWidth===2,typeof t.style.zoom!="undefined"&&(t.style.display="inline",t.style.zoom=1,u.inlineBlockNeedsLayout=t.offsetWidth===2,t.style.display="",t.innerHTML="
",u.shrinkWrapBlocks=t.offsetWidth!==2),t.style.cssText=a+v,t.innerHTML=w,e=t.firstChild,n=e.firstChild,p=e.nextSibling.firstChild.firstChild,o={doesNotAddBorder:n.offsetTop!==5,doesAddBorderForTableAndCells:p.offsetTop===5},n.style.position="fixed",n.style.top="20px",o.fixedPosition=n.offsetTop===20||n.offsetTop===15,n.style.position=n.style.top="",e.style.overflow="hidden",e.style.position="relative",o.subtractsBorderForOverflowNotVisible=n.offsetTop===-5,o.doesNotIncludeMarginInBodyOffset=s.offsetTop!==l,s.removeChild(f),t=f=null,i.extend(u,o))}),u}(),rr=/^(?:\{.*\}|\[.*\])$/,ar=/([A-Z])/g,i.extend({cache:{},uuid:0,expando:"jQuery"+(i.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ot(n)},data:function(n,r,u,f){if(!!i.acceptData(n)){var a,o,h,c=i.expando,v=typeof r=="string",l=n.nodeType,s=l?i.cache:n,e=l?n[c]:n[c]&&c,y=r==="events";return(!e||!s[e]||!y&&!f&&!s[e].data)&&v&&u===t?void 0:(e||(l?n[c]=e=++i.uuid:e=c),s[e]||(s[e]={},l||(s[e].toJSON=i.noop)),(typeof r=="object"||typeof r=="function")&&(f?s[e]=i.extend(s[e],r):s[e].data=i.extend(s[e].data,r)),a=o=s[e],f||(o.data||(o.data={}),o=o.data),u!==t&&(o[i.camelCase(r)]=u),y&&!o[r])?a.events:(v?(h=o[r],h==null&&(h=o[i.camelCase(r)])):h=o,h)}},removeData:function(n,t,r){if(!!i.acceptData(n)){var e,s,c,o=i.expando,h=n.nodeType,u=h?i.cache:n,f=h?n[o]:o;if(!u[f])return;if(t&&(e=r?u[f]:u[f].data,e)){for(i.isArray(t)||(t in e?t=[t]:(t=i.camelCase(t),t=t in e?[t]:t.split(" "))),s=0,c=t.length;s-1)return!0;return!1},val:function(n){var r,u,e,f=this[0];return!arguments.length?f?(r=i.valHooks[f.nodeName.toLowerCase()]||i.valHooks[f.type],r&&"get"in r&&(u=r.get(f,"value"))!==t)?u:(u=f.value,typeof u=="string"?u.replace(pu,""):u==null?"":u):void 0:(e=i.isFunction(n),this.each(function(u){var o=i(this),f;this.nodeType===1&&(f=e?n.call(this,u,o.val()):n,f==null?f="":typeof f=="number"?f+="":i.isArray(f)&&(f=i.map(f,function(n){return n==null?"":n+""})),r=i.valHooks[this.nodeName.toLowerCase()]||i.valHooks[this.type],r&&"set"in r&&r.set(this,f,"value")!==t||(this.value=f))}))}}),i.extend({valHooks:{option:{get:function(n){var t=n.attributes.value;return!t||t.specified?n.value:n.text}},select:{get:function(n){var o,r,h,t,u=n.selectedIndex,s=[],f=n.options,e=n.type==="select-one";if(u<0)return null;for(r=e?u:0,h=e?u+1:f.length;r=0}),r.length||(n.selectedIndex=-1),r}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(n,r,u,f){var o,s,h,c=n.nodeType;if(!!n&&c!==3&&c!==8&&c!==2){if(f&&r in i.attrFn)return i(n)[r](u);if(typeof n.getAttribute=="undefined")return i.prop(n,r,u);if(h=c!==1||!i.isXMLDoc(n),h&&(r=r.toLowerCase(),s=i.attrHooks[r]||(hr.test(r)?er:e)),u!==t){if(u===null){i.removeAttr(n,r);return}return s&&"set"in s&&h&&(o=s.set(n,u,r))!==t?o:(n.setAttribute(r,""+u),u)}return s&&"get"in s&&h&&(o=s.get(n,r))!==null?o:(o=n.getAttribute(r),o===null?t:o)}},removeAttr:function(n,t){var u,f,r,o,e=0;if(t&&n.nodeType===1)for(f=t.toLowerCase().split(w),o=f.length;e=0}})});var it=/^(?:textarea|input|select)$/i,ci=/^([^\.]*)?(?:\.(.+))?$/,lu=/\bhover(\.\S+)?\b/,cu=/^key/,bu=/^(?:mouse|contextmenu)|click/,vt=/^(?:focusinfocus|focusoutblur)$/,of=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,sf=function(n){var t=of.exec(n);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},hf=function(n,t){var i=n.attributes||{};return(!t[1]||n.nodeName.toLowerCase()===t[1])&&(!t[2]||(i.id||{}).value===t[2])&&(!t[3]||t[3].test((i["class"]||{}).value))},wt=function(n){return i.event.special.hover?n:n.replace(lu,"mouseenter$1 mouseleave$1")};i.event={add:function(n,r,u,f,e){var v,h,a,p,y,o,w,l,b,k,c,s;if(!(n.nodeType===3||n.nodeType===8||!r||!u||!(v=i._data(n)))){for(u.handler&&(b=u,u=b.handler),u.guid||(u.guid=i.guid++),a=v.events,a||(v.events=a={}),h=v.handle,h||(v.handle=h=function(n){return typeof i!="undefined"&&(!n||i.event.triggered!==n.type)?i.event.dispatch.apply(h.elem,arguments):t},h.elem=n),r=i.trim(wt(r)).split(" "),p=0;p=0&&(o=o.slice(0,-1),k=!0),o.indexOf(".")>=0&&(p=o.split("."),o=p.shift(),p.sort()),(!f||i.event.customEvent[o])&&!i.event.global[o])return;if(r=typeof r=="object"?r[i.expando]?r:new i.Event(o,r):new i.Event(o),r.type=o,r.isTrigger=!0,r.exclusive=k,r.namespace=p.join("."),r.namespace_re=r.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,a=o.indexOf(":")<0?"on"+o:"",!f){w=i.cache;for(c in w)w[c].events&&w[c].events[o]&&i.event.trigger(r,u,w[c].handle.elem,!0);return}if(r.result=t,r.target||(r.target=f),u=u!=null?i.makeArray(u):[],u.unshift(r),l=i.event.special[o]||{},l.trigger&&l.trigger.apply(f,u)===!1)return;if(y=[[f,l.bindType||o]],!e&&!l.noBubble&&!i.isWindow(f)){for(b=l.delegateType||o,s=vt.test(b+o)?f:f.parentNode,h=null;s;s=s.parentNode)y.push([s,b]),h=s;h&&h===f.ownerDocument&&y.push([h.defaultView||h.parentWindow||n,b])}for(c=0;cc&&h.push({elem:this,matches:w.slice(c)}),f=0;f0?this.on(t,null,n,i):this.trigger(t)},i.attrFn&&(i.attrFn[t]=!0),cu.test(t)&&(i.event.fixHooks[t]=i.event.keyHooks),bu.test(t)&&(i.event.fixHooks[t]=i.event.mouseHooks)}),function(){function b(t,i,r,u,f,o){for(var s,c,h=0,l=u.length;h0){c=s;break}s=s[t]}u[h]=c}}function g(n,t,i,r,u,f){for(var o,h,s=0,c=r.length;s+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),y=0,d=Object.prototype.toString,a=!1,k=!0,o=/\\/g,tt=/\r\n/g,c=/\W/,n,h,f,l,s,p;[0,0].sort(function(){return k=!1,0}),n=function(t,i,e,o){var nt;if(e=e||[],i=i||r,nt=i,i.nodeType!==1&&i.nodeType!==9)return[];if(!t||typeof t!="string")return e;var y,a,h,g,l,w,b,c,tt=!0,k=n.isXML(i),s=[],rt=t;do if(v.exec(""),y=v.exec(rt),y&&(rt=y[3],s.push(y[1]),y[2])){g=y[3];break}while(y);if(s.length>1&&it.exec(t))if(s.length===2&&u.relative[s[0]])a=p(s[0]+s[1],i,o);else for(a=u.relative[s[0]]?[i]:n(s.shift(),i);s.length;)t=s.shift(),u.relative[t]&&(t+=s.shift()),a=p(t,a,o);else if(!o&&s.length>1&&i.nodeType===9&&!k&&u.match.ID.test(s[0])&&!u.match.ID.test(s[s.length-1])&&(l=n.find(s.shift(),i,k),i=l.expr?n.filter(l.expr,l.set)[0]:l.set[0]),i)for(l=o?{expr:s.pop(),set:f(o)}:n.find(s.pop(),s.length===1&&(s[0]==="~"||s[0]==="+")&&i.parentNode?i.parentNode:i,k),a=l.expr?n.filter(l.expr,l.set):l.set,s.length>0?h=f(a):tt=!1;s.length;)w=s.pop(),b=w,u.relative[w]?b=s.pop():w="",b==null&&(b=i),u.relative[w](h,b,k);else h=s=[];if(h||(h=a),h||n.error(w||t),d.call(h)==="[object Array]")if(tt)if(i&&i.nodeType===1)for(c=0;h[c]!=null;c++)h[c]&&(h[c]===!0||h[c].nodeType===1&&n.contains(i,h[c]))&&e.push(a[c]);else for(c=0;h[c]!=null;c++)h[c]&&h[c].nodeType===1&&e.push(a[c]);else e.push.apply(e,h);else f(h,e);return g&&(n(g,nt,e,o),n.uniqueSort(e)),e},n.uniqueSort=function(n){if(l&&(a=k,n.sort(l),a))for(var t=1;t0},n.find=function(n,t,i){var f,e,c,r,s,h;if(!n)return[];for(e=0,c=u.order.length;e":function(t,i){var u,f=typeof i=="string",r=0,o=t.length,e;if(f&&!c.test(i))for(i=i.toLowerCase();r=0)?i||r.push(e):i&&(t[s]=!1));return!1},ID:function(n){return n[1].replace(o,"")},TAG:function(n){return n[1].replace(o,"").toLowerCase()},CHILD:function(t){if(t[1]==="nth"){t[2]||n.error(t[0]),t[2]=t[2].replace(/^\+|\s*/g,"");var i=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(t[2]==="even"&&"2n"||t[2]==="odd"&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=i[1]+(i[2]||1)-0,t[3]=i[3]-0}else t[2]&&n.error(t[0]);return t[0]=y++,t},ATTR:function(n,t,i,r,f,e){var s=n[1]=n[1].replace(o,"");return!e&&u.attrMap[s]&&(n[1]=u.attrMap[s]),n[4]=(n[4]||n[5]||"").replace(o,""),n[2]==="~="&&(n[4]=" "+n[4]+" "),n},PSEUDO:function(t,i,r,f,e){if(t[1]==="not")if((v.exec(t[3])||"").length>1||/^\w/.test(t[3]))t[3]=n(t[3],null,null,i);else{var o=n.filter(t[3],i,r,!0^e);return r||f.push.apply(f,o),!1}else if(u.match.POS.test(t[0])||u.match.CHILD.test(t[0]))return!0;return t},POS:function(n){return n.unshift(!0),n}},filters:{enabled:function(n){return n.disabled===!1&&n.type!=="hidden"},disabled:function(n){return n.disabled===!0},checked:function(n){return n.checked===!0},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},parent:function(n){return!!n.firstChild},empty:function(n){return!n.firstChild},has:function(t,i,r){return!!n(r[3],t).length},header:function(n){return/h\d/i.test(n.nodeName)},text:function(n){var t=n.getAttribute("type"),i=n.type;return n.nodeName.toLowerCase()==="input"&&"text"===i&&(t===i||t===null)},radio:function(n){return n.nodeName.toLowerCase()==="input"&&"radio"===n.type},checkbox:function(n){return n.nodeName.toLowerCase()==="input"&&"checkbox"===n.type},file:function(n){return n.nodeName.toLowerCase()==="input"&&"file"===n.type},password:function(n){return n.nodeName.toLowerCase()==="input"&&"password"===n.type},submit:function(n){var t=n.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===n.type},image:function(n){return n.nodeName.toLowerCase()==="input"&&"image"===n.type},reset:function(n){var t=n.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===n.type},button:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&"button"===n.type||t==="button"},input:function(n){return/input|select|textarea|button/i.test(n.nodeName)},focus:function(n){return n===n.ownerDocument.activeElement}},setFilters:{first:function(n,t){return t===0},last:function(n,t,i,r){return t===r.length-1},even:function(n,t){return t%2==0},odd:function(n,t){return t%2==1},lt:function(n,t,i){return ti[3]-0},nth:function(n,t,i){return i[3]-0===t},eq:function(n,t,i){return i[3]-0===t}},filter:{PSEUDO:function(t,i,r,f){var e=i[1],h=u.filters[e],s,o,c;if(h)return h(t,r,i,f);if(e==="contains")return(t.textContent||t.innerText||w([t])||"").indexOf(i[3])>=0;if(e==="not"){for(s=i[3],o=0,c=s.length;o=0}},ID:function(n,t){return n.nodeType===1&&n.getAttribute("id")===t},TAG:function(n,t){return t==="*"&&n.nodeType===1||!!n.nodeName&&n.nodeName.toLowerCase()===t},CLASS:function(n,t){return(" "+(n.className||n.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(t,i){var o=i[1],s=n.attr?n.attr(t,o):u.attrHandle[o]?u.attrHandle[o](t):t[o]!=null?t[o]:t.getAttribute(o),f=s+"",e=i[2],r=i[4];return s==null?e==="!=":!e&&n.attr?s!=null:e==="="?f===r:e==="*="?f.indexOf(r)>=0:e==="~="?(" "+f+" ").indexOf(r)>=0:r?e==="!="?f!==r:e==="^="?f.indexOf(r)===0:e==="$="?f.substr(f.length-r.length)===r:e==="|="?f===r||f.substr(0,r.length+1)===r+"-":!1:f&&s!==!1},POS:function(n,t,i,r){var e=t[2],f=u.setFilters[e];if(f)return f(n,i,t,r)}}},it=u.match.POS,nt=function(n,t){return"\\"+(+t+1)};for(h in u.match)u.match[h]=new RegExp(u.match[h].source+/(?![^\[]*\])(?![^\(]*\))/.source),u.leftMatch[h]=new RegExp(/(^(?:.|\r|\n)*?)/.source+u.match[h].source.replace(/\\(\d+)/g,nt));f=function(n,t){return(n=Array.prototype.slice.call(n,0),t)?(t.push.apply(t,n),t):n};try{Array.prototype.slice.call(r.documentElement.childNodes,0)[0].nodeType}catch(rt){f=function(n,t){var i=0,r=t||[],u;if(d.call(n)==="[object Array]")Array.prototype.push.apply(r,n);else if(typeof n.length=="number")for(u=n.length;i",i.insertBefore(n,i.firstChild),r.getElementById(f)&&(u.find.ID=function(n,i,r){if(typeof i.getElementById!="undefined"&&!r){var u=i.getElementById(n[1]);return u?u.id===n[1]||typeof u.getAttributeNode!="undefined"&&u.getAttributeNode("id").nodeValue===n[1]?[u]:t:[]}},u.filter.ID=function(n,t){var i=typeof n.getAttributeNode!="undefined"&&n.getAttributeNode("id");return n.nodeType===1&&i&&i.nodeValue===t}),i.removeChild(n),i=n=null}(),function(){var n=r.createElement("div");n.appendChild(r.createComment("")),n.getElementsByTagName("*").length>0&&(u.find.TAG=function(n,t){var i=t.getElementsByTagName(n[1]),u,r;if(n[1]==="*"){for(u=[],r=0;i[r];r++)i[r].nodeType===1&&u.push(i[r]);i=u}return i}),n.innerHTML="",n.firstChild&&typeof n.firstChild.getAttribute!="undefined"&&n.firstChild.getAttribute("href")!=="#"&&(u.attrHandle.href=function(n){return n.getAttribute("href",2)}),n=null}(),r.querySelectorAll&&function(){var i=n,t=r.createElement("div"),o="__sizzle__",e;if(t.innerHTML="

",!t.querySelectorAll||t.querySelectorAll(".TEST").length!==0){n=function(t,e,s,h){var c,l;if(e=e||r,!h&&!n.isXML(e)){if(c=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t),c&&(e.nodeType===1||e.nodeType===9)){if(c[1])return f(e.getElementsByTagName(t),s);if(c[2]&&u.find.CLASS&&e.getElementsByClassName)return f(e.getElementsByClassName(c[2]),s)}if(e.nodeType===9){if(t==="body"&&e.body)return f([e.body],s);if(c&&c[3]){if(l=e.getElementById(c[3]),!l||!l.parentNode)return f([],s);if(l.id===c[3])return f([l],s)}try{return f(e.querySelectorAll(t),s)}catch(b){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var w=e,v=e.getAttribute("id"),a=v||o,y=e.parentNode,p=/^\s*[+~]/.test(t);v?a=a.replace(/'/g,"\\$&"):e.setAttribute("id",a),p&&y&&(e=e.parentNode);try{if(!p||y)return f(e.querySelectorAll("[id='"+a+"'] "+t),s)}catch(k){}finally{v||w.removeAttribute("id")}}}return i(t,e,s,h)};for(e in i)n[e]=i[e];t=null}}(),function(){var t=r.documentElement,i=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector,e,f;if(i){e=!i.call(r.createElement("div"),"div"),f=!1;try{i.call(r.documentElement,"[test!='']:sizzle")}catch(o){f=!0}n.matchesSelector=function(t,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!n.isXML(t))try{if(f||!u.match.PSEUDO.test(r)&&!/!=/.test(r)){var o=i.call(t,r);if(o||!e||t.document&&t.document.nodeType!==11)return o}}catch(s){}return n(r,null,null,[t]).length>0}}}(),function(){var n=r.createElement("div");if(n.innerHTML="
",!!n.getElementsByClassName&&n.getElementsByClassName("e").length!==0){if(n.lastChild.className="e",n.getElementsByClassName("e").length===1)return;u.order.splice(1,0,"CLASS"),u.find.CLASS=function(n,t,i){if(typeof t.getElementsByClassName!="undefined"&&!i)return t.getElementsByClassName(n[1])},n=null}}(),n.contains=r.documentElement.contains?function(n,t){return n!==t&&(n.contains?n.contains(t):!0)}:r.documentElement.compareDocumentPosition?function(n,t){return!!(n.compareDocumentPosition(t)&16)}:function(){return!1},n.isXML=function(n){var t=(n?n.ownerDocument||n:0).documentElement;return t?t.nodeName!=="HTML":!1},p=function(t,i,r){for(var e,o=[],s="",h=i.nodeType?[i]:i,f,c;e=u.match.PSEUDO.exec(t);)s+=e[0],t=t.replace(u.match.PSEUDO,"");for(t=u.relative[t]?t+"*":t,f=0,c=h.length;f0)for(u=o;u=0:i.filter(n,this).length>0:this.filter(n).length>0)},closest:function(n,t){var f=[],u,s,r=this[0],e,o;if(i.isArray(n)){for(e=1;r&&r.ownerDocument&&r!==t;){for(u=0;u-1:i.find.matchesSelector(r,n)){f.push(r);break}if(r=r.parentNode,!r||!r.ownerDocument||r===t||r.nodeType===11)break}return f=f.length>1?i.unique(f):f,this.pushStack(f,"closest",n)},index:function(n){return n?typeof n=="string"?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(n,t){var u=typeof n=="string"?i(n,t):i.makeArray(n&&n.nodeType?[n]:n),r=i.merge(this.get(),u);return this.pushStack(pi(u[0])||pi(r[0])?r:i.unique(r))},andSelf:function(){return this.add(this.prevObject)}}),i.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return i.nth(n,2,"nextSibling")},prev:function(n){return i.nth(n,2,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling(n.parentNode.firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.makeArray(n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return fe.test(n)||(u=r),u&&typeof u=="string"&&(f=i.filter(u,f)),f=this.length>1&&!te[n]?i.unique(f):f,(this.length>1||re.test(u))&&ue.test(n)&&(f=f.reverse()),this.pushStack(f,n,su.call(arguments).join(","))}}),i.extend({filter:function(n,t,r){return r&&(n=":not("+n+")"),t.length===1?i.find.matchesSelector(t[0],n)?[t[0]]:[]:i.find.matches(n,t)},dir:function(n,r,u){for(var e=[],f=n[r];f&&f.nodeType!==9&&(u===t||f.nodeType!==1||!i(f).is(u));)f.nodeType===1&&e.push(f),f=f[r];return e},nth:function(n,t,i){t=t||1;for(var u=0;n;n=n[i])if(n.nodeType===1&&++u===t)break;return n},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i}});var ni="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ne=/ jQuery\d+="(?:\d+|null)"/g,st=/^\s+/,ri=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ui=/<([\w:]+)/,gf=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},dt=vi(r);u.optgroup=u.option,u.tbody=u.tfoot=u.colgroup=u.caption=u.thead,u.th=u.td,i.support.htmlSerialize||(u._default=[1,"div
","
"]),i.fn.extend({text:function(n){return i.isFunction(n)?this.each(function(t){var r=i(this);r.text(n.call(this,t,r.text()))}):typeof n!="object"&&n!==t?this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(n)):i.text(this)},wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var n=this;n.firstChild&&n.firstChild.nodeType===1;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return i.isFunction(n)?this.each(function(t){i(this).wrapInner(n.call(this,t))}):this.each(function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(n){this.nodeType===1&&this.appendChild(n)})},prepend:function(){return this.domManip(arguments,!0,function(n){this.nodeType===1&&this.insertBefore(n,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this)});if(arguments.length){var n=i.clean(arguments);return n.push.apply(n,this.toArray()),this.pushStack(n,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(n){this.parentNode.insertBefore(n,this.nextSibling)});if(arguments.length){var n=this.pushStack(this,"after",arguments);return n.push.apply(n,i.clean(arguments)),n}},remove:function(n,t){for(var u=0,r;(r=this[u])!=null;u++)(!n||i.filter(n,[r]).length)&&(!t&&r.nodeType===1&&(i.cleanData(r.getElementsByTagName("*")),i.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r));return this},empty:function(){for(var t=0,n;(n=this[t])!=null;t++)for(n.nodeType===1&&i.cleanData(n.getElementsByTagName("*"));n.firstChild;)n.removeChild(n.firstChild);return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){if(n===t)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ne,""):null;if(typeof n!="string"||kf.test(n)||!i.support.leadingWhitespace&&st.test(n)||u[(ui.exec(n)||["",""])[1].toLowerCase()])i.isFunction(n)?this.each(function(t){var r=i(this);r.html(n.call(this,t,r.html()))}):this.empty().append(n);else{n=n.replace(ri,"<$1>");try{for(var r=0,f=this.length;r1&&h0?this.clone(!0):this).get(),i(u[f])[t](s),e=e.concat(s);return this.pushStack(e,n,u.selector)}}),i.extend({clone:function(n,t,r){var f,e,u,o=i.support.html5Clone||!ei.test("<"+n.nodeName)?n.cloneNode(!0):gu(n);if((!i.support.noCloneEvent||!i.support.noCloneChecked)&&(n.nodeType===1||n.nodeType===11)&&!i.isXMLDoc(n))for(at(n,o),f=tt(n),e=tt(o),u=0;f[u];++u)e[u]&&at(f[u],e[u]);if(t&&(yr(n,o),r))for(f=tt(n),e=tt(o),u=0;f[u];++u)yr(f[u],e[u]);return f=e=null,o},clean:function(n,t,f,e){var b,s,c,h,o,y,a,p,k;for(t=t||r,typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||r),s=[],h=0;(o=n[h])!=null;h++)if(typeof o=="number"&&(o+=""),o){if(typeof o=="string")if(df.test(o)){o=o.replace(ri,"<$1>");var w=(ui.exec(o)||["",""])[1].toLowerCase(),v=u[w]||u._default,d=v[0],l=t.createElement("div");for(t===r?dt.appendChild(l):vi(t).appendChild(l),l.innerHTML=v[1]+o+v[2];d--;)l=l.lastChild;if(!i.support.tbody)for(y=gf.test(o),a=w==="table"&&!y?l.firstChild&&l.firstChild.childNodes:v[1]===""&&!y?l.childNodes:[],c=a.length-1;c>=0;--c)i.nodeName(a[c],"tbody")&&!a[c].childNodes.length&&a[c].parentNode.removeChild(a[c]);!i.support.leadingWhitespace&&st.test(o)&&l.insertBefore(t.createTextNode(st.exec(o)[0]),l.firstChild),o=l.childNodes}else o=t.createTextNode(o);if(!i.support.appendChecked)if(o[0]&&typeof(p=o.length)=="number")for(c=0;c=0?t+"px":void 0):t}}}),i.support.opacity||(i.cssHooks.opacity={get:function(n,t){return yf.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+t*100+")":"",f=u&&u.filter||r.filter||"";(r.zoom=1,t>=1&&i.trim(f.replace(ht,""))===""&&(r.removeAttribute("filter"),u&&!u.filter))||(r.filter=ht.test(f)?f.replace(ht,e):f+" "+e)}}),i(function(){i.support.reliableMarginRight||(i.cssHooks.marginRight={get:function(n,t){var r;return i.swap(n,{display:"inline-block"},function(){r=t?a(n,"margin-right","marginRight"):n.style.marginRight}),r}})}),r.defaultView&&r.defaultView.getComputedStyle&&(lr=function(n,t){var r,u,f;return t=t.replace(vf,"-$1").toLowerCase(),(u=n.ownerDocument.defaultView)&&(f=u.getComputedStyle(n,null))&&(r=f.getPropertyValue(t),r===""&&!i.contains(n.ownerDocument.documentElement,n)&&(r=i.style(n,t))),r}),r.documentElement.currentStyle&&(gt=function(n,t){var f,u,e,i=n.currentStyle&&n.currentStyle[t],r=n.style;return i===null&&r&&(e=r[t])&&(i=e),!fi.test(i)&&af.test(i)&&(f=r.left,u=n.runtimeStyle&&n.runtimeStyle.left,u&&(n.runtimeStyle.left=n.currentStyle.left),r.left=t==="fontSize"?"1em":i||0,i=r.pixelLeft+"px",r.left=f,u&&(n.runtimeStyle.left=u)),i===""?"auto":i}),a=lr||gt,i.expr&&i.expr.filters&&(i.expr.filters.hidden=function(n){var t=n.offsetWidth,r=n.offsetHeight;return t===0&&r===0||!i.support.reliableHiddenOffsets&&(n.style&&n.style.display||i.css(n,"display"))==="none"},i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)});var fu=/%20/g,ru=/\[\]$/,si=/\r?\n/g,dr=/#.*$/,kr=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,eu=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,wr=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,br=/^(?:GET|HEAD)$/,gr=/^\/\//,ti=/\?/,ou=/)<[^<]*)*<\/script>/gi,iu=/^(?:select|textarea)/i,kt=/\s+/,nu=/([?&])_=[^&]*/,bt=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,pt=i.fn.load,rt={},yt={},o,s,ii=["*/"]+["*"];try{o=wu.href}catch(oe){o=r.createElement("a"),o.href="",o=o.href}s=bt.exec(o.toLowerCase())||[],i.fn.extend({load:function(n,r,u){var f,e,o,s;return typeof n!="string"&&pt?pt.apply(this,arguments):this.length?(f=n.indexOf(" "),f>=0&&(e=n.slice(f,n.length),n=n.slice(0,f)),o="GET",r&&(i.isFunction(r)?(u=r,r=t):typeof r=="object"&&(r=i.param(r,i.ajaxSettings.traditional),o="POST")),s=this,i.ajax({url:n,type:o,dataType:"html",data:r,complete:function(n,t,r){r=n.responseText,n.isResolved()&&(n.done(function(n){r=n}),s.html(e?i("
").append(r.replace(ou,"")).find(e):r)),u&&s.each(u,[r,t,n])}}),this):this},serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?i.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||iu.test(this.nodeName)||eu.test(this.type))}).map(function(n,t){var r=i(this).val();return r==null?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(si,"\r\n")}}):{name:t.name,value:r.replace(si,"\r\n")}}).get()}}),i.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(n,t){i.fn[t]=function(n){return this.on(t,n)}}),i.each(["get","post"],function(n,r){i[r]=function(n,u,f,e){return i.isFunction(u)&&(e=e||f,f=u,u=t),i.ajax({type:r,url:n,data:u,success:f,dataType:e})}}),i.extend({getScript:function(n,r){return i.get(n,t,r,"script")},getJSON:function(n,t,r){return i.get(n,t,r,"json")},ajaxSetup:function(n,t){return t?tr(n,i.ajaxSettings):(t=n,n=i.ajaxSettings),tr(n,t),n},ajaxSettings:{url:o,isLocal:wr.test(s[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":ii},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":n.String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:lt(rt),ajaxTransport:lt(yt),ajax:function(n,r){function w(n,r,s,l){if(e!==2){e=2,tt&&clearTimeout(tt),c=t,g=l||"",f.readyState=n>0?4:0;var p,k,w,a=r,rt=s?tf(u,f,s):t,d,nt;if(n>=200&&n<300||n===304)if(u.ifModified&&((d=f.getResponseHeader("Last-Modified"))&&(i.lastModified[o]=d),(nt=f.getResponseHeader("Etag"))&&(i.etag[o]=nt)),n===304)a="notmodified",p=!0;else try{k=rf(u,rt),a="success",p=!0}catch(ut){a="parsererror",w=ut}else w=a,(!a||n)&&(a="error",n<0&&(n=0));f.status=n,f.statusText=""+(r||a),p?b.resolveWith(h,[k,a,f]):b.rejectWith(h,[f,a,w]),f.statusCode(y),y=t,v&&it.trigger("ajax"+(p?"Success":"Error"),[f,u,p?k:w]),ft.fireWith(h,[f,a]),v&&(it.trigger("ajaxComplete",[f,u]),--i.active||i.event.trigger("ajaxStop"))}}var k,d;typeof n=="object"&&(r=n,n=t),r=r||{};var u=i.ajaxSetup({},r),h=u.context||u,it=h!==u&&(h.nodeType||h instanceof i)?i(h):i.event,b=i.Deferred(),ft=i.Callbacks("once memory"),y=u.statusCode||{},o,et={},ut={},g,p,c,tt,l,e=0,v,a,f={readyState:0,setRequestHeader:function(n,t){if(!e){var i=n.toLowerCase();n=ut[i]=ut[i]||n,et[n]=t}return this},getAllResponseHeaders:function(){return e===2?g:null},getResponseHeader:function(n){var i;if(e===2){if(!p)for(p={};i=kr.exec(g);)p[i[1].toLowerCase()]=i[2];i=p[n.toLowerCase()]}return i===t?null:i},overrideMimeType:function(n){return e||(u.mimeType=n),this},abort:function(n){return n=n||"abort",c&&c.abort(n),w(0,n),this}};if(b.promise(f),f.success=f.done,f.error=f.fail,f.complete=ft.add,f.statusCode=function(n){if(n){var t;if(e<2)for(t in n)y[t]=[y[t],n[t]];else t=n[f.status],f.then(t,t)}return this},u.url=((n||u.url)+"").replace(dr,"").replace(gr,s[1]+"//"),u.dataTypes=i.trim(u.dataType||"*").toLowerCase().split(kt),u.crossDomain==null&&(l=bt.exec(u.url.toLowerCase()),u.crossDomain=!(!l||l[1]==s[1]&&l[2]==s[2]&&(l[3]||(l[1]==="http:"?80:443))==(s[3]||(s[1]==="http:"?80:443)))),u.data&&u.processData&&typeof u.data!="string"&&(u.data=i.param(u.data,u.traditional)),nt(rt,u,r,f),e===2)return!1;v=u.global,u.type=u.type.toUpperCase(),u.hasContent=!br.test(u.type),v&&i.active++==0&&i.event.trigger("ajaxStart"),u.hasContent||(u.data&&(u.url+=(ti.test(u.url)?"&":"?")+u.data,delete u.data),o=u.url,u.cache===!1&&(k=i.now(),d=u.url.replace(nu,"$1_="+k),u.url=d+(d===u.url?(ti.test(u.url)?"&":"?")+"_="+k:""))),(u.data&&u.hasContent&&u.contentType!==!1||r.contentType)&&f.setRequestHeader("Content-Type",u.contentType),u.ifModified&&(o=o||u.url,i.lastModified[o]&&f.setRequestHeader("If-Modified-Since",i.lastModified[o]),i.etag[o]&&f.setRequestHeader("If-None-Match",i.etag[o])),f.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+(u.dataTypes[0]!=="*"?", "+ii+"; q=0.01":""):u.accepts["*"]);for(a in u.headers)f.setRequestHeader(a,u.headers[a]);if(u.beforeSend&&(u.beforeSend.call(h,f,u)===!1||e===2))return f.abort(),!1;for(a in{success:1,error:1,complete:1})f[a](u[a]);if(c=nt(yt,u,r,f),c){f.readyState=1,v&&it.trigger("ajaxSend",[f,u]),u.async&&u.timeout>0&&(tt=setTimeout(function(){f.abort("timeout")},u.timeout));try{e=1,c.send(et,w)}catch(ot){if(e<2)w(-1,ot);else throw ot;}}else w(-1,"No Transport");return f},param:function(n,r){var u=[],e=function(n,t){t=i.isFunction(t)?t():t,u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)},f;if(r===t&&(r=i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){e(this.name,this.value)});else for(f in n)ct(f,n[f],r,e);return u.join("&").replace(fu,"+")}}),i.extend({active:0,lastModified:{},etag:{}}),cr=i.now(),y=/(\=)\?(&|$)|\?\?/i,i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return i.expando+"_"+cr++}}),i.ajaxPrefilter("json jsonp",function(t,r,u){var h=t.contentType==="application/x-www-form-urlencoded"&&typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(y.test(t.url)||h&&y.test(t.data))){var o,f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,c=n[f],e=t.url,s=t.data,l="$1"+f+"$2";return t.jsonp!==!1&&(e=e.replace(y,l),t.url===e&&(h&&(s=s.replace(y,l)),t.data===s&&(e+=(/\?/.test(e)?"&":"?")+t.jsonp+"="+f))),t.url=e,t.data=s,n[f]=function(n){o=[n]},u.always(function(){n[f]=c,o&&i.isFunction(c)&&n[f](o[0])}),t.converters["script json"]=function(){return o||i.error(f+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(n){return i.globalEval(n),n}}}),i.ajaxPrefilter("script",function(n){n.cache===t&&(n.cache=!1),n.crossDomain&&(n.type="GET",n.global=!1)}),i.ajaxTransport("script",function(n){if(n.crossDomain){var i,u=r.head||r.getElementsByTagName("head")[0]||r.documentElement;return{send:function(f,e){i=r.createElement("script"),i.async="async",n.scriptCharset&&(i.charset=n.scriptCharset),i.src=n.url,i.onload=i.onreadystatechange=function(n,r){(r||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,u&&i.parentNode&&u.removeChild(i),i=t,r||e(200,"success"))},u.insertBefore(i,u.firstChild)},abort:function(){i&&i.onload(0,1)}}}}),p=n.ActiveXObject?function(){for(var n in h)h[n](0,1)}:!1,vr=0,i.ajaxSettings.xhr=n.ActiveXObject?function(){return!this.isLocal&&gi()||uf()}:gi,function(n){i.extend(i.support,{ajax:!!n,cors:!!n&&"withCredentials"in n})}(i.ajaxSettings.xhr()),i.support.ajax&&i.ajaxTransport(function(r){if(!r.crossDomain||i.support.cors){var u;return{send:function(f,e){var o=r.xhr(),c,s;if(r.username?o.open(r.type,r.url,r.async,r.username,r.password):o.open(r.type,r.url,r.async),r.xhrFields)for(s in r.xhrFields)o[s]=r.xhrFields[s];r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType),!r.crossDomain&&!f["X-Requested-With"]&&(f["X-Requested-With"]="XMLHttpRequest");try{for(s in f)o.setRequestHeader(s,f[s])}catch(l){}o.send(r.hasContent&&r.data||null),u=function(n,f){var s,v,y,l,a;try{if(u&&(f||o.readyState===4))if(u=t,c&&(o.onreadystatechange=i.noop,p&&delete h[c]),f)o.readyState!==4&&o.abort();else{s=o.status,y=o.getAllResponseHeaders(),l={},a=o.responseXML,a&&a.documentElement&&(l.xml=a),l.text=o.responseText;try{v=o.statusText}catch(w){v=""}!s&&r.isLocal&&!r.crossDomain?s=l.text?200:404:s===1223&&(s=204)}}catch(b){f||e(-1,b)}l&&e(s,v,l,y)},!r.async||o.readyState===4?u():(c=++vr,p&&(h||(h={},i(n).unload(p)),h[c]=u),o.onreadystatechange=u)},abort:function(){u&&u(0,1)}}}});var ft={},f,l,uu=/^(?:toggle|show|hide)$/,tu=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,d,di=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],k;i.fn.extend({show:function(n,t,r){var u,e,f,o;if(n||n===0)return this.animate(v("show",3),n,t,r);for(f=0,o=this.length;f=t.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),t.animatedProperties[this.prop]=!0;for(r in t.animatedProperties)t.animatedProperties[r]!==!0&&(s=!1);if(s){if(t.overflow!=null&&!i.support.shrinkWrapBlocks&&i.each(["","X","Y"],function(n,i){u.style["overflow"+i]=t.overflow[n]}),t.hide&&i(u).hide(),t.hide||t.show)for(r in t.animatedProperties)i.style(u,r,t.orig[r]),i.removeData(u,"fxshow"+r,!0),i.removeData(u,"toggle"+r,!0);e=t.complete,e&&(t.complete=!1,e.call(u))}return!1}return t.duration==Infinity?this.now=o:(f=o-this.startTime,this.state=f/t.duration,this.pos=i.easing[t.animatedProperties[this.prop]](this.state,f,0,1,t.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},i.extend(i.fx,{tick:function(){for(var r,n=i.timers,t=0;t-1,u={},s={},h,c;v?(s=e.position(),h=s.top,c=s.left):(h=parseFloat(l)||0,c=parseFloat(a)||0),i.isFunction(t)&&(t=t.call(n,r,o)),t.top!=null&&(u.top=t.top-o.top+h),t.left!=null&&(u.left=t.left-o.left+c),"using"in t?t.using.call(n,u):e.css(u)}},i.fn.extend({position:function(){if(!this[0])return null;var u=this[0],n=this.offsetParent(),t=this.offset(),r=ut.test(n[0].nodeName)?{top:0,left:0}:n.offset();return t.top-=parseFloat(i.css(u,"marginTop"))||0,t.left-=parseFloat(i.css(u,"marginLeft"))||0,r.top+=parseFloat(i.css(n[0],"borderTopWidth"))||0,r.left+=parseFloat(i.css(n[0],"borderLeftWidth"))||0,{top:t.top-r.top,left:t.left-r.left}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||r.body;n&&!ut.test(n.nodeName)&&i.css(n,"position")==="static";)n=n.offsetParent;return n})}}),i.each(["Left","Top"],function(n,r){var u="scroll"+r;i.fn[u]=function(r){var e,f;return r===t?(e=this[0],!e)?null:(f=et(e),f?"pageXOffset"in f?f[n?"pageYOffset":"pageXOffset"]:i.support.boxModel&&f.document.documentElement[u]||f.document.body[u]:e[u]):this.each(function(){f=et(this),f?f.scrollTo(n?i(f).scrollLeft():r,n?r:i(f).scrollTop()):this[u]=r})}}),i.each(["Height","Width"],function(n,r){var u=r.toLowerCase();i.fn["inner"+r]=function(){var n=this[0];return n?n.style?parseFloat(i.css(n,u,"padding")):this[u]():null},i.fn["outer"+r]=function(n){var t=this[0];return t?t.style?parseFloat(i.css(t,u,n?"margin":"border")):this[u]():null},i.fn[u]=function(n){var f=this[0],e,o,s,h;return f?i.isFunction(n)?this.each(function(t){var r=i(this);r[u](n.call(this,t,r[u]()))}):i.isWindow(f)?(e=f.document.documentElement["client"+r],o=f.document.body,f.document.compatMode==="CSS1Compat"&&e||o&&o["client"+r]||e):f.nodeType===9?Math.max(f.documentElement["client"+r],f.body["scroll"+r],f.documentElement["scroll"+r],f.body["offset"+r],f.documentElement["offset"+r]):n===t?(s=i.css(f,u),h=parseFloat(s),i.isNumeric(h)?h:s):this.css(u,typeof n=="string"?n:n+"px"):n==null?null:this}}),n.jQuery=n.$=i,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return i})})(window),function(n){function i(n,t){for(var i=window,r=(n||"").split(".");i&&r.length;)i=i[r.shift()];return typeof i=="function"?i:(t.push(n),Function.constructor.apply(null,t))}function r(n){return n==="GET"||n==="POST"}function e(n,t){!r(t)&&n.setRequestHeader("X-HTTP-Method-Override",t)}function o(t,i,r){var u;r.indexOf("application/x-javascript")===-1&&(u=(t.getAttribute("data-ajax-mode")||"").toUpperCase(),n(t.getAttribute("data-ajax-update")).each(function(t,r){var f;switch(u){case"BEFORE":f=r.firstChild,n("
").html(i).contents().each(function(){r.insertBefore(this,f)});break;case"AFTER":n("
").html(i).contents().each(function(){r.appendChild(this)});break;default:n(r).html(i)}}))}function u(t,u){var s,h,f,c;(s=t.getAttribute("data-ajax-confirm"),!s||window.confirm(s))&&(h=n(t.getAttribute("data-ajax-loading")),c=t.getAttribute("data-ajax-loading-duration")||0,n.extend(u,{type:t.getAttribute("data-ajax-method")||undefined,url:t.getAttribute("data-ajax-url")||undefined,beforeSend:function(n){var r;return e(n,f),r=i(t.getAttribute("data-ajax-begin"),["xhr"]).apply(this,arguments),r!==!1&&h.show(c),r},complete:function(){h.hide(c),i(t.getAttribute("data-ajax-complete"),["xhr","status"]).apply(this,arguments)},success:function(n,r,u){o(t,n,u.getResponseHeader("Content-Type")||"text/html"),i(t.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(this,arguments)},error:i(t.getAttribute("data-ajax-failure"),["xhr","status","error"])}),u.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),f=u.type.toUpperCase(),r(f)||(u.type="POST",u.data.push({name:"X-HTTP-Method-Override",value:f})),n.ajax(u))}function s(t){var i=n(t).data(f);return!i||!i.validate||i.validate()}var t="unobtrusiveAjaxClick",f="unobtrusiveValidation";n("a[data-ajax=true]").live("click",function(n){n.preventDefault(),u(this,{url:this.href,type:"GET",data:[]})}),n("form[data-ajax=true] input[type=image]").live("click",function(i){var r=i.target.name,u=n(i.target),f=u.parents("form")[0],e=u.offset();n(f).data(t,[{name:r+".x",value:Math.round(i.pageX-e.left)},{name:r+".y",value:Math.round(i.pageY-e.top)}]),setTimeout(function(){n(f).removeData(t)},0)}),n("form[data-ajax=true] :submit").live("click",function(i){var r=i.target.name,u=n(i.target).parents("form")[0];n(u).data(t,r?[{name:r,value:i.target.value}]:[]),setTimeout(function(){n(u).removeData(t)},0)}),n("form[data-ajax=true]").live("submit",function(i){var r=n(this).data(t)||[];(i.preventDefault(),s(this))&&u(this,{url:this.action,type:this.method||"GET",data:r.concat(n(this).serializeArray())})})}(jQuery),function(n){n.extend(n.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.");return}var i=n.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new n.validator(t,this[0]),n.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){i.settings.submitHandler&&(i.submitButton=t.target),n(t.target).hasClass("cancel")&&(i.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return i.settings.submitHandler?(i.submitButton&&(r=n("").attr("name",i.submitButton.name).val(i.submitButton.value).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,t),i.submitButton&&r.remove(),!1):!0}return i.settings.debug&&t.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,r()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):r():(i.focusInvalid(),!1)})),i)},valid:function(){if(n(this[0]).is("form"))return this.validate().form();var t=!0,i=n(this[0].form).validate();return this.each(function(){t&=i.element(this)}),t},removeAttrs:function(t){var i={},r=this;return n.each(t.split(/\s/),function(n,t){i[t]=r.attr(t),r.removeAttr(t)}),i},rules:function(t,i){var r=this[0],o,u,h;if(t){var e=n.data(r.form,"validator").settings,s=e.rules,f=n.validator.staticRules(r);switch(t){case"add":n.extend(f,n.validator.normalizeRule(i)),s[r.name]=f,i.messages&&(e.messages[r.name]=n.extend(e.messages[r.name],i.messages));break;case"remove":return i?(o={},n.each(i.split(/\s/),function(n,t){o[t]=f[t],delete f[t]}),o):(delete s[r.name],f)}}return u=n.validator.normalizeRules(n.extend({},n.validator.classRules(r),n.validator.attributeRules(r),n.validator.dataRules(r),n.validator.staticRules(r)),r),u.required&&(h=u.required,delete u.required,u=n.extend({required:h},u)),u}}),n.extend(n.expr[":"],{blank:function(t){return!n.trim(""+t.value)},filled:function(t){return!!n.trim(""+t.value)},unchecked:function(n){return!n.checked}}),n.validator=function(t,i){this.settings=n.extend(!0,{},n.validator.defaults,t),this.currentForm=i,this.init()},n.validator.format=function(t,i){return arguments.length===1?function(){var i=n.makeArray(arguments);return i.unshift(t),n.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=n.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),n.each(i,function(n,i){t=t.replace(new RegExp("\\{"+n+"\\}","g"),function(){return i})}),t)},n.extend(n.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:n([]),errorLabelContainer:n([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(n){this.lastActive=n,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,n,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(n)).hide())},onfocusout:function(n){!this.checkable(n)&&(n.name in this.submitted||!this.optional(n))&&this.element(n)},onkeyup:function(n,t){(t.which!==9||this.elementValue(n)!=="")&&(n.name in this.submitted||n===this.lastElement)&&this.element(n)},onclick:function(n){n.name in this.submitted?this.element(n):n.parentNode.name in this.submitted&&this.element(n.parentNode)},highlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).addClass(i).removeClass(r):n(t).addClass(i).removeClass(r)},unhighlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).removeClass(i).addClass(r):n(t).removeClass(i).addClass(r)}},setDefaults:function(t){n.extend(n.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:n.validator.format("Please enter no more than {0} characters."),minlength:n.validator.format("Please enter at least {0} characters."),rangelength:n.validator.format("Please enter a value between {0} and {1} characters long."),range:n.validator.format("Please enter a value between {0} and {1}."),max:n.validator.format("Please enter a value less than or equal to {0}."),min:n.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var i=n.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");i.settings[r]&&i.settings[r].call(i,this[0],t)}var i,t;this.labelContainer=n(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||n(this.currentForm),this.containers=n(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset(),i=this.groups={},n.each(this.settings.groups,function(t,r){typeof r=="string"&&(r=r.split(/\s/)),n.each(r,function(n,r){i[r]=t})}),t=this.settings.rules,n.each(t,function(i,r){t[i]=n.validator.normalizeRule(r)}),n(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",r).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",r),this.settings.invalidHandler&&n(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),n.extend(this.submitted,this.errorMap),this.invalid=n.extend({},this.errorMap),this.valid()||n(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var n=0,t=this.currentElements=this.elements();t[n];n++)this.check(t[n]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t)),this.lastElement=t,this.prepareElement(t),this.currentElements=n(t);var i=this.check(t)!==!1;return i?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(t){if(t){n.extend(this.errorMap,t),this.errorList=[];for(var i in t)this.errorList.push({message:t[i],element:this.findByName(i)[0]});this.successList=n.grep(this.successList,function(n){return!(n.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){n.fn.resetForm&&n(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(n){var t=0,i;for(i in n)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{n(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&n.grep(this.errorList,function(n){return n.element.name===t.name}).length===1&&t},elements:function(){var t=this,i={};return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!t.objectLength(n(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(t){return n(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return n(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=n([]),this.toHide=n([]),this.currentElements=n([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(n){this.reset(),this.toHide=this.errorsFor(n)},elementValue:function(t){var r=n(t).attr("type"),i=n(t).val();return r==="radio"||r==="checkbox"?n("input[name='"+n(t).attr("name")+"']:checked").val():typeof i=="string"?i.replace(/\r/g,""):i},check:function(t){var r,u;t=this.validationTargetFor(this.clean(t));var f=n(t).rules(),e=!1,o=this.elementValue(t),i;for(r in f){u={method:r,parameters:f[r]};try{if(i=n.validator.methods[r].call(this,o,t,u.parameters),i==="dependency-mismatch"){e=!0;continue}if(e=!1,i==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!i)return this.formatAndAdd(t,u),!1}catch(s){throw this.settings.debug&&window.console&&console.log("Exception occured when checking element "+t.id+", check the '"+u.method+"' method.",s),s;}}if(!e)return this.objectLength(f)&&this.successList.push(t),!0},customDataMessage:function(t,i){return n(t).data("msg-"+i.toLowerCase())||t.attributes&&n(t).attr("data-msg-"+i.toLowerCase())},customMessage:function(n,t){var i=this.settings.messages[n];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var n=0;nWarning: No message defined for "+t.name+"")},formatAndAdd:function(t,i){var r=this.defaultMessage(t,i.method),u=/\$?\{(\d+)\}/g;typeof r=="function"?r=r.call(this,i.parameters,t):u.test(r)&&(r=n.validator.format(r.replace(u,"{$1}"),i.parameters)),this.errorList.push({message:r,element:t}),this.errorMap[t.name]=r,this.submitted[t.name]=r},addWrapper:function(n){return this.settings.wrapper&&(n=n.add(n.parent(this.settings.wrapper))),n},defaultShowErrors:function(){for(var i,t,n=0;this.errorList[n];n++)t=this.errorList[n],this.settings.highlight&&this.settings.highlight.call(this,t.element,this.settings.errorClass,this.settings.validClass),this.showLabel(t.element,t.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(n=0;this.successList[n];n++)this.showLabel(this.successList[n]);if(this.settings.unhighlight)for(n=0,i=this.validElements();i[n];n++)this.settings.unhighlight.call(this,i[n],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return n(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.html(i)):(r=n("<"+this.settings.errorElement+">").attr("for",this.idOrName(t)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,n(t)):r.insertAfter(t))),!i&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t)),this.toShow=this.toShow.add(r)},errorsFor:function(t){var i=this.idOrName(t);return this.errors().filter(function(){return n(this).attr("for")===i})},idOrName:function(n){return this.groups[n.name]||(this.checkable(n)?n.name:n.id||n.name)},validationTargetFor:function(n){return this.checkable(n)&&(n=this.findByName(n.name).not(this.settings.ignore)[0]),n},checkable:function(n){return/radio|checkbox/i.test(n.type)},findByName:function(t){return n(this.currentForm).find("[name='"+t+"']")},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return n("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(n,t){return this.dependTypes[typeof n]?this.dependTypes[typeof n](n,t):!0},dependTypes:{boolean:function(n){return n},string:function(t,i){return!!n(t,i.form).length},"function":function(n,t){return n(t)}},optional:function(t){var i=this.elementValue(t);return!n.validator.methods.required.call(this,i,t)&&"dependency-mismatch"},startRequest:function(n){this.pending[n.name]||(this.pendingRequest++,this.pending[n.name]=!0)},stopRequest:function(t,i){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],i&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(n(this.currentForm).submit(),this.formSubmitted=!1):!i&&this.pendingRequest===0&&this.formSubmitted&&(n(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return n.data(t,"previousValue")||n.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,i){t.constructor===String?this.classRuleSettings[t]=i:n.extend(this.classRuleSettings,t)},classRules:function(t){var i={},r=n(t).attr("class");return r&&n.each(r.split(" "),function(){this in n.validator.classRuleSettings&&n.extend(i,n.validator.classRuleSettings[this])}),i},attributeRules:function(t){var u={},f=n(t),r,i;for(r in n.validator.methods)r==="required"?(i=f.get(0).getAttribute(r),i===""&&(i=!0),i=!!i):i=f.attr(r),i?u[r]=i:f[0].getAttribute("type")===r&&(u[r]=!0);return u.maxlength&&/-1|2147483647|524288/.test(u.maxlength)&&delete u.maxlength,u},dataRules:function(t){var i,r,u={},f=n(t);for(i in n.validator.methods)r=f.data("rule-"+i.toLowerCase()),r!==undefined&&(u[i]=r);return u},staticRules:function(t){var i={},r=n.data(t.form,"validator");return r.settings.rules&&(i=n.validator.normalizeRule(r.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return n.each(t,function(r,u){if(u===!1){delete t[r];return}if(u.param||u.depends){var f=!0;switch(typeof u.depends){case"string":f=!!n(u.depends,i.form).length;break;case"function":f=u.depends.call(i,i)}f?t[r]=u.param!==undefined?u.param:!0:delete t[r]}}),n.each(t,function(r,u){t[r]=n.isFunction(u)?u(i):u}),n.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),n.each(["rangelength"],function(){var i;t[this]&&(n.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:typeof t[this]=="string"&&(i=t[this].split(/[\s,]+/),t[this]=[Number(i[0]),Number(i[1])]))}),n.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if(typeof t=="string"){var i={};n.each(t.split(/\s/),function(){i[this]=!0}),t=i}return t},addMethod:function(t,i,r){n.validator.methods[t]=i,n.validator.messages[t]=r!==undefined?r:n.validator.messages[t],i.length<3&&n.validator.addClassRules(t,n.validator.normalizeRule(t))},methods:{required:function(t,i,r){if(!this.depend(r,i))return"dependency-mismatch";if(i.nodeName.toLowerCase()==="select"){var u=n(i).val();return u&&u.length>0}return this.checkable(i)?this.getLength(t,i)>0:n.trim(t).length>0},remote:function(t,i,r){var f,u,e;return this.optional(i)?"dependency-mismatch":(f=this.previousValue(i),this.settings.messages[i.name]||(this.settings.messages[i.name]={}),f.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=f.message,r=typeof r=="string"&&{url:r}||r,f.old===t)?f.valid:(f.old=t,u=this,this.startRequest(i),e={},e[i.name]=t,n.ajax(n.extend(!0,{url:r,mode:"abort",port:"validate"+i.name,dataType:"json",data:e,success:function(r){var e,h,s,o;u.settings.messages[i.name].remote=f.originalMessage,e=r===!0||r==="true",e?(h=u.formSubmitted,u.prepareElement(i),u.formSubmitted=h,u.successList.push(i),delete u.invalid[i.name],u.showErrors()):(s={},o=r||u.defaultMessage(i,"remote"),s[i.name]=f.message=n.isFunction(o)?o(t):o,u.invalid[i.name]=!0,u.showErrors(s)),f.valid=e,u.stopRequest(i,e)}},r)),"pending")},minlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u>=r},maxlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u<=r},rangelength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u>=r[0]&&u<=r[1]},min:function(n,t,i){return this.optional(t)||n>=i},max:function(n,t,i){return this.optional(t)||n<=i},range:function(n,t,i){return this.optional(t)||n>=i[0]&&n<=i[1]},email:function(n,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n)},url:function(n,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)},date:function(n,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(n).toString())},dateISO:function(n,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(n)},number:function(n,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)},digits:function(n,t){return this.optional(t)||/^\d+$/.test(n)},creditcard:function(n,t){var r,e;if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(n))return!1;var f=0,i=0,u=!1;for(n=n.replace(/\D/g,""),r=n.length-1;r>=0;r--)e=n.charAt(r),i=parseInt(e,10),u&&(i*=2)>9&&(i-=9),f+=i,u=!u;return f%10==0},equalTo:function(t,i,r){var u=n(r);return this.settings.onfocusout&&u.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){n(i).valid()}),t===u.val()}}}),n.format=n.validator.format}(jQuery),function(n){var t={},i;n.ajaxPrefilter?n.ajaxPrefilter(function(n,i,r){var u=n.port;n.mode==="abort"&&(t[u]&&t[u].abort(),t[u]=r)}):(i=n.ajax,n.ajax=function(r){var f=("mode"in r?r:n.ajaxSettings).mode,u=("port"in r?r:n.ajaxSettings).port;return f==="abort"?(t[u]&&t[u].abort(),t[u]=i.apply(this,arguments)):i.apply(this,arguments)})}(jQuery),function(n){n.extend(n.fn,{validateDelegate:function(t,i,r){return this.bind(i,function(i){var u=n(i.target);if(u.is(t))return r.apply(u,arguments)})}})}(jQuery),function(n){function i(n,t,i){n.rules[t]=i,n.message&&(n.messages[t]=n.message)}function s(n){return n.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(n){return n.substr(0,n.lastIndexOf(".")+1)}function e(n,t){return n.indexOf("*.")===0&&(n=n.replace("*.",t)),n}function h(t,i){var r=n(this).find("[data-valmsg-for='"+i[0].name+"']"),u=n.parseJSON(r.attr("data-valmsg-replace"))!==!1;r.removeClass("field-validation-valid").addClass("field-validation-error"),t.data("unobtrusiveContainer",r),u?(r.empty(),t.removeClass("input-validation-error").appendTo(r)):t.hide()}function c(t,i){var u=n(this).find("[data-valmsg-summary=true]"),r=u.find("ul");r&&r.length&&i.errorList.length&&(r.empty(),u.addClass("validation-summary-errors").removeClass("validation-summary-valid"),n.each(i.errorList,function(){n("
  • ").html(this.message).appendTo(r)}))}function l(t){var i=t.data("unobtrusiveContainer"),r=n.parseJSON(i.attr("data-valmsg-replace"));i&&(i.addClass("field-validation-valid").removeClass("field-validation-error"),t.removeData("unobtrusiveContainer"),r&&i.empty())}function o(t){var i=n(t),r=i.data(u);return r||(r={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:n.proxy(h,t),invalidHandler:n.proxy(c,t),messages:{},rules:{},success:n.proxy(l,t)},attachValidation:function(){i.validate(this.options)},validate:function(){return i.validate(),i.valid()}},i.data(u,r)),r}var r=n.validator,t,u="unobtrusiveValidation";r.unobtrusive={adapters:[],parseElement:function(t,i){var u=n(t),f=u.parents("form")[0],r,e,s;f&&(r=o(f),r.options.rules[t.name]=e={},r.options.messages[t.name]=s={},n.each(this.adapters,function(){var i="data-val-"+this.name,r=u.attr(i),o={};r!==undefined&&(i+="-",n.each(this.params,function(){o[this]=u.attr(i+this)}),this.adapt({element:t,form:f,message:r,params:o,rules:e,messages:s}))}),jQuery.extend(e,{__dummy__:!0}),!i&&r.attachValidation())},parse:function(t){n(t).find(":input[data-val=true]").each(function(){r.unobtrusive.parseElement(this,!0)}),n("form").each(function(){var n=o(this);n&&n.attachValidation()})}},t=r.unobtrusive.adapters,t.add=function(n,t,i){return i||(i=t,t=[]),this.push({name:n,params:t,adapt:i}),this},t.addBool=function(n,t){return this.add(n,function(r){i(r,t||n,!0)})},t.addMinMax=function(n,t,r,u,f,e){return this.add(n,[f||"min",e||"max"],function(n){var f=n.params.min,e=n.params.max;f&&e?i(n,u,[f,e]):f?i(n,t,f):e&&i(n,r,e)})},t.addSingleVal=function(n,t,r){return this.add(n,[t||"val"],function(u){i(u,r||n,u.params[t])})},r.addMethod("__dummy__",function(){return!0}),r.addMethod("regex",function(n,t,i){var r;return this.optional(t)?!0:(r=new RegExp(i).exec(n),r&&r.index===0&&r[0].length===n.length)}),t.addSingleVal("accept","exts").addSingleVal("regex","pattern"),t.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),t.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),t.add("equalto",["other"],function(t){var r=f(t.element.name),u=t.params.other,o=e(u,r),s=n(t.form).find(":input[name="+o+"]")[0];i(t,"equalTo",s)}),t.add("required",function(n){(n.element.tagName.toUpperCase()!=="INPUT"||n.element.type.toUpperCase()!=="CHECKBOX")&&i(n,"required",!0)}),t.add("remote",["url","type","additionalfields"],function(t){var r={url:t.params.url,type:t.params.type||"GET",data:{}},u=f(t.element.name);n.each(s(t.params.additionalfields||t.element.name),function(i,f){var o=e(f,u);r.data[o]=function(){return n(t.form).find(":input[name='"+o+"']").val()}}),i(t,"remote",r)}),n(function(){r.unobtrusive.parse(document)})}(jQuery),q=null,window.PR_SHOULD_USE_CONTINUATION=!0,function(){function d(n){function u(n){var i=n.charCodeAt(0),t;return i!==92?i:(t=n.charAt(1),(i=a[t])?i:"0"<=t&&t<="7"?parseInt(n.substring(1),8):t==="u"||t==="x"?parseInt(n.substring(2),16):n.charCodeAt(1))}function f(n){return n<32?(n<16?"\\x0":"\\x")+n.toString(16):(n=String.fromCharCode(n),(n==="\\"||n==="-"||n==="["||n==="]")&&(n="\\"+n),n)}function h(n){for(var t,s,o=n.substring(1,n.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),n=[],i=[],h=o[0]==="^",r=h?1:0,e=o.length;r122||(s<65||t>90||i.push([Math.max(65,t)|32,Math.min(s,90)|32]),s<97||t>122||i.push([Math.max(97,t)&-33,Math.min(s,122)&-33])));for(i.sort(function(n,t){return n[0]-t[0]||t[1]-n[1]}),o=[],t=[NaN,NaN],r=0;re[0]&&(e[1]+1>e[0]&&i.push("-"),i.push(f(e[1])));return i.push("]"),i.join("")}function c(n){for(var i,r=n.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),o=r.length,f=[],t=0,u=0;t=2&&n==="["?r[t]=h(i):n!=="\\"&&(r[t]=i.replace(/[A-Za-z]/g,function(n){return n=n.charCodeAt(0),"["+String.fromCharCode(n&-33,n|32)+"]"}));return r.join("")}for(var t,l=0,e=!1,r=!1,i=0,o=n.length;i=5&&"lang-"===h.substring(0,5))&&!(a&&typeof a[1]=="string")&&(s=!1,h="src"),s||(g[l]=h)}c=k,k+=l.length,s?(s=a[1],p=l.indexOf(s),w=p+s.length,a[2]&&(w=l.length-a[2].length,p=w-s.length),h=h.substring(5),e(v+c,l.substring(0,p),i,y),e(v+c+p,s,o(h,s),y),e(v+c+w,l.substring(w),i,y)):y.push(v+c,h)}n.e=y}var r={},u,f;return function(){for(var i,f,s,h=n.concat(t),e=[],c={},o=0,l=h.length;o=0;)r[f.charAt(s)]=i;i=i[1],f=""+i,c.hasOwnProperty(f)||(e.push(i),c[f]=q)}e.push(/[\S\s]/),u=d(e)}(),f=t.length,i}function t(n){var i=[],t=[],u;return n.tripleQuotedStrings?i.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):n.multiLineStrings?i.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,q,"'\"`"]):i.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]),n.verbatimStrings&&t.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]),u=n.hashComments,u&&(n.cStyleComments?(u>1?i.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):i.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),t.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):i.push(["com",/^#[^\n\r]*/,q,"#"])),n.cStyleComments&&(t.push(["com",/^\/\/[^\n\r]*/,q]),t.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q])),n.regexLiterals&&t.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]),(u=n.types)&&t.push(["typ",u]),n=(""+n.keywords).replace(/^ | $/g,""),n.length&&t.push(["kwd",RegExp("^(?:"+n.replace(/[\s,]+/g,"|")+")\\b"),q]),i.push(["pln",/^\s+/,q," \r\n\t "]),t.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]),r(i,t)}function p(n,t){function o(n){var t,i,r;switch(n.nodeType){case 1:if(c.test(n.className))break;if("BR"===n.nodeName)s(n),n.parentNode&&n.parentNode.removeChild(n);else for(n=n.firstChild;n;n=n.nextSibling)o(n);break;case 3:case 4:h&&(t=n.nodeValue,i=t.match(l),i&&(r=t.substring(0,i.index),n.nodeValue=r,(t=t.substring(i.index+i[0].length))&&n.parentNode.insertBefore(f.createTextNode(t),n.nextSibling),s(n),r||n.parentNode.removeChild(n)))}}function s(n){function i(n,t){var e=t?n.cloneNode(!1):n,r=n.parentNode,f,u;if(r)for(r=i(r,1),f=n.nextSibling,r.appendChild(e),u=f;u;u=f)f=u.nextSibling,r.appendChild(u);return e}for(;!n.nextSibling;)if(n=n.parentNode,!n)return;for(var n=i(n.nextSibling,0),t;(t=n.parentNode)&&t.nodeType===1;)n=t;u.push(n)}var c=/(?:^|\s)nocode(?:\s|$)/,l=/\r\n?|\n/,f=n.ownerDocument,i,h,u,r,e;for(n.currentStyle?i=n.currentStyle.whiteSpace:window.getComputedStyle&&(i=f.defaultView.getComputedStyle(n,q).getPropertyValue("white-space")),h=i&&"pre"===i.substring(0,3),i=f.createElement("LI");n.firstChild;)i.appendChild(n.firstChild);for(u=[i],r=0;r=0;)i=t[r],f.hasOwnProperty(i)?window.console&&console.warn("cannot override language handler %s",i):f[i]=n}function o(n,t){return n&&f.hasOwnProperty(n)||(n=/^\s*=v&&(f+=2),e>=nt&&(n+=2)}}catch(ut){"console"in window&&console.log(ut&&ut.stack?ut.stack:ut)}}var i=["break,continue,do,else,for,if,return,while"],u=[[i,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[u,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],c=[u,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],l=[c,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],u=[u,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],a=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],v=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],i=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],y=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,k=/\S/,w=t({keywords:[h,l,u,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+a,v,i],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),f={};n(w,["default-code"]),n(r([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),n(r([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]),n(r([],[["atv",/^[\S\s]+/]]),["uq.val"]),n(t({keywords:h,hashComments:!0,cStyleComments:!0,types:y}),["c","cc","cpp","cxx","cyc","m"]),n(t({keywords:"null,true,false"}),["json"]),n(t({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:y}),["cs"]),n(t({keywords:c,cStyleComments:!0}),["java"]),n(t({keywords:i,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]),n(t({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]),n(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]),n(t({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]),n(t({keywords:u,cStyleComments:!0,regexLiterals:!0}),["js"]),n(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),n(r([],[["str",/^[\S\s]+/]]),["regex"]),window.prettyPrintOne=function(n,t,i){var r=document.createElement("PRE");return r.innerHTML=n,i&&p(r,i),s({g:t,i:i,h:r}),r.innerHTML},window.prettyPrint=function(n){function h(){for(var c,e,v,r,a,y,f,w=window.PR_SHOULD_USE_CONTINUATION?t.now()+250:Infinity;i=0){if(e=e.match(o),r=!e){for(r=c,f=void 0,a=r.firstChild;a;a=a.nextSibling)y=a.nodeType,f=y===1?f?r:a:y===3?k.test(a.nodeValue)?r:f:f;r=(v=f===r?void 0:f)&&"CODE"===v.tagName}for(r&&(e=v.className.match(o)),e&&(e=e[1]),r=!1,f=c.parentNode;f;f=f.parentNode)if((f.tagName==="pre"||f.tagName==="code"||f.tagName==="xmp")&&f.className&&f.className.indexOf("prettyprint")>=0){r=!0;break}r||((r=(r=c.className.match(/\blinenums\b(?::(\d+))?/))?r[1]&&r[1].length?+r[1]:!0:!1)&&p(c,r),l={g:e,h:c,i:r},s(l))}i)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]),PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]),PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]),Markdown=typeof exports=="object"&&typeof require=="function"?exports:{},function(){function i(n){return n}function r(){return!1}function n(){}function t(){}n.prototype={chain:function(n,t){var r=this[n];if(!r)throw new Error("unknown hook "+n);this[n]=r===i?t:function(n){return t(r(n))}},set:function(n,t){if(!this[n])throw new Error("unknown hook "+n);this[n]=t},addNoop:function(n){this[n]=i},addFalse:function(n){this[n]=r}},Markdown.HookCollection=n,t.prototype={set:function(n,t){this["s_"+n]=t},get:function(n){return this["s_"+n]}},Markdown.Converter=function(){function bt(n){return n.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(n,t,u,f,e,o){return(t=t.toLowerCase(),i.set(t,y(u)),e)?f:(o&&r.set(t,o.replace(/"/g,""")),"")})}function nt(n){return n=n.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,e),n=n.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,e),n=n.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,e),n=n.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,e),n.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,e)}function e(n,t){var i=t;return i=i.replace(/^\n+/,""),i=i.replace(/\n+$/g,""),"\n\n~K"+(s.push(i)-1)+"K\n\n"}function l(n,t){n=at(n);var i="
    \n";return n=n.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,i),n=n.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,i),n=n.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,i),n=b(n),n=lt(n),n=ut(n),n=nt(n),ot(n,t)}function o(n){return n=ht(n),n=pt(n),n=et(n),n=vt(n),n=yt(n),n=ft(n),n=y(n),n=st(n),tt.autoNewLine?n.replace(/\n/g,"
    \n"):n.replace(/ +\n/g,"
    \n")}function pt(n){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return n.replace(t,function(n){var t=n.replace(/(.)<\/?code>(?=.)/g,"$1`");return u(t,n.charAt(1)=="!"?"\\`*_/":"\\`*_")})}function yt(n){return n=n.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,a),n=n.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,a),n.replace(/(\[([^\[\]]+)\])()()()()()/g,a)}function a(n,t,f,e,o,s,h,c){var y;c==undefined&&(c="");var p=t,w=f,a=e.toLowerCase(),l=o,v=c;if(l=="")if(a==""&&(a=w.toLowerCase().replace(/ ?\n/g," ")),l="#"+a,i.get(a)!=undefined)l=i.get(a),r.get(a)!=undefined&&(v=r.get(a));else if(p.search(/\(\s*\)$/m)>-1)l="";else return p;return l=rt(l),l=u(l,"*_"),y='"+w+"")}function vt(n){return n=n.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,g),n.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,g)}function g(n,t,f,e,o,s,h,c){var w=t,y=f,a=e.toLowerCase(),v=o,l=c,p;if(l||(l=""),v=="")if(a==""&&(a=y.toLowerCase().replace(/ ?\n/g," ")),v="#"+a,i.get(a)!=undefined)v=i.get(a),r.get(a)!=undefined&&(l=r.get(a));else return w;return y=y.replace(/"/g,"""),v=u(v,"*_"),p=''+y+'"}function at(n){return n=n.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(n,t){return"

    "+o(t)+"

    \n\n"}),n=n.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(n,t){return"

    "+o(t)+"

    \n\n"}),n.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(n,t,i){var r=t.length;return""+o(i)+"\n\n"})}function b(n){n+="~0";var t=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return h?n=n.replace(t,function(n,t,i){var f=t,r=i.search(/[*+-]/g)>-1?"ul":"ol",u=k(f,r);return u=u.replace(/\s+$/,""),"<"+r+">"+u+"\n"}):(t=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,n=n.replace(t,function(n,t,i,r){var f=t,e=i,u=r.search(/[*+-]/g)>-1?"ul":"ol",o=k(e,u);return f+"<"+u+">\n"+o+"\n"})),n.replace(/~0/,"")}function k(n,t){h++,n=n.replace(/\n{2,}$/,"\n")+"~0";var i=p[t],u=new RegExp("(^[ \\t]*)("+i+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+i+")[ \\t]+))","gm"),r=!1;return n=n.replace(u,function(n,t,i,u){var f=u,h=t,e=/\n\n$/.test(f),s=e||f.search(/\n{2,}/)>-1;return s||r?f=l(c(f),!0):(f=b(c(f)),f=f.replace(/\n$/,""),f=o(f)),r=e,"
  • "+f+"
  • \n"}),n=n.replace(/~0/g,""),h--,n}function lt(n){return n+="~0",n=n.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(n,t,i){var r=t,u=i;return r=w(c(r)),r=d(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
    "+r+"\n
    ","\n\n"+r+"\n\n"+u}),n.replace(/~0/,"")}function ct(n){return n=n.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(s.push(n)-1)+"K\n\n"}function ht(n){return n.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(n,t,i,r){var u=r;return u=u.replace(/^([ \t]*)/g,""),u=u.replace(/[ \t]*$/g,""),u=w(u),t+""+u+""})}function w(n){return n=n.replace(/&/g,"&"),n=n.replace(//g,">"),u(n,"*_{}[]\\",!1)}function st(n){return n=n.replace(/([^A-Za-z0-9]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2(?=[^A-Za-z0-9]|$)/g,"$1$3"),n.replace(/([^A-Za-z0-9]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2(?=[^A-Za-z0-9]|$)/g,"$1$3")}function ut(n){return n.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(n,t){var i=t;return i=i.replace(/^[ \t]*>[ \t]?/gm,"~0"),i=i.replace(/~0/g,""),i=i.replace(/^[ \t]+$/gm,""),i=l(i),i=i.replace(/(^|\n)/g,"$1 "),i=i.replace(/(\s*
    [^\r]+?<\/pre>)/gm,function(n,t){var i=t;return i=i.replace(/^  /mg,"~0"),i.replace(/~0/g,"")}),ct("
    \n"+i+"\n
    ")})}function ot(n,t){var i,r,f;n=n.replace(/^\n+/g,""),n=n.replace(/\n+$/g,"");var h=n.split(/\n{2,}/g),u=[],e=h.length;for(r=0;r=0?u.push(i):i.search(/\S/)>=0&&(i=o(i),i=i.replace(/^([ \t]*)/g,"

    "),i+="

    ",u.push(i));if(!t)for(e=u.length,r=0;r=0)f=s[RegExp.$1],f=f.replace(/\$/g,"$$$$"),u[r]=u[r].replace(/~K\d+K/,f);return u.join("\n\n")}function y(n){return n=n.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),n.replace(/<(?![a-z\/?\$!])/gi,"<")}function et(n){return n=n.replace(/\\(\\)/g,v),n.replace(/\\([`*_{}\[\]()>#+-.!])/g,v)}function ft(n){n=n.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi,"$1<$2$3>$4");var t=function(n,t){return''+f.plainLinkText(t)+""};return n.replace(/<((https?|ftp):[^'">\s]+)>/gi,t)}function wt(n){return n.replace(/~E(\d+)E/g,function(n,t){var i=parseInt(t);return String.fromCharCode(i)})}function c(n){return n=n.replace(/^(\t|[ ]{1,4})/gm,"~0"),n.replace(/~0/g,"")}function d(n){if(!/\t/.test(n))return n;var r=[" "," "," "," "],t=0,i;return n.replace(/[\n\t]/g,function(n,u){return n==="\n"?(t=u+1,n):(i=(u-t)%4,t=u+1,r[i])})}function rt(n){if(!n)return"";var t=n.length;return n.replace(it,function(i,r){return i=="~D"?"%24":i==":"&&(r==t-1||/[0-9\/]/.test(n.charAt(r+1)))?":":"%"+i.charCodeAt(0).toString(16)})}function u(n,t,i){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])",u;return i&&(r="\\\\"+r),u=new RegExp(r,"g"),n.replace(u,v)}function v(n,t){var i=t.charCodeAt(0);return"~E"+i+"E"}var f=this.hooks=new n,tt,i,r,s,h,p,it;f.addNoop("plainLinkText"),f.addNoop("preConversion"),f.addNoop("postConversion"),tt=this,this.autoNewLine=!1,this.makeHtml=function(n){if(i)throw new Error("Recursive call to converter.makeHtml");return i=new t,r=new t,s=[],h=0,n=f.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=d(n),n=n.replace(/^[ \t]+$/mg,""),n=nt(n),n=bt(n),n=l(n),n=wt(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=f.postConversion(n),s=r=i=null,n},p={ol:"\\d+[.]",ul:"[*+-]"},it=/(?:["'*()[\]:]|~D)/g}}(),function(){function i(n){return n.replace(/<[^>]*>?/gi,e)}function e(n){return n.match(r)||n.match(u)||n.match(f)?n:""}function o(n){var i,t;if(n=="")return"";var s=/<\/?\w+[^>]*(\s|$|>)/g,r=n.toLowerCase().match(s),f=(r||[]).length;if(f==0)return n;var e,h,a="



  • ",u,o=[],c=[],l=!1;for(t=0;t")>-1)){if(h=r[t],u=-1,!/^<\//.test(h))for(i=t+1;i"){u=i;break}u==-1?l=c[t]=!0:o[u]=!0}return l?(t=0,n=n.replace(s,function(n){var i=c[t]?"":n;return t++,i})):n}var n,t;typeof exports=="object"&&typeof require=="function"?(n=exports,t=require("./Markdown.Converter").Converter):(n=window.Markdown,t=n.Converter),n.getSanitizingConverter=function(){var n=new t;return n.hooks.chain("postConversion",i),n.hooks.chain("postConversion",o),n};var r=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,u=/^(]+")?\s?>|<\/a>)$/i,f=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i}(),function(){function c(){}function w(t){this.buttonBar=n.getElementById("wmd-button-bar"+t),this.preview=n.getElementById("wmd-preview"+t),this.input=n.getElementById("wmd-input"+t)}function p(n,i){var l=this,e=[],r=0,o="none",f,v,a,h=function(n,t){o!=n&&(o=n,t||y()),u.isIE&&o=="moving"?a=null:v=top.setTimeout(c,1)},c=function(n){a=new s(i,n),v=undefined};this.setCommandMode=function(){o="command",y(),v=top.setTimeout(c,0)},this.canUndo=function(){return r>1},this.canRedo=function(){return e[r+1]?!0:!1},this.undo=function(){l.canUndo()&&(f?(f.restore(),f=null):(e[r]=new s(i),e[--r].restore(),n&&n())),o="none",i.input.focus(),c()},this.redo=function(){l.canRedo()&&(e[++r].restore(),n&&n()),o="none",i.input.focus(),c()};var y=function(){var t=a||new s(i);if(!t)return!1;if(o=="moving"){f||(f=t);return}f&&(e[r-1].text!=f.text&&(e[r++]=f),f=null),e[r++]=t,e[r+1]=null,n&&n()},p=function(n){var t=!1,i,r;if(n.ctrlKey||n.metaKey){i=n.charCode||n.keyCode,r=String.fromCharCode(i);switch(r){case"y":l.redo(),t=!0;break;case"z":n.shiftKey?l.redo():l.undo(),t=!0}}if(t){n.preventDefault&&n.preventDefault(),top.event&&(top.event.returnValue=!1);return}},w=function(n){if(!n.ctrlKey&&!n.metaKey){var t=n.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?h("moving"):t==8||t==46||t==127?h("deleting"):t==13?h("newlines"):t==27?h("escape"):(t<16||t>20)&&t!=91&&h("typing")}},b=function(){t.addEvent(i.input,"keypress",function(n){(n.ctrlKey||n.metaKey)&&(n.keyCode==89||n.keyCode==90)&&n.preventDefault()});var n=function(){(u.isIE||a&&a.text!=i.input.value)&&v==undefined&&(o="paste",y(),c())};t.addEvent(i.input,"keydown",p),t.addEvent(i.input,"keydown",w),t.addEvent(i.input,"mousedown",function(){h("moving")}),i.input.onpaste=n,i.input.ondrop=n},k=function(){b(),c(!0),y()};k()}function s(i,r){var e=this,f=i.input;this.init=function(){t.isVisible(f)&&(r||!n.activeElement||n.activeElement===f)&&(this.setInputAreaSelectionStartEnd(),this.scrollTop=f.scrollTop,(!this.text&&f.selectionStart||f.selectionStart===0)&&(this.text=f.value))},this.setInputAreaSelection=function(){if(t.isVisible(f))if(f.selectionStart===undefined||u.isOpera){if(n.selection){if(n.activeElement&&n.activeElement!==f)return;f.focus();var i=f.createTextRange();i.moveStart("character",-f.value.length),i.moveEnd("character",-f.value.length),i.moveEnd("character",e.end),i.moveStart("character",e.start),i.select()}}else f.focus(),f.selectionStart=e.start,f.selectionEnd=e.end,f.scrollTop=e.scrollTop},this.setInputAreaSelectionStartEnd=function(){var r,s,h;if(!i.ieRetardedClick&&(f.selectionStart||f.selectionStart===0))e.start=f.selectionStart,e.end=f.selectionEnd;else if(n.selection){e.text=t.fixEolChars(f.value),i.ieRetardedClick&&i.ieCachedRange?(r=i.ieCachedRange,i.ieRetardedClick=!1):r=n.selection.createRange();var u=t.fixEolChars(r.text),o="\x07",c=o+u+o;if(r.text=c,s=t.fixEolChars(f.value),r.moveStart("character",-c.length),r.text=u,e.start=s.indexOf(o),e.end=s.lastIndexOf(o)-o.length,h=e.text.length-t.fixEolChars(f.value).length,h){for(r.moveStart("character",-u.length);h--;)u+="\n",e.end+=1;r.text=u}this.setInputAreaSelection()}},this.restore=function(){e.text!=undefined&&e.text!=f.value&&(f.value=e.text),this.setInputAreaSelection(),f.scrollTop=e.scrollTop},this.getChunks=function(){var n=new c;return n.before=t.fixEolChars(e.text.substring(0,e.start)),n.startTag="",n.selection=t.fixEolChars(e.text.substring(e.start,e.end)),n.endTag="",n.after=t.fixEolChars(e.text.substring(e.end)),n.scrollTop=e.scrollTop,n},this.setChunks=function(n){n.before=n.before+n.startTag,n.after=n.endTag+n.after,this.start=n.before.length,this.end=n.before.length+n.selection.length,this.text=n.before+n.selection+n.after,this.scrollTop=n.scrollTop},this.init()}function y(i,r,e){var ut=this,s,h,c,b=3e3,w="delayed",g=function(n,i){t.addEvent(n,"input",i),n.onpaste=i,n.ondrop=i,t.addEvent(n,"keypress",i),t.addEvent(n,"keydown",i)},p=function(){var t=0;return top.innerHeight?t=top.pageYOffset:n.documentElement&&n.documentElement.scrollTop?t=n.documentElement.scrollTop:n.body&&(t=n.body.scrollTop),t},l=function(){var n,t,u;r.preview&&((n=r.input.value,n&&n==c)||(c=n,t=+new Date,n=i.makeHtml(n),u=+new Date,h=u-t,k(n)))},y=function(){if(s&&(top.clearTimeout(s),s=undefined),w!=="manual"){var n=0;w==="delayed"&&(n=h),n>b&&(n=b),s=top.setTimeout(l,n)}},nt=function(n){return n.scrollHeight<=n.clientHeight?1:n.scrollTop/(n.scrollHeight-n.clientHeight)},tt=function(){r.preview&&(r.preview.scrollTop=(r.preview.scrollHeight-r.preview.clientHeight)*nt(r.preview))},k,d;this.refresh=function(n){n?(c="",l()):y()},this.processingTime=function(){return h};var v=!0,it=function(n){var t=r.preview,i=t.parentNode,u=t.nextSibling;i.removeChild(t),t.innerHTML=n,u?i.insertBefore(t,u):i.appendChild(t)},a=function(n){r.preview.innerHTML=n},o,rt=function(n){if(o)return o(n);try{a(n),o=a}catch(t){o=it,o(n)}};ff=typeof r.preview.innerText!="undefined"?!1:!0,k=function(n){var i=f.getTop(r.input)-p(),t;if(r.preview&&(rt(n),e()),tt(),v){v=!1;return}t=f.getTop(r.input)-p(),u.isIE?top.setTimeout(function(){top.scrollBy(0,t-i)},0):top.scrollBy(0,t-i),document.getElementById("wmd-char-count")&&(document.getElementById("wmd-char-count").innerHTML=ff?r.preview.textContent.length:r.preview.innerText.length)},d=function(){g(r.input,y),l(),r.preview&&(r.preview.scrollTop=0)},d()}function a(i,r,f,o,h,c){function a(n){var t;if(p.focus(),n.textOp){if(f&&f.setCommandMode(),t=new s(r),!t)return;var i=t.getChunks(),u=function(){p.focus(),i&&t.setChunks(i),t.restore(),o.refresh()},e=n.textOp(i,u);e||u()}n.execute&&n.execute(f)}function w(t,i){var e="0px",o="-20px",s="-40px",f=t.getElementsByTagName("span")[0];i?(f.style.backgroundPosition=t.XShift+" "+e,t.onmouseover=function(){f.style.backgroundPosition=this.XShift+" "+s},t.onmouseout=function(){f.style.backgroundPosition=this.XShift+" "+e},u.isIE&&(t.onmousedown=function(){n.activeElement&&n.activeElement!==r.input||(r.ieRetardedClick=!0,r.ieCachedRange=document.selection.createRange())}),t.isHelp||(t.onclick=function(){return this.onmouseout&&this.onmouseout(),a(this),!1})):(f.style.backgroundPosition=t.XShift+" "+o,t.onmouseover=t.onmouseout=t.onclick=function(){})}function y(n){return typeof n=="string"&&(n=h[n]),function(){n.apply(h,arguments)}}function d(){var a=r.buttonBar,p="0px",b="-20px",d="-40px",u=document.createElement("ul"),s,t,h;u.id="wmd-button-row"+i,u.className="wmd-button-row",u=a.appendChild(u);var f=0,n=function(n,t,r,e){var o=document.createElement("li"),s;return o.className="wmd-button",o.style.left=f+"px",f+=25,s=document.createElement("span"),o.id=n+i,o.appendChild(s),o.title=t,o.XShift=r,e&&(o.textOp=e),w(o,!0),u.appendChild(o),o},o=function(n){var t=document.createElement("li");t.className="wmd-spacer wmd-spacer"+n,t.id="wmd-spacer"+n+i,u.appendChild(t),f+=25};l.bold=n("wmd-bold-button","Strong Ctrl+B","0px",y("doBold")),l.italic=n("wmd-italic-button","Emphasis Ctrl+I","-20px",y("doItalic")),o(1),l.link=n("wmd-link-button","Hyperlink Ctrl+L","-40px",y(function(n,t){return this.doLinkOrImage(n,t,!1)})),l.quote=n("wmd-quote-button","Blockquote
    Ctrl+Q","-60px",y("doBlockquote")),l.code=n("wmd-code-button","Code Sample
     Ctrl+K","-80px",y("doCode")),l.image=n("wmd-image-button","Image  Ctrl+G","-100px",y(function(n,t){return this.doLinkOrImage(n,t,!0)})),o(2),l.olist=n("wmd-olist-button","Numbered List 
      Ctrl+O","-120px",y(function(n,t){this.doList(n,t,!0)})),l.ulist=n("wmd-ulist-button","Bulleted List
        Ctrl+U","-140px",y(function(n,t){this.doList(n,t,!1)})),l.heading=n("wmd-heading-button","Heading

        /

        Ctrl+H","-160px",y("doHeading")),l.hr=n("wmd-hr-button","Horizontal Rule
        Ctrl+R","-180px",y("doHorizontalRule")),o(3),l.undo=n("wmd-undo-button","Undo - Ctrl+Z","-200px",null),l.undo.execute=function(n){n&&n.undo()},s=/win/.test(e.platform.toLowerCase())?"Redo - Ctrl+Y":"Redo - Ctrl+Shift+Z",l.redo=n("wmd-redo-button",s,"-220px",null),l.redo.execute=function(n){n&&n.redo()},c&&(t=document.createElement("li"),h=document.createElement("span"),t.appendChild(h),t.className="wmd-button wmd-help-button",t.id="wmd-help-button"+i,t.XShift="-240px",t.isHelp=!0,t.style.right="0px",t.title=c.title||v,t.onclick=c.handler,w(t,!0),u.appendChild(t),l.help=t),k()}function k(){f&&(w(l.undo,f.canUndo()),w(l.redo,f.canRedo()))}var p=r.input,l={},b;d(),b="keydown",u.isOpera&&(b="keypress"),t.addEvent(p,b,function(n){if((n.ctrlKey||n.metaKey)&&!n.altKey){var t=n.charCode||n.keyCode,i=String.fromCharCode(t).toLowerCase();switch(i){case"b":a(l.bold);break;case"i":a(l.italic);break;case"l":a(l.link);break;case"q":a(l.quote);break;case"k":a(l.code);break;case"g":a(l.image);break;case"o":a(l.olist);break;case"u":a(l.ulist);break;case"h":a(l.heading);break;case"r":a(l.hr);break;case"y":a(l.redo);break;case"z":n.shiftKey?a(l.redo):a(l.undo);break;default:return}n.preventDefault&&n.preventDefault(),top.event&&(top.event.returnValue=!1)}}),t.addEvent(p,"keyup",function(n){if(n.shiftKey&&!n.ctrlKey&&!n.metaKey){var t=n.charCode||n.keyCode;t===13&&(fakeButton={},fakeButton.textOp=y("doAutoindent"),a(fakeButton))}}),u.isIE&&t.addEvent(p,"keydown",function(n){var t=n.keyCode;if(t===27)return!1}),this.setUndoRedoButtonStates=k}function l(n){this.hooks=n}function nt(n){return n.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(n,t,i){return t=t.replace(/\?.*$/,function(n){return n.replace(/\+/g," ")}),t=decodeURIComponent(t),t=encodeURI(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),t=t.replace(/\?.*$/,function(n){return n.replace(/\+/g,"%2b")}),i&&(i=i.trim?i.trim():i.replace(/^\s*/,"").replace(/\s*$/,""),i=$.trim(i).replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),i?t+' "'+i+'"':t})}var t={},f={},o={},n=top.document,i=top.RegExp,e=top.navigator,h={lineLength:72},u={isIE:/msie/.test(e.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(e.userAgent.toLowerCase())||/msie 5/.test(e.userAgent.toLowerCase()),isOpera:/opera/.test(e.userAgent.toLowerCase())},b='

        Insert Hyperlink

        http://example.com/ "optional title"

        ',k="

        Insert Image

        http://example.com/images/diagram.jpg \"optional title\"

        Need
        free image hosting?

        ",d="http://",g="http://",v="Markdown Editing Help",r;Markdown.Editor=function(t,i,r){var u,e,f;i=i||"",u=this.hooks=new Markdown.HookCollection,u.addNoop("onPreviewRefresh"),u.addNoop("postBlockquoteCreation"),u.addFalse("insertImageDialog"),this.getConverter=function(){return t},e=this,this.run=function(){var h,o,c,s,v;f||(f=new w(i),h=new l(u),o=new y(t,f,function(){u.onPreviewRefresh()}),/\?noundo/.test(n.location.href)||(c=new p(function(){o.refresh(),s&&s.setUndoRedoButtonStates()},f)),s=new a(i,f,c,o,h,r),s.setUndoRedoButtonStates(),v=e.refreshPreview=function(){o.refresh(!0)},v())}},c.prototype.findTags=function(n,i){var r=this,u;n&&(u=t.extendRegExp(n,"","$"),this.before=this.before.replace(u,function(n){return r.startTag=r.startTag+n,""}),u=t.extendRegExp(n,"^",""),this.selection=this.selection.replace(u,function(n){return r.startTag=r.startTag+n,""})),i&&(u=t.extendRegExp(i,"","$"),this.selection=this.selection.replace(u,function(n){return r.endTag=n+r.endTag,""}),u=t.extendRegExp(i,"^",""),this.after=this.after.replace(u,function(n){return r.endTag=n+r.endTag,""}))},c.prototype.trimWhitespace=function(n){this.selection=this.selection.replace(/^(\s*)/,""),n||(this.before+=i.$1),this.selection=this.selection.replace(/(\s*)$/,""),n||(this.after=i.$1+this.after)},c.prototype.skipLines=function(n,t,r){n===undefined&&(n=1),t===undefined&&(t=1),n++,t++;var u,f;if(navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+i.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+i.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+i.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+i.$1,this.before){for(u=f="";n--;)u+="\\n?",f+="\n";r&&(u="\\n*"),this.before=this.before.replace(new i(u+"$",""),f)}if(this.after){for(u=f="";t--;)u+="\\n?",f+="\n";r&&(u="\\n*"),this.after=this.after.replace(new i(u,""),f)}},t.isVisible=function(n){return window.getComputedStyle?window.getComputedStyle(n,null).getPropertyValue("display")!=="none":n.currentStyle?n.currentStyle.display!=="none":void 0},t.addEvent=function(n,t,i){n.attachEvent?n.attachEvent("on"+t,i):n.addEventListener(t,i,!1)},t.removeEvent=function(n,t,i){n.detachEvent?n.detachEvent("on"+t,i):n.removeEventListener(t,i,!1)},t.fixEolChars=function(n){return n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n")},t.extendRegExp=function(n,t,r){(t===null||t===undefined)&&(t=""),(r===null||r===undefined)&&(r="");var u=n.toString(),f;return u=u.replace(/\/([gim]*)$/,""),f=i.$1,u=u.replace(/(^\/|\/$)/g,""),u=t+u+r,new i(u,f)},f.getTop=function(n,t){var i=n.offsetTop;if(!t)while(n=n.offsetParent)i+=n.offsetTop;return i},f.getHeight=function(n){return n.offsetHeight||n.scrollHeight},f.getWidth=function(n){return n.offsetWidth||n.scrollWidth},f.getPageSize=function(){var r,u,t,i,f,e;return self.innerHeight&&self.scrollMaxY?(r=n.body.scrollWidth,u=self.innerHeight+self.scrollMaxY):n.body.scrollHeight>n.body.offsetHeight?(r=n.body.scrollWidth,u=n.body.scrollHeight):(r=n.body.offsetWidth,u=n.body.offsetHeight),self.innerHeight?(t=self.innerWidth,i=self.innerHeight):n.documentElement&&n.documentElement.clientHeight?(t=n.documentElement.clientWidth,i=n.documentElement.clientHeight):n.body&&(t=n.body.clientWidth,i=n.body.clientHeight),f=Math.max(r,t),e=Math.max(u,i),[f,e,t,i]},o.createBackground=function(){var t=n.createElement("div"),i;return t.className="wmd-prompt-background",style=t.style,style.position="absolute",style.top="0",style.zIndex="1000",u.isIE?style.filter="alpha(opacity=50)":style.opacity="0.5",i=f.getPageSize(),style.height=i[1]+"px",u.isIE?(style.left=n.documentElement.scrollLeft,style.width=n.documentElement.clientWidth):(style.left="0",style.width="100%"),n.body.appendChild(t),t},o.prompt=function(i,r,e){var o,s;r===undefined&&(r="");var c=function(n){var t=n.charCode||n.keyCode;t===27&&h(!0)},h=function(i){t.removeEvent(n.body,"keydown",c);var r=s.value;return i?r=null:(r=r.replace("http://http://","http://"),r=r.replace("http://https://","https://"),r=r.replace("http://ftp://","ftp://"),r.indexOf("http://")===-1&&r.indexOf("ftp://")===-1&&r.indexOf("https://")===-1&&(r="http://"+r)),o.parentNode.removeChild(o),e(r),!1},l=function(){var v,e,l,a;o=n.createElement("div"),o.className="wmd-prompt-dialog",o.style.padding="10px;",o.style.position="fixed",o.style.width="400px",o.style.zIndex="1001",v=n.createElement("div"),v.innerHTML=i,v.style.padding="5px",o.appendChild(v),e=n.createElement("form"),e.onsubmit=function(){return h(!1)},style=e.style,style.padding="0",style.margin="0",style.cssFloat="left",style.width="100%",style.textAlign="center",style.position="relative",o.appendChild(e),s=n.createElement("input"),s.type="text",s.value=r,style=s.style,style.display="block",style.width="80%",style.marginLeft=style.marginRight="auto",e.appendChild(s),l=n.createElement("input"),l.type="button",l.onclick=function(){return h(!1)},l.value="OK",style=l.style,style.margin="10px",style.display="inline",style.width="7em",a=n.createElement("input"),a.type="button",a.onclick=function(){return h(!0)},a.value="Cancel",style=a.style,style.margin="10px",style.display="inline",style.width="7em",e.appendChild(l),e.appendChild(a),t.addEvent(n.body,"keydown",c),o.style.top="50%",o.style.left="50%",o.style.display="block",u.isIE_5or6&&(o.style.position="absolute",o.style.top=n.documentElement.scrollTop+200+"px",o.style.left="50%"),n.body.appendChild(o),o.style.marginTop=-(f.getHeight(o)/2)+"px",o.style.marginLeft=-(f.getWidth(o)/2)+"px"};top.setTimeout(function(){var t,n;l(),t=r.length,s.selectionStart!==undefined?(s.selectionStart=0,s.selectionEnd=t):s.createTextRange&&(n=s.createTextRange(),n.collapse(!1),n.moveStart("character",-t),n.moveEnd("character",t),n.select()),s.focus()},0)},r=l.prototype,r.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",r.unwrap=function(n){var t=new i("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");n.selection=n.selection.replace(t,"$1 $2")},r.wrap=function(n,t){this.unwrap(n);var r=new i("(.{1,"+t+"})( +|$\\n?)","gm");n.selection=n.selection.replace(r,function(n,t){return new i("^"+this.prefixes,"").test(n)?n:t+"\n"}),n.selection=n.selection.replace(/\s+$/,"")},r.doBold=function(n,t){return this.doBorI(n,t,2,"strong text")},r.doItalic=function(n,t){return this.doBorI(n,t,1,"emphasized text")},r.doBorI=function(n,t,r,u){var s,f,e,h,o;n.trimWhitespace(),n.selection=n.selection.replace(/\n{2,}/g,"\n"),n.before.search(/(\**$)/),s=i.$1,n.after.search(/(^\**)/),f=i.$1,e=Math.min(s.length,f.length),e>=r&&(e!=2||r!=1)?(n.before=n.before.replace(i("[*]{"+r+"}$",""),""),n.after=n.after.replace(i("^[*]{"+r+"}",""),"")):!n.selection&&f?(n.after=n.after.replace(/^([*_]*)/,""),n.before=n.before.replace(/(\s?)$/,""),h=i.$1,n.before=n.before+f+h):(n.selection||f||(n.selection=u),o=r<=1?"*":"**",n.before=n.before+o,n.after=o+n.after);return},r.stripLinkDefs=function(n,t){return n=n.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(n,i,r,u,f){return(t[i]=n.replace(/\s*$/,""),u)?(t[i]=n.replace(/["(](.+?)[")]$/,""),u+f):""})},r.addLinkDef=function(n,t){var r=0,i={},s;n.before=this.stripLinkDefs(n.before,i),n.selection=this.stripLinkDefs(n.selection,i),n.after=this.stripLinkDefs(n.after,i);var e="",u=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,o=function(n){r++,n=n.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+r+"]:"),e+="\n"+n},f=function(n,t,e,s,h,c){return(e=e.replace(u,f),i[h])?(o(i[h]),t+e+s+r+c):n};return n.before=n.before.replace(u,f),t?o(t):n.selection=n.selection.replace(u,f),s=r,n.after=n.after.replace(u,f),n.after&&(n.after=n.after.replace(/\n*$/,"")),n.after||(n.selection=n.selection.replace(/\n*$/,"")),n.after+="\n\n"+e,s},r.doLinkOrImage=function(n,t,i){var u,f,r;if(n.trimWhitespace(),n.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/),n.endTag.length>1)n.startTag=n.startTag.replace(/!?\[/,""),n.endTag="",this.addLinkDef(n,null);else{if(/\n\n/.test(n.selection)){this.addLinkDef(n,null);return}return f=this,r=function(r){if(u.parentNode.removeChild(u),r!==null){n.startTag=n.endTag="";var e=" [999]: "+nt(r),o=f.addLinkDef(n,e);n.startTag=i?"![":"[",n.endTag="]["+o+"]",n.selection||(n.selection=i?"enter image description here":"enter link description here")}t()},u=o.createBackground(),i?this.hooks.insertImageDialog(r)||o.prompt(k,d,r):o.prompt(b,g,r),!0}},r.doAutoindent=function(n){var i=this;n.before=n.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),n.before=n.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),n.before=n.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(n.before)&&i.doList&&i.doList(n),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(n.before)&&i.doBlockquote&&i.doBlockquote(n),/(\n|^)(\t|[ ]{4,}).*\n$/.test(n.before)&&i.doCode&&i.doCode(n)},r.doBlockquote=function(n){var i,e,r,s,u,o,f,c;if(n.selection=n.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,i,r,u){return n.before+=i,n.after=u+n.after,r}),n.before=n.before.replace(/(>[ \t]*)$/,function(t,i){return n.selection=i+n.selection,""}),n.selection=n.selection.replace(/^(\s|>)+$/,""),n.selection=n.selection||"Blockquote",i="",e="",n.before){for(s=n.before.replace(/\n$/,"").split("\n"),u=!1,o=0;o0,/^>/.test(r)?(f=!0,!u&&r.length>1&&(u=!0)):f=/^[ \t]*$/.test(r)?!0:u,f?i+=r+"\n":(e+=i+r,i="\n");/(^|\n)>/.test(i)||(e+=i,i="")}n.startTag=i,n.before=e,n.after&&(n.after=n.after.replace(/^\n?/,"\n")),n.after=n.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return n.endTag=t,""}),c=function(t){var i=t?"> ":"";n.startTag&&(n.startTag=n.startTag.replace(/\n((>|\s)*)\n$/,function(n,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,i)+"\n"})),n.endTag&&(n.endTag=n.endTag.replace(/^\n((>|\s)*)\n/,function(n,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,i)+"\n"}))},/^(?![ ]{0,3}>)/m.test(n.selection)?(this.wrap(n,h.lineLength-2),n.selection=n.selection.replace(/^/gm,"> "),c(!0),n.skipLines()):(n.selection=n.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(n),c(!1),!/^(\n|^)[ ]{0,3}>/.test(n.selection)&&n.startTag&&(n.startTag=n.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(n.selection)&&n.endTag&&(n.endTag=n.endTag.replace(/^\n{0,2}/,"\n\n"))),n.selection=this.hooks.postBlockquoteCreation(n.selection),/\n/.test(n.selection)||(n.selection=n.selection.replace(/^(> *)/,function(t,i){return n.startTag+=i,""}))},r.doCode=function(n){var u=/\S[ ]*$/.test(n.before),f=/^[ ]*\S/.test(n.after),i,r;(f||u)&&!/\n/.test(n.selection)?(n.trimWhitespace(),n.findTags(/`/,/`/),n.startTag||n.endTag?n.endTag&&!n.startTag?(n.before+=n.endTag,n.endTag=""):n.startTag=n.endTag="":(n.startTag=n.endTag="`",n.selection||(n.selection="enter code here"))):(n.before=n.before.replace(/[ ]{4}$/,function(t){return n.selection=t+n.selection,""}),i=1,r=1,/\n(\t|[ ]{4,}).*\n$/.test(n.before)&&(i=0),/^\n(\t|[ ]{4,})/.test(n.after)&&(r=0),n.skipLines(i,r),n.selection?n.selection=/^[ ]{0,3}\S/m.test(n.selection)?n.selection.replace(/^/gm," "):n.selection.replace(/^[ ]{4}/gm,""):(n.startTag=" ",n.selection="enter code here"))},r.doList=function(n,t,r){var p=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,l=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,a="-",v=1,y=function(){var n;return r?(n=" "+v+". ",v++):n=" "+a+" ",n},u=function(n){return r===undefined&&(r=/^\s*\d/.test(n)),n=n.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return y()})},f,e,o,s,c;(n.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!n.before||/\n$/.test(n.before)||/^\n/.test(n.startTag)||(n.before+=n.startTag,n.startTag=""),n.startTag&&(f=/\d+[.]/.test(n.startTag),n.startTag="",n.selection=n.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(n),n.skipLines(),f&&(n.after=n.after.replace(l,u)),r==f))||(e=1,n.before=n.before.replace(p,function(n){return/^\s*([*+-])/.test(n)&&(a=i.$1),e=/[^\n]\n\n[^\n]/.test(n)?1:0,u(n)}),n.selection||(n.selection="List item"),o=y(),s=1,n.after=n.after.replace(l,function(n){return s=/[^\n]\n\n[^\n]/.test(n)?1:0,u(n)}),n.trimWhitespace(!0),n.skipLines(e,s,!0),n.startTag=o,c=o.replace(/./g," "),this.wrap(n,h.lineLength-c.length),n.selection=n.selection.replace(/\n/g,"\n"+c))},r.doHeading=function(n){var r,f,e,u;if(n.selection=n.selection.replace(/\s+/g," "),n.selection=n.selection.replace(/(^\s+|\s+$)/g,""),!n.selection){n.startTag="## ",n.selection="Heading",n.endTag=" ##";return}if(r=0,n.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(n.startTag)&&(r=i.lastMatch.length),n.startTag=n.endTag="",n.findTags(null,/\s?(-+|=+)/),/=+/.test(n.endTag)&&(r=1),/-+/.test(n.endTag)&&(r=2),n.startTag=n.endTag="",n.skipLines(1,1),f=r==0?2:r-1,f>0)for(e=f>=2?"-":"=",u=n.selection.length,u>h.lineLength&&(u=h.lineLength),n.endTag="\n";u--;)n.endTag+=e},r.doHorizontalRule=function(n){n.startTag="----------\n",n.selection="",n.skipLines(2,1,!0)}}(),function(n){function r(r,u){var f=this,h=r.add(f),v=n(window),s,e,c,o=n.tools.expose&&(u.mask||u.expose),l=Math.random().toString().slice(10),a;if(o&&(typeof o=="string"&&(o={color:o}),o.closeOnClick=o.closeOnEsc=!1),a=u.target||r.attr("rel"),e=a?n(a):null||r,!e.length)throw"Could not find Overlay: "+a;r&&r.index(e)==-1&&r.click(function(n){return f.load(n),n.preventDefault()}),n.extend(f,{load:function(r){var a;if(f.isOpened())return f;if(a=t[u.effect],!a)throw'Overlay: cannot find effect : "'+u.effect+'"';if(u.oneInstance&&n.each(i,function(){this.close(r)}),r=r||n.Event(),r.type="onBeforeLoad",h.trigger(r),r.isDefaultPrevented())return f;c=!0,o&&n(e).expose(o);var s=u.top,y=u.left,p=e.outerWidth({margin:!0}),w=e.outerHeight({margin:!0});return typeof s=="string"&&(s=s=="center"?Math.max((v.height()-w)/2,0):parseInt(s,10)/100*v.height()),y=="center"&&(y=Math.max((v.width()-p)/2,0)),a[0].call(f,{top:s,left:y},function(){c&&(r.type="onLoad",h.trigger(r))}),o&&u.closeOnClick&&n.mask.getMask().one("click",f.close),u.closeOnClick&&n(document).bind("click."+l,function(t){n(t.target).parents(e).length||f.close(t)}),u.closeOnEsc&&n(document).bind("keydown."+l,function(n){n.keyCode==27&&f.close(n)}),f},close:function(i){return f.isOpened()?(i=i||n.Event(),i.type="onBeforeClose",h.trigger(i),i.isDefaultPrevented()?void 0:(c=!1,t[u.effect][1].call(f,function(){i.type="onClose",h.trigger(i)}),n(document).unbind("click."+l).unbind("keydown."+l),o&&n.mask.close(),f)):f},getOverlay:function(){return e},getTrigger:function(){return r},getClosers:function(){return s},isOpened:function(){return c},getConf:function(){return u}}),n.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(t,i){n.isFunction(u[i])&&n(f).bind(i,u[i]),f[i]=function(t){return t&&n(f).bind(i,t),f}}),s=e.find(u.close||".close"),!s.length&&!u.close&&(s=n(''),e.prepend(s)),s.click(function(n){f.close(n)}),u.load&&f.load()}n.tools=n.tools||{version:"v1.2.6"},n.tools.overlay={addEffect:function(n,i,r){t[n]=[i,r]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",fixed:!n.browser.msie||n.browser.version>6,left:"center",load:!1,mask:null,oneInstance:!0,speed:"normal",target:null,top:"10%"}};var i=[],t={};n.tools.overlay.addEffect("default",function(t,i){var r=this.getConf(),u=n(window);r.fixed||(t.top+=u.scrollTop(),t.left+=u.scrollLeft()),t.position=r.fixed?"fixed":"absolute",this.getOverlay().css(t).fadeIn(r.speed,i)},function(n){this.getOverlay().fadeOut(this.getConf().closeSpeed,n)}),n.fn.overlay=function(t){var u=this.data("overlay");return u?u:(n.isFunction(t)&&(t={onBeforeLoad:t}),t=n.extend(!0,{},n.tools.overlay.conf,t),this.each(function(){u=new r(n(this),t),i.push(u),n(this).data("overlay",u)}),t.api?u:this)}}(jQuery),function(n){function i(t,i){var r=n(i);return r.length<2?r:t.parent().find(i)}function r(r,u){var f=this,v=r.add(f),e=r.children(),l=0,o=u.vertical,y,p,a,s,h,c;t||(t=f),e.length>1&&(e=n(u.items,r)),u.size>1&&(u.circular=!1),n.extend(f,{getConf:function(){return u},getIndex:function(){return l},getSize:function(){return f.getItems().size()},getNaviButtons:function(){return s.add(h)},getRoot:function(){return r},getItemWrap:function(){return e},getItems:function(){return e.find(u.item).not("."+u.clonedClass)},move:function(n,t){return f.seekTo(l+n,t)},next:function(n){return f.move(u.size,n)},prev:function(n){return f.move(-u.size,n)},begin:function(n){return f.seekTo(0,n)},end:function(n){return f.seekTo(f.getSize()-1,n)},focus:function(){return t=f,f},addItem:function(t){return t=n(t),u.circular?(e.children().last().before(t),e.children().first().replaceWith(t.clone().addClass(u.clonedClass))):(e.append(t),h.removeClass("disabled")),v.trigger("onAddItem",[t]),f},seekTo:function(i,r,s){var h,c,a;return(i.jquery||(i*=1),u.circular&&i===0&&l==-1&&r!==0)?f:!u.circular&&i<0||i>f.getSize()||i<-1?f:(h=i,i.jquery?i=f.getItems().index(i):h=f.getItems().eq(i),c=n.Event("onBeforeSeek"),!s&&(v.trigger(c,[i,r]),c.isDefaultPrevented()||!h.length))?f:(a=o?{top:-h.position().top}:{left:-h.position().left},l=i,t=f,r===undefined&&(r=u.speed),e.animate(a,r,u.easing,s||function(){v.trigger("onSeek",[i])}),f)}}),n.each(["onBeforeSeek","onSeek","onAddItem"],function(t,i){n.isFunction(u[i])&&n(f).bind(i,u[i]),f[i]=function(t){return t&&n(f).bind(i,t),f}}),u.circular&&(y=f.getItems().slice(-1).clone().prependTo(e),p=f.getItems().eq(1).clone().appendTo(e),y.add(p).addClass(u.clonedClass),f.onBeforeSeek(function(n,t,i){if(!n.isDefaultPrevented()){if(t==-1)return f.seekTo(y,i,function(){f.end(0)}),n.preventDefault();t==f.getSize()&&f.seekTo(p,i,function(){f.begin(0)})}}),a=r.parents().add(r).filter(function(){if(n(this).css("display")==="none")return!0}),a.length?(a.show(),f.seekTo(0,0,function(){}),a.hide()):f.seekTo(0,0,function(){})),s=i(r,u.prev).click(function(n){n.stopPropagation(),f.prev()}),h=i(r,u.next).click(function(n){n.stopPropagation(),f.next()}),u.circular||(f.onBeforeSeek(function(n,t){setTimeout(function(){n.isDefaultPrevented()||(s.toggleClass(u.disabledClass,t<=0),h.toggleClass(u.disabledClass,t>=f.getSize()-1))},1)}),u.initialIndex||s.addClass(u.disabledClass)),f.getSize()<2&&s.add(h).addClass(u.disabledClass),u.mousewheel&&n.fn.mousewheel&&r.mousewheel(function(n,t){if(u.mousewheel)return f.move(t<0?1:-1,u.wheelSpeed||50),!1}),u.touch&&(c={},e[0].ontouchstart=function(n){var t=n.touches[0];c.x=t.clientX,c.y=t.clientY},e[0].ontouchmove=function(n){if(n.touches.length==1&&!e.is(":animated")){var t=n.touches[0],i=c.x-t.clientX,r=c.y-t.clientY;f[o&&r>0||!o&&i>0?"next":"prev"](),n.preventDefault()}}),u.keyboard&&n(document).bind("keydown.scrollable",function(i){if(!(!u.keyboard||i.altKey||i.ctrlKey||i.metaKey||n(i.target).is(":input"))){if(u.keyboard!="static"&&t!=f)return;var r=i.keyCode;if(o&&(r==38||r==40))return f.move(r==38?-1:1),i.preventDefault();if(!o&&(r==37||r==39))return f.move(r==37?-1:1),i.preventDefault()}}),u.initialIndex&&f.seekTo(u.initialIndex,0,function(){})}n.tools=n.tools||{version:"v1.2.6"},n.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:"> *",items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",size:1,speed:400,vertical:!1,touch:!0,wheelSpeed:0}};var t;n.fn.scrollable=function(t){var i=this.data("scrollable");return i?i:(t=n.extend({},n.tools.scrollable.conf,t),this.each(function(){i=new r(n(this),t),n(this).data("scrollable",i)}),t.api?i:this)}}(jQuery),function(n){var t=n.tools.scrollable;t.autoscroll={conf:{autoplay:!0,interval:3e3,autopause:!0}},n.fn.autoscroll=function(i){typeof i=="number"&&(i={interval:i});var r=n.extend({},t.autoscroll.conf,i),u;return this.each(function(){function o(){i=setTimeout(function(){t.next()},r.interval)}var t=n(this).data("scrollable"),f=t.getRoot(),i,e=!1;t&&(u=t),t.play=function(){i||(e=!1,f.bind("onSeek",o),o())},t.pause=function(){i=clearTimeout(i),f.unbind("onSeek",o)},t.resume=function(){e||t.play()},t.stop=function(){e=!0,t.pause()},r.autopause&&f.add(t.getNaviButtons()).hover(t.pause,t.resume),r.autoplay&&t.play()}),r.api?u:this}}(jQuery),function(n){function i(t,i){var r=n(i);return r.length<2?r:t.parent().find(i)}var t=n.tools.scrollable;t.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:!1,idPrefix:null,history:!1}},n.fn.navigator=function(r){typeof r=="string"&&(r={navi:r}),r=n.extend({},t.navigator.conf,r);var u;return this.each(function(){function c(n,i,r){t.seekTo(i),r.preventDefault(),h&&history.pushState({i:i})}function f(){return e.find(r.naviItem||"> *")}function l(t){var i=n("<"+(r.naviItem||"a")+"/>").click(function(i){c(n(this),t,i)});return t===0&&i.addClass(o),r.indexed&&i.text(t+1),r.idPrefix&&i.attr("id",r.idPrefix+t),i.appendTo(e)}var t=n(this).data("scrollable"),e=r.navi.jquery?r.navi:i(t.getRoot(),r.navi),a=t.getNaviButtons(),o=r.activeClass,h=r.history&&history.pushState,s=t.getConf().size;t&&(u=t),t.getNaviButtons=function(){return a.add(e)},h&&(history.pushState({i:0}),n(window).bind("popstate",function(n){var i=n.originalEvent.state;i&&t.seekTo(i.i)})),f().length?f().each(function(t){n(this).click(function(i){c(n(this),t,i)})}):n.each(t.getItems(),function(n){n%s==0&&l(n)}),t.onBeforeSeek(function(n,t){setTimeout(function(){if(!n.isDefaultPrevented()){var i=t/s,r=f().eq(i);r.length&&f().removeClass(o).eq(i).addClass(o)}},1)}),t.onAddItem(function(n,i){var r=t.getItems().index(i);r%s==0&&l(r)})}),r.api?u:this}}(jQuery),function(n){function i(t,i,r){var u=r.relative?t.position().top:t.offset().top,e=r.relative?t.position().left:t.offset().left,f=r.position[0],o,s;return u-=i.outerHeight()-r.offset[0],e+=t.outerWidth()+r.offset[1],/iPad/i.test(navigator.userAgent)&&(u-=n(window).scrollTop()),o=i.outerHeight()+t.outerHeight(),f=="center"&&(u+=o/2),f=="bottom"&&(u+=o),f=r.position[1],s=i.outerWidth()+t.outerWidth(),f=="center"&&(e-=s/2),f=="left"&&(e-=s),{top:u,left:e}}function r(r,u){var f=this,h=r.add(f),e,l=0,a=0,c=r.attr("title"),v=r.attr("data-tooltip"),y=t[u.effect],s,p=r.is(":input"),b=p&&r.is(":checkbox, :radio, select, :button, :submit"),w=r.attr("type"),o=u.events[w]||u.events[p?b?"widget":"input":"def"];if(!y)throw'Nonexistent effect "'+u.effect+'"';if(o=o.split(/,\s*/),o.length!=2)throw"Tooltip: bad events configuration for "+w;r.bind(o[0],function(n){clearTimeout(l),u.predelay?a=setTimeout(function(){f.show(n)},u.predelay):f.show(n)}).bind(o[1],function(n){clearTimeout(a),u.delay?l=setTimeout(function(){f.hide(n)},u.delay):f.hide(n)}),c&&u.cancelDefault&&(r.removeAttr("title"),r.data("title",c)),n.extend(f,{show:function(t){var w,p;if(!e&&(v?e=n(v):u.tip?e=n(u.tip).eq(0):c?e=n(u.layout).addClass(u.tipClass).appendTo(document.body).hide().append(c):(e=r.next(),e.length||(e=r.parent().next())),!e.length))throw"Cannot find tooltip for "+r;return f.isShown()?f:(e.stop(!0,!0),w=i(r,e,u),u.tip&&e.html(r.data("title")),t=n.Event(),t.type="onBeforeShow",h.trigger(t,[w]),t.isDefaultPrevented())?f:(w=i(r,e,u),e.css({position:"absolute",top:w.top,left:w.left}),s=!0,y[0].call(f,function(){t.type="onShow",s="full",h.trigger(t)}),p=u.events.tooltip.split(/,\s*/),e.data("__set")||(e.unbind(p[0]).bind(p[0],function(){clearTimeout(l),clearTimeout(a)}),p[1]&&!r.is("input:not(:checkbox, :radio), textarea")&&e.unbind(p[1]).bind(p[1],function(n){n.relatedTarget!=r[0]&&r.trigger(o[1].split(" ")[0])}),u.tip||e.data("__set",!0)),f)},hide:function(i){return!e||!f.isShown()?f:(i=n.Event(),i.type="onBeforeHide",h.trigger(i),i.isDefaultPrevented()?void 0:(s=!1,t[u.effect][1].call(f,function(){i.type="onHide",h.trigger(i)}),f))},isShown:function(n){return n?s=="full":s},getConf:function(){return u},getTip:function(){return e},getTrigger:function(){return r}}),n.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(t,i){n.isFunction(u[i])&&n(f).bind(i,u[i]),f[i]=function(t){return t&&n(f).bind(i,t),f}})}n.tools=n.tools||{version:"v1.2.6"},n.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"
        ",tipClass:"tooltip"},addEffect:function(n,i,r){t[n]=[i,r]}};var t={toggle:[function(n){var r=this.getConf(),t=this.getTip(),i=r.opacity;i<1&&t.css({opacity:i}),t.show(),n.call()},function(n){this.getTip().hide(),n.call()}],fade:[function(t){var i=this.getConf();!n.browser.msie||i.fadeIE?this.getTip().fadeTo(i.fadeInSpeed,i.opacity,t):(this.getTip().show(),t())},function(t){var i=this.getConf();!n.browser.msie||i.fadeIE?this.getTip().fadeOut(i.fadeOutSpeed,t):(this.getTip().hide(),t())}]};n.fn.tooltip=function(t){var i=this.data("tooltip");return i?i:(t=n.extend(!0,{},n.tools.tooltip.conf,t),typeof t.position=="string"&&(t.position=t.position.split(/,?\s/)),this.each(function(){i=new r(n(this),t),n(this).data("tooltip",i)}),t.api?i:this)}}(jQuery),function(n){function i(t){var i=n(window),r=i.width()+i.scrollLeft(),u=i.height()+i.scrollTop();return[t.offset().top<=i.scrollTop(),r<=t.offset().left+t.width(),u<=t.offset().top+t.height(),i.scrollLeft()>=t.offset().left]}function r(n){for(var t=n.length;t--;)if(n[t])return!1;return!0}var t=n.tools.tooltip;t.dynamic={conf:{classNames:"top right bottom left"}},n.fn.dynamic=function(u){typeof u=="number"&&(u={speed:u}),u=n.extend({},t.dynamic.conf,u);var o=n.extend(!0,{},u),e=u.classNames.split(/\s/),f;return this.each(function(){var t=n(this).tooltip().onBeforeShow(function(t,u){var c=this.getTip(),s=this.getConf(),l,h;f||(f=[s.position[0],s.position[1],s.offset[0],s.offset[1],n.extend({},s)]),n.extend(s,f[4]),s.position=[f[0],f[1]],s.offset=[f[2],f[3]],c.css({visibility:"hidden",position:"absolute",top:u.top,left:u.left}).show(),l=n.extend(!0,{},o),h=i(c),r(h)||(h[2]&&(n.extend(s,l.top),s.position[0]="top",c.addClass(e[0])),h[3]&&(n.extend(s,l.right),s.position[1]="right",c.addClass(e[1])),h[0]&&(n.extend(s,l.bottom),s.position[0]="bottom",c.addClass(e[2])),h[1]&&(n.extend(s,l.left),s.position[1]="left",c.addClass(e[3])),(h[0]||h[2])&&(s.offset[0]*=-1),(h[1]||h[3])&&(s.offset[1]*=-1)),c.css({visibility:"visible"}).hide()});t.onBeforeShow(function(){var n=this.getConf(),t=this.getTip();setTimeout(function(){n.position=[f[0],f[1]],n.offset=[f[2],f[3]]},0)}),t.onHide(function(){var n=this.getTip();n.removeClass(u.classNames)}),ret=t}),u.api?ret:this}}(jQuery),function(n){var i=n.tools.tooltip,t;n.extend(i.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!n.browser.msie}),t={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]},i.addEffect("slide",function(n){var i=this.getConf(),r=this.getTip(),u=i.slideFade?{opacity:i.opacity}:{},f=t[i.direction]||t.up;u[f[1]]=f[0]+"="+i.slideOffset,i.slideFade&&r.css({opacity:0}),r.show().animate(u,i.slideInSpeed,n)},function(i){var r=this.getConf(),o=r.slideOffset,f=r.slideFade?{opacity:0}:{},e=t[r.direction]||t.up,u=""+e[0];r.bounce&&(u=u=="+"?"-":"+"),f[e[1]]=u+"="+o,this.getTip().animate(f,r.slideOutSpeed,function(){n(this).hide(),i.call()})})}(jQuery),jQuery.fn.center=function(n){return this.each(function(){var t=jQuery(this);t.css({position:n?"absolute":"fixed",left:"50%",top:"0",zIndex:"10000"}).css({marginLeft:"-"+t.outerWidth()/2+"px",marginTop:"0"}),n&&t.css({marginTop:parseInt(t.css("marginTop"),10)+jQuery(window).scrollTop(),marginLeft:parseInt(t.css("marginLeft"),10)+jQuery(window).scrollLeft()})})},function(n){n.fn.extend({autocomplete:function(t,i){var r=typeof t=="string";return i=n.extend({},n.Autocompleter.defaults,{url:r?t:null,data:r?null:t,delay:r?n.Autocompleter.defaults.delay:10,max:i&&!i.scroll?10:150},i),i.highlight=i.highlight||function(n){return n},i.formatMatch=i.formatMatch||i.formatItem,this.each(function(){new n.Autocompleter(this,i)})},result:function(n){return this.bind("result",n)},search:function(n){return this.trigger("search",[n])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(n){return this.trigger("setOptions",[n])},unautocomplete:function(){return this.trigger("unautocomplete")}}),n.Autocompleter=function(t,i){function d(){var h=r.selected(),f,s;if(!h)return!1;if(f=h.result,e=f,i.multiple){if(s=o(u.val()),s.length>1){var v=i.multipleSeparator.length,y=n(t).selection().start,l,c=0;n.each(s,function(n,t){if(c+=t.length,y<=c)return l=n,!1;c+=v}),s[l]=f,f=s.join(i.multipleSeparator)}f+=i.multipleSeparator}return u.val(f),a(),u.trigger("result",[h.data,h.value]),!0}function s(n,t){if(p==f.DEL){r.hide();return}var o=u.val();(t||o!=e)&&(e=o,o=v(o),o.length>=i.minChars?(u.addClass(i.loadingClass),i.matchCase||(o=o.toLowerCase()),k(o,it,a)):(w(),r.hide()))}function o(t){return t?i.multiple?n.map(t.split(i.multipleSeparator),function(i){return n.trim(t).length?n.trim(i):null}):[n.trim(t)]:[""]}function v(r){var u,f;return i.multiple?(u=o(r),u.length==1)?u[0]:(f=n(t).selection().start,u=f==r.length?o(r):o(r.replace(r.substring(f),"")),u[u.length-1]):r}function nt(r,o){i.autoFill&&v(u.val()).toLowerCase()==r.toLowerCase()&&p!=f.BACKSPACE&&(u.val(u.val()+o.substring(v(e).length)),n(t).selection(e.length,e.length+o.length))}function tt(){clearTimeout(h),h=setTimeout(a,200)}function a(){var n=r.visible();r.hide(),clearTimeout(h),w(),i.mustMatch&&u.search(function(n){if(!n)if(i.multiple){var t=o(u.val()).slice(0,-1);u.val(t.join(i.multipleSeparator)+(t.length?i.multipleSeparator:""))}else u.val(""),u.trigger("result",null)})}function it(n,t){t&&t.length&&c?(w(),r.display(t,n),nt(n,t[0].value),r.show()):a()}function k(u,f,e){var o,s;i.matchCase||(u=u.toLowerCase()),o=l.load(u),o&&o.length?f(u,o):typeof i.url=="string"&&i.url.length>0?(s={timestamp:+new Date},n.each(i.extraParams,function(n,t){s[n]=typeof t=="function"?t():t}),n.ajax({mode:"abort",port:"autocomplete"+t.name,dataType:i.dataType,url:i.url,data:n.extend({q:v(u),limit:i.max},s),success:function(n){var t=i.parse&&i.parse(n)||g(n);l.add(u,t),f(u,t)}})):(r.emptyList(),e(u))}function g(t){for(var f=[],e=t.split("\n"),r,u=0;u1&&!r.visible()&&s(0,!0)}).bind("search",function(){function i(n,i){var r,f;if(i&&i.length)for(f=0;f1?arguments[1]:null;n.each(o(u.val()),function(n,t){k(t,i,i)})}).bind("flushCache",function(){l.flush()}).bind("setOptions",function(){n.extend(!0,i,arguments[1]),"data"in arguments[1]&&l.populate()}).bind("unautocomplete",function(){r.unbind(),u.unbind(),n(t.form).unbind(".autocomplete")})},n.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:!1,matchSubset:!0,matchContains:!1,cacheLength:10,max:100,mustMatch:!1,extraParams:{},selectFirst:!0,formatItem:function(n){return n[0]},formatMatch:null,autoFill:!1,width:0,multiple:!1,multipleSeparator:" ",highlight:function(n,t){return n.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1")},scroll:!0,scrollHeight:180},n.Autocompleter.Cache=function(t){function u(n,i){t.matchCase||(n=n.toLowerCase());var r=n.indexOf(i);return(t.matchContains=="word"&&(r=n.toLowerCase().search("\\b"+i.toLowerCase())),r==-1)?!1:r==0||t.matchContains}function f(n,u){r>t.cacheLength&&o(),i[n]||r++,i[n]=u}function e(){var r,h,u,c,i,e,o,s;if(!t.data)return!1;for(r={},h=0,t.url||(t.cacheLength=1),r[""]=[],u=0,c=t.data.length;u0&&(o=i[h],n.each(o,function(n,t){u(t.value,f)&&e.push(t)}));return e}if(i[f])return i[f];if(t.matchSubset)for(s=f.length-1;s>=t.minChars;s--)if(o=i[f.substr(0,s)],o)return e=[],n.each(o,function(n,t){u(t.value,f)&&(e[e.length]=t)}),e;return null}}},n.Autocompleter.Select=function(t,i,r,u){function b(){y&&(h=n("
        ").hide().addClass(t.resultsClass).css("position","absolute").appendTo(document.body),o=n("
          ").appendTo(h).mouseover(function(t){a(t).nodeName&&a(t).nodeName.toUpperCase()=="LI"&&(e=n("li",o).removeClass(s.ACTIVE).index(a(t)),n(a(t)).addClass(s.ACTIVE))}).click(function(t){return n(a(t)).addClass(s.ACTIVE),r(),i.focus(),!1}).mousedown(function(){u.mouseDownOnSelect=!0}).mouseup(function(){u.mouseDownOnSelect=!1}),t.width>0&&h.css("width",t.width),y=!1)}function a(n){for(var t=n.target;t&&t.tagName!="LI";)t=t.parentNode;return t?t:[]}function l(n){var r,i;f.slice(e,e+1).removeClass(s.ACTIVE),w(n),r=f.slice(e,e+1).addClass(s.ACTIVE),t.scroll&&(i=0,f.slice(0,e).each(function(){i+=this.offsetHeight}),i+r[0].offsetHeight-o.scrollTop()>o[0].clientHeight?o.scrollTop(i+r[0].offsetHeight-o.innerHeight()):i=f.size()&&(e=0)}function p(n){return t.max&&t.max").html(t.highlight(u,v)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(o)[0],n.data(h,"ac_data",c[i]));f=o.find("li"),t.selectFirst&&(f.slice(0,1).addClass(s.ACTIVE),e=0),n.fn.bgiframe&&o.bgiframe()}var s={ACTIVE:"ac_over"},f,e=-1,c,v="",y=!0,h,o;return{display:function(n,t){b(),c=n,v=t,k()},next:function(){l(1)},prev:function(){l(-1)},pageUp:function(){e!=0&&e-8<0?l(-e):l(-8)},pageDown:function(){e!=f.size()-1&&e+8>f.size()?l(f.size()-1-e):l(8)},hide:function(){h&&h.hide(),f&&f.removeClass(s.ACTIVE),e=-1},visible:function(){return h&&h.is(":visible")},current:function(){return this.visible()&&(f.filter("."+s.ACTIVE)[0]||t.selectFirst&&f[0])},show:function(){var e=n(i).offset(),r,u;h.css({width:typeof t.width=="string"||t.width>0?t.width:n(i).width(),top:e.top+i.offsetHeight,left:e.left}).show(),t.scroll&&(o.scrollTop(0),o.css({maxHeight:t.scrollHeight,overflow:"auto"}),n.browser.msie&&typeof document.body.style.maxHeight=="undefined"&&(r=0,f.each(function(){r+=this.offsetHeight}),u=r>t.scrollHeight,o.css("height",u?t.scrollHeight:r),u||f.width(o.width()-parseInt(f.css("padding-left"))-parseInt(f.css("padding-right")))))},selected:function(){var t=f&&f.filter("."+s.ACTIVE).removeClass(s.ACTIVE);return t&&t.length&&n.data(t[0],"ac_data")},emptyList:function(){o&&o.empty()},unbind:function(){h&&h.remove()}}},n.fn.selection=function(n,t){var i,r;if(n!==undefined)return this.each(function(){if(this.createTextRange){var i=this.createTextRange();t===undefined||n==t?(i.move("character",n),i.select()):(i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",t),i.select())}else this.setSelectionRange?this.setSelectionRange(n,t):this.selectionStart&&(this.selectionStart=n,this.selectionEnd=t)});if(i=this[0],i.createTextRange){var u=document.selection.createRange(),o=i.value,f="<->",e=u.text.length;return u.text=f,r=i.value.indexOf(f),i.value=o,this.selection(r,r+e),{start:r,end:r+e}}if(i.selectionStart!==undefined)return{start:i.selectionStart,end:i.selectionEnd}}}(jQuery),function(n){function i(){return url=location.href,hashtag=url.indexOf("#!")!=-1?decodeURI(url.substring(url.indexOf("#!")+2,url.length)):!1}function r(){typeof theRel!="undefined"&&(location.hash="!"+theRel+"/"+rel_index+"/")}function t(n,t){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+n+"=([^&#]*)",u=new RegExp(r),i=u.exec(t);return i==null?"":i[1]}n.prettyPhoto={version:"3.1.2"},n.fn.prettyPhoto=function(u){function p(){n(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(s/2-f.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:f.contentHeight,width:f.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:o/2-f.containerWidth/2,width:f.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(f.height).width(f.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&b(pp_images[set_position])=="image"?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),f.resized?n("a.pp_expand,a.pp_contract").show():n("a.pp_expand").hide(),!settings.autoplay_slideshow||l||y||n.prettyPhoto.startSlideshow(),settings.deeplinking&&r(),settings.changepicturecallback(),y=!0}),rt()}function d(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){n(".pp_loaderIcon").show(),t()})}function ut(t){t>1?n(".pp_nav").show():n(".pp_nav").hide()}function e(n,t){if(resized=!1,g(n,t),imageWidth=n,imageHeight=t,(h>o||c>s)&&doresize&&settings.allow_resize&&!a){for(resized=!0,fitting=!1;!fitting;)h>o?(imageWidth=o-200,imageHeight=t/n*imageWidth):c>s?(imageHeight=s-200,imageWidth=n/t*imageHeight):fitting=!0,c=imageHeight,h=imageWidth;g(imageWidth,imageHeight),(h>o||c>s)&&e(h,c)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(c),containerWidth:Math.floor(h)+settings.horizontal_padding*2,contentHeight:Math.floor(v),contentWidth:Math.floor(tt),resized:resized}}function g(t,i){t=parseFloat(t),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(t),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(n("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,n.browser.msie&&n.browser.version==7&&(detailsHeight+=8),$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(t),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(n("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),v=i+detailsHeight,tt=t,c=v+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),h=t}function b(n){return n.match(/youtube\.com\/watch/i)?"youtube":n.match(/vimeo\.com/i)?"vimeo":n.match(/\b.mov\b/i)?"quicktime":n.match(/\b.swf\b/i)?"flash":n.match(/\biframe=true\b/i)?"iframe":n.match(/\bajax=true\b/i)?"ajax":n.match(/\bcustom=true\b/i)?"custom":n.substr(0,1)=="#"?"inline":"image"}function k(){if(doresize&&typeof $pp_pic_holder!="undefined"){if(scroll_pos=nt(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=s/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>s)return;$pp_pic_holder.css({top:projectedTop,left:o/2+scroll_pos.scrollLeft-contentwidth/2})}}function nt(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function ft(){s=n(window).height(),o=n(window).width(),typeof $pp_overlay!="undefined"&&$pp_overlay.height(n(document).height()).width(o)}function rt(){isSet&&settings.overlay_gallery&&b(pp_images[set_position])=="image"&&settings.ie6_fallback&&!(n.browser.msie&&parseInt(n.browser.version)==6)?(itemWidth=57,navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30,itemsPerPage=Math.floor((f.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=n(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return n.prettyPhoto.changeGalleryPage("next"),n.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return n.prettyPhoto.changeGalleryPage("previous"),n.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(t){n(this).find("a").click(function(){return n.prettyPhoto.changePage(t),n.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('Play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return n.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:n(document).height(),width:n(window).width()}).bind("click",function(){settings.modal||n.prettyPhoto.close()}),n("a.pp_close").bind("click",function(){return n.prettyPhoto.close(),!1}),n("a.pp_expand").bind("click",function(){return n(this).hasClass("pp_expand")?(n(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(n(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),d(function(){n.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return n.prettyPhoto.changePage("previous"),n.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return n.prettyPhoto.changePage("next"),n.prettyPhoto.stopSlideshow(),!1}),k()}u=jQuery.extend({animation_speed:"fast",slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'
          ',gallery_markup:'',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'
          {content}
          ',custom_markup:"",social_tools:'