/* ...
*/
(function(a,b){function c(a){return K.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function d(a){if(!cp[a]){var b=H.body,c=K("<"+a+">").appendTo(b),d=c.css("display");c.remove();if(d==="none"||d===""){cq||(cq=H.createElement("iframe"),cq.frameBorder=cq.width=cq.height=0),b.appendChild(cq);if(!cr||!cq.createElement)cr=(cq.contentWindow||cq.contentDocument).document,cr.write((H.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cr.close();c=cr.createElement(a),cr.body.appendChild(c),d=K.css(c,"display"),b.removeChild(cq)}cp[a]=d}return cp[a]}function e(a,b){var c={};return K.each(cv.concat.apply([],cv.slice(0,b)),function(){c[this]=a}),c}function f(){cw=b}function g(){return setTimeout(f,0),cw=K.now()}function h(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function i(){try{return new a.XMLHttpRequest}catch(b){}}function j(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},f,g,h=d.length,i,j=d[0],k,l,m,n,o;for(f=1;f<h;f++){if(f===1)for(g in a.converters)typeof g=="string"&&(e[g.toLowerCase()]=a.converters[g]);k=j,j=d[f];if(j==="*")j=k;else if(k!=="*"&&k!==j){l=k+" "+j,m=e[l]||e["* "+j];if(!m){o=b;for(n in e){i=n.split(" ");if(i[0]===k||i[0]==="*"){o=e[i[1]+" "+j];if(o){n=e[n],n===!0?m=o:o===!0&&(m=n);break}}}}!m&&!o&&K.error("No conversion from "+l.replace(" "," to ")),m!==!0&&(c=m?m(c):o(n(c)))}}return c}function k(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j)return j!==f[0]&&f.unshift(j),d[j]}function l(a,b,c,d){if(K.isArray(b))K.each(b,function(b,e){c||bR.test(a)?d(a,e):l(a+"["+(typeof e=="object"||K.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)l(a+"["+e+"]",b[e],c,d);else d(a,b)}function m(a,c){var d,e,f=K.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&K.extend(!0,a,e)}function n(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===ce,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=n(a,c,d,e,l,g)));return(k||!l)&&!g["*"]&&(l=n(a,c,d,e,"*",g)),l}function o(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(K.isFunction(c)){var d=b.toLowerCase().split(ca),e=0,f=d.length,g,h,i;for(;e<f;e++)g=d[e],i=/^\+/.test(g),i&&(g=g.substr(1)||"*"),h=a[g]=a[g]||[],h[i?"unshift":"push"](c)}}}function p(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bL:bM,f=0,g=e.length;if(d>0){if(c!=="border")for(;f<g;f++)c||(d-=parseFloat(K.css(a,"padding"+e[f]))||0),c==="margin"?d+=parseFloat(K.css(a,c+e[f]))||0:d-=parseFloat(K.css(a,"border"+e[f]+"Width"))||0;return d+"px"}d=bN(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;f<g;f++)d+=parseFloat(K.css(a,"padding"+e[f]))||0,c!=="padding"&&(d+=parseFloat(K.css(a,"border"+e[f]+"Width"))||0),c==="margin"&&(d+=parseFloat(K.css(a,c+e[f]))||0);return d+"px"}function q(a,b){b.src?K.ajax({url:b.src,async:!1,dataType:"script"}):K.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bB,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function r(a){var b=H.createElement("div");return bD.appendChild(b),b.innerHTML=a.outerHTML,b.firstChild}function s(a){var b=(a.nodeName||"").toLowerCase();b==="input"?t(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&K.grep(a.getElementsByTagName("input"),t)}function t(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function u(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function v(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(K.expando)}}function w(a,b){if(b.nodeType===1&&!!K.hasData(a)){var c,d,e,f=K._data(a),g=K._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)K.event.add(b,c+(h[c][d].namespace?".":"")+h[c][d].namespace,h[c][d],h[c][d].data)}g.data&&(g.data=K.extend({},g.data))}}function x(a,b){return K.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function y(a){var b=bp.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function z(a,b,c){b=b||0;if(K.isFunction(b))return K.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return K.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=K.grep(a,function(a){return a.nodeType===1});if(bl.test(b))return K.filter(b,d,!c);b=K.filter(b,d)}return K.grep(a,function(a,d){return K.inArray(a,b)>=0===c})}function A(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function B(){return!0}function C(){return!1}function D(a,b,c){var d=b+"defer",e=b+"queue",f=b+"mark",g=K._data(a,d);g&&(c==="queue"||!K._data(a,e))&&(c==="mark"||!K._data(a,f))&&setTimeout(function(){!K._data(a,e)&&!K._data(a,f)&&(K.removeData(a,d,!0),g.fire())},0)}function E(a){for(var b in a){if(b==="data"&&K.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function F(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(O,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:K.isNumeric(d)?parseFloat(d):N.test(d)?K.parseJSON(d):d}catch(f){}K.data(a,c,d)}else d=b}return d}function G(a){var b=L[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var H=a.document,I=a.navigator,J=a.location,K=function(){function c(){if(!d.isReady){try{H.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m=/^[\],:{}\s]*$/,n=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,p=/(?:^|:|,)(?:\s*\[)+/g,q=/(webkit)[ \/]([\w.]+)/,r=/(opera)(?:.*version)?[ \/]([\w.]+)/,s=/(msie) ([\w.]+)/,t=/(mozilla)(?:.*? rv:([\w.]+))?/,u=/-([a-z]|[0-9])/ig,v=/^-ms-/,w=function(a,b){return(b+"").toUpperCase()},x=I.userAgent,y,z,A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,J={};return d.fn=d.prototype={constructor:d,init:function(a,c,e){var f,g,i,j;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(a==="body"&&!c&&H.body)return this.context=H,this[0]=H.body,this.selector=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?f=h.exec(a):f=[null,a,null];if(f&&(f[1]||!c)){if(f[1])return c=c instanceof d?c[0]:c,j=c?c.ownerDocument||c:H,i=l.exec(a),i?d.isPlainObject(c)?(a=[H.createElement(i[1])],d.fn.attr.call(a,c,!0)):a=[j.createElement(i[1])]:(i=d.buildFragment([f[1]],[j]),a=(i.cacheable?d.clone(i.fragment):i.fragment).childNodes),d.merge(this,a);g=H.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return e.find(a);this.length=1,this[0]=g}return this.context=H,this.selector=a,this}return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a)}return d.isFunction(a)?e.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),d.makeArray(a,this))},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();return d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")"),e},each:function(a,b){return d.each(this,a,b)},ready:function(a){return d.bindReady(),z.add(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){return a.$===d&&(a.$=f),b&&a.jQuery===d&&(a.jQuery=e),d},isReady:!1,readyWait:1,holdReady:function(a){a?d.readyWait++:d.ready(!0)},ready:function(a){if(a===!0&&!--d.readyWait||a!==!0&&!d.isReady){if(!H.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;z.fireWith(H,[d]),d.fn.trigger&&d(H).trigger("ready").off("ready")}},bindReady:function(){if(!z){z=d.Callbacks("once memory");if(H.readyState==="complete")return setTimeout(d.ready,1);if(H.addEventListener)H.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(H.attachEvent){H.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}H.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):J[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var e;for(e in a);return e===b||C.call(a,e)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(m.test(b.replace(n,"@").replace(o,"]").replace(p,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(c){var e,f;try{a.DOMParser?(f=new DOMParser,e=f.parseFromString(c,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(c))}catch(g){e=b}return(!e||!e.documentElement||e.getElementsByTagName("parsererror").length)&&d.error("Invalid XML: "+c),e},noop:function(){},globalEval:function(b){b&&i.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(v,"ms-").replace(u,w)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(G)return G.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];return a.length=d,a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,e){var f,g,h=[],i=0,j=a.length,k=a instanceof d||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||d.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,e),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,e),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var e=a[c];c=a,a=e}if(!d.isFunction(a))return b;var f=E.call(arguments,2),g=function(){return a.apply(c,f.concat(E.call(arguments)))};return g.guid=a.guid=a.guid||g.guid||d.guid++,g},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=q.exec(a)||r.exec(a)||s.exec(a)||a.indexOf("compatible")<0&&t.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,e){return e&&e instanceof d&&!(e instanceof a)&&(e=a(e)),d.fn.init.call(this,c,e,b)},a.fn.init.prototype=a.fn;var b=a(H);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),y=d.uaMatch(x),y.browser&&(d.browser[y.browser]=!0,d.browser.version=y.version),d.browser.webkit&&(d.browser.safari=!0),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(H),H.addEventListener?A=function(){H.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:H.attachEvent&&(A=function(){H.readyState==="complete"&&(H.detachEvent("onreadystatechange",A),d.ready())}),d}(),L={};K.Callbacks=function(a){a=a?L[a]||G(a):{};var c=[],d=[],e,f,g,h,i,j=function(b){var d,e,f,g,h;for(d=0,e=b.length;d<e;d++)f=b[d],g=K.type(f),g==="array"?j(f):g==="function"&&(!a.unique||!l.has(f))&&c.push(f)},k=function(b,j){j=j||[],e=!a.memory||[b,j],f=!0,i=g||0,g=0,h=c.length;for(;c&&i<h;i++)if(c[i].apply(b,j)===!1&&a.stopOnFalse){e=!0;break}f=!1,c&&(a.once?e===!0?l.disable():c=[]:d&&d.length&&(e=d.shift(),l.fireWith(e[0],e[1])))},l={add:function(){if(c){var a=c.length;j(arguments),f?h=c.length:e&&e!==!0&&(g=a,k(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var g=0;g<c.length;g++)if(b[d]===c[g]){f&&g<=h&&(h--,g<=i&&i--),c.splice(g--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){return c=[],this},disable:function(){return c=d=e=b,this},disabled:function(){return!c},lock:function(){return d=b,(!e||e===!0)&&l.disable(),this},locked:function(){return!d},fireWith:function(b,c){return d&&(f?a.once||d.push([b,c]):(!a.once||!e)&&k(b,c)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!e}};return l};var M=[].slice;K.extend({Deferred:function(a){var b=K.Callbacks("once memory"),c=K.Callbacks("once memory"),d=K.Callbacks("memory"),e="pending",f={resolve:b,reject:c,notify:d},g={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){return h.done(a).fail(b).progress(c),this},always:function(){return h.done.apply(h,arguments).fail.apply(h,arguments),this},pipe:function(a,b,c){return K.Deferred(function(d){K.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],f;K.isFunction(c)?h[a](function(){f=c.apply(this,arguments),f&&K.isFunction(f.promise)?f.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===h?d:this,[f])}):h[a](d[e])})}).promise()},promise:function(a){if(a==null)a=g;else for(var b in g)a[b]=g[b];return a}},h=g.promise({}),i;for(i in f)h[i]=f[i].fire,h[i+"With"]=f[i].fireWith;return h.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(h,h),h},when:function(a){function b(a){return function(b){g[a]=arguments.length>1?M.call(arguments,0):b,j.notifyWith(k,g)}}function c(a){return function(b){d[a]=arguments.length>1?M.call(arguments,0):b,--h||j.resolveWith(j,d)}}var d=M.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,i=f,j=f<=1&&a&&K.isFunction(a.promise)?a:K.Deferred(),k=j.promise();if(f>1){for(;e<f;e++)d[e]&&d[e].promise&&K.isFunction(d[e].promise)?d[e].promise().then(c(e),j.reject,b(e)):--h;h||j.resolveWith(j,d)}else j!==a&&j.resolveWith(j,f?[a]:[]);return k}}),K.support=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=H.createElement("div"),p=H.documentElement;o.setAttribute("className","t"),o.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",c=o.getElementsByTagName("*"),d=o.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=H.createElement("select"),f=e.appendChild(H.createElement("option")),g=o.getElementsByTagName("input")[0],b={leadingWhitespace:o.firstChild.nodeType===3,tbody:!o.getElementsByTagName("tbody").length,htmlSerialize:!!o.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:g.value==="on",optSelected:f.selected,getSetAttribute:o.className!=="t",enctype:!!H.createElement("form").enctype,html5Clone:H.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},g.checked=!0,b.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,b.optDisabled=!f.disabled;try{delete o.test}catch(q){b.deleteExpando=!1}!o.addEventListener&&o.attachEvent&&o.fireEvent&&(o.attachEvent("onclick",function(){b.noCloneEvent=!1}),o.cloneNode(!0).fireEvent("onclick")),g=H.createElement("input"),g.value="t",g.setAttribute("type","radio"),b.radioValue=g.value==="t",g.setAttribute("checked","checked"),o.appendChild(g),i=H.createDocumentFragment(),i.appendChild(o.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=g.checked,i.removeChild(g),i.appendChild(o),o.innerHTML="",a.getComputedStyle&&(h=H.createElement("div"),h.style.width="0",h.style.marginRight="0",o.style.width="2px",o.appendChild(h),b.reliableMarginRight=(parseInt((a.getComputedStyle(h,null)||{marginRight:0}).marginRight,10)||0)===0);if(o.attachEvent)for(m in{submit:1,change:1,focusin:1})l="on"+m,n=l in o,n||(o.setAttribute(l,"return;"),n=typeof o[l]=="function"),b[m+"Bubbles"]=n;return i.removeChild(o),i=e=f=h=o=g=null,K(function(){var a,c,d,e,f,g,h,i,k,l,m,p=H.getElementsByTagName("body")[0];!p||(h=1,i="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",k="visibility:hidden;border:0;",l="style='"+i+"border:5px solid #000;padding:0;'",m="<div "+l+"><div></div></div>"+"<table "+l+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=H.createElement("div"),a.style.cssText=k+"width:0;height:0;position:static;top:0;margin-top:"+h+"px",p.insertBefore(a,p.firstChild),o=H.createElement("div"),a.appendChild(o),o.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",j=o.getElementsByTagName("td"),n=j[0].offsetHeight===0,j[0].style.display="",j[1].style.display="none",b.reliableHiddenOffsets=n&&j[0].offsetHeight===0,o.innerHTML="",o.style.width=o.style.paddingLeft="1px",K.boxModel=b.boxModel=o.offsetWidth===2,typeof o.style.zoom!="undefined"&&(o.style.display="inline",o.style.zoom=1,b.inlineBlockNeedsLayout=o.offsetWidth===2,o.style.display="",o.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=o.offsetWidth!==2),o.style.cssText=i+k,o.innerHTML=m,c=o.firstChild,d=c.firstChild,f=c.nextSibling.firstChild.firstChild,g={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:f.offsetTop===5},d.style.position="fixed",d.style.top="20px",g.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",c.style.overflow="hidden",c.style.position="relative",g.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,g.doesNotIncludeMarginInBodyOffset=p.offsetTop!==h,p.removeChild(a),o=a=null,K.extend(b,g))}),b}();var N=/^(?:\{.*\}|\[.*\])$/,O=/([A-Z])/g;K.extend({cache:{},uuid:0,expando:"jQuery"+(K.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?K.cache[a[K.expando]]:a[K.expando],!!a&&!E(a)},data:function(a,c,d,e){if(!!K.acceptData(a)){var f,g,h,i=K.expando,j=typeof c=="string",k=a.nodeType,l=k?K.cache:a,m=k?a[i]:a[i]&&i,n=c==="events";if((!m||!l[m]||!n&&!e&&!l[m].data)&&j&&d===b)return;m||(k?a[i]=m=++K.uuid:m=i),l[m]||(l[m]={},k||(l[m].toJSON=K.noop));if(typeof c=="object"||typeof c=="function")e?l[m]=K.extend(l[m],c):l[m].data=K.extend(l[m].data,c);return f=g=l[m],e||(g.data||(g.data={}),g=g.data),d!==b&&(g[K.camelCase(c)]=d),n&&!g[c]?f.events:(j?(h=g[c],h==null&&(h=g[K.camelCase(c)])):h=g,h)}},removeData:function(a,b,c){if(!!K.acceptData(a)){var d,e,f,g=K.expando,h=a.nodeType,i=h?K.cache:a,j=h?a[g]:g;if(!i[j])return;if(b){d=c?i[j]:i[j].data;if(d){K.isArray(b)||(b in d?b=[b]:(b=K.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?E:K.isEmptyObject)(d))return}}if(!c){delete i[j].data;if(!E(i[j]))return}K.support.deleteExpando||!i.setInterval?delete i[j]:i[j]=null,h&&(K.support.deleteExpando?delete a[g]:a.removeAttribute?a.removeAttribute(g):a[g]=null)}},_data:function(a,b,c){return K.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=K.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),K.fn.extend({data:function(a,c){var d,e,f,g=null;if(typeof a=="undefined"){if(this.length){g=K.data(this[0]);if(this[0].nodeType===1&&!K._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var h=0,i=e.length;h<i;h++)f=e[h].name,f.indexOf("data-")===0&&(f=K.camelCase(f.substring(5)),F(this[0],f,g[f]));K._data(this[0],"parsedAttrs",!0)}}return g}return typeof a=="object"?this.each(function(){K.data(this,a)}):(d=a.split("."),d[1]=d[1]?"."+d[1]:"",c===b?(g=this.triggerHandler("getData"+d[1]+"!",[d[0]]),g===b&&this.length&&(g=K.data(this[0],a),g=F(this[0],a,g)),g===b&&d[1]?this.data(d[0]):g):this.each(function(){var b=K(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),K.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)}))},removeData:function(a){return this.each(function(){K.removeData(this,a)})}}),K.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",K._data(a,b,(K._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(K._data(b,d)||1)-1;e?K._data(b,d,e):(K.removeData(b,d,!0),D(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=K._data(a,b),c&&(!d||K.isArray(c)?d=K._data(a,b,K.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=K.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),K._data(a,b+".run",e),d.call(a,function(){K.dequeue(a,b)},e)),c.length||(K.removeData(a,b+"queue "+b+".run",!0),D(a,b,"queue"))}}),K.fn.extend({queue:function(a,c){return typeof a!="string"&&(c=a,a="fx"),c===b?K.queue(this[0],a):this.each(function(){var b=K.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&K.dequeue(this,a)})},dequeue:function(a){return this.each(function(){K.dequeue(this,a)})},delay:function(a,b){return a=K.fx?K.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function d(){--h||e.resolveWith(f,[f])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var e=K.Deferred(),f=this,g=f.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=K.data(f[g],i,b,!0)||(K.data(f[g],j,b,!0)||K.data(f[g],k,b,!0))&&K.data(f[g],i,K.Callbacks("once memory"),!0))h++,l.add(d);return d(),e.promise()}});var P=/[\n\t\r]/g,Q=/\s+/,R=/\r/g,S=/^(?:button|input)$/i,T=/^(?:button|input|object|select|textarea)$/i,U=/^a(?:rea)?$/i,V=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,W=K.support.getSetAttribute,X,Y,Z;K.fn.extend({attr:function(a,b){return K.access(this,a,b,!0,K.attr)},removeAttr:function(a){return this.each(function(){K.removeAttr(this,a)})},prop:function(a,b){return K.access(this,a,b,!0,K.prop)},removeProp:function(a){return a=K.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(K.isFunction(a))return this.each(function(b){K(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(Q);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=K.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(K.isFunction(a))return this.each(function(b){K(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(Q);for(d=0,e=this.length;d<e;d++){f=this[d];if(f.nodeType===1&&f.className)if(a){g=(" "+f.className+" ").replace(P," ");for(h=0,i=c.length;h<i;h++)g=g.replace(" "+c[h]+" "," ");f.className=K.trim(g)}else f.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return K.isFunction(a)?this.each(function(c){K(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=K(this),h=b,i=a.split(Q);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&K._data(this,"__className__",this.className),this.className=this.className||a===!1?"":K._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(P," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!!arguments.length)return e=K.isFunction(a),this.each(function(d){var f=K(this),g;if(this.nodeType===1){e?g=a.call(this,d,f.val()):g=a,g==null?g="":typeof g=="number"?g+="":K.isArray(g)&&(g=K.map(g,function(a){return a==null?"":a+""})),c=K.valHooks[this.nodeName.toLowerCase()]||K.valHooks[this.type];if(!c||!("set"in c)||c.set(this,g,"value")===b)this.value=g}});if(f)return c=K.valHooks[f.nodeName.toLowerCase()]||K.valHooks[f.type],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(R,""):d==null?"":d)}}),K.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(K.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!K.nodeName(e.parentNode,"optgroup"))){b=K(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?K(h[f]).val():g},set:function(a,b){var c=K.makeArray(b);return K(a).find("option").each(function(){this.selected=K.inArray(K(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){if(e&&c in K.attrFn)return K(a)[c](d);if(typeof a.getAttribute=="undefined")return K.prop(a,c,d);h=i!==1||!K.isXMLDoc(a),h&&(c=c.toLowerCase(),g=K.attrHooks[c]||(V.test(c)?Y:X));if(d!==b){if(d===null){K.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)}},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(Q),f=d.length;for(;g<f;g++)e=d[g],e&&(c=K.propFix[e]||e,K.attr(a,e,""),a.removeAttribute(W?e:c),V.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(S.test(a.nodeName)&&a.parentNode)K.error("type property can't be changed");else if(!K.support.radioValue&&b==="radio"&&K.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return X&&K.nodeName(a,"button")?X.get(a,b):b in a?a.value:null},set:function(a,b,c){if(X&&K.nodeName(a,"button"))return X.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!!a&&h!==3&&h!==8&&h!==2)return g=h!==1||!K.isXMLDoc(a),g&&(c=K.propFix[c]||c,f=K.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):T.test(a.nodeName)||U.test(a.nodeName)&&a.href?0:b}}}}),K.attrHooks.tabindex=K.propHooks.tabIndex,Y={get:function(a,c){var d,e=K.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?K.removeAttr(a,c):(d=K.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},W||(Z={name:!0,id:!0},X=K.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(Z[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=H.createAttribute(c),a.setAttributeNode(d)),d.nodeValue=b+""}},K.attrHooks.tabindex.set=X.set,K.each(["width","height"],function(a,b){K.attrHooks[b]=K.extend(K.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),K.attrHooks.contenteditable={get:X.get,set:function(a,b,c){b===""&&(b="false"),X.set(a,b,c)}}),K.support.hrefNormalized||K.each(["href","src","width","height"],function(a,c){K.attrHooks[c]=K.extend(K.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),K.support.style||(K.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),K.support.optSelected||(K.propHooks.selected=K.extend(K.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),K.support.enctype||(K.propFix.enctype="encoding"),K.support.checkOn||K.each(["radio","checkbox"],function(){K.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),K.each(["radio","checkbox"],function(){K.valHooks[this]=K.extend(K.valHooks[this],{set:function(a,b){if(K.isArray(b))return a.checked=K.inArray(K(a).val(),b)>=0}})});var $=/^(?:textarea|input|select)$/i,_=/^([^\.]*)?(?:\.(.+))?$/,ba=/\bhover(\.\S+)?\b/,bb=/^key/,bc=/^(?:mouse|contextmenu)|click/,bd=/^(?:focusinfocus|focusoutblur)$/,be=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,bf=function(a){var b=be.exec(a);return b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)")),b},bg=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},bh=function(a){return K.event.special.hover?a:a.replace(ba,"mouseenter$1 mouseleave$1")};K.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(g=K._data(a)))){d.handler&&(o=d,d=o.handler),d.guid||(d.guid=K.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof K=="undefined"||!!a&&K.event.triggered===a.type?b:K.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=K.trim(bh(c)).split(" ");for(j=0;j<c.length;j++){k=_.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=K.event.special
[l]||{},l=(f?r.delegateType:r.bindType)||l,r=K.event.special[l]||{},n=K.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,quick:bf(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),K.event.global[l]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var f=K.hasData(a)&&K._data(a),g,h,i,j,k,l,m,n,o,p,q,r;if(!!f&&!!(n=f.events)){b=K.trim(bh(b||"")).split(" ");for(g=0;g<b.length;g++){h=_.exec(b[g])||[],i=j=h[1],k=h[2];if(!i){for(i in n)K.event.remove(a,i+b[g],c,d,!0);continue}o=K.event.special[i]||{},i=(d?o.delegateType:o.bindType)||i,q=n[i]||[],l=q.length,k=k?new RegExp("(^|\\.)"+k.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(m=0;m<q.length;m++)r=q[m],(e||j===r.origType)&&(!c||c.guid===r.guid)&&(!k||k.test(r.namespace))&&(!d||d===r.selector||d==="**"&&r.selector)&&(q.splice(m--,1),r.selector&&q.delegateCount--,o.remove&&o.remove.call(a,r));q.length===0&&l!==q.length&&((!o.teardown||o.teardown.call(a,k)===!1)&&K.removeEvent(a,i,f.handle),delete n[i])}K.isEmptyObject(n)&&(p=f.handle,p&&(p.elem=null),K.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,f){if(!e||e.nodeType!==3&&e.nodeType!==8){var g=c.type||c,h=[],i,j,k,l,m,n,o,p,q,r;if(bd.test(g+K.event.triggered))return;g.indexOf("!")>=0&&(g=g.slice(0,-1),j=!0),g.indexOf(".")>=0&&(h=g.split("."),g=h.shift(),h.sort());if((!e||K.event.customEvent[g])&&!K.event.global[g])return;c=typeof c=="object"?c[K.expando]?c:new K.Event(g,c):new K.Event(g),c.type=g,c.isTrigger=!0,c.exclusive=j,c.namespace=h.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,n=g.indexOf(":")<0?"on"+g:"";if(!e){i=K.cache;for(k in i)i[k].events&&i[k].events[g]&&K.event.trigger(c,d,i[k].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?K.makeArray(d):[],d.unshift(c),o=K.event.special[g]||{};if(o.trigger&&o.trigger.apply(e,d)===!1)return;q=[[e,o.bindType||g]];if(!f&&!o.noBubble&&!K.isWindow(e)){r=o.delegateType||g,l=bd.test(r+g)?e:e.parentNode,m=null;for(;l;l=l.parentNode)q.push([l,r]),m=l;m&&m===e.ownerDocument&&q.push([m.defaultView||m.parentWindow||a,r])}for(k=0;k<q.length&&!c.isPropagationStopped();k++)l=q[k][0],c.type=q[k][1],p=(K._data(l,"events")||{})[c.type]&&K._data(l,"handle"),p&&p.apply(l,d),p=n&&l[n],p&&K.acceptData(l)&&p.apply(l,d)===!1&&c.preventDefault();return c.type=g,!f&&!c.isDefaultPrevented()&&(!o._default||o._default.apply(e.ownerDocument,d)===!1)&&(g!=="click"||!K.nodeName(e,"a"))&&K.acceptData(e)&&n&&e[g]&&(g!=="focus"&&g!=="blur"||c.target.offsetWidth!==0)&&!K.isWindow(e)&&(m=e[n],m&&(e[n]=null),K.event.triggered=g,e[g](),K.event.triggered=b,m&&(e[n]=m)),c.result}},dispatch:function(c){c=K.event.fix(c||a.event);var d=(K._data(this,"events")||{})[c.type]||[],e=d.delegateCount,f=[].slice.call(arguments,0),g=!c.exclusive&&!c.namespace,h=[],i,j,k,l,m,n,o,p,q,r,s;f[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){l=K(this),l.context=this.ownerDocument||this;for(k=c.target;k!=this;k=k.parentNode||this){n={},p=[],l[0]=k;for(i=0;i<e;i++)q=d[i],r=q.selector,n[r]===b&&(n[r]=q.quick?bg(k,q.quick):l.is(r)),n[r]&&p.push(q);p.length&&h.push({elem:k,matches:p})}}d.length>e&&h.push({elem:this,matches:d.slice(e)});for(i=0;i<h.length&&!c.isPropagationStopped();i++){o=h[i],c.currentTarget=o.elem;for(j=0;j<o.matches.length&&!c.isImmediatePropagationStopped();j++){q=o.matches[j];if(g||!c.namespace&&!q.namespace||c.namespace_re&&c.namespace_re.test(q.namespace))c.data=q.data,c.handleObj=q,m=((K.event.special[q.origType]||{}).handle||q.handler).apply(o.elem,f),m!==b&&(c.result=m,m===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,f,g=c.button,h=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||H,e=d.documentElement,f=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?c.toElement:h),!a.which&&g!==b&&(a.which=g&1?1:g&2?3:g&4?2:0),a}},fix:function(a){if(a[K.expando])return a;var c,d,e=a,f=K.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=K.Event(e);for(c=g.length;c;)d=g[--c],a[d]=e[d];return a.target||(a.target=e.srcElement||H),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey),f.filter?f.filter(a,e):a},special:{ready:{setup:K.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){K.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=K.extend(new K.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?K.event.trigger(e,null,b):K.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},K.event.handle=K.event.dispatch,K.removeEvent=H.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},K.Event=function(a,b){if(this instanceof K.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?B:C):this.type=a,b&&K.extend(this,b),this.timeStamp=a&&a.timeStamp||K.now(),this[K.expando]=!0;else return new K.Event(a,b)},K.Event.prototype={preventDefault:function(){this.isDefaultPrevented=B;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=B;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=B,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C},K.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){K.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,f=e.selector,g;if(!d||d!==c&&!K.contains(c,d))a.type=e.origType,g=e.handler.apply(this,arguments),a.type=b;return g}}}),K.support.submitBubbles||(K.event.special.submit={setup:function(){if(K.nodeName(this,"form"))return!1;K.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=K.nodeName(c,"input")||K.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(K.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&K.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(K.nodeName(this,"form"))return!1;K.event.remove(this,"._submit")}}),K.support.changeBubbles||(K.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")K.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),K.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,K.event.simulate("change",this,a,!0))});return!1}K.event.add(this,"beforeactivate._change",function(a){var b=a.target;$.test(b.nodeName)&&!b._change_attached&&(K.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&K.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return K.event.remove(this,"._change"),$.test(this.nodeName)}}),K.support.focusinBubbles||K.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){K.event.simulate(b,a.target,K.event.fix(a),!0)};K.event.special[b]={setup:function(){c++===0&&H.addEventListener(a,d,!0)},teardown:function(){--c===0&&H.removeEventListener(a,d,!0)}}}),K.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=C;else if(!e)return this;return f===1&&(g=e,e=function(a){return K().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=K.guid++)),this.each(function(){K.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;return K(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler),this}if(typeof a=="object"){for(var f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=C),this.each(function(){K.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return K(this.context).on(a,this.selector,b,c),this},die:function(a,b){return K(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){K.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return K.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||K.guid++,d=0,e=function(c){var e=(K._data(this,"lastToggle"+a.guid)||0)%d;return K._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),K.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){K.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},K.attrFn&&(K.attrFn[b]=!0),bb.test(b)&&(K.event.fixHooks[b]=K.event.keyHooks),bc.test(b)&&(K.event.fixHooks[b]=K.event.mouseHooks)}),function(){function a(a,b,c,d,f,g){for(var h=0,i=d.length;h<i;h++){var j=d[h];if(j){var k=!1;j=j[a];while(j){if(j[e]===c){k=d[j.sizset];break}if(j.nodeType===1){g||(j[e]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}d[h]=k}}}function c(a,b,c,d,f,g){for(var h=0,i=d.length;h<i;h++){var j=d[h];if(j){var k=!1;j=j[a];while(j){if(j[e]===c){k=d[j.sizset];break}j.nodeType===1&&!g&&(j[e]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}d[h]=k}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){return i=!1,0});var m=function(a,b,c,e){c=c||[],b=b||H;var f=b;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!="string")return c;var h,i,j,k,l,n,q,r,t=!0,u=m.isXML(b),v=[],x=a;do{d.exec(""),h=d.exec(x);if(h){x=h[3],v.push(h[1]);if(h[2]){k=h[3];break}}}while(h);if(v.length>1&&p.exec(a))if(v.length===2&&o.relative[v[0]])i=w(v[0]+v[1],b,e);else{i=o.relative[v[0]]?[b]:m(v.shift(),b);while(v.length)a=v.shift(),o.relative[a]&&(a+=v.shift()),i=w(a,i,e)}else{!e&&v.length>1&&b.nodeType===9&&!u&&o.match.ID.test(v[0])&&!o.match.ID.test(v[v.length-1])&&(l=m.find(v.shift(),b,u),b=l.expr?m.filter(l.expr,l.set)[0]:l.set[0]);if(b){l=e?{expr:v.pop(),set:s(e)}:m.find(v.pop(),v.length!==1||v[0]!=="~"&&v[0]!=="+"||!b.parentNode?b:b.parentNode,u),i=l.expr?m.filter(l.expr,l.set):l.set,v.length>0?j=s(i):t=!1;while(v.length)n=v.pop(),q=n,o.relative[n]?q=v.pop():n="",q==null&&(q=b),o.relative[n](j,q,u)}else j=v=[]}j||(j=i),j||m.error(n||a);if(g.call(j)==="[object Array]")if(!t)c.push.apply(c,j);else if(b&&b.nodeType===1)for(r=0;j[r]!=null;r++)j[r]&&(j[r]===!0||j[r].nodeType===1&&m.contains(b,j[r]))&&c.push(i[r]);else for(r=0;j[r]!=null;r++)j[r]&&j[r].nodeType===1&&c.push(i[r]);else s(j,c);return k&&(m(k,f,c,e),m.uniqueSort(c)),c};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}return d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]),{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,i=a;typeof d=="string"&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("parentNode",d,h,b,g,e)},"~":function(b,d,e){var g,h=f++,i=a;typeof d=="string"&&!l.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("previousSibling",d,h,b,g,e)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);return a[0]=f++,a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");return!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" "),a},PSEUDO:function(a,b,c,e,f){if(a[1]==="not")if((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=m(a[3],null,null,b);else{var g=m.filter(a[3],b,c,!0^f);return c||e.push.apply(e,g),!1}else if(o.match.POS.test(a[0])||o.match.CHILD.test(a[0]))return!0;return a},POS:function(a){return a.unshift(!0),a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,d,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],d=b[3];if(c===1&&d===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[e]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[e]=f}return j=a.nodeIndex-d,c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){return a=Array.prototype.slice.call(a,0),b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(H.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;H.documentElement.compareDocumentPosition?u=function(a,b){return a===b?(h=!0,0):!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b)return h=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=H.createElement("div"),c="script"+(new Date).getTime(),d=H.documentElement;a.innerHTML="<a name='"+c+"'/>",d.insertBefore(a,d.firstChild),H.getElementById(c)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=H.createElement("div");a.appendChild(H.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),H.querySelectorAll&&function(){var a=m,b=H.createElement("div"),c="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,d,e,f){d=d||H;if(!f&&!m.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(d.nodeType===1||d.nodeType===9)){if(g[1])return s(d.getElementsByTagName(b),e);if(g[2]&&o.find.CLASS&&d.getElementsByClassName)return s(d.getElementsByClassName(g[2]),e)}if(d.nodeType===9){if(b==="body"&&d.body)return s([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return s([],e);if(h.id===g[3])return s([h],e)}try{return s(d.querySelectorAll(b),e)}catch(i){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d,k=d.getAttribute("id"),l=k||c,n=d.parentNode,p=/^\s*[+~]/.test(b);k?l=l.replace(/'/g,"\\$&"):d.setAttribute("id",l),p&&n&&(d=d.parentNode);try{if(!p||n)return s(d.querySelectorAll("[id='"+l+"'] "+b),e)}catch(q){}finally{k||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)m[d]=a[d];b=null}}(),function(){var a=H.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(H.createElement("div"),"div"),d=!1;try{b.call(H.documentElement,"[test!='']:sizzle")}catch(e){d=!0}m.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(d||!o.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(e,null,null,[a]).length>0}}}(),function(){var a=H.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),H.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:H.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var w=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=K.attr,m.selectors.attrMap={},K.find=m,K.expr=m.selectors,K.expr[":"]=K.expr.filters,K.unique=m.uniqueSort,K.text=m.getText,K.isXMLDoc=m.isXML,K.contains=m.contains}();var bi=/Until$/,bj=/^(?:parents|prevUntil|prevAll)/,bk=/,/,bl=/^.[^:#\[\.,]*$/,bm=Array.prototype.slice,bn=K.expr.match.POS,bo={children:!0,contents:!0,next:!0,prev:!0};K.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return K(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(K.contains(b[c],this))return!0});var e=this.pushStack("","find",a),f,g,h;for(c=0,d=this.length;c<d;c++){f=e.length,K.find(a,this[c],e);if(c>0)for(g=f;g<e.length;g++)for(h=0;h<f;h++)if(e[h]===e[g]){e.splice(g--,1);break}}return e},has:function(a){var b=K(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(K.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(z(this,a,!1),"not",a)},filter:function(a){return this.pushStack(z(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bn.test(a)?K(a,this.context).index(this[0])>=0:K.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,f=this[0];if(K.isArray(a)){var g=1;while(f&&f.ownerDocument&&f!==b){for(d=0;d<a.length;d++)K(f).is(a[d])&&c.push({selector:a[d],elem:f,level:g});f=f.parentNode,g++}return c}var h=bn.test(a)||typeof a!="string"?K(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){f=this[d];while(f){if(h?h.index(f)>-1:K.find.matchesSelector(f,a)){c.push(f);break}f=f.parentNode;if(!f||!f.ownerDocument||f===b||f.nodeType===11)break}}return c=c.length>1?K.unique(c):c,this.pushStack(c,"closest",a)},index:function(a){return a?typeof a=="string"?K.inArray(this[0],K(a)):K.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?K(a,b):K.makeArray(a&&a.nodeType?[a]:a),d=K.merge(this.get(),c);return this.pushStack(A(c[0])||A(d[0])?d:K.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),K.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return K.dir(a,"parentNode")},parentsUntil:function(a,b,c){return K.dir(a,"parentNode",c)},next:function(a){return K.nth(a,2,"nextSibling")},prev:function(a){return K.nth(a,2,"previousSibling")},nextAll:function(a){return K.dir(a,"nextSibling")},prevAll:function(a){return K.dir(a,"previousSibling")},nextUntil:function(a,b,c){return K.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return K.dir(a,"previousSibling",c)},siblings:function(a){return K.sibling(a.parentNode.firstChild,a)},children:function(a){return K.sibling(a.firstChild)},contents:function(a){return K.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:K.makeArray(a.childNodes)}},function(a,b){K.fn[a]=function(c,d){var e=K.map(this,b,c);return bi.test(a)||(d=c),d&&typeof d=="string"&&(e=K.filter(d,e)),e=this.length>1&&!bo[a]?K.unique(e):e,(this.length>1||bk.test(d))&&bj.test(a)&&(e=e.reverse()),this.pushStack(e,a,bm.call(arguments).join(","))}}),K.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?K.find.matchesSelector(b[0],a)?[b[0]]:[]:K.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!K(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bp="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bq=/ jQuery\d+="(?:\d+|null)"/g,br=/^\s+/,bs=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,bt=/<([\w:]+)/,bu=/<tbody/i,bv=/<|&#?\w+;/,bw=/<(?:script|style)/i,bx=/<(?:script|object|embed|option|style)/i,by=new RegExp("<(?:"+bp+")","i"),bz=/checked\s*(?:[^=]|=\s*.checked.)/i,bA=/\/(java|ecma)script/i,bB=/^\s*<!(?:\[CDATA\[|\-\-)/,bC={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bD=y(H);bC.optgroup=bC.option,bC.tbody=bC.tfoot=bC.colgroup=bC.caption=bC.thead,bC.th=bC.td,K.support.htmlSerialize||(bC._default=[1,"div<div>","</div>"]),K.fn.extend({text:function(a){return K.isFunction(a)?this.each(function(b){var c=K(this);c.text(a.call(this,b,c.text()))}):typeof a!="object"&&a!==b?this.empty().append((this[0]&&this[0].ownerDocument||H).createTextNode(a)):K.text(this)},wrapAll:function(a){if(K.isFunction(a))return this.each(function(b){K(this).wrapAll(a.call(this,b))});if(this[0]){var b=K(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return K.isFunction(a)?this.each(function(b){K(this).wrapInner(a.call(this,b))}):this.each(function(){var b=K(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=K.isFunction(a);return this.each(function(c){K(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){K.nodeName(this,"body")||K(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=K.clean(arguments);return a.push.apply(a,this.toArray()),this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);return a.push.apply(a,K.clean(arguments)),a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||K.filter(a,[d]).length)!b&&d.nodeType===1&&(K.cleanData(d.getElementsByTagName("*")),K.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&K.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return K.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(bq,""):null;if(typeof a=="string"&&!bw.test(a)&&(K.support.leadingWhitespace||!br.test(a))&&!bC[(bt.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bs,"<$1></$2>");try{for(var c=0,d=this.length
;c<d;c++)this[c].nodeType===1&&(K.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else K.isFunction(a)?this.each(function(b){var c=K(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){return this[0]&&this[0].parentNode?K.isFunction(a)?this.each(function(b){var c=K(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=K(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;K(this).remove(),b?K(b).before(a):K(c).append(a)})):this.length?this.pushStack(K(K.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g,h,i=a[0],j=[];if(!K.support.checkClone&&arguments.length===3&&typeof i=="string"&&bz.test(i))return this.each(function(){K(this).domManip(a,c,d,!0)});if(K.isFunction(i))return this.each(function(e){var f=K(this);a[0]=i.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){h=i&&i.parentNode,K.support.parentNode&&h&&h.nodeType===11&&h.childNodes.length===this.length?e={fragment:h}:e=K.buildFragment(a,this,j),g=e.fragment,g.childNodes.length===1?f=g=g.firstChild:f=g.firstChild;if(f){c=c&&K.nodeName(f,"tr");for(var k=0,l=this.length,m=l-1;k<l;k++)d.call(c?x(this[k],f):this[k],e.cacheable||l>1&&k<m?K.clone(g,!0,!0):g)}j.length&&K.each(j,q)}return this}}),K.buildFragment=function(a,b,c){var d,e,f,g,h=a[0];return b&&b[0]&&(g=b[0].ownerDocument||b[0]),g.createDocumentFragment||(g=H),a.length===1&&typeof h=="string"&&h.length<512&&g===H&&h.charAt(0)==="<"&&!bx.test(h)&&(K.support.checkClone||!bz.test(h))&&(K.support.html5Clone||!by.test(h))&&(e=!0,f=K.fragments[h],f&&f!==1&&(d=f)),d||(d=g.createDocumentFragment(),K.clean(a,g,d,c)),e&&(K.fragments[h]=f?d:1),{fragment:d,cacheable:e}},K.fragments={},K.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){K.fn[a]=function(c){var d=[],e=K(c),f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&e.length===1)return e[b](this[0]),this;for(var g=0,h=e.length;g<h;g++){var i=(g>0?this.clone(!0):this).get();K(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),K.extend({clone:function(a,b,c){var d,e,f,g=K.support.html5Clone||!by.test("<"+a.nodeName)?a.cloneNode(!0):r(a);if((!K.support.noCloneEvent||!K.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!K.isXMLDoc(a)){v(a,g),d=u(a),e=u(g);for(f=0;d[f];++f)e[f]&&v(d[f],e[f])}if(b){w(a,g);if(c){d=u(a),e=u(g);for(f=0;d[f];++f)w(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var e;b=b||H,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||H);var f=[],g;for(var h=0,i;(i=a[h])!=null;h++){typeof i=="number"&&(i+="");if(!i)continue;if(typeof i=="string")if(!bv.test(i))i=b.createTextNode(i);else{i=i.replace(bs,"<$1></$2>");var j=(bt.exec(i)||["",""])[1].toLowerCase(),k=bC[j]||bC._default,l=k[0],m=b.createElement("div");b===H?bD.appendChild(m):y(b).appendChild(m),m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!K.support.tbody){var n=bu.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(g=o.length-1;g>=0;--g)K.nodeName(o[g],"tbody")&&!o[g].childNodes.length&&o[g].parentNode.removeChild(o[g])}!K.support.leadingWhitespace&&br.test(i)&&m.insertBefore(b.createTextNode(br.exec(i)[0]),m.firstChild),i=m.childNodes}var p;if(!K.support.appendChecked)if(i[0]&&typeof (p=i.length)=="number")for(g=0;g<p;g++)s(i[g]);else s(i);i.nodeType?f.push(i):f=K.merge(f,i)}if(c){e=function(a){return!a.type||bA.test(a.type)};for(h=0;f[h];h++)if(d&&K.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))d.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{if(f[h].nodeType===1){var q=K.grep(f[h].getElementsByTagName("script"),e);f.splice.apply(f,[h+1,0].concat(q))}c.appendChild(f[h])}}return f},cleanData:function(a){var b,c,d=K.cache,e=K.event.special,f=K.support.deleteExpando;for(var g=0,h;(h=a[g])!=null;g++){if(h.nodeName&&K.noData[h.nodeName.toLowerCase()])continue;c=h[K.expando];if(c){b=d[c];if(b&&b.events){for(var i in b.events)e[i]?K.event.remove(h,i):K.removeEvent(h,i,b.handle);b.handle&&(b.handle.elem=null)}f?delete h[K.expando]:h.removeAttribute&&h.removeAttribute(K.expando),delete d[c]}}}});var bE=/alpha\([^)]*\)/i,bF=/opacity=([^)]*)/,bG=/([A-Z]|^ms)/g,bH=/^-?\d+(?:px)?$/i,bI=/^-?\d/,bJ=/^([\-+])=([\-+.\de]+)/,bK={position:"absolute",visibility:"hidden",display:"block"},bL=["Left","Right"],bM=["Top","Bottom"],bN,bO,bP;K.fn.css=function(a,c){return arguments.length===2&&c===b?this:K.access(this,a,c,!0,function(a,c,d){return d!==b?K.style(a,c,d):K.css(a,c)})},K.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bN(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":K.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var f,g,h=K.camelCase(c),i=a.style,j=K.cssHooks[h];c=K.cssProps[h]||h;if(d===b)return j&&"get"in j&&(f=j.get(a,!1,e))!==b?f:i[c];g=typeof d,g==="string"&&(f=bJ.exec(d))&&(d=+(f[1]+1)*+f[2]+parseFloat(K.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!K.cssNumber[h]&&(d+="px");if(!j||!("set"in j)||(d=j.set(a,d))!==b)try{i[c]=d}catch(k){}}},css:function(a,c,d){var e,f;c=K.camelCase(c),f=K.cssHooks[c],c=K.cssProps[c]||c,c==="cssFloat"&&(c="float");if(f&&"get"in f&&(e=f.get(a,!0,d))!==b)return e;if(bN)return bN(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),K.curCSS=K.css,K.each(["height","width"],function(a,b){K.cssHooks[b]={get:function(a,c,d){var e;if(c)return a.offsetWidth!==0?p(a,b,d):(K.swap(a,bK,function(){e=p(a,b,d)}),e)},set:function(a,b){if(!bH.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),K.support.opacity||(K.cssHooks.opacity={get:function(a,b){return bF.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=K.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&K.trim(f.replace(bE,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bE.test(f)?f.replace(bE,e):f+" "+e}}),K(function(){K.support.reliableMarginRight||(K.cssHooks.marginRight={get:function(a,b){var c;return K.swap(a,{display:"inline-block"},function(){b?c=bN(a,"margin-right","marginRight"):c=a.style.marginRight}),c}})}),H.defaultView&&H.defaultView.getComputedStyle&&(bO=function(a,b){var c,d,e;return b=b.replace(bG,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!K.contains(a.ownerDocument.documentElement,a)&&(c=K.style(a,b))),c}),H.documentElement.currentStyle&&(bP=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;return f===null&&g&&(e=g[b])&&(f=e),!bH.test(f)&&bI.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d)),f===""?"auto":f}),bN=bO||bP,K.expr&&K.expr.filters&&(K.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!K.support.reliableHiddenOffsets&&(a.style&&a.style.display||K.css(a,"display"))==="none"},K.expr.filters.visible=function(a){return!K.expr.filters.hidden(a)});var bQ=/%20/g,bR=/\[\]$/,bS=/\r?\n/g,bT=/#.*$/,bU=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bV=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bW=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bX=/^(?:GET|HEAD)$/,bY=/^\/\//,bZ=/\?/,b$=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,b_=/^(?:select|textarea)/i,ca=/\s+/,cb=/([?&])_=[^&]*/,cc=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,cd=K.fn.load,ce={},cf={},cg,ch,ci=["*/"]+["*"];try{cg=J.href}catch(cj){cg=H.createElement("a"),cg.href="",cg=cg.href}ch=cc.exec(cg.toLowerCase())||[],K.fn.extend({load:function(a,c,d){if(typeof a!="string"&&cd)return cd.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(K.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=K.param(c,K.ajaxSettings.traditional),g="POST"));var h=this;return K.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?K("<div>").append(c.replace(b$,"")).find(f):c)),d&&h.each(d,[c,b,a])}}),this},serialize:function(){return K.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?K.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||b_.test(this.nodeName)||bV.test(this.type))}).map(function(a,b){var c=K(this).val();return c==null?null:K.isArray(c)?K.map(c,function(a,c){return{name:b.name,value:a.replace(bS,"\r\n")}}):{name:b.name,value:c.replace(bS,"\r\n")}}).get()}}),K.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){K.fn[b]=function(a){return this.on(b,a)}}),K.each(["get","post"],function(a,c){K[c]=function(a,d,e,f){return K.isFunction(d)&&(f=f||e,e=d,d=b),K.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),K.extend({getScript:function(a,c){return K.get(a,b,c,"script")},getJSON:function(a,b,c){return K.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?m(a,K.ajaxSettings):(b=a,a=K.ajaxSettings),m(a,b),a},ajaxSettings:{url:cg,isLocal:bW.test(ch[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","*":ci},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":K.parseJSON,"text xml":K.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:o(ce),ajaxTransport:o(cf),ajax:function(a,c){function d(a,c,d,n){if(v!==2){v=2,t&&clearTimeout(t),s=b,q=n||"",y.readyState=a>0?4:0;var o,p,r,u=c,x=d?k(e,y,d):b,z,A;if(a>=200&&a<300||a===304){if(e.ifModified){if(z=y.getResponseHeader("Last-Modified"))K.lastModified[m]=z;if(A=y.getResponseHeader("Etag"))K.etag[m]=A}if(a===304)u="notmodified",o=!0;else try{p=j(e,x),u="success",o=!0}catch(B){u="parsererror",r=B}}else{r=u;if(!u||a)u="error",a<0&&(a=0)}y.status=a,y.statusText=""+(c||u),o?h.resolveWith(f,[p,u,y]):h.rejectWith(f,[y,u,r]),y.statusCode(l),l=b,w&&g.trigger("ajax"+(o?"Success":"Error"),[y,e,o?p:r]),i.fireWith(f,[y,u]),w&&(g.trigger("ajaxComplete",[y,e]),--K.active||K.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=K.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof K)?K(f):K.event,h=K.Deferred(),i=K.Callbacks("once memory"),l=e.statusCode||{},m,o={},p={},q,r,s,t,u,v=0,w,x,y={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=p[c]=p[c]||a,o[a]=b}return this},getAllResponseHeaders:function(){return v===2?q:null},getResponseHeader:function(a){var c;if(v===2){if(!r){r={};while(c=bU.exec(q))r[c[1].toLowerCase()]=c[2]}c=r[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(e.mimeType=a),this},abort:function(a){return a=a||"abort",s&&s.abort(a),d(0,a),this}};h.promise(y),y.success=y.done,y.error=y.fail,y.complete=i.add,y.statusCode=function(a){if(a){var b;if(v<2)for(b in a)l[b]=[l[b],a[b]];else b=a[y.status],y.then(b,b)}return this},e.url=((a||e.url)+"").replace(bT,"").replace(bY,ch[1]+"//"),e.dataTypes=K.trim(e.dataType||"*").toLowerCase().split(ca),e.crossDomain==null&&(u=cc.exec(e.url.toLowerCase()),e.crossDomain=!(!u||u[1]==ch[1]&&u[2]==ch[2]&&(u[3]||(u[1]==="http:"?80:443))==(ch[3]||(ch[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=K.param(e.data,e.traditional)),n(ce,e,c,y);if(v===2)return!1;w=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bX.test(e.type),w&&K.active++===0&&K.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bZ.test(e.url)?"&":"?")+e.data,delete e.data),m=e.url;if(e.cache===!1){var z=K.now(),A=e.url.replace(cb,"$1_="+z);e.url=A+(A===e.url?(bZ.test(e.url)?"&":"?")+"_="+z:"")}}(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",e.contentType),e.ifModified&&(m=m||e.url,K.lastModified[m]&&y.setRequestHeader("If-Modified-Since",K.lastModified[m]),K.etag[m]&&y.setRequestHeader("If-None-Match",K.etag[m])),y.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", "+ci+"; q=0.01":""):e.accepts["*"]);for(x in e.headers)y.setRequestHeader(x,e.headers[x]);if(!e.beforeSend||e.beforeSend.call(f,y,e)!==!1&&v!==2){for(x in{success:1,error:1,complete:1})y[x](e[x]);s=n(cf,e,c,y);if(!s)d(-1,"No Transport");else{y.readyState=1,w&&g.trigger("ajaxSend",[y,e]),e.async&&e.timeout>0&&(t=setTimeout(function(){y.abort("timeout")},e.timeout));try{v=1,s.send(o,d)}catch(B){if(v<2)d(-1,B);else throw B}}return y}return y.abort(),!1},param:function(a,c){var d=[],e=function(a,b){b=K.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=K.ajaxSettings.traditional);if(K.isArray(a)||a.jquery&&!K.isPlainObject(a))K.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(bQ,"+")}}),K.extend({active:0,lastModified:{},etag:{}});var ck=K.now(),cl=/(\=)\?(&|$)|\?\?/i;K.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return K.expando+"_"+ck++}}),K.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cl.test(b.url)||e&&cl.test(b.data))){var f,g=b.jsonpCallback=K.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";return b.jsonp!==!1&&(i=i.replace(cl,k),b.url===i&&(e&&(j=j.replace(cl,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.always(function(){a[g]=h,f&&K.isFunction(h)&&a[g](f[0])}),b.converters["script json"]=function(){return f||K.error(g+" was not called"),f[0]},b.dataTypes[0]="json","script"}}),K.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return K.globalEval(a),a}}}),K.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),K.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=H.head||H.getElementsByTagName("head")[0]||H.documentElement;return{send:function(e,f){c=H.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cm=a.ActiveXObject?function(){for(var a in co)co[a](0,1)}:!1,cn=0,co;K.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&i()||h()}:i,function(a){K.extend(K.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(K.ajaxSettings.xhr()),K.support.ajax&&K.ajaxTransport(function(c){if(!c.crossDomain||K.support.cors){var d;return{send:function(e,f){var g=c.xhr(),h,i;c.username?g.open(c.type,c.url,c.async,c.username,c.password):g.open(c.type,c.url,c.async);if(c.xhrFields)for(i in c.xhrFields)g[i]=c.xhrFields[i];c.mimeType&&g.overrideMimeType&&g.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(c.hasContent&&c.data||null),d=function(a,e){var i,j,k,l,m;try{if(d&&(e||g.readyState===4)){d=b,h&&(g.onreadystatechange=K.noop,cm&&delete co[h]);if(e)g.readyState!==4&&g.abort();else{i=g.status,k=g.getAllResponseHeaders(),l={},m=g.responseXML,m&&m.documentElement&&(l.xml=m),l.text=g.responseText;try{j=g.statusText}catch(n){j=""}!i&&c.isLocal&&!c.crossDomain?i=l.text?200:404:i===1223&&(i=204)}}}catch(o){e||f(-1,o)}l&&f(i,j,l,k)},!c.async||g.readyState===4?d():(h=++cn,cm&&(co||(co={},K(a).unload(cm)),co[h]=d),g.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cp={},cq,cr,cs=/^(?:toggle|show|hide)$/,ct=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cu,cv=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cw;K.fn.extend({show:function(a,b,c){var f,g;if(a||a===0)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;h<i;h++)f=this[h],f.style&&(g=f.style.display,!K._data(f,"olddisplay")&&g==="none"&&(g=f.style.display=""),g===""&&K.css(f,"display")==="none"&&K._data(f,"olddisplay",d(f.nodeName)));for(h=0;h<i;h++){f=this[h];if(f.style){g=f.style.display;if(g===""||g==="none")f.style.display=K._data(f,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(e("hide",3),a,b,c);var d,f,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(f=K.css(d,"display"),f!=="none"&&!K._data(d,"olddisplay")&&K._data(d,"olddisplay",f));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:K.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";return K.isFunction(a)&&K.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:K(this).is(":hidden");K(this)[b?"show":"hide"]()}):this.animate(e("toggle",3),a,b,c),this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){function f(){g.queue===!1&&K._mark(this);var b=K.extend({},g),c=this.nodeType===1,e=c&&K(this).is(":hidden"),f,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){f=K.camelCase(i),i!==f&&(a[f]=a[i],delete a[i]),h=a[f],K.isArray(h)?(b.animatedProperties[f]=h[1],h=a[f]=h[0]):b.animatedProperties[f]=b.specialEasing&&b.specialEasing[f]||b.easing||"swing";if(h==="hide"&&e||h==="show"&&!e)return b.complete.call(this);c&&(f==="height"||f==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],K.css(this,"display")==="inline"&&K.css(this,"float")==="none"&&(!K.support.inlineBlockNeedsLayout||d(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new K.fx(this,b,i),h=a[i],cs.test(h)?(o=K._data(this,"toggle"+i)||(h==="toggle"?e?"show":"hide":0),o?(K._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=ct.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(K.cssNumber[i]?"":"px"),n!=="px"&&(K.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,K.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var g=K.speed(b,c,e);return K.isEmptyObject(a)?this.each(g.complete,[!1]):(a=K.extend({},a),g.queue===!1?this.each(f):this.queue(g.queue,f))},stop:function(a,c,d){return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){function b(a,b,c){var e=b[c];K.removeData(a,c,!0),e.stop(d)}var c,e=!1,f=K.timers,g=K._data(this);d||K._unmark(!0,this);if(a==null)for(c in g)g[c]&&g[c].stop&&c.indexOf(".run")===c.length-4&&b(this,g,c);else g[c=a+".run"]&&g[c].stop&&b(this,g,c);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(d?f[c](!0):f[c].saveState(),e=!0,f.splice(c,1));(!d||!e)&&K.dequeue(this,a)})}}),K.each({slideDown:e("show",1),slideUp:e("hide",1),slideToggle:e("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){K.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),K.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?K.extend({},a):{complete:c||!c&&b||K.isFunction(a)&&a,duration:a,easing:c&&b||b&&!K.isFunction(b)&&b};d.duration=K.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in K.fx.speeds?K.fx.speeds[d.duration]:K.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(a){K.isFunction(d.old)&&d.old.call(this),d.queue?K.dequeue(this,d.queue):a!==!1&&K._unmark(this)},d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),K.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(K.fx.step[this.prop]||K.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]==null||!!this.elem.style&&this.elem.style[this.prop]!=null){var a,b=K.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a}return this.elem[this.prop]},custom:function(a,c,d){function e(a){return f.step(a)}var f=this,h=K.fx;this.startTime=cw||g(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(K.cssNumber[this.prop]?"":"px"),e.queue=this.options.queue,e.elem=this.elem,e.saveState=function(){f.options.hide&&K._data(f.elem,"fxshow"+f.prop)===b&&K._data(f.elem,"fxshow"+f.prop,f.start)},e()&&K.timers.push(e)&&!cu&&(cu=setInterval(h.tick,h.interval))},show:function(){var a=K._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||K.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),K(this.elem).show()},hide:function(){this.options.orig[this.prop]=K._data(this.elem,"fxshow"+this.prop)||K.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cw||g(),f=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(f=!1);if(f){i.overflow!=null&&!K.support.shrinkWrapBlocks&&K.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&K(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)K.style(h,b,i.orig[b]),K.removeData(h,"fxshow"+b,!0),K.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}return i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=K.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},K.extend(K.fx,{tick:function(){var a,b=K.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||K.fx.stop()},interval:13,stop:function(){clearInterval(cu),cu=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){K.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),K.each(["width","height"],function(a,b){K.fx.step[b]=function(a){K.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),K.expr&&K.expr.filters&&(K.expr.filters.animated=function(a){return K.grep(K.timers,function(b){return a===b.elem}).length});var cx=/^t(?:able|d|h)$/i,cy=/^(?:body|html)$/i;"getBoundingClientRect"in H.documentElement?K.fn.offset=function(a){var b=this[0],d;if(a)return this.each(function(b){K.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return K.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!d||!K.contains(g,b))return d?{top:d.top,left:d.left}:{top:0,left:0};var h=f.body,i=c(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||K.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||K.support.boxModel&&g.scrollLeft||h.scrollLeft,n=d.top+l-j,o=d.left+m-k;return{top:n,left:o}}:K.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){K.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return K.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,f=b.ownerDocument,g=f.documentElement,h=f.body,i=f.defaultView,j=i?i.getComputedStyle(b,null):b.currentStyle,k=b.offsetTop,l=b.offsetLeft;while((b=b.parentNode)&&b!==h&&b!==g){if(K.support.fixedPosition&&j.position==="fixed")break;c=i?i.getComputedStyle(b,null):b.currentStyle,k-=b.scrollTop,l-=b.scrollLeft,b===d&&(k+=b.offsetTop,l+=b.offsetLeft,K.support.doesNotAddBorder&&(!K.support.doesAddBorderForTableAndCells||!cx.test(b.nodeName))&&(k+=parseFloat(c.borderTopWidth)||0,l+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),K.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(k+=parseFloat(c.borderTopWidth)||0,l+=parseFloat(c.borderLeftWidth)||0),j=c}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;return K.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(g.scrollTop,h.scrollTop),l+=Math.max(g.scrollLeft,h.scrollLeft)),{top:k,left:l}},K.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return K.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(K.css(a,"marginTop"))||0,c+=parseFloat(K.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=K.css(a,"position");d==="static"&&(a.style.position="relative");var e=K(a),f=e.offset(),g=K.css(a,"top"),h=K.css(a,"left"),i=(d==="absolute"||d==="fixed")&&K.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),K.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},K.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cy.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(K.css(a,"marginTop"))||0,c.left-=parseFloat(K.css(a,"marginLeft"))||0,d.top+=parseFloat(K.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(K.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||H.body;while(a&&!cy.test(a.nodeName)&&K.css(a,"position")==="static")a=a.offsetParent;return a})}}),K.each(["Left","Top"],function(a,d){var e="scroll"+d;K.fn[e]=function(d){var f,g;return d===b?(f=this[0],f?(g=c(f),g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:K.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]):null):this.each(function(){g=c(this),g?g.scrollTo(a?K(g).scrollLeft():d,a?d:K(g).scrollTop()):this[e]=d})}}),K.each(["Height","Width"],function(a,c){var d=c.toLowerCase();K.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(K.css(a,d,"padding")):this[d]():null},K.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(K.css(b,d,a?"margin":"border")):this[d]():null},K.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(K.isFunction(a))return this.each(function(b){var c=K(this);c[d](a.call(this,b,c[d]()))});if(K.isWindow(e)){var f=e.document.documentElement["client"+c],g=e.document.body;return e.document.compatMode==="CSS1Compat"&&f||g&&g["client"+c]||f}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=K.css(e,d),i=parseFloat(h);return K.isNumeric(i)?i:h}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=K,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return K})})(window),function(){function B(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&x.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&x.isFunction(b.isEqual))return b.isEqual(a);var d=j.call(a);if(d!=j.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;var e=c.length;while(e--)if(c[e]==a)return!0;c.push(a);var f=0,g=!0;if(d=="[object Array]"){f=a.length,g=f==b.length;if(g)while(f--)if(!(g=f in a==f in b&&B(a[f],b[f],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var h in a)if(k.call(a,h)){f++;if(!(g=k.call(b,h)&&B(a[h],b[h],c)))break}if(g){for(h in b)if(k.call(b,h)&&!(f--))break;g=!f}}return c.pop(),g}var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.concat,i=d.unshift,j=e.toString,k=e.hasOwnProperty,l=d.forEach,m=d.map,n=d.reduce,o=d.reduceRight,p=d.filter,q=d.every,r=d.some,s=d.indexOf,t=d.lastIndexOf,u=Array.isArray,v=Object.keys,w=f.bind,x=function(a){return new D(a)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):typeof define=="function"&&define.amd?define("underscore",function(){return x}):a._=x,x.VERSION="1.2.3";var y=x.each=x.forEach=function(a,b,d){if(a==null)return;if(l&&a.forEach===l)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;e<f;e++)if(e in a&&b.call(d,a[e],e,a)===c)return}else for(var g in a)if(k.call(a,g)&&b.call(d,a[g],g,a)===c)return};x.map=function(a,b,c){var d=[];return a==null?d:m&&a.map===m?a.map(b,c):(y(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)},x.reduce=x.foldl=x.inject=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(n&&a.reduce===n)return d&&(b=x.bind(b,d)),e?a.reduce(b,c):a.reduce(b);y(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},x.reduceRight=x.foldr=function(a,b,c,d){var e=arguments.length>2;a==null&&(a=[]);if(o&&a.reduceRight===o)return d&&(b=x.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=x.toArray(a).reverse();return d&&!e&&(b=x.bind(b,d)),e?x.reduce(f,b,c,d):x.reduce(f,b)},x.find=x.detect=function(a,b,c){var d;return z(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},x.filter=x.select=function(a,b,c){var d=[];return a==null?d:p&&a.filter===p?a.filter(b,c):(y(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},x.reject=function(a,b,c){var d=[];return a==null?d:(y(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)}),d)},x.every=x.all=function(a,b,d){var e=!0;return a==null?e:q&&a.every===q?a.every(b,d):(y(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c}),e)};var z=x.some=x.any=function(a,b,d){b||(b=x.identity);var e=!1;return a==null?e:r&&a.some===r?a.some(b,d):(y(a,function(a,f,g){if(e||(e=b.call(d,a,f,g)))return c}),!!e)};x.include=x.contains=function(a,b){var c=!1;return a==null?c:s&&a.indexOf===s?a.indexOf(b)!=-1:(c=z(a,function(a){return a===b}),c)},x.invoke=function(a,b){var c=g.call(arguments,2);return x.map(a,function(a){return(b.call?b||a:a[b]).apply(a,c)})},x.pluck=function(a,b){return x.map(a,function(a){return a[b]})},x.max=function(a,b,c){if(!b&&x.isArray(a))return Math.max.apply(Math,a);if(!b&&x.isEmpty(a))return-Infinity;var d={computed:-Infinity};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},x.min=function(a,b,c){if(!b&&x.isArray(a))return Math.min.apply(Math,a);if(!b&&x.isEmpty(a))return Infinity;var d={computed:Infinity};return y(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},x.shuffle=function(a){var b=[],c;return y(a,function(a,d,e){d==0?b[0]=a:(c=Math.floor(Math.random()*(d+1)),b[d]=b[c],b[c]=a)}),b},x.sortBy=function(a,b,c){return x.pluck(x.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},x.groupBy=function(a,b){var c={},d=x.isFunction(b)?b:function(a){return a[b]};return y(a,function(a,b){var e=d(a,b);(c[e]||(c[e]=[])).push(a)}),c},x.sortedIndex=function(a,b,c){c||(c=x.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},x.toArray=function(a){return a?a.toArray?a.toArray():x.isArray(a)?g.call(a):x.isArguments(a)?g.call(a):x.values(a):[]},x.size=function(a){return x.toArray(a).length},x.first=x.head=
function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},x.initial=function(a,b,c){return g.call(a,0,a.length-(b==null||c?1:b))},x.last=function(a,b,c){return b!=null&&!c?g.call(a,Math.max(a.length-b,0)):a[a.length-1]},x.rest=x.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},x.compact=function(a){return x.filter(a,function(a){return!!a})},x.flatten=function(a,b){return x.reduce(a,function(a,c){return x.isArray(c)?a.concat(b?c:x.flatten(c)):(a[a.length]=c,a)},[])},x.without=function(a){return x.difference(a,g.call(arguments,1))},x.uniq=x.unique=function(a,b,c){var d=c?x.map(a,c):a,e=[];return x.reduce(d,function(c,d,f){if(0==f||(b===!0?x.last(c)!=d:!x.include(c,d)))c[c.length]=d,e[e.length]=a[f];return c},[]),e},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=x.intersect=function(a){var b=g.call(arguments,1);return x.filter(x.uniq(a),function(a){return x.every(b,function(b){return x.indexOf(b,a)>=0})})},x.difference=function(a){var b=x.flatten(g.call(arguments,1));return x.filter(a,function(a){return!x.include(b,a)})},x.zip=function(){var a=g.call(arguments),b=x.max(x.pluck(a,"length")),c=new Array(b);for(var d=0;d<b;d++)c[d]=x.pluck(a,""+d);return c},x.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c)return d=x.sortedIndex(a,b),a[d]===b?d:-1;if(s&&a.indexOf===s)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===b)return d;return-1},x.lastIndexOf=function(a,b){if(a==null)return-1;if(t&&a.lastIndexOf===t)return a.lastIndexOf(b);var c=a.length;while(c--)if(c in a&&a[c]===b)return c;return-1},x.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);while(e<d)f[e++]=a,a+=c;return f};var A=function(){};x.bind=function(a,b){var c,d;if(a.bind===w&&w)return w.apply(a,g.call(arguments,1));if(!x.isFunction(a))throw new TypeError;return d=g.call(arguments,2),c=function(){if(this instanceof c){A.prototype=a.prototype;var e=new A,f=a.apply(e,d.concat(g.call(arguments)));return Object(f)===f?f:e}return a.apply(b,d.concat(g.call(arguments)))}},x.bindAll=function(a){var b=g.call(arguments,1);return b.length==0&&(b=x.functions(a)),y(b,function(b){a[b]=x.bind(a[b],a)}),a},x.memoize=function(a,b){var c={};return b||(b=x.identity),function(){var d=b.apply(this,arguments);return k.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},x.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},x.defer=function(a){return x.delay.apply(x,[a,1].concat(g.call(arguments,1)))},x.throttle=function(a,b){var c,d,e,f,g,h=x.debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var i=function(){e=null,g&&a.apply(c,d),h()};e||(e=setTimeout(i,b)),f?g=!0:a.apply(c,d),h(),f=!0}},x.debounce=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}},x.once=function(a){var b=!1,c;return function(){return b?c:(b=!0,c=a.apply(this,arguments))}},x.wrap=function(a,b){return function(){var c=h.apply([a],arguments);return b.apply(this,c)}},x.compose=function(){var a=arguments;return function(){var b=arguments;for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},x.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}},x.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)k.call(a,c)&&(b[b.length]=c);return b},x.values=function(a){return x.map(a,x.identity)},x.functions=x.methods=function(a){var b=[];for(var c in a)x.isFunction(a[c])&&b.push(c);return b.sort()},x.extend=function(a){return y(g.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])}),a},x.defaults=function(a){return y(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])}),a},x.clone=function(a){return x.isObject(a)?x.isArray(a)?a.slice():x.extend({},a):a},x.tap=function(a,b){return b(a),a},x.isEqual=function(a,b){return B(a,b,[])},x.isEmpty=function(a){if(x.isArray(a)||x.isString(a))return a.length===0;for(var b in a)if(k.call(a,b))return!1;return!0},x.isElement=function(a){return!!a&&a.nodeType==1},x.isArray=u||function(a){return j.call(a)=="[object Array]"},x.isObject=function(a){return a===Object(a)},x.isArguments=function(a){return j.call(a)=="[object Arguments]"},x.isArguments(arguments)||(x.isArguments=function(a){return!!a&&!!k.call(a,"callee")}),x.isFunction=function(a){return j.call(a)=="[object Function]"},x.isString=function(a){return j.call(a)=="[object String]"},x.isNumber=function(a){return j.call(a)=="[object Number]"},x.isNaN=function(a){return a!==a},x.isBoolean=function(a){return a===!0||a===!1||j.call(a)=="[object Boolean]"},x.isDate=function(a){return j.call(a)=="[object Date]"},x.isRegExp=function(a){return j.call(a)=="[object RegExp]"},x.isNull=function(a){return a===null},x.isUndefined=function(a){return a===void 0},x.noConflict=function(){return a._=b,this},x.identity=function(a){return a},x.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},x.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},x.mixin=function(a){y(x.functions(a),function(b){F(b,x[b]=a[b])})};var C=0;x.uniqueId=function(a){var b=C++;return a?a+b:b},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},x.template=function(a,b){var c=x.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return b?e(b,x):function(a){return e.call(this,a,x)}};var D=function(a){this._wrapped=a};x.prototype=D.prototype;var E=function(a,b){return b?x(a).chain():a},F=function(a,b){D.prototype[a]=function(){var a=g.call(arguments);return i.call(a,this._wrapped),E(b.apply(x,a),this._chain)}};x.mixin(x),y(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];D.prototype[a]=function(){return b.apply(this._wrapped,arguments),E(this._wrapped,this._chain)}}),y(["concat","join","slice"],function(a){var b=d[a];D.prototype[a]=function(){return E(b.apply(this._wrapped,arguments),this._chain)}}),D.prototype.chain=function(){return this._chain=!0,this},D.prototype.value=function(){return this._wrapped}}.call(this),function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);return j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}return!1},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=c.attr("target"),g=a("meta[name=csrf-token]").attr("content"),h=a("meta[name=csrf-param]").attr("content"),i=a('<form method="post" action="'+d+'"></form>'),j='<input name="_method" value="'+e+'" type="hidden" />';h!==b&&g!==b&&(j+='<input name="'+h+'" value="'+g+'" type="hidden" />'),f&&i.attr("target",f),i.hide().append(j).appendTo("body"),i.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.prop("disabled",!0)})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.prop("disabled",!1)})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c,d){var e=c.data("events"),f=!0;return e!==b&&e.submit!==b&&a.each(e.submit,function(a,b){if(typeof b.handler=="function")return f=b.handler(d)}),f},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(document).delegate(c.linkDisableSelector,"ajax:complete",function(){c.enableElement(a(this))}),a(document).delegate(c.linkClickSelector,"click.rails",function(d){var e=a(this),f=e.data("method"),g=e.data("params");if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return(d.metaKey||d.ctrlKey)&&(!f||f==="GET")&&!g?!0:(c.handleRemote(e)===!1&&c.enableElement(e),!1);if(e.data("method"))return c.handleMethod(e),!1}),a(document).delegate(c.inputChangeSelector,"change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(document).delegate(c.formSubmitSelector,"submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&a().jquery<"1.7"&&c.callFormSubmitBindings(e,d)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(document).delegate(c.formInputClickSelector,"click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(document).delegate(c.formSubmitSelector,"ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(document).delegate(c.formSubmitSelector,"ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})}(jQuery),function(a){function d(){this.controls={bold:{groupIndex:0,visible:!0,tags:["b","strong"],css:{fontWeight:"bold"},tooltip:"Bold",hotkey:{ctrl:1,key:66}},copy:{groupIndex:8,visible:!1,tooltip:"Copy"},createLink:{groupIndex:6,visible:!0,exec:function(){var c=this;a.wysiwyg.controls&&a.wysiwyg.controls.link?a.wysiwyg.controls.link.init(this):a.wysiwyg.autoload?a.wysiwyg.autoload.control("wysiwyg.link.js",function(){c.controls.createLink.exec.apply(c)}):b.error("$.wysiwyg.controls.link not defined. You need to include wysiwyg.link.js file")},tags:["a"],tooltip:"Create link"},cut:{groupIndex:8,visible:!1,tooltip:"Cut"},decreaseFontSize:{groupIndex:9,visible:!1,tags:["small"],tooltip:"Decrease font size",exec:function(){this.decreaseFontSize()}},h1:{groupIndex:7,visible:!0,className:"h1",command:a.browser.msie||a.browser.safari?"FormatBlock":"heading",arguments:a.browser.msie||a.browser.safari?"<h1>":"h1",tags:["h1"],tooltip:"Header 1"},h2:{groupIndex:7,visible:!0,className:"h2",command:a.browser.msie||a.browser.safari?"FormatBlock":"heading",arguments:a.browser.msie||a.browser.safari?"<h2>":"h2",tags:["h2"],tooltip:"Header 2"},h3:{groupIndex:7,visible:!0,className:"h3",command:a.browser.msie||a.browser.safari?"FormatBlock":"heading",arguments:a.browser.msie||a.browser.safari?"<h3>":"h3",tags:["h3"],tooltip:"Header 3"},highlight:{tooltip:"Highlight",className:"highlight",groupIndex:1,visible:!1,css:{backgroundColor:"rgb(255, 255, 102)"},exec:function(){var b,c,d,e;a.browser.msie||a.browser.safari?b="backcolor":b="hilitecolor";if(a.browser.msie)c=this.getInternalRange().parentElement();else{d=this.getInternalSelection(),c=d.extentNode||d.focusNode;while(c.style===undefined){c=c.parentNode;if(c.tagName&&c.tagName.toLowerCase()==="body")return}}c.style.backgroundColor==="rgb(255, 255, 102)"||c.style.backgroundColor==="#ffff66"?e="#ffffff":e="#ffff66",this.editorDoc.execCommand(b,!1,e)}},html:{groupIndex:10,visible:!1,exec:function(){var b;this.options.resizeOptions&&a.fn.resizable&&(b=this.element.height()),this.viewHTML?(this.setContent(this.original.value),a(this.original).hide(),this.editor.show(),this.options.resizeOptions&&a.fn.resizable&&(b===this.element.height()&&this.element.height(b+this.editor.height()),this.element.resizable(a.extend(!0,{alsoResize:this.editor},this.options.resizeOptions))),this.ui.toolbar.find("li").each(function(){var b=a(this);b.hasClass("html")?b.removeClass("active"):b.removeClass("disabled")})):(this.saveContent(),a(this.original).css({width:this.element.outerWidth()-6,height:this.element.height()-this.ui.toolbar.height()-6,resize:"none"}).show(),this.editor.hide(),this.options.resizeOptions&&a.fn.resizable&&(b===this.element.height()&&this.element.height(this.ui.toolbar.height()),this.element.resizable("destroy")),this.ui.toolbar.find("li").each(function(){var b=a(this);b.hasClass("html")?b.addClass("active"):!1===b.hasClass("fullscreen")&&b.removeClass("active").addClass("disabled")})),this.viewHTML=!this.viewHTML},tooltip:"View source code"},increaseFontSize:{groupIndex:9,visible:!1,tags:["big"],tooltip:"Increase font size",exec:function(){this.increaseFontSize()}},indent:{groupIndex:2,visible:!0,tooltip:"Indent"},insertHorizontalRule:{groupIndex:6,visible:!0,tags:["hr"],tooltip:"Insert Horizontal Rule"},insertImage:{groupIndex:6,visible:!0,exec:function(){var c=this;a.wysiwyg.controls&&a.wysiwyg.controls.image?a.wysiwyg.controls.image.init(this):a.wysiwyg.autoload?a.wysiwyg.autoload.control("wysiwyg.image.js",function(){c.controls.insertImage.exec.apply(c)}):b.error("$.wysiwyg.controls.image not defined. You need to include wysiwyg.image.js file")},tags:["img"],tooltip:"Insert image"},insertOrderedList:{groupIndex:5,visible:!0,tags:["ol"],tooltip:"Insert Ordered List"},insertTable:{groupIndex:6,visible:!0,exec:function(){var c=this;a.wysiwyg.controls&&a.wysiwyg.controls.table?a.wysiwyg.controls.table(this):a.wysiwyg.autoload?a.wysiwyg.autoload.control("wysiwyg.table.js",function(){c.controls.insertTable.exec.apply(c)}):b.error("$.wysiwyg.controls.table not defined. You need to include wysiwyg.table.js file")},tags:["table"],tooltip:"Insert table"},insertUnorderedList:{groupIndex:5,visible:!0,tags:["ul"],tooltip:"Insert Unordered List"},italic:{groupIndex:0,visible:!0,tags:["i","em"],css:{fontStyle:"italic"},tooltip:"Italic",hotkey:{ctrl:1,key:73}},justifyCenter:{groupIndex:1,visible:!0,tags:["center"],css:{textAlign:"center"},tooltip:"Justify Center"},justifyFull:{groupIndex:1,visible:!0,css:{textAlign:"justify"},tooltip:"Justify Full"},justifyLeft:{visible:!0,groupIndex:1,css:{textAlign:"left"},tooltip:"Justify Left"},justifyRight:{groupIndex:1,visible:!0,css:{textAlign:"right"},tooltip:"Justify Right"},ltr:{groupIndex:10,visible:!1,exec:function(){var b=this.dom.getElement("p");return b?(a(b).attr("dir","ltr"),!0):!1},tooltip:"Left to Right"},outdent:{groupIndex:2,visible:!0,tooltip:"Outdent"},paragraph:{groupIndex:7,visible:!1,className:"paragraph",command:"FormatBlock",arguments:a.browser.msie||a.browser.safari?"<p>":"p",tags:["p"],tooltip:"Paragraph"},paste:{groupIndex:8,visible:!1,tooltip:"Paste"},redo:{groupIndex:4,visible:!0,tooltip:"Redo"},removeFormat:{groupIndex:10,visible:!0,exec:function(){this.removeFormat()},tooltip:"Remove formatting"},rtl:{groupIndex:10,visible:!1,exec:function(){var b=this.dom.getElement("p");return b?(a(b).attr("dir","rtl"),!0):!1},tooltip:"Right to Left"},strikeThrough:{groupIndex:0,visible:!0,tags:["s","strike"],css:{textDecoration:"line-through"},tooltip:"Strike-through"},subscript:{groupIndex:3,visible:!0,tags:["sub"],tooltip:"Subscript"},superscript:{groupIndex:3,visible:!0,tags:["sup"],tooltip:"Superscript"},underline:{groupIndex:0,visible:!0,tags:["u"],css:{textDecoration:"underline"},tooltip:"Underline",hotkey:{ctrl:1,key:85}},undo:{groupIndex:4,visible:!0,tooltip:"Undo"},code:{visible:!0,groupIndex:6,tooltip:"Code snippet",exec:function(){var b=this.getInternalRange(),c=a(b.commonAncestorContainer),d=b.commonAncestorContainer.nodeName.toLowerCase();c.parent("code").length?c.unwrap():d!=="body"&&c.wrap("<code/>")}},cssWrap:{visible:!1,groupIndex:6,tooltip:"CSS Wrapper",exec:function(){a.wysiwyg.controls.cssWrap.init(this)}}},this.defaults={html:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" style="margin:0"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body style="margin:0;">INITIAL_CONTENT</body></html>',debug:!1,controls:{},css:{},events:{},autoGrow:!1,autoSave:!0,brIE:!0,formHeight:270,formWidth:440,iFrameClass:null,initialContent:"<p>Initial content</p>",maxHeight:1e4,maxLength:0,messages:{nonSelection:"Select the text you wish to link"},toolbarHtml:'<ul role="menu" class="toolbar"></ul>',removeHeadings:!1,replaceDivWithP:!1,resizeOptions:!1,rmUnusedControls:!1,rmUnwantedBr:!0,tableFiller:"Lorem ipsum",initialMinHeight:null,controlImage:{forceRelativeUrls:!1},controlLink:{forceRelativeUrls:!1},plugins:{autoload:!1,i18n:!1,rmFormat:{rmMsWordMarkup:!1}},dialog:"default"},this.availableControlProperties=["arguments","callback","className","command","css","custom","exec","groupIndex","hotkey","icon","tags","tooltip","visible"],this.editor=null,this.editorDoc=null,this.element=null,this.options={},this.original=null,this.savedRange=null,this.timers=[],this.validKeyCodes=[8,9,13,16,17,18,19,20,27,33,34,35,36,37,38,39,40,45,46],this.isDestroyed=!1,this.dom={ie:{parent:null},w3c:{parent:null}},this.dom.parent=this,this.dom.ie.parent=this.dom,this.dom.w3c.parent=this.dom,this.ui={},this.ui.self=this,this.ui.toolbar=null,this.ui.initialHeight=null,this.dom.getAncestor=function(a,b){b=b.toLowerCase();while(a&&typeof a.tagName!="undefined"&&"body"!==a.tagName.toLowerCase()){if(b===a.tagName.toLowerCase())return a;a=a.parentNode}if(!a.tagName&&(a.previousSibling||a.nextSibling)){if(a.previousSibling&&a.previousSibling.tagName.toLowerCase()==b)return a.previousSibling;if(a.nextSibling&&a.nextSibling.tagName.toLowerCase()==b)return a.nextSibling}return null},this.dom.getElement=function(a){var b=this;return a=a.toLowerCase(),window.getSelection?b.w3c.getElement(a):b.ie.getElement(a)},this.dom.ie.getElement=function(a){var b=this.parent,c=b.parent.getInternalSelection(),d=c.createRange(),e;if("Control"===c.type)if(1===d.length)e=d.item(0);else return null;else e=d.parentElement();return b.getAncestor(e,a)},this.dom.w3c.getElement=function(a){var b=this.parent,c=b.parent.getInternalRange(),d;if(!c)return null;d=c.commonAncestorContainer,3===d.nodeType&&(d=d.parentNode),d===c.startContainer&&(d=d.childNodes[c.startOffset]);if(!d.tagName&&(d.previousSibiling||d.nextSibling)){if(d.previousSibiling&&d.previousSibiling.tagName.toLowerCase()==a)return d.previousSibiling;if(d.nextSibling&&d.nextSibling.tagName.toLowerCase()==a)return d.nextSibling}return b.getAncestor(d,a)},this.ui.addHoverClass=function(){a(this).addClass("wysiwyg-button-hover")},this.ui.appendControls=function(){var b=this,c=this.self,d=c.parseControls(),e=!0,f=[],g={},h,i,j=function(a,c){c.groupIndex&&i!==c.groupIndex&&(i=c.groupIndex,e=!1);if(!c.visible)return;e||(b.appendItemSeparator(),e=!0),c.custom?b.appendItemCustom(a,c):b.appendItem(a,c)};a.each(d,function(a,b){var c="empty";undefined!==b.groupIndex&&(""===b.groupIndex?c="empty":c=b.groupIndex),undefined===g[c]&&(f.push(c),g[c]={}),g[c][a]=b}),f.sort(function(a,b){return"number"==typeof a&&typeof a==typeof b?a-b:(a=a.toString(),b=b.toString(),a>b?1:a===b?0:-1)}),0<f.length&&(i=f[0]);for(h=0;h<f.length;h+=1)a.each(g[f[h]],j)},this.ui.appendItem=function(b,c){var d=this.self,e=c.className||c.command||b||"empty",f=c.tooltip||c.command||b||"";return a('<li role="menuitem" unselectable="on">'+e+"</li>").addClass(e).attr("title",f).hover(this.addHoverClass,this.removeHoverClass).click(function(e){if(a(this).hasClass("disabled"))return!1;d.triggerControl.apply(d,[b,c]);var f=a(e.target);for(var g in d.controls)if(f.hasClass(g)){d.ui.toolbar.find("."+g).toggleClass("active"),d.editorDoc.rememberCommand=!0;break}return this.blur(),d.ui.returnRange(),d.ui.focus(),!0}).appendTo(d.ui.toolbar)},this.ui.appendItemCustom=function(b,c){var d=this.self,e=c.tooltip||c.command||b||"";return c.callback&&a(window).bind("trigger-"+b+".wysiwyg",c.callback),a('<li role="menuitem" unselectable="on" style="background: url(\''+c.icon+"') no-repeat;\"></li>").addClass("custom-command-"+b).addClass("wysiwyg-custom-command").addClass(b).attr("title",e).hover(this.addHoverClass,this.removeHoverClass).click(function(){return a(this).hasClass("disabled")?!1:(d.triggerControl.apply(d,[b,c]),this.blur(),d.ui.returnRange(),d.ui.focus(),d.triggerControlCallback(b),!0)}).appendTo(d.ui.toolbar)},this.ui.appendItemSeparator=function(){var b=this.self;return a('<li role="separator" class="separator"></li>').appendTo(b.ui.toolbar)},this.autoSaveFunction=function(){this.saveContent()},this.ui.checkTargets=function(b){var c=this.self;a.each(c.options.controls,function(d,e){var f=e.className||e.command||d||"empty",g,h,i,j,k=function(a,b){var d;"function"==typeof b?(d=b,d(j.css(a).toString().toLowerCase(),c)&&c.ui.toolbar.find("."+f).addClass("active")):j.css(a).toString().toLowerCase()===b&&c.ui.toolbar.find("."+f).addClass("active")};"fullscreen"!==f&&c.ui.toolbar.find("."+f).removeClass("active");if(e.tags||e.options&&e.options.tags){g=e.tags||e.options&&e.options.tags,h=b;while(h){if(h.nodeType!==1)break;a.inArray(h.tagName.toLowerCase(),g)!==-1&&c.ui.toolbar.find("."+f).addClass("active"),h=h.parentNode}}if(e.css||e.options&&e.options.css){i=e.css||e.options&&e.options.css,j=a(b);while(j){if(j[0].nodeType!==1)break;a.each(i,k),j=j.parent()}}})},this.ui.designMode=function(){var a=3,b=this.self,c;c=function(a){if("on"===b.editorDoc.designMode){b.timers.designMode&&window.clearTimeout(b.timers.designMode),b.innerDocument()!==b.editorDoc&&b.ui.initFrame();return}try{b.editorDoc.designMode="on"}catch(d){}a-=1,a>0&&(b.timers.designMode=window.setTimeout(function(){c(a)},100))},c(a)},this.destroy=function(){this.isDestroyed=!0;var b,c=this.element.closest("form");for(b=0;b<this.timers.length;b+=1)window.clearTimeout(this.timers[b]);return c.unbind(".wysiwyg"),this.element.remove(),a.removeData(this.original,"wysiwyg"),a(this.original).show(),this},this.getRangeText=function(){var a=this.getInternalRange();return a.toString?a=a.toString():a.text&&(a=a.text),a},this.execute=function(a,b){typeof b=="undefined"&&(b=null),this.editorDoc.execCommand(a,!1,b)},this.extendOptions=function(b){var c={};return"object"==typeof b.controls&&(c=b.controls,delete b.controls),b=a.extend(!0,{},this.defaults,b),b.controls=a.extend(!0,{},c,this.controls,c),b.rmUnusedControls&&a.each(b.controls,function(a){c[a]||delete b.controls[a]}),b},this.ui.focus=function(){var a=this.self;return a.editor.get(0).contentWindow.focus(),a},this.ui.returnRange=function(){var a=this.self,c;if(a.savedRange!==null){if(window.getSelection){c=window.getSelection(),c.rangeCount>0&&c.removeAllRanges();try{c.addRange(a.savedRange)}catch(d){b.error(d)}}else window.document.createRange?window.getSelection().addRange(a.savedRange):window.document.selection&&a.savedRange.select();a.savedRange=null}},this.increaseFontSize=function(){if(a.browser.mozilla||a.browser.opera)this.editorDoc.execCommand("increaseFontSize",!1,null);else if(a.browser.safari){var c=this.getInternalRange(),d=this.getInternalSelection(),e=this.editorDoc.createElement("big");if(!0===c.collapsed&&3===c.commonAncestorContainer.nodeType){var f=c.commonAncestorContainer.nodeValue.toString(),g=f.lastIndexOf(" ",c.startOffset)+1,h=-1===f.indexOf(" ",c.startOffset)?f:f.indexOf(" ",c.startOffset);c.setStart(c.commonAncestorContainer,g),c.setEnd(c.commonAncestorContainer,h),c.surroundContents(e),d.addRange(c)}else c.surroundContents(e),d.removeAllRanges(),d.addRange(c)}else b.error("Internet Explorer?")},this.decreaseFontSize=function(){if(a.browser.mozilla||a.browser.opera)this.editorDoc.execCommand("decreaseFontSize",!1,null);else if(a.browser.safari){var c=this.getInternalRange(),d=this.getInternalSelection(),e=this.editorDoc.createElement("small");if(!0===c.collapsed&&3===c.commonAncestorContainer.nodeType){var f=c.commonAncestorContainer.nodeValue.toString(),g=f.lastIndexOf(" ",c.startOffset)+1,h=-1===f.indexOf(" ",c.startOffset)?f:f.indexOf(" ",c.startOffset);c.setStart(c.commonAncestorContainer,g),c.setEnd(c.commonAncestorContainer,h),c.surroundContents(e),d.addRange(c)}else c.surroundContents(e),d.removeAllRanges(),d.addRange(c)}else b.error("Internet Explorer?")},this.getContent=function(){return this.viewHTML&&this.setContent(this.original.value),this.events.filter("getContent",this.editorDoc.body.innerHTML)},this.events={_events:{},bind:function(a,b){typeof this._events.eventName!="object"&&(this._events[a]=[]),this._events[a].push(b)},trigger:function(b,c){if(typeof this._events.eventName=="object"){var d=this.editor;a.each(this._events[b],function(a,b){typeof b=="function"&&b.apply(d,c)})}},filter:function(b,c){if(typeof this._events[b]=="object"){var d=this.editor,e=Array.prototype.slice.call(arguments,1);a.each(this._events[b],function(a,b){typeof b=="function"&&(c=b.apply(d,e))})}return c}},this.getElementByAttributeValue=function(b,c,d){var e,f,g=this.editorDoc.getElementsByTagName(b);for(e=0;e<g.length;e+=1){f=g[e].getAttribute(c),a.browser.msie&&(f=f.substr(f.length-d.length));if(f===d)return g[e]}return!1},this.getInternalRange=function(){var a=this.getInternalSelection();return a?a.rangeCount&&a.rangeCount>0?a.getRangeAt(0):a.createRange?a.createRange():null:null},this.getInternalSelection=function(){if(this.editor.get(0).contentWindow){if(this.editor.get(0).contentWindow.getSelection)return this.editor.get(0).contentWindow.getSelection();if(this.editor.get(0).contentWindow.selection)return this.editor.get(0).contentWindow.selection}return this.editorDoc.getSelection?this.editorDoc.getSelection():this.editorDoc.selection?this.editorDoc.selection:null},this.getRange=function(){var a=this.getSelection();if(!a)return null;if(a.rangeCount&&a.rangeCount>0)a.getRangeAt(0);else if(a.createRange)return a.createRange();return null},this.getSelection=function(){return window.getSelection?window.getSelection():window.document.selection},this.ui.grow=function(){var b=this.self,c=a(b.editorDoc.body),d=a.browser.msie?c[0].scrollHeight:c.height()+2+20,e=b.ui.initialHeight,f=Math.max(d,e);return f=Math.min(f,b.options.maxHeight),b.editor.attr("scrolling",f<b.options.maxHeight?"no":"auto"),c.css("overflow",f<b.options.maxHeight?"hidden":""),b.editor.get(0).height=f,b},this.init=function(b,c){var d=this,e=a(b).closest("form"),f=b.width||b.clientWidth||0,g=b.height||b.clientHeight||0;this.options=this.extendOptions(c),this.original=b,this.ui.toolbar=a(this.options.toolbarHtml),a.browser.msie&&parseInt(a.browser.version,10)<8&&(this.options.autoGrow=!1),f===0&&b.cols&&(f=b.cols*8+21),g===0&&b.rows&&(g=b.rows*16+16),this.editor=a(window.location.protocol==="https:"?'<iframe src="javascript:false;"></iframe>':"<iframe></iframe>").attr("frameborder","0"),this.options.iFrameClass?this.editor.addClass(this.options.iFrameClass):(this.editor.css({minHeight:(g-6).toString()+"px",width:f>50?(f-8).toString()+"px":""}),a.browser.msie&&parseInt(a.browser.version,10)<7&&this.editor.css("height",g.toString()+"px"));if(b.id){var h=b.id+"-wysiwyg-iframe";document.getElementById(h)||this.editor.attr("id",h)}this.editor.attr("tabindex",a(b).attr("tabindex")),this.element=a("<div/>").addClass("wysiwyg"),this.options.iFrameClass||this.element.css({width:f>0?f.toString()+"px":"100%"}),a(b).hide().before(this.element),this.viewHTML=!1,this.initialContent=a(b).val(),this.ui.initFrame(),this.options.resizeOptions&&a.fn.resizable&&this.element.resizable(a.extend(!0,{alsoResize:this.editor},this.options.resizeOptions)),this.options.autoSave&&e.bind("submit.wysiwyg",function(){d.autoSaveFunction()}),e.bind("reset.wysiwyg",function(){d.resetFunction()})},this.ui.initFrame=function(){var c=this.self,d,e,f;c.ui.appendControls(),c.element.append(c.ui.toolbar).append(a("<div><!-- --></div>").css({clear:"both"})).append(c.editor),c.editorDoc=c.innerDocument();if(c.isDestroyed)return null;c.ui.designMode(),c.editorDoc.open(),c.editorDoc.write(c.options.html.replace(/INITIAL_CONTENT/,function(){return c.wrapInitialContent()})),c.editorDoc.close(),a.wysiwyg.plugin.bind(c),a(c.editorDoc).trigger("initFrame.wysiwyg"),a(c.editorDoc).bind("click.wysiwyg",function(a){c.ui.checkTargets(a.target?a.target:a.srcElement)}),setInterval(function(){var d=null;try{var e=c.getInternalRange();e&&(d={range:e,parent:a.browser.msie?e.parentElement():e.endContainer.parentNode,width:(a.browser.msie?e.boundingWidth:e.startOffset-e.endOffset)||0})}catch(f){b.error(f)}d&&d.width==0&&!c.editorDoc.rememberCommand&&c.ui.checkTargets(d.parent)},400),a(c.original).focus(function(){if(a(this).filter(":visible").length===0)return;c.ui.focus()}),a(c.editorDoc).keydown(function(a){var b;if(a.keyCode===8){b=/^<([\w]+)[^>]*>(<br\/?>)?<\/\1>$/;if(b.test(c.getContent()))return a.stopPropagation(),!1}return c.editorDoc.rememberCommand=!1,!0}),a.browser.msie?c.options.brIE&&a(c.editorDoc).keydown(function(a){if(a.keyCode===13){var b=c.getRange();return b.pasteHTML("<br/>"),b.collapse(!1),b.select(),!1}return!0}):a(c.editorDoc).keydown(function(a){var b;if(a.ctrlKey||a.metaKey)for(b in c.controls)if(c.controls[b].hotkey&&c.controls[b].hotkey.ctrl&&a.keyCode===c.controls[b].hotkey.key)return c.triggerControl.apply(c,[b,c.controls[b]]),!1;return!0}),c.options.plugins.rmFormat.rmMsWordMarkup&&a(c.editorDoc).bind("keyup.wysiwyg",function(b){(b.ctrlKey||b.metaKey)&&86===b.keyCode&&a.wysiwyg.rmFormat&&("object"==typeof c.options.plugins.rmFormat.rmMsWordMarkup?a.wysiwyg.rmFormat.run(c,{rules:{msWordMarkup:c.options.plugins.rmFormat.rmMsWordMarkup}}):a.wysiwyg.rmFormat.run(c,{rules:{msWordMarkup:{enabled:!0}}}))}),c.options.autoSave&&a(c.editorDoc).keydown(function(){c.autoSaveFunction()}).keyup(function(){c.autoSaveFunction()}).mousedown(function(){c.autoSaveFunction()}).bind(a.support.noCloneEvent?"input.wysiwyg":"paste.wysiwyg",function(){c.autoSaveFunction()}),c.options.autoGrow&&(c.options.initialMinHeight!==null?c.ui.initialHeight=c.options.initialMinHeight:c.ui.initialHeight=a(c.editorDoc).height(),a(c.editorDoc.body).css("border","1px solid white"),e=function(){c.ui.grow()},a(c.editorDoc)
.keyup(e),a(c.editorDoc).bind("editorRefresh.wysiwyg",e),c.ui.grow()),c.options.css&&(String===c.options.css.constructor?a.browser.msie?(d=c.editorDoc.createStyleSheet(c.options.css),a(d).attr({media:"all"})):(d=a("<link/>").attr({href:c.options.css,media:"all",rel:"stylesheet",type:"text/css"}),a(c.editorDoc).find("head").append(d)):c.timers.initFrame_Css=window.setTimeout(function(){a(c.editorDoc.body).css(c.options.css)},0)),c.initialContent.length===0&&("function"==typeof c.options.initialContent?c.setContent(c.options.initialContent()):c.setContent(c.options.initialContent)),c.options.maxLength>0&&a(c.editorDoc).keydown(function(b){a(c.editorDoc).text().length>=c.options.maxLength&&a.inArray(b.which,c.validKeyCodes)===-1&&b.preventDefault()}),a.each(c.options.events,function(b,d){a(c.editorDoc).bind(b+".wysiwyg",function(a){d.apply(c.editorDoc,[a,c])})}),a.browser.msie?a(c.editorDoc).bind("beforedeactivate.wysiwyg",function(){c.savedRange=c.getInternalRange()}):a(c.editorDoc).bind("blur.wysiwyg",function(){c.savedRange=c.getInternalRange()}),a(c.editorDoc.body).addClass("wysiwyg"),c.options.events&&c.options.events.save&&(f=c.options.events.save,a(c.editorDoc).bind("keyup.wysiwyg",f),a(c.editorDoc).bind("change.wysiwyg",f),a.support.noCloneEvent?a(c.editorDoc).bind("input.wysiwyg",f):(a(c.editorDoc).bind("paste.wysiwyg",f),a(c.editorDoc).bind("cut.wysiwyg",f)));if(c.options.xhtml5&&c.options.unicode){var g={ne:8800,le:8804,para:182,xi:958,darr:8595,nu:957,oacute:243,Uacute:218,omega:969,prime:8242,pound:163,igrave:236,thorn:254,forall:8704,emsp:8195,lowast:8727,brvbar:166,alefsym:8501,nbsp:160,delta:948,clubs:9827,lArr:8656,Omega:937,Auml:196,cedil:184,and:8743,plusmn:177,ge:8805,raquo:187,uml:168,equiv:8801,laquo:171,rdquo:8221,Epsilon:917,divide:247,fnof:402,chi:967,Dagger:8225,iacute:237,rceil:8969,sigma:963,Oslash:216,acute:180,frac34:190,lrm:8206,upsih:978,Scaron:352,part:8706,exist:8707,nabla:8711,image:8465,prop:8733,zwj:8205,omicron:959,aacute:225,Yuml:376,Yacute:221,weierp:8472,rsquo:8217,otimes:8855,kappa:954,thetasym:977,harr:8596,Ouml:214,Iota:921,ograve:242,sdot:8901,copy:169,oplus:8853,acirc:226,sup:8835,zeta:950,Iacute:205,Oacute:211,crarr:8629,Nu:925,bdquo:8222,lsquo:8216,apos:39,Beta:914,eacute:233,egrave:232,lceil:8968,Kappa:922,piv:982,Ccedil:199,ldquo:8220,Xi:926,cent:162,uarr:8593,hellip:8230,Aacute:193,ensp:8194,sect:167,Ugrave:217,aelig:230,ordf:170,curren:164,sbquo:8218,macr:175,Phi:934,Eta:919,rho:961,Omicron:927,sup2:178,euro:8364,aring:229,Theta:920,mdash:8212,uuml:252,otilde:245,eta:951,uacute:250,rArr:8658,nsub:8836,agrave:224,notin:8713,ndash:8211,Psi:936,Ocirc:212,sube:8838,szlig:223,micro:181,not:172,sup1:185,middot:183,iota:953,ecirc:234,lsaquo:8249,thinsp:8201,sum:8721,ntilde:241,scaron:353,cap:8745,atilde:227,lang:10216,__replacement:65533,isin:8712,gamma:947,Euml:203,ang:8736,upsilon:965,Ntilde:209,hearts:9829,Alpha:913,Tau:932,spades:9824,dagger:8224,THORN:222,"int":8747,lambda:955,Eacute:201,Uuml:220,infin:8734,rlm:8207,Aring:197,ugrave:249,Egrave:200,Acirc:194,rsaquo:8250,ETH:208,oslash:248,alpha:945,Ograve:210,Prime:8243,mu:956,ni:8715,real:8476,bull:8226,beta:946,icirc:238,eth:240,prod:8719,larr:8592,ordm:186,perp:8869,Gamma:915,reg:174,ucirc:251,Pi:928,psi:968,tilde:732,asymp:8776,zwnj:8204,Agrave:192,deg:176,AElig:198,times:215,Delta:916,sim:8764,Otilde:213,Mu:924,uArr:8657,circ:710,theta:952,Rho:929,sup3:179,diams:9830,tau:964,Chi:935,frac14:188,oelig:339,shy:173,or:8744,dArr:8659,phi:966,iuml:239,Lambda:923,rfloor:8971,iexcl:161,cong:8773,ccedil:231,Icirc:206,frac12:189,loz:9674,rarr:8594,cup:8746,radic:8730,frasl:8260,euml:235,OElig:338,hArr:8660,Atilde:195,Upsilon:933,there4:8756,ouml:246,oline:8254,Ecirc:202,yacute:253,auml:228,permil:8240,sigmaf:962,iquest:191,empty:8709,pi:960,Ucirc:219,supe:8839,Igrave:204,yen:165,rang:10217,trade:8482,lfloor:8970,minus:8722,Zeta:918,sub:8834,epsilon:949,yuml:255,Sigma:931,Iuml:207,ocirc:244};c.events.bind("getContent",function(a){return a.replace(/&(?:amp;)?(?!amp|lt|gt|quot)([a-z][a-z0-9]*);/gi,function(a,b){g[b]||(b=b.toLowerCase(),g[b]||(b="__replacement"));var c=g[b];return String.fromCharCode(c)})})}a(c.original).trigger("ready.jwysiwyg",[c.editorDoc,c])},this.innerDocument=function(){var a=this.editor.get(0);if(a.nodeName.toLowerCase()==="iframe"){if(a.contentDocument)return a.contentDocument;if(a.contentWindow)return a.contentWindow.document;if(this.isDestroyed)return null;b.error("Unexpected error in innerDocument")}return a},this.insertHtml=function(b){var c,d;return!b||b.length===0?this:(a.browser.msie?(this.ui.focus(),this.editorDoc.execCommand("insertImage",!1,"#jwysiwyg#"),c=this.getElementByAttributeValue("img","src","#jwysiwyg#"),c&&a(c).replaceWith(b)):a.browser.mozilla?1===a(b).length?(d=this.getInternalRange(),d.deleteContents(),d.insertNode(a(b).get(0))):this.editorDoc.execCommand("insertHTML",!1,b):this.editorDoc.execCommand("insertHTML",!1,b)||(this.editor.focus(),this.editorDoc.execCommand("insertHTML",!1,b)),this.saveContent(),this)},this.parseControls=function(){var b=this;return a.each(this.options.controls,function(c,d){a.each(d,function(d){if(-1===a.inArray(d,b.availableControlProperties))throw c+'["'+d+'"]: property "'+d+'" not exists in Wysiwyg.availableControlProperties'})}),this.options.parseControls?this.options.parseControls.call(this):this.options.controls},this.removeFormat=function(){return a.browser.msie&&this.ui.focus(),this.options.removeHeadings&&this.editorDoc.execCommand("formatBlock",!1,"<p>"),this.editorDoc.execCommand("removeFormat",!1,null),this.editorDoc.execCommand("unlink",!1,null),a.wysiwyg.rmFormat&&a.wysiwyg.rmFormat.enabled&&("object"==typeof this.options.plugins.rmFormat.rmMsWordMarkup?a.wysiwyg.rmFormat.run(this,{rules:{msWordMarkup:this.options.plugins.rmFormat.rmMsWordMarkup}}):a.wysiwyg.rmFormat.run(this,{rules:{msWordMarkup:{enabled:!0}}})),this},this.ui.removeHoverClass=function(){a(this).removeClass("wysiwyg-button-hover")},this.resetFunction=function(){this.setContent(this.initialContent)},this.saveContent=function(){if(this.viewHTML)return;if(this.original){var b,c;b=this.getContent(),this.options.rmUnwantedBr&&(b=b.replace(/<br\/?>$/,"")),this.options.replaceDivWithP&&(c=a("<div/>").addClass("temp").append(b),c.children("div").each(function(){var b=a(this),c=b.find("p"),d;if(0===c.length){c=a("<p></p>");if(this.attributes.length>0)for(d=0;d<this.attributes.length;d+=1)c.attr(this.attributes[d].name,b.attr(this.attributes[d].name));c.append(b.html()),b.replaceWith(c)}}),b=c.html()),a(this.original).val(b),this.options.events&&this.options.events.save&&this.options.events.save.call(this)}return this},this.setContent=function(a){return this.editorDoc.body.innerHTML=a,this.saveContent(),this},this.triggerControl=function(a,c){var d=c.command||a,e=c.arguments||[];if(c.exec)c.exec.apply(this);else{this.ui.focus(),this.ui.withoutCss();try{this.editorDoc.execCommand(d,!1,e)}catch(f){b.error(f)}}this.options.autoSave&&this.autoSaveFunction()},this.triggerControlCallback=function(b){a(window).trigger("trigger-"+b+".wysiwyg",[this])},this.ui.withoutCss=function(){var b=this.self;if(a.browser.mozilla)try{b.editorDoc.execCommand("styleWithCSS",!1,!1)}catch(c){try{b.editorDoc.execCommand("useCSS",!1,!0)}catch(d){}}return b},this.wrapInitialContent=function(){var a=this.initialContent,b=a.match(/<\/?p>/gi);return b?a:"<p>"+a+"</p>"}}"use strict";var b=window.console?window.console:{log:a.noop,error:function(b){a.error(b)}},c="prop"in a.fn&&"removeProp"in a.fn;a.wysiwyg={messages:{noObject:"Something goes wrong, check object"},addControl:function(b,c,d){return b.each(function(){var b=a(this).data("wysiwyg"),e={},f;if(!b)return this;e[c]=a.extend(!0,{visible:!0,custom:!0},d),a.extend(!0,b.options.controls,e),f=a(b.options.toolbarHtml),b.ui.toolbar.replaceWith(f),b.ui.toolbar=f,b.ui.appendControls()})},clear:function(b){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.setContent("")})},console:b,destroy:function(b){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.destroy()})},document:function(b){var c=b.data("wysiwyg");return c?a(c.editorDoc):undefined},getContent:function(a){var b=a.data("wysiwyg");return b?b.getContent():undefined},init:function(b,c){return b.each(function(){var b=a.extend(!0,{},c),e;if("textarea"!==this.nodeName.toLowerCase()||a(this).data("wysiwyg"))return;e=new d,e.init(this,b),a.data(this,"wysiwyg",e),a(e.editorDoc).trigger("afterInit.wysiwyg")})},insertHtml:function(b,c){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.insertHtml(c)})},plugin:{listeners:{},bind:function(b){var c=this;a.each(this.listeners,function(d,e){var f,g;for(f=0;f<e.length;f+=1)g=c.parseName(e[f]),a(b.editorDoc).bind(d+".wysiwyg",{plugin:g},function(c){a.wysiwyg[c.data.plugin.name][c.data.plugin.method].apply(a.wysiwyg[c.data.plugin.name],[b])})})},exists:function(b){var c;return"string"!=typeof b?!1:(c=this.parseName(b),!a.wysiwyg[c.name]||!a.wysiwyg[c.name][c.method]?!1:!0)},listen:function(b,c){var d;return d=this.parseName(c),!a.wysiwyg[d.name]||!a.wysiwyg[d.name][d.method]?!1:(this.listeners[b]||(this.listeners[b]=[]),this.listeners[b].push(c),!0)},parseName:function(a){var b;return"string"!=typeof a?!1:(b=a.split("."),2>b.length?!1:{name:b[0],method:b[1]})},register:function(c){return c.name||b.error("Plugin name missing"),a.each(a.wysiwyg,function(a){a===c.name&&b.error("Plugin with name '"+c.name+"' was already registered")}),a.wysiwyg[c.name]=c,!0}},removeFormat:function(b){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.removeFormat()})},save:function(b){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.saveContent()})},selectAll:function(a){var b=a.data("wysiwyg"),c,d,e;if(!b)return this;c=b.editorDoc.body,window.getSelection?(e=b.getInternalSelection(),e.selectAllChildren(c)):(d=c.createTextRange(),d.moveToElementText(c),d.select())},setContent:function(b,c){return b.each(function(){var b=a(this).data("wysiwyg");if(!b)return this;b.setContent(c)})},triggerControl:function(c,d){return c.each(function(){var c=a(this).data("wysiwyg");if(!c)return this;c.controls[d]||b.error("Control '"+d+"' not exists"),c.triggerControl.apply(c,[d,c.controls[d]])})},support:{prop:c},utils:{extraSafeEntities:[["<",">","'",'"'," "],[32]],encodeEntities:function(b){var c=this,d,e=[];return this.extraSafeEntities[1].length===0&&a.each(this.extraSafeEntities[0],function(a,b){c.extraSafeEntities[1].push(b.charCodeAt(0))}),d=b.split(""),a.each(d,function(b){var f=d[b].charCodeAt(0);a.inArray(f,c.extraSafeEntities[1])&&(f<65||f>127||f>90&&f<97)?e.push("&#"+f+";"):e.push(d[b])}),e.join("")}}},a.wysiwyg.dialog=function(b,c){var d=b&&b.options&&b.options.dialog?b.options.dialog:c.theme?c.theme:"default",e=new a.wysiwyg.dialog.createDialog(d),f=this,g=a(f);return this.options={modal:!0,draggable:!0,title:"Title",content:"Content",width:"auto",height:"auto",zIndex:2e3,open:!1,close:!1},this.isOpen=!1,a.extend(this.options,c),this.object=e,this.open=function(){this.isOpen=!0,e.init.apply(f,[]);var a=e.show.apply(f,[]);g.trigger("afterOpen",[a])},this.show=function(){this.isOpen=!0,g.trigger("beforeShow");var a=e.show.apply(f,[]);g.trigger("afterShow")},this.hide=function(){this.isOpen=!1,g.trigger("beforeHide");var a=e.hide.apply(f,[]);g.trigger("afterHide",[a])},this.close=function(){this.isOpen=!1;var a=e.hide.apply(f,[]);g.trigger("beforeClose",[a]),e.destroy.apply(f,[]),g.trigger("afterClose",[a])},this.options.open&&g.bind("afterOpen",this.options.open),this.options.close&&g.bind("afterClose",this.options.close),this},a.extend(!0,a.wysiwyg.dialog,{_themes:{},_theme:"",register:function(b,c){a.wysiwyg.dialog._themes[b]=c},deregister:function(b){delete a.wysiwyg.dialog._themes[b]},createDialog:function(b){return new a.wysiwyg.dialog._themes[b]},getDimensions:function(){var b=document.body.scrollWidth,c=document.body.scrollHeight;return a.browser.opera&&(c=Math.max(a(document).height(),a(window).height(),document.documentElement.clientHeight)),[b,c]}}),a(function(){jQuery.ui&&a.wysiwyg.dialog.register("jqueryui",function(){var b=this;this._$dialog=null,this.init=function(){var c=this,d=this.options.content;typeof d=="object"&&(typeof d.html=="function"?d=d.html():typeof d.toString=="function"&&(d=d.toString())),b._$dialog=a("<div></div>").attr("title",this.options.title).html(d);var e=this.options.height=="auto"?300:this.options.height,f=this.options.width=="auto"?450:this.options.width;return b._$dialog.dialog({modal:this.options.modal,draggable:this.options.draggable,height:e,width:f}),b._$dialog},this.show=function(){return b._$dialog.dialog("open"),b._$dialog},this.hide=function(){return b._$dialog.dialog("close"),b._$dialog},this.destroy=function(){return b._$dialog.dialog("destroy"),b._$dialog}}),a.wysiwyg.dialog.register("default",function(){var b=this;this._$dialog=null,this.init=function(){var c=this,d=this.options.content;typeof d=="object"&&(typeof d.html=="function"?d=d.html():typeof d.toString=="function"&&(d=d.toString())),b._$dialog=a('<div class="wysiwyg-dialog"></div>').css({"z-index":this.options.zIndex});var e=a('<div class="wysiwyg-dialog-topbar"><div class="wysiwyg-dialog-close-wrapper"></div><div class="wysiwyg-dialog-title">'+this.options.title+"</div></div>"),f=a('<a href="#" class="wysiwyg-dialog-close-button">X</a>');f.click(function(){c.close()}),e.find(".wysiwyg-dialog-close-wrapper").prepend(f);var g=a('<div class="wysiwyg-dialog-content">'+d+"</div>");b._$dialog.append(e).append(g);var h=this.options.height=="auto"?300:this.options.height,i=this.options.width=="auto"?450:this.options.width;return b._$dialog.hide().css({width:i,height:h,left:(a(window).width()-i)/2,top:(a(window).height()-h)/3}),a("body").append(b._$dialog),b._$dialog},this.show=function(){if(this.options.modal){var c=a.wysiwyg.dialog.getDimensions(),d=a('<div class="wysiwyg-dialog-modal-div"></div>').css({width:c[0],height:c[1]});b._$dialog.wrap(d)}if(this.options.draggable){var e=!1;b._$dialog.find("div.wysiwyg-dialog-topbar").bind("mousedown",function(b){b.preventDefault(),a(this).css({cursor:"move"});var c=a(this),d=a(this).parents(".wysiwyg-dialog"),f=b.pageX-parseInt(d.css("left"),10),g=b.pageY-parseInt(d.css("top"),10);e=!0,a(this).css({cursor:"move"}),a(document).bind("mousemove",function(a){a.preventDefault(),e&&d.css({top:a.pageY-g,left:a.pageX-f})}).bind("mouseup",function(b){b.preventDefault(),e=!1,c.css({cursor:"auto"}),a(document).unbind("mousemove").unbind("mouseup")})})}return b._$dialog.show(),b._$dialog},this.hide=function(){return b._$dialog.hide(),b._$dialog},this.destroy=function(){return this.options.modal&&b._$dialog.unwrap(),this.options.draggable&&b._$dialog.find("div.wysiwyg-dialog-topbar").unbind("mousedown"),b._$dialog.remove(),b._$dialog}})}),a.fn.wysiwyg=function(c){var d=arguments,e;if("undefined"!=typeof a.wysiwyg[c])return d=Array.prototype.concat.call([d[0]],[this],Array.prototype.slice.call(d,1)),a.wysiwyg[c].apply(a.wysiwyg,Array.prototype.slice.call(d,1));if("object"==typeof c||!c)return Array.prototype.unshift.call(d,this),a.wysiwyg.init.apply(a.wysiwyg,d);if(a.wysiwyg.plugin.exists(c))return e=a.wysiwyg.plugin.parseName(c),d=Array.prototype.concat.call([d[0]],[this],Array.prototype.slice.call(d,1)),a.wysiwyg[e.name][e.method].apply(a.wysiwyg[e.name],Array.prototype.slice.call(d,1));b.error("Method '"+c+"' does not exist on jQuery.wysiwyg.\nTry to include some extra controls or plugins")},a.fn.getWysiwyg=function(){return this.data("wysiwyg")}}(jQuery),function(a){"use strict";if(undefined===a.wysiwyg)throw"wysiwyg.image.js depends on $.wysiwyg";a.wysiwyg.controls||(a.wysiwyg.controls={}),a.wysiwyg.controls.image={groupIndex:6,visible:!0,exec:function(){a.wysiwyg.controls.image.init(this)},tags:["img"],tooltip:"Insert image",init:function(b){var c=this,d,e,f,g,h,i,j,k,l={alt:"",self:b.dom?b.dom.getElement("img"):null,src:"http://",title:""};i={legend:"Insert Image",preview:"Preview",url:"URL",title:"Title",description:"Description",width:"Width",height:"Height",original:"Original W x H","float":"Float",floatNone:"None",floatLeft:"Left",floatRight:"Right",submit:"Insert Image",reset:"Cancel",fileManagerIcon:"Select file from server"},g='<form class="wysiwyg" id="wysiwyg-addImage"><fieldset><div class="form-row"><span class="form-row-key">{preview}:</span><div class="form-row-value"><img src="" alt="{preview}" style="margin: 2px; padding:5px; max-width: 100%; overflow:hidden; max-height: 100px; border: 1px solid rgb(192, 192, 192);"/></div></div><div class="form-row"><label for="name">{url}:</label><div class="form-row-value"><input type="text" name="src" value=""/>',a.wysiwyg.fileManager&&a.wysiwyg.fileManager.ready&&(g+='<div class="wysiwyg-fileManager" title="{fileManagerIcon}"/>'),g+='</div></div><div class="form-row"><label for="name">{title}:</label><div class="form-row-value"><input type="text" name="imgtitle" value=""/></div></div><div class="form-row"><label for="name">{description}:</label><div class="form-row-value"><input type="text" name="description" value=""/></div></div><div class="form-row"><label for="name">{width} x {height}:</label><div class="form-row-value"><input type="text" name="width" value="" class="width-small"/> x <input type="text" name="height" value="" class="width-small"/></div></div><div class="form-row"><label for="name">{original}:</label><div class="form-row-value"><input type="text" name="naturalWidth" value="" class="width-small" disabled="disabled"/> x <input type="text" name="naturalHeight" value="" class="width-small" disabled="disabled"/></div></div><div class="form-row"><label for="name">{float}:</label><div class="form-row-value"><select name="float"><option value="">{floatNone}</option><option value="left">{floatLeft}</option><option value="right">{floatRight}</option></select></div></div><div class="form-row form-row-last"><label for="name"></label><div class="form-row-value"><input type="submit" class="button" value="{submit}"/> <input type="reset" value="{reset}"/></div></div></fieldset></form>';for(j in i)a.wysiwyg.i18n&&(k=a.wysiwyg.i18n.t(i[j],"dialogs.image"),k===i[j]&&(k=a.wysiwyg.i18n.t(i[j],"dialogs")),i[j]=k),h=new RegExp("{"+j+"}","g"),g=g.replace(h,i[j]);l.self&&(l.src=l.self.src?l.self.src:"",l.alt=l.self.alt?l.self.alt:"",l.title=l.self.title?l.self.title:"",l.width=l.self.width?l.self.width:"",l.height=l.self.height?l.self.height:"",l.styleFloat=a(l.self).css("float")),e=new a.wysiwyg.dialog(b,{title:i.legend,content:g}),a(e).bind("afterOpen",function(d,f){f.find("form#wysiwyg-addImage").submit(function(a){return a.preventDefault(),c.processInsert(f.container,b,l),e.close(),!1}),a.wysiwyg.fileManager&&a("div.wysiwyg-fileManager").bind("click",function(){a.wysiwyg.fileManager.init(function(a){f.find("input[name=src]").val(a),f.find("input[name=src]").trigger("change")})}),a("input:reset",f).click(function(a){return e.close(),!1}),a("fieldset",f).click(function(a){a.stopPropagation()}),c.makeForm(f,l)}),e.open(),a(b.editorDoc).trigger("editorRefresh.wysiwyg")},processInsert:function(b,c,d){var e,f=a('input[name="src"]',b).val(),g=a('input[name="imgtitle"]',b).val(),h=a('input[name="description"]',b).val(),i=a('input[name="width"]',b).val(),j=a('input[name="height"]',b).val(),k=a('select[name="float"]',b).val(),l=[],m="",n,o;c.options.controlImage&&c.options.controlImage.forceRelativeUrls&&(o=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),0===f.indexOf(o)&&(f=f.substr(o.length))),d.self?(a(d.self).attr("src",f).attr("title",g).attr("alt",h).css("float",k),i.toString().match(/^[0-9]+(px|%)?$/)?a(d.self).css("width",i):a(d.self).css("width",""),j.toString().match(/^[0-9]+(px|%)?$/)?a(d.self).css("height",j):a(d.self).css("height",""),c.saveContent()):(n=i.toString().match(/^[0-9]+(px|%)?$/),n&&(n[1]?l.push("width: "+i+";"):l.push("width: "+i+"px;")),n=j.toString().match(/^[0-9]+(px|%)?$/),n&&(n[1]?l.push("height: "+j+";"):l.push("height: "+j+"px;")),k.length>0&&l.push("float: "+k+";"),l.length>0&&(m=' style="'+l.join(" ")+'"'),e="<img src='"+f+"' title='"+g+"' alt='"+h+"'"+m+"/>",c.insertHtml(e))},makeForm:function(a,b){return a.find("input[name=src]").val(b.src),a.find("input[name=imgtitle]").val(b.title),a.find("input[name=description]").val(b.alt),a.find('input[name="width"]').val(b.width),a.find('input[name="height"]').val(b.height),a.find('select[name="float"]').val(b.styleFloat),a.find("img").attr("src",b.src),a.find("img").bind("load",function(){a.find("img").get(0).naturalWidth?(a.find('input[name="naturalWidth"]').val(a.find("img").get(0).naturalWidth),a.find('input[name="naturalHeight"]').val(a.find("img").get(0).naturalHeight)):a.find("img").attr("naturalWidth")&&(a.find('input[name="naturalWidth"]').val(a.find("img").attr("naturalWidth")),a.find('input[name="naturalHeight"]').val(a.find("img").attr("naturalHeight")))}),a.find("input[name=src]").bind("change",function(){a.find("img").attr("src",this.value)}),a}},a.wysiwyg.insertImage=function(b,c,d){return b.each(function(){var b=a(this).data("wysiwyg"),e,f;if(!b)return this;if(!c||c.length===0)return this;a.browser.msie&&b.ui.focus();if(d){b.editorDoc.execCommand("insertImage",!1,"#jwysiwyg#"),e=b.getElementByAttributeValue("img","src","#jwysiwyg#");if(e){e.src=c;for(f in d)d.hasOwnProperty(f)&&e.setAttribute(f,d[f])}}else b.editorDoc.execCommand("insertImage",!1,c);return b.saveContent(),a(b.editorDoc).trigger("editorRefresh.wysiwyg"),this})}}(jQuery),function(a){"use strict";if(undefined===a.wysiwyg)throw"wysiwyg.link.js depends on $.wysiwyg";a.wysiwyg.controls||(a.wysiwyg.controls={}),a.wysiwyg.controls.link={init:function(b){var c=this,d,e,f,g,h,i,j,k,l,m,n,o;j={legend:"Insert Link",url:"Link URL",title:"Link Title",target:"Link Target",submit:"Insert Link",reset:"Cancel"},i='<form class="wysiwyg"><fieldset><legend>{legend}</legend><label>{url}: <input type="text" name="linkhref" value=""/></label><label>{title}: <input type="text" name="linktitle" value=""/></label><label>{target}: <input type="text" name="linktarget" value=""/></label><input type="submit" class="button" value="{submit}"/> <input type="reset" value="{reset}"/></fieldset></form>';for(k in j)a.wysiwyg.i18n&&(l=a.wysiwyg.i18n.t(j[k],"dialogs.link"),l===j[k]&&(l=a.wysiwyg.i18n.t(j[k],"dialogs")),j[k]=l),m=new RegExp("{"+k+"}","g"),i=i.replace(m,j[k]);g={self:b.dom.getElement("a"),href:"http://",title:"",target:""},g.self&&(g.href=g.self.href?g.self.href:g.href,g.title=g.self.title?g.self.title:"",g.target=g.self.target?g.self.target:"");if(a.fn.dialog){d=a(i),d.find("input[name=linkhref]").val(g.href),d.find("input[name=linktitle]").val(g.title),d.find("input[name=linktarget]").val(g.target);if(a.browser.msie)try{e=d.appendTo(b.editorDoc.body)}catch(p){e=d.appendTo("body")}else e=d.appendTo("body");e.dialog({modal:!0,open:function(c,d){a("input:submit",e).click(function(c){c.preventDefault();var d=a('input[name="linkhref"]',e).val(),f=a('input[name="linktitle"]',e).val(),i=a('input[name="linktarget"]',e).val(),j,k;b.options.controlLink.forceRelativeUrls&&(j=window.location.protocol+"//"+window.location.hostname,0===d.indexOf(j)&&(d=d.substr(j.length))),g.self?"string"==typeof d&&(d.length>0?a(g.self).attr("href",d).attr("title",f).attr("target",i):a(g.self).replaceWith(g.self.innerHTML)):(a.browser.msie&&b.ui.returnRange(),h=b.getRangeText(),k=b.dom.getElement("img"),h&&h.length>0||k?(a.browser.msie&&b.ui.focus(),"string"==typeof d&&(d.length>0?b.editorDoc.execCommand("createLink",!1,d):b.editorDoc.execCommand("unlink",!1,null)),g.self=b.dom.getElement("a"),a(g.self).attr("href",d).attr("title",f),a(g.self).attr("target",i)):b.options.messages.nonSelection&&window.alert(b.options.messages.nonSelection)),b.saveContent(),a(e).dialog("close")}),a("input:reset",e).click(function(b){b.preventDefault(),a(e).dialog("close")})},close:function(a,b){e.dialog("destroy"),e.remove()}})}else g.self?(f=window.prompt("URL",g.href),b.options.controlLink.forceRelativeUrls&&(n=window.location.protocol+"//"+window.location.hostname,0===f.indexOf(n)&&(f=f.substr(n.length))),"string"==typeof f&&(f.length>0?a(g.self).attr("href",f):a(g.self).replaceWith(g.self.innerHTML))):(h=b.getRangeText(),o=b.dom.getElement("img"),h&&h.length>0||o?a.browser.msie?(b.ui.focus(),b.editorDoc.execCommand("createLink",!0,null)):(f=window.prompt(j.url,g.href),b.options.controlLink.forceRelativeUrls&&(n=window.location.protocol+"//"+window.location.hostname,0===f.indexOf(n)&&(f=f.substr(n.length))),"string"==typeof f&&(f.length>0?b.editorDoc.execCommand("createLink",!1,f):b.editorDoc.execCommand("unlink",!1,null))):b.options.messages.nonSelection&&window.alert(b.options.messages.nonSelection)),b.saveContent();a(b.editorDoc).trigger("editorRefresh.wysiwyg")}},a.wysiwyg.createLink=function(b,c){return b.each(function(){var b=a(this).data("wysiwyg"),d;return b?!c||c.length===0?this:(d=b.getRangeText(),d&&d.length>0?(a.browser.msie&&b.ui.focus(),b.editorDoc.execCommand("unlink",!1,null),b.editorDoc.execCommand("createLink",!1,c)):b.options.messages.nonSelection&&window.alert(b.options.messages.nonSelection),this):this})}}(jQuery),function(a){"use strict";if(undefined===a.wysiwyg)throw"wysiwyg.table.js depends on $.wysiwyg";a.wysiwyg.controls||(a.wysiwyg.controls={});var b=function(a,b,c){if(isNaN(b)||isNaN(a)||b===null||a===null)return;var d,e,f=['<table border="1" style="width: 100%;"><tbody>'];a=parseInt(a,10),b=parseInt(b,10),c===null&&(c="&nbsp;"),c="<td>"+c+"</td>";for(d=b;d>0;d-=1){f.push("<tr>");for(e=a;e>0;e-=1)f.push(c);f.push("</tr>")}return f.push("</tbody></table>"),this.insertHtml(f.join(""))};a.wysiwyg.controls.table=function(c){var d,e,f,g,h,i,j,k,l;i={legend:"Insert table",cols:"Count of columns",rows:"Count of rows",submit:"Insert table",reset:"Cancel"},h='<form class="wysiwyg" id="wysiwyg-tableInsert"><fieldset><legend>{legend}</legend><label>{cols}: <input type="text" name="colCount" value="3" /></label><br/><label>{rows}: <input type="text" name="rowCount" value="3" /></label><br/><input type="submit" class="button" value="{submit}"/> <input type="reset" value="{reset}"/></fieldset></form>';for(j in i)a.wysiwyg.i18n&&(k=a.wysiwyg.i18n.t(i[j],"dialogs.table"),k===i[j]&&(k=a.wysiwyg.i18n.t(i[j],"dialogs")),i[j]=k),l=new RegExp("{"+j+"}","g"),h=h.replace(l,i[j]);c.insertTable||(c.insertTable=b),d=new a.wysiwyg.dialog(c,{title:i.legend,content:h,open:function(a,b){b.find("form#wysiwyg-tableInsert").submit(function(a){return a.preventDefault(),g=b.find("input[name=rowCount]").val(),f=b.find("input[name=colCount]").val(),c.insertTable(f,g,c.defaults.tableFiller),d.close(),!1}),b.find("input:reset").click(function(a){return a.preventDefault(),d.close(),!1})}}),d.open(),a(c.editorDoc).trigger("editorRefresh.wysiwyg")},a.wysiwyg.insertTable=function(c,d,e,f){return c.each(function(){var c=a(this).data("wysiwyg");return c.insertTable||(c.insertTable=b),c?(c.insertTable(d,e,f),a(c.editorDoc).trigger("editorRefresh.wysiwyg"),this):this})}}(jQuery),function(a){function c(b){this.handler=b,this.loaded=!1,this.move=!1,this.rename=!1,this.remove=!1,this.upload=!1,this.mkdir=!1,this.selectedFile="",this.curDir="/",this.curListHtml="",this.dialog=null;var c=a.wysiwyg.console;c.log("handler: "+this.handler),this.load=function(d){var e=this;e.loaded=!0,e.authenticate(function(f){if(f!=="success"){var g=new a.wysiwyg.dialog(null,{title:"Error",content:f});return g.open(),!1}var h='<div class="wysiwyg-files-wrapper"><input type="text" name="url" /><div id="wysiwyg-files-list-wrapper"></div>';e.upload.enabled&&(h+='<div class="wysiwyg-files-action-upload" title="{{upload_action}}"></div>'),e.mkdir.enabled&&(h+='<div class="wysiwyg-files-action-mkdir" title="{{mkdir_action}}"></div>'),h+='<input style="display:none;" type="button" name="submit" value="{{select}}" /></div>',h=e.i18n(h);if(a.wysiwyg.dialog){var i=e.i18n("{{file_manager}}"),j=new a.wysiwyg.dialog(b,{title:i,content:h,close:function(a,b){e.dialog=null},open:function(b,c){e.dialog=c,e.loadDir(),e.bindHover(),e.bindBrowse(),c.find("input[name=submit]").bind("click",function(){var a=c.find("input[name=url]").val();j.close(),e.loaded=!1,d(a)}),a(".wysiwyg-files-action-mkdir").bind("click",function(b){b.preventDefault();var c='<div><input type="text" class="wysiwyg-files-textfield" name="newName" value="{{new_directory}}" /><input type="button" name="cancel" value="{{cancel}}" /><input type="button" name="create" value="{{create}}" /></div>';c=e.i18n(c);var d=e.i18n("{{mkdir_title}}"),f=new a.wysiwyg.dialog(null,{title:d,content:c,close:function(){},open:function(a,b){b.find("input[name=create]").bind("click",function(){e.mkDir(b.find("input[name=newName]").val(),function(a){e.loadDir(),f.close()})}),b.find("input[name=cancel]").bind("click",function(){f.close()})}});f.open()}),a(".wysiwyg-files-action-upload").bind("click",function(a){e.loadUploadUI()})},modal:!1});j.open()}else c.error("$.wysiwyg.fileManager: This plugin uses the native dialog system of jWYSIWYG. Make sure you are using version > 0.98")})},this.authenticate=function(b){if(!this.loaded)return!1;var d=this;a.getJSON(d.handler,{action:"auth",auth:"jwysiwyg"},function(a){c.log("Finished"),a.success?(c.log("Success"),d.move=a.data.move,d.rename=a.data.rename,d.remove=a.data.remove,d.mkdir=a.data.mkdir,d.upload=a.data.upload,b("success")):(c.log("Fail"),b(a.error+"\n<br>$.wysiwyg.fileManager: Unable to authenticate handler."))})},this.loadDir=function(){if(!this.loaded)return!1;var b=this;b.curDir=b.curDir.replace(/\/$/,"")+"/",a.getJSON(b.handler,{dir:b.curDir,action:"list"},function(a){a.success?(b.dialog.find("#wysiwyg-files-list-wrapper").removeClass("wysiwyg-files-ajax").html(b.listDir(a)),b.bindHover(),b.bindBrowse()):alert(a.error)})},this.listDir=function(b){if(!this.loaded)return!1;var c=this,d='<ul class="wysiwyg-files-list">';if(c.curDir!=="/"){var e=c.curDir.replace(/[^\/]+\/?$/,"");d+='<li class="wysiwyg-files-dir wysiwyg-files-dir-prev"><a href="#" rel="'+e+'" title="{{previous_directory}}">'+c.curDir+"</a></li>"}return a.each(b.data.directories,function(a,b){d+='<li class="wysiwyg-files-dir"><a href="#" rel="'+b+'">'+a+"</a></li>"}),a.each(b.data.files,function(a,b){var c=a.replace(/^.*?\./,"").toLowerCase();d+='<li class="wysiwyg-files-file wysiwyg-files-'+c+'">'+'<a href="#" rel="'+b+'">'+a+"</a></li>"}),d+="</ul>",c.i18n(d)},this.removeFile=function(b,d){if(!this.loaded)return!1;if(!this.remove.enabled)return c.log("$.wysiwyg.fileManager: handler: remove is disabled."),!1;var e=this;a.getJSON(e.remove.handler,{action:"remove",type:b,dir:e.curDir,file:e.selectedFile},function(a){a.success?alert(a.data):alert(a.error),d(a)})},this.renameFile=function(b,d,e){if(!this.loaded)return!1;if(!this.rename.enabled)return c.log("$.wysiwyg.fileManager: handler: rename is disabled."),!1;var f=this;a.getJSON(f.rename.handler,{action:"rename",type:b,dir:f.curDir,file:f.selectedFile,newName:d},function(a){a.success?alert(a.data):alert(a.error),e(a)})},this.mkDir=function(b,d){if(!this.loaded)return!1;if(!this.mkdir.enabled)return c.log("$.wysiwyg.fileManager: handler: mkdir is disabled."),!1;var e=this;a.getJSON(e.mkdir.handler,{action:"mkdir",dir:e.curDir,newName:b},function(a){a.success?alert(a.data):alert(a.error),d(a)})},this.moveFile=function(){if(!this.loaded)return!1;if(!this.move.enabled)return c.log("$.wysiwyg.fileManager: handler: move is disabled."),!1;var a=this;return!1},this.loadUploadUI=function(){if(!this.loaded)return!1;if(!this.upload.enabled)return c.log("$.wysiwyg.fileManager: handler: move is disabled."),!1;var b=this,d='<form enctype="multipart/form-data" method="post" action="'+b.upload.handler+'">'+'<p><input type="file" name="handle" /> '+'<input type="text" name="action" style="display:none;" value="upload" />'+'<input type="text" name="dir" style="display:none;" value="'+b.curDir+'" />'+'<input type="submit" name="submit" value="{{submit}}" /></p>'+"</form>";d=b.i18n(d);var e=b.i18n("{{upload_title}}"),f=new a.wysiwyg.dialog(null,{title:e,content:"",open:function(b,c){a("<iframe/>",{"class":"wysiwyg-files-upload"}).load(function(){var b=a(this).contents();b.find("body").append(d),b.find("input[type=file]").change(function(){var c=a(this).val();c=c.replace(/.*[\\\/]/,""),b.find("input[name=newName]").val(c)})}).appendTo(c.find(".wysiwyg-dialog-content"))},close:function(){b.loadDir()}});f.open()},this.defaultTranslations={file_manager:"File Manager",upload_title:"Upload File",rename_title:"Rename File",remove_title:"Remove File",mkdir_title:"Create Directory",upload_action:"Upload new file to current directory",mkdir_action
:"Create new directory",remove_action:"Remove this file",rename_action:"Rename this file",delete_message:"Are you sure you want to delete this file?",new_directory:"New Directory",previous_directory:"Go to previous directory",rename:"Rename",select:"Select",create:"Create",submit:"Submit",cancel:"Cancel",yes:"Yes",no:"No"},this.i18n=function(b){var c=this.defaultTranslations;return a.wysiwyg.i18n&&a.each(c,function(b,d){c[b]=a.wysiwyg.i18n.t(b,"dialogs.fileManager")}),a.each(c,function(a,c){b=b.replace("{{"+a+"}}",c)}),b},this.bindHover=function(){var b=this,c=b.dialog,d=c.find("li");d.bind("mouseenter",function(){a(this).addClass("wysiwyg-files-hover"),a(this).hasClass("wysiwyg-files-dir")&&a(this).addClass("wysiwyg-files-dir-expanded");if(!a(this).hasClass("wysiwyg-files-dir-prev")){a(".wysiwyg-files-action").remove();if(b.remove.enabled){var c=b.i18n("{{remove_action}}");a("<div/>",{"class":"wysiwyg-files-action wysiwyg-files-action-remove",title:c}).appendTo(this),a(".wysiwyg-files-action-remove").bind("click",function(c){c.preventDefault();var d=a(this).parent("li"),e=d.hasClass("wysiwyg-files-file")?"file":"dir",f='<p>{{delete_message}}</p><div class=""><input type="button" name="cancel" value="{{no}}" /><input type="button" name="remove" value="{{yes}}" /></div>';f=b.i18n(f);var g=b.i18n("{{remove_title}}"),h=new a.wysiwyg.dialog(null,{title:g,content:f,close:function(){},open:function(a,c){c.find("input[name=remove]").bind("click",function(){b.selectedFile=d.find("a").text(),b.removeFile(e,function(a){b.loadDir(),h.close()})}),c.find("input[name=cancel]").bind("click",function(){h.close()})}});h.open()})}if(b.rename.enabled){var d=b.i18n("{{rename_action}}");a("<div/>",{"class":"wysiwyg-files-action wysiwyg-files-action-rename",title:d}).appendTo(this),a(".wysiwyg-files-action-rename").bind("click",function(c){c.preventDefault();var d=a(this).parent("li"),e=d.hasClass("wysiwyg-files-file")?"file":"dir",f='<div><input type="text" class="wysiwyg-files-textfield" name="newName" value="'+d.find("a").text()+'" />'+'<input type="button" name="cancel" value="{{cancel}}" />'+'<input type="button" name="rename" value="{{rename}}" />'+"</div>";f=b.i18n(f);var g=b.i18n("{{rename_title}}"),h=new a.wysiwyg.dialog(null,{title:g,content:f,close:function(){},open:function(a,c){c.find("input[name=rename]").bind("click",function(){b.selectedFile=d.find("a").text(),b.renameFile(e,c.find("input[name=newName]").val(),function(a){b.loadDir(),h.close()})}),c.find("input[name=cancel]").bind("click",function(){h.close()})}});h.open()})}}}).bind("mouseleave",function(){a(this).removeClass("wysiwyg-files-dir-expanded"),a(this).removeClass("wysiwyg-files-hover"),a(".wysiwyg-files-action").remove()})},this.bindBrowse=function(){var b=this,c=b.dialog,d=b.dialog.find("li").find("a");d.bind("click",function(d){a(".wysiwyg-files-wrapper").find("li").css("backgroundColor","#FFF"),a(this).parent("li").hasClass("wysiwyg-files-dir")?(b.selectedFile=a(this).attr("rel"),b.curDir=a(this).attr("rel"),c.find("input[name=submit]").hide(),a(".wysiwyg-files-wrapper").find("input[name=url]").val(""),a("#wysiwyg-files-list-wrapper").addClass("wysiwyg-files-ajax"),a("#wysiwyg-files-list-wrapper").html(""),b.loadDir(),c.find("input[name=submit]").hide()):(b.selectedFile=a(this).text(),a(this).parent("li").css("backgroundColor","#BDF"),a(".wysiwyg-files-wrapper").find("input[name=url]").val(a(this).attr("rel")),c.find("input[name=submit]").show())})},this.bindPreview=function(a){var b=this}}"use strict";if(undefined===a.wysiwyg)throw"wysiwyg.fileManager.js depends on $.wysiwyg";var b={name:"fileManager",version:"0.98",ajaxHandler:"",selected:null,setAjaxHandler:function(a){return this.ajaxHandler=a,this.ready=!0,this},ready:!1,init:function(a){if(!this.ready)return console.log("$.wysiwyg.fileManager: Must set ajax handler first, using $.wysiwyg.fileManager.setAjaxHandler()"),!1;var b=new c(this.ajaxHandler);b.load(a)}};a.wysiwyg.plugin.register(b)}(jQuery),function(a,b,c){var d={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,COMMA:188,SPACE:32,HOME:36,END:35},e={triggerChar:"@",onDataRequest:a.noop,minChars:2,showAvatars:!0,elastic:!0,classes:{autoCompleteItemActive:"active"},templates:{wrapper:b.template('<div class="mentions-input-box"></div>'),autocompleteList:b.template('<div class="mentions-autocomplete-list"></div>'),autocompleteListItem:b.template('<li data-ref-id="<%= id %>" data-ref-type="<%= type %>" data-display="<%= display %>"><%= content %></li>'),autocompleteListItemAvatar:b.template('<img  src="<%= avatar %>" />'),autocompleteListItemIcon:b.template('<div class="icon <%= icon %>"></div>'),mentionsOverlay:b.template('<div class="mentions"><div></div></div>'),mentionItemSyntax:b.template("@[<%= value %>](<%= type %>:<%= id %>)"),mentionItemHighlight:b.template("<strong><span><%= value %></span></strong>")}},f={htmlEncode:function(a){return b.escape(a)},highlightTerm:function(a,b){return!b&&!b.length?a:a.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b+")(?![^<>]*>)(?![^&;]+;)","gi"),"<b>$1</b>")},setCaratPosition:function(a,b){if(a.createTextRange){var c=a.createTextRange();c.move("character",b),c.select()}else a.selectionStart?(a.focus(),a.setSelectionRange(b,b)):a.focus()}},g=function(c){function p(){g=a(c);if(g.attr("data-mentions-input")=="true")return;h=g.parent(),j=a(e.templates.wrapper()),g.wrapAll(j),j=h.find("> div"),g.attr("data-mentions-input","true"),g.bind("keydown",B),g.bind("keypress",A),g.bind("input",z),g.bind("click",y),e.elastic&&g.elastic()}function q(){i=a(e.templates.autocompleteList()),i.appendTo(j),i.delegate("li","click",x)}function r(){k=a(e.templates.mentionsOverlay()),k.prependTo(j)}function s(){var a=w();b.each(m,function(b){var c=e.templates.mentionItemSyntax({value:b.value,type:"contact",id:b.id});a=a.replace(b.value,c)});var c=f.htmlEncode(a);b.each(m,function(a){var b=e.templates.mentionItemSyntax({value:f.htmlEncode(a.value),type:"contact",id:a.id}),d=e.templates.mentionItemHighlight({value:f.htmlEncode(a.value)});c=c.replace(b,d)}),c=c.replace(/\n/g,"<br />"),c=c.replace(/ {2}/g,"&nbsp; "),g.data("messageText",a),k.find("div").html(c)}function t(){n=[]}function u(){var a=w();m=b.reject(m,function(b,c){return!b.value||a.indexOf(b.value)==-1}),m=b.compact(m)}function v(a,b,c,d){var h=w();o||(o=a);var i=new RegExp("\\"+e.triggerChar+o,"gi");i.exec(h);var j=i.lastIndex-o.length-1,k=i.lastIndex,l=h.substr(0,j),n=h.substr(k,h.length),p=(l+a).length,q=l+a+n;m.push({id:b,type:c,value:a}),t(),o="",C(),d||g.val(q),s(),g.focus(),f.setCaratPosition(g[0],p)}function w(){return a.trim(g.val())}function x(b){var c=a(this);return v(c.attr("data-display"),c.attr("data-ref-id"),c.attr("data-ref-type")),!1}function y(a){t()}function z(a){s(),u(),C();var c=b.lastIndexOf(n,e.triggerChar);c>-1&&(o=n.slice(c+1).join(""),b.defer(b.bind(F,this,o)))}function A(a){var b=String.fromCharCode(a.which||a.keyCode);n.push(b)}function B(c){if(c.keyCode==d.LEFT||c.keyCode==d.RIGHT||c.keyCode==d.HOME||c.keyCode==d.END){b.defer(t);return}if(c.keyCode==d.BACKSPACE){n=n.slice(0,-1+n.length);return}if(!i.is(":visible"))return!0;switch(c.keyCode){case d.UP:case d.DOWN:var e=null;return c.keyCode==d.DOWN?l&&l.length?e=l.next():e=i.find("li").first():e=a(l).prev(),e.length&&D(e),!1;case d.RETURN:case d.TAB:if(l&&l.length)return l.click(),!1}return!0}function C(){l=null,i.empty().hide()}function D(a){a.addClass(e.classes.autoCompleteItemActive),a.siblings().removeClass(e.classes.autoCompleteItemActive),l=a}function E(c,d){i.show();var g=b.pluck(m,"value");d=b.reject(d,function(a){return b.include(g,a.name)});if(!d.length){C();return}i.empty();var h=a("<ul>").appendTo(i).hide();b.each(d,function(b){var d=a(e.templates.autocompleteListItem({id:f.htmlEncode(b.id),display:f.htmlEncode(b.name),type:f.htmlEncode(b.type),content:f.highlightTerm(f.htmlEncode(b.name),c)}));if(e.showAvatars){var g;b.avatar?g=a(e.templates.autocompleteListItemAvatar({avatar:b.avatar})):g=a(e.templates.autocompleteListItemIcon({icon:b.icon})),g.prependTo(d)}d=d.appendTo(h)}),i.show(),h.show()}function F(a){a&&a.length&&a.length>=e.minChars&&e.onDataRequest.call(this,"search",a,function(b){E(a,b)})}var e,g,h,i,j,k,l,m=[],n=[],o;return{init:function(a){e=a,p(),q(),r()},val:function(a){if(!b.isFunction(a))return;var c=m.length?g.data("messageText"):w();a.call(this,c)},reset:function(){g.val(""),m=[],s()},getMentions:function(a){if(!b.isFunction(a))return;a.call(this,m)},addMention:function(a,b,c){v(a,b,c,!0)}}};a.fn.mentionsInput=function(c,d){if(typeof c=="object"||!c)d=c;d||(d={}),d=b.defaults(d,e);var f=arguments;return this.each(function(){var e=a.data(this,"mentionsInput")||a.data(this,"mentionsInput",new g(this));if(b.isFunction(e[c]))return e[c].apply(this,Array.prototype.slice.call(f,1));if(typeof c=="object"||!c)return e.init.call(this,d);a.error("Method "+c+" does not exist")})}}(jQuery,_),function(a){function b(){var b=a(this);window.event.propertyName=="value"&&!b.data("triggering.inputEvent")&&(b.data("triggering.inputEvent",!0).trigger("input"),window.setTimeout(function(){b.data("triggering.inputEvent",!1)},0))}function c(a){a.setAttribute("oninput","return");if(typeof a.oninput=="function")return!0;try{var b=document.createEvent("KeyboardEvent"),c=!1,d=function(a){c=!0,a.preventDefault(),a.stopPropagation()};return document.body.appendChild(a),a.addEventListener("input",d,!1),a.removeEventListener("input",d,!1),document.body.removeChild(a),c}catch(e){}}a.event.special.input={setup:function(b,d){function m(){var b=a(f);f.value!=g&&!b.data("triggering.inputEvent")&&(g=f.value,b.data("triggering.inputEvent",!0).trigger("input"),window.setTimeout(function(){b.data("triggering.inputEvent",!1)},0))}function n(a){a.type=="focus"?(m(),clearInterval(e),e=window.setInterval(m,250)):a.type=="blur"?window.clearInterval(e):window.setTimeout(m,0)}var e,f=this,g=f.value,h=document.createElement(this.tagName),i="oninput"in h||c(h),j="onpropertychange"in h,k="inputEventNS"+~~(Math.random()*1e7),l=["focus","blur","paste","cut","keydown","drop",""].join("."+k+" ");if(i)return!1;a(this).find("input, textarea").andSelf().filter("input, textarea").bind(l,n),a(this).data("inputEventHandlerNS",k)},teardown:function(){var b=a(this);b.find("input, textarea").unbind(b.data("inputEventHandlerNS")),b.data("inputEventHandlerNS","")}},a.fn.input=function(a){return a?this.bind("input",a):this.trigger("input")}}(jQuery),function(a){a.fn.extend({elastic:function(){var b=["paddingTop","paddingRight","paddingBottom","paddingLeft","marginTop","marginRight","marginBottom","marginLeft","fontSize","lineHeight","fontFamily","width","fontWeight","border-top-width","border-right-width","border-bottom-width","border-left-width","borderTopStyle","borderTopColor","borderRightStyle","borderRightColor","borderBottomStyle","borderBottomColor","borderLeftStyle","borderLeftColor","box-sizing","-moz-box-sizing","-webkit-box-sizing"];return this.each(function(){function j(){curatedWidth=Math.floor(parseInt(c.width(),10)),d.width()!==curatedWidth&&(d.css({width:curatedWidth+"px"}),l(!0))}function k(a,b){var d=Math.floor(parseInt(a,10));c.height()!==d&&(c.css({height:d+"px",overflow:b}),c.triggerHandler("resize"))}function l(a){var b=c.val().replace(/&/g,"&amp;").replace(/ {2}/g,"&nbsp;").replace(/<|>/g,"&gt;").replace(/\n/g,"<br />"),h=d.html().replace(/<br>/ig,"<br />");if(a||b+"&nbsp;"!==h){d.html(b+"&nbsp;");if(Math.abs(d.outerHeight()+e-c.outerHeight())>3){var i=d.outerHeight();i>=g?k(g,"auto"):i<=f?k(f,"hidden"):k(i,"hidden")}}}if(this.type!=="textarea")return!1;var c=a(this),d=a("<div />").css({position:"absolute",display:"none","word-wrap":"break-word"}),e=parseInt(c.css("line-height"),10)||parseInt(c.css("font-size"),"10"),f=parseInt(c.css("height"),10)||e*3,g=parseInt(c.css("max-height"),10)||Number.MAX_VALUE,h=0;g<0&&(g=Number.MAX_VALUE),d.appendTo(c.parent());var i=b.length;while(i--)b[i].toString()==="width"&&c.css(b[i].toString())==="0px"?j():d.css(b[i].toString(),c.css(b[i].toString()));l(!0),c.bind("input",l),c.bind("change",l),$(window).bind("resize",j)})}})}(jQuery),function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n=this;k=function(a,b){return a===1?b:""+b+"s"},i=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},j=function(a){return $("#forum_tab_links li").removeClass("active"),$("#link_"+a).addClass("active"),document.location.href="#"+i(a)},m=function(a){return $(".part_link_li.active").removeClass("active"),$(".top_participant_container").hide(),$("#top_"+a+"_container").show(),$("#part_link_li_"+a).addClass("active")},window.showParticipantTab=m,window.openTags=[],window.toggleTag=function(a,b){return openTags.indexOf(a)<0?(openTags[openTags.length]=a,insertAtCursor(document.getElementById(b.attr("id")),"["+a+"]"),$("#btn_"+a).css("color","#ff0000")):(openTags[openTags.indexOf(a)]=null,insertAtCursor(document.getElementById(b.attr("id")),"[/"+a+"]"),$("#btn_"+a).css("color","#000")),b.focus(),!1},l=function(){return this.lightbox=$('<div id="lightbox" style="display: none; height: '+document.body.offsetHeight+'px"></div>'),this.lightbox.click(function(){return hide_lightbox()}),this.target_div=$('<div id="lightboxContent" style="display: none; left: '+(document.body.offsetWidth/2-225)+'px"></div>'),$(document.body).append(this.lightbox),$(document.body).append(this.target_div)},window.show_lightbox=function(a){var b=this;return $.ajax(a,{type:"get",complete:function(a,b){return $("#lightboxContent").html(a.responseText)},beforeSend:function(){return $("#lightboxContent").html('<img src="/images/spinner.gif" alt="Please wait..." />'),$("#lightbox, #lightboxContent").show()}})},window.hide_lightbox=function(){return $("#lightboxContent").html(""),$("#lightbox, #lightboxContent").hide()},window.switchSettingsTab=function(a){return $(".profile_settings_tab").hide(),$(".tab").removeClass("active"),$("#"+a).show(),$("#tab_"+a).addClass("active"),$("#tab_"+a).removeClass("inactive")},window.isMobile=function(){var a,b,c,d;return d=navigator.userAgent.toLowerCase(),a=d.indexOf("android")>-1,b=d.indexOf("iphone")>-1||d.indexOf("ipod")>-1||d.indexOf("ipad")>-1,c=d.indexOf("windows phone os")>-1,a||b||c},c=function(){function a(){this.bindFlashEvents(),this.removeJsHiddenClasses()}return a.prototype.bindFlashEvents=function(){return $(".flash, .staging_alert").click(function(){return $(this).hide()})},a.prototype.removeJsHiddenClasses=function(){return $(".js-hidden").removeClass("js-hidden")},a}(),f=function(){function a(a,b){this.select=a,this.replacementClass=b,this.hideSelect(),this.div_el=$("<div></div>").addClass(this.replacementClass).css("overflow","hidden"),this.ul_el=$("<ul></ul>").css("display","none"),$(this.select).after(this.buildSelector()),this.choose($(this.select)[0].selectedIndex)}return a.prototype.hideSelect=function(){return $(this.select).hide()},a.prototype.buildSelector=function(){var a,b,c,d,e,f,g=this;this.trigger_link=$("<a></a>").attr("href","javascript:void(0);"),this.trigger_link.click(function(){return g.div_el.css("overflow")==="visible"?(g.ul_el.hide(),g.div_el.css("overflow","hidden")):(g.ul_el.show(),g.div_el.css("overflow","visible"))}),b=0,f=$(this.select).find("option");for(d=0,e=f.length;d<e;d++)a=f[d],c=$("<li></li>").html('<a href="javascript:void(0);">'+a.label+"</a>"),c.click({i:b},function(a){return g.choose(a.data.i),g.ul_el.hide(),g.div_el.css("overflow","hidden")}),this.ul_el.append(c),b+=1;return this.div_el.mouseout(function(){return g.timer=setTimeout(g.hide_el.bind(g),500)}),this.div_el.mouseover(function(){return g.stopTimer()}),this.div_el.append(this.trigger_link),this.div_el.append(this.ul_el),this.div_el},a.prototype.stopTimer=function(){return clearTimeout(this.timer)},a.prototype.hide_el=function(){return this.ul_el.hide(),this.div_el.css("overflow","hidden")},a.prototype.choose=function(a){return $(this.select)[0].selectedIndex=a,this.trigger_link.text($(""+this.select+" option")[a].label)},a}(),a=function(){function a(a){this.parent=a,this.parent.find(".forum_section_content, .sub_accordion_content_forum_listing").hide(),this.parent.find("h3").click(function(){return $(this).parent().next().slideToggle().find("div.sub_accordion_toggle").show()}),this.parent.find("h4").click(function(){return $(this).parent().next("div").slideToggle()})}return a}(),e=function(){function a(a,b,c){this.container=a,this.current_rating=b,this.url=c,this.sending=!1,this.container.html(this.buildSelector()),this.bindEvents()}return a.prototype.bindEvents=function(){var a,b,c,d,e,f,g=this;b=0,e=this.container.find("a"),f=[];for(c=0,d=e.length;c<d;c++)a=e[c],a=$(a),a.bind("click",{i:b},function(a){return g.setRating(a.data.i+1)}),a.bind("mouseover",{i:b},function(a){return g.highlightSelection(a.data.i+1),g.setStatus(a.data.i+1)}),a.bind("mouseout",{i:b},function(a){return g.resetStatus()}),f.push(b+=1);return f},a.prototype.buildSelector=function(){var a,b,c,d;a=$("<div></div>");if(!(this.current_rating<1))for(b=1,c=this.current_rating;1<=c?b<=c:b>=c;1<=c?b++:b--)a.append($('<a href="javascript: void(0);"><img src="/images/star.png" border="0" /></a>'));if(!(this.current_rating>=5))for(b=1,d=5-this.current_rating;1<=d?b<=d:b>=d;1<=d?b++:b--)a.append($('<a href="javascript: void(0);"><img src="/images/star-off.png" border="0" /></a>'));return this.status_element=$('<span class="current_rating">Rating: '+this.current_rating+"</span>"),a.append(this.status_element),a},a.prototype.resetStatus=function(){if(!this.sending)return this.status_element.text("Rating: "+this.current_rating),this.highlightSelection(this.current_rating)},a.prototype.setStatus=function(a){if(!this.sending)return this.status_element.text("Your rating: "+a)},a.prototype.highlightSelection=function(a){var b,c,d,e,f,g,h;if(!this.sending){c=this.container.find("img");for(e=0,f=c.length;e<f;e++)d=c[e],this.resetImage(d);h=[];for(b=0,g=a-1;0<=g?b<=g:b>=g;0<=g?b++:b--)h.push($(c[b]).attr("src","/images/star.png"));return h}},a.prototype.resetImage=function(a){return $(a).attr("src","/images/star-off.png")},a.prototype.setRating=function(a){var b=this;return $.ajax(this.url,{type:"post",data:{rating:a},loading:function(){return b.status_element.text("Please wait..."),b.sending=!0},complete:function(a,c){var d;return b.sending=!1,d=parseInt(a.responseText),d>0&&d<=5?(b.status_element.text("Rating saved!"),b.current_rating=d):b.resetStatus()}})},a}(),window.RatingSelector=e,g=function(){function a(a,b,c){this.targetEl=a,this.toggler=b,this.callbacks=c,this.originalDisplay=this.targetEl.css("display"),this.toggler.bind("click",this.toggle.bind(this))}return a.prototype.toggle=function(){if(this.targetEl.css("display")==="none"){this.targetEl.show();if(this.callbacks.afterShow)return this.callbacks.afterShow(this)}else{this.targetEl.hide();if(this.callbacks.afterHide)return this.callbacks.afterHide(this)}},a}(),window.Toggler=g,h=function(){function a(a,b){this.inbox_link=a,this.notifications_link=b,this.spinner=$("#nav_notifications_spinner"),this.notifications_list=$("#notifications_list"),this.notifications_list&&this.sendRequest()}return a.prototype.sendRequest=function(){var a=this;return $.ajax("/users/notifications.json",{type:"GET",success:function(b,c,d){var e;b=jQuery.parseJSON(d.responseText),b.messages>0&&a.inbox_link.append(" <sup>"+b.messages+"</sup>"),e=0+b.colleague_requests+b.reference_requests+b.properties+b.group_invitations+b.mentions,a.spinner.hide();if(!(e>0))return a.notifications_list.append($('<li class="align-center"><a href="#">No Notifications</a></li>'));a.notifications_link.append(" <sup>"+e+"</sup>"),b.colleague_requests>0&&a.notifications_list.append($("<li></li>").html('<a href="/colleague_requests">'+b.colleague_requests+" colleague "+k(b.colleague_requests,"request")+"</a>")),b.reference_requests>0&&a.notifications_list.append($("<li></li>").html('<a href="/references/requests">'+b.reference_requests+" reference "+k(b.reference_requests("request"))+"</a>")),b.properties>0&&a.notifications_list.append($("<li></li>").html('<a href="/properties/notifications">'+b.properties+" property "+k(b.properties("notice"))+"</a>")),b.group_invitations>0&&a.notifications_list.append($("<li></li>").html('<a href="/groups/invitations">'+b.group_invitations+" group "+k(b.group_invitations,"invite")+"</a>"));if(b.mentions>0)return a.notifications_list.append($("<li></li>").html('<a href="/mentions">'+b.mentions+" mentions"))}})},a}(),b=function(){function a(a){this.element=a,this.hideSubnavs(),this.bindEvents()}return a.prototype.hideSubnavs=function(a){return a?this.timer=setTimeout(this.hideAllSubnavs.bind(this),300):this.hideAllSubnavs()},a.prototype.hideAllSubnavs=function(){return $(this.element).find("li.nav-item > ul").hide()},a.prototype.bindEvents=function(){var a,b,c,d,e,f,g=this;e=$(this.element).find("li.nav-item > a"),f=[];for(c=0,d=e.length;c<d;c++)a=e[c],b=$(a).parent("li").children("ul"),b?($(a).mouseover({el:a},function(a){return g.showSubnav(a.data.el)}),$(a).mouseout({el:a},function(a){return g.hideSubnavs(a.data.el)}),$(b).mouseout({el:a},function(a){return g.hideSubnavs(a.data.el)}),f.push($(b).mouseover(function(){return g.stopTimer()}))):f.push(void 0);return f},a.prototype.showSubnav=function(a){return this.stopTimer(),this.hideSubnavs(),$(a).parent("li").children("ul").show()},a.prototype.stopTimer=function(){return clearTimeout(this.timer)},a}(),d=function(){function a(a,b){this.target=a,this.delay=b,this.timer=null,this.displayNext()}return a.prototype.displayNext=function(){var a=this;return this.target.css("display")==="none"?this.timer=setTimeout(this.displayNext.bind(this),this.delay):$.ajax("/meet/random_member",{success:function(b,c,d){return a.target.html(d.responseText),a.timer=setTimeout(a.displayNext.bind(a),a.delay)}})},a}(),window.RandomMember=d,$(document).ready(function(){var d,e,g,i,k,m,n;return $("#search-type").exists()&&(m=new f("#search-type","select-type-replace")),$("#nav").exists()&&(i=new b("#nav")),k=new c,$("#inbox-link").exists()&&(n=new h($("#inbox-link"),$("#notifications-link"))),d=new a($("#forum_accordion")),e=new a($("#resources_accordion")),l(),$(".open-in-lightbox").click(function(){return show_lightbox(this.href),!1}),$(".monitor_checkbox").change(function(){return $.ajax($(this).parent().parent().attr("action"),{type:this.checked?"POST":"DELETE"})}),$("#forum_tab_links li a").bind("ajax:before",function(){return $("#dash_tab_spinner").show()}),$("#forum_tab_links li a").bind("ajax:success",function(a,b){return $("#dash_tab_spinner").hide(),j($(this).parent()[0].id.substring(5))}),$(".task-checkbox").bind("change",function(){return $.ajax("/tasks/"+$(this).attr("id").split("_")[1]+"/toggle?remove_on_complete=1",{type:"post"})}),$(".dash_tabs li a").bind("ajax:success",function(a,b){return $("#dash_tab_spinner").hide()}),$(".dash_tabs li a").bind("ajax:beforeSend",function(){return $("#dash_tab_spinner").show()}),$("textarea.elastic").elastic(),$(".wysiwyg").wysiwyg({initialContent:"",css:"/assets/application/text.css",controls:{h1:{visible:!1},strikeThrough:{visible:!1},undo:{visible:!1},redo:{visible:!1},code:{visible:!1},fileManager:{visible:!1,groupIndex:12,tooltip:"File Manager",exec:function(){return $.wysiwyg.fileManager.init(function(){return file?alert(file):alert("No file selected.")})}}}}),$.wysiwyg.fileManager.setAjaxHandler("/blog_images/"),g=$(document.body),g&&g.bind("click",function(a){var b,c,d=this;c=$(a.target),c.is(".close-lightbox")&&hide_lightbox();if(c.is(".pagination.ajax a"))return b=c.parent(".pagination"),b.append($('<img src="/images/spinner.gif" class="spinner" />')),b.parent().attr("ajax-replace")?$.ajax(c.attr("href"),{type:"get",complete:function(a,c){return $("#"+b.parent("div").attr("ajax-replace")).html(a.responseText)}}):b.attr("ajax-replace")?$.ajax(c.attr("href"),{type:"get",complete:function(a,c){return $("#"+b.attr("ajax-replace")).html(a.responseText)}}):$.ajax(c.attr("href"),{type:"get"}),!1}),null})}.call(this),function(){function c(){if(b.length>0){$("#attached_files_list").html("<strong>Attached files:</strong> ");for(var a=0;a<b.length;a++)$("#attached_files_list").append(b[a][1]+' <a href="javascript:void(0)" onclick="detachFileFromPost('+b[a][0]+');"><img src="/assets/close.gif" border="0" style="width:12px;height:12px;" alt="Cancel"></a>'),a!=b.length-1&&$("#attached_files_list").append(", ")}else $("#attached_files_list").html("")}var a,b;jQuery.fn.exists=function(){return this.length>0},String.prototype.capitalize=function(){return""+this.charAt(0).toUpperCase()+this.slice(1)},window.updateLotSize=function(a){var b,c;return b=$("#numformat_"+a),c=$("#lot_size_value_"+a),isNaN(parseInt(c))&&(c=0),b==="acre"&&(c*=43560),$("#attr_"+a).val(c)},b=[],window.attached_files=b,window.toggleSubmissionDate=function(a){return a===!1?$(".submission_date_container").show():$(".submission_date_container").hide()},window.checkAndSetChkBoxValue=function(a,b){return $("#"+b).val($("#"+a).attr("checked")?1:0)},window.attachFileToPost=function(a,b){if(attachFile(a,b))return updateAttachedFilesInput("post_file_ids"),c()},window.detachFileFromPost=function(a){return detachFile(a),updateAttachedFilesInput("post_file_ids"),c()},window.updateAttachedFilesInput=function(a){var c,d,e,f;f=[];for(d=0,e=b.length;d<e;d++)c=b[d],f.push($(a).val(""+$(a).val()+c+","));return f},window.updateAttachedFilesSentence=c,window.attachFile=function(a,c){var d,e,f;if(b.length>=3)return!1;for(e=0,f=b.length;e<f;e++){d=b[e];if(d[0]===a)return!1}return b[b.length]=[a,c],!0},window.detachFile=function(a){for(var c=0;c<b.length;c++)b[c][0]==a&&b.splice(c,1);return!0},window.setCaretPos=0,window.getCaretPosition=function(a){var b=0;if(document.selection){a.focus();var c=document.selection.createRange();c.moveStart("character",-a.value.length),b=c.text.length}else if(a.selectionStart||a.selectionStart=="0")b=a.selectionStart;return b},window.setCaretPosition=function(a,b){if(document.selection){a.focus();var c=document.selection.createRange();c.moveStart("character",-a.value.length),c.moveStart("character",b),c.moveEnd("character",0),c.select()}else if(a.selectionStart||a.selectionStart=="0")a.selectionStart=b,a.selectionEnd=b,a.focus()},window.insertAtCursor=function(a,b){if(document.selection)a.focus(),sel=document.selection.createRange(),sel.text=b+sel.text;else if(a.selectionStart||a.selectionStart=="0"){var c=a.selectionStart,d=a.selectionEnd;a.value=a.value.substring(0,c)+b+a.value.substring(c,a.value.length),setCaretPosition(a,c+b.length)}else a.value+=b;$("#"+a.id).trigger("input")},a=function(){function a(a,b){var c=this;this.timeout=a,this.func=b,this.timer=setTimeout(function(){return c.run()},this.timeout)}return a.prototype.run=function(){var a=this;return this.func(),this.timer=setTimeout(function(){return a.run()},this.timeout)},a}(),window.TimedRepeater=a}.call(this),function(){var a,b=this;a=function(){function a(a,b,c,d){this.form=a,this.content_type=b,this.context_content_id=c,this.context_content_type=d,this.mentionPool=[],this.populateMentionPool(),this.insertHiddenFields(),this.bindSubmit()}return a.prototype.populateMentionPool=function(){var a,b=this;return a={},typeof this.context_content_type!="undefined"&&typeof this.context_content_id!="undefined"&&(a={content_type:this.context_content_type.capitalize(),content_id:this.context_content_id}),$.ajax("/users/context.json",{type:"get",data:a,success:function(a,c,d){a=jQuery.parseJSON(d.responseText),b.mentionPool=_.map(a,function(a){return a=a.social_user,{id:a.id,name:a.display_name,avatar:a.user_avatar.latest_posts_thumb.url,type:"user"}}),b.bindMentionInput();if(typeof passed_through_mention_data!="undefined")return b.initializeWithMentionData(passed_through_mention_data)}})},a.prototype.bindMentionInput=function(){var a=this;return this.form.find("textarea.mention-input").mentionsInput({elastic:!0,onDataRequest:function(b,c,d){var e;return e=_.filter(a.mentionPool,function(a){return a.name.toLowerCase().indexOf(c.toLowerCase())>=0}),d.call(a,e)}})},a.prototype.insertHiddenFields=function(){return this.userIdField=$('<input type="hidden" id="'+this.content_type+'_mentioned_users" name="'+this.content_type+'[mentioned_users]" />'),this.hiddenField=$('<input type="hidden" id="mention_data_meta" name="mentions[mention_data_meta]" />'),this.form.append(this.userIdField),this.form.append(this.hiddenField)},a.prototype.initializeWithMentionData=function(a){var b=this;return this.hiddenField.val(JSON.stringify(a)),_.each(a,function(a){return b.form.find("textarea.mention-input").mentionsInput("addMention",a.value,a.id,"user")})},a.prototype.bindSubmit=function(){var a=this;return this.form.bind("submit",function(){return $("textarea.mention-input").mentionsInput("getMentions",function(b){return a.userIdField.val(_.pluck(b,"id").join(",")),a.hiddenField.val(JSON.stringify(b))})})},a}(),$(document).ready(function(){var c;return!isMobile()&&$("form.post_form").exists()&&($("#reply_body").exists()?c=new a($("form.post_form"),"post",topic_id,"topic"):c=new a($("form.post_form"),"topic"),window.postInput=c),$("#topic_title").change(function(){return $.ajax("/topics/get_related_for_title",{data:"title="+b.val()})})})}.call(this),function(){var a,b;a=function(){function a(a,b,c){this.container=a,this.callbacks=c,this.names={},this.value_types={},this.unselectables=[],this.insertHiddenField(),this.currentContainer=this.container,b?this.getChildren(b):this.getChildren()}return a.prototype.setCurrentLabelId=function(a){return this.currentLabelId=a,this.hiddenField.val(this.currentLabelId),this.currentLabelSelectable=this.unselectables.indexOf(parseInt(this.currentLabelId))<0},a.prototype.getChildren=function(a){var b,c=this;return b="/labels.json",a&&(b+="?parent_id="+a),$.ajax(b,{type:"get",success:function(a,b,d){var e;e=c.buildInput(jQuery.parseJSON(d.responseText));if(e)return c.currentContainer.append(e),c.currentContainer=e}})},a.prototype.buildInput=function(a){var b,c,d;b=a.label?a.label.id:"root",c=null,this.valueInput=null;if(a.children&&a.children.length>0)this.valueInput=null,c=this.buildSelect(a);else{switch(a.label.value_type){case"Integer":this.valueInput=this.buildIntegerInput(a);break;case"String":this.valueInput=this.buildStringInput(a);break;case"Zip":this.valueInput=this.buildZipInput(a);break;default:return this.valueInput=null,null}c=this.valueInput}return d=a.label&&a.label.value_label?a.label.value_label:null,c=this.wrapDiv(b,c,d),c},a.prototype.buildIntegerInput=function(a){return $('<input type="text" name="labellings[][value]" class="label-input-int" />')},a.prototype.buildStringInput=function(a){return $('<input type="text" name="labellings[][value]" class="label-input-str" />')},a.prototype.buildZipInput=function(a){return $('<input type="text" name="labellings[][value]" class="label-input-zip" maxlength="5" />')},a.prototype.buildSelect=function(a){var b,c,d,e,f,g=this;d=$("<select><option></option></select>"),c=a.children;for(e=0,f=c.length;e<f;e++)b=c[e],b.selectable===!1&&(this.unselectables[this.unselectables.length]=b.id),this.names[b.id]=b.description&&b.description.indexOf("{")<0?b.description:b.name,this.value_types[b.id]=b.value_type,d.append($('<option value="'+b.id+'">'+b.name+"</option>"));return d.bind("change",function(a){var b,c,d;c=$(a.currentTarget),b=c.next("div"),b&&b.remove(),g.currentContainer=c.parent("div"),c.val()?(g.setCurrentLabelId(c.val()),g.getChildren(g.currentLabelId)):(d=g.currentContainer.parent("div"),d&&g.setCurrentLabelId(d.find("select").val()));if(g.callbacks&&g.callbacks.afterSelect)return g.callbacks.afterSelect(g,c)}),d},a.prototype.insertHiddenField=function(a){return this.hiddenField=$('<input type="hidden" name="labellings[][label_id]" />'),this.container.prepend(this.hiddenField)},a.prototype.wrapDiv=function(a,b,c){var d;return d=$('<div id="label_'+a+'"></div>').html(b),c&&d.append($("<span></span>").html(c)),d},a}(),window.LabelSelector=a,b=function(){function b(b,c,d){this.form=b,this.target=c,this.labelSelector=d,this.counter=0,this.selector=new a(this.labelSelector),this.defaultContent=this.target.html(),this.insertSpinner(),this.insertList(),this.buildSelectorForm(),this.bindFormEvents(),this.updateSubmitability()}return b.prototype.buildSelectorForm=function(){var a,b=this;return a=$('<input type="submit" value="Add Filter" />').click(function(){var a,c,d;return b.selector.currentLabelSelectable&&(a=b.selector.currentLabelId,c=b.selector.names[a],b.selector.valueInput?(console.log("1"),b.selector.valueInput.val()&&b.selector.valueInput.val()!==""&&(console.log("2"),d=b.selector.value_types[a],b.addLabel(a,b.selector.valueInput.val(),c,d),console.log("3"))):b.addLabel(a,null,c,null)),!1}),this.selector.container
.after($('<div class="add-filter-wrapper"></div>').html(a))},b.prototype.insertList=function(){return this.list=$("<ul></ul>"),this.form.prepend(this.list)},b.prototype.insertSpinner=function(){return this.spinner=$('<img src="/images/spinner.gif" />').hide(),this.form.append(this.spinner)},b.prototype.addLabel=function(b,c,d,e){var f,g,h=this;return b&&(c&&(d=d+" ("+c+")"),g=$("<li></li>").text(d),g.append($('<input type="hidden" value="'+b+'" name="labels['+this.counter+'][label_id]" />')),c&&e&&(g.append($('<input type="hidden" name="labels['+this.counter+'][value]" value="'+c+'" />')),g.append($('<input type="hidden" name="labels['+this.counter+'][value_type]" value="'+e+'" />'))),f=$('<a href="#">-</a>').click(function(a){return $(a.currentTarget).parent("li").remove(),h.updateSubmitability(),h.getCurrentCount()}),g.append(f),this.list.append(g),this.selector.container.html(""),this.selector=new a(this.labelSelector),this.counter+=1,this.getCurrentCount()),this.updateSubmitability()},b.prototype.setCountLabel=function(a){return!a||a<1?$("#apply-search-btn").val("Apply Search"):$("#apply-search-btn").val("Apply Search ("+a+")")},b.prototype.getCurrentCount=function(){var a,b=this;return a=0,$.ajax("/users/filter?count=1",{type:"POST",data:this.form.serialize(),failure:function(){return this.setCountLabel()},success:function(a,c,d){return b.setCountLabel(parseInt(d.responseText))}})},b.prototype.reset=function(){var a=this;return this.currentEffect=this.target.fadeTo(.2,0,function(){return a.target.html(a.defaultContent).fadeTo(.2,1)}),this.list.html(""),this.updateSubmitability(),this.setCountLabel()},b.prototype.updateSubmitability=function(){return this.list.find("li").exists()?this.form.find("input[type='submit']").attr("disabled",!1):this.form.find("input[type='submit']").attr("disabled",!0)},b.prototype.loading=function(){return this.currentEffect=this.target.fadeTo(.5,.5),this.spinner.show()},b.prototype.finishedLoading=function(){return this.target.stop(),this.currentEffect=this.target.fadeTo(.25,1),this.spinner.hide()},b.prototype.bindFormEvents=function(){var a=this;return this.form.bind("ajax:before",this.loading.bind(this)),this.form.bind("ajax:complete",this.finishedLoading.bind(this)),this.form.bind("ajax:success",function(b,c){return a.target.html(c)}),this.form.find("a.reset-filter").click(this.reset.bind(this))},b}(),window.UserFilter=b}.call(this),function(){var a,b,c,d,e;d=function(){function a(a,b){this.element=a,this.element.css("visibility","visible"),this.completeness=b>100?100:b,this.bar=this.element.find("div"),this.animateToValue(this.completeness)}return a.prototype.animateToValue=function(){return this.bar.css("width","0%"),this.bar.animate({width:""+this.completeness+"%",background:"#000"})},a}(),window.ProfileCompletenessBar=d,e=function(){function a(a){var b=this;$("#"+a+" .tab_content").hide(),this.tabs=$("#"+a+" .tabs li a"),this.tab_contents=$("#"+a+" .tab_content"),this.tabs.click(function(a){return b.hideAllTabs(),b.selectTab(b.tabs.index(a.currentTarget))}),this.hideAllTabs(),this.selectTab(0)}return a.prototype.hideAllTabs=function(){return this.tabs.parent().removeClass("active"),this.tab_contents.hide()},a.prototype.selectTab=function(a){return $(this.tab_contents[a]).show(),$(this.tabs[a]).parent().addClass("active")},a}(),window.ProfileTabs=e,b=function(){function a(a,b){var c=this;this.countryEl=a,this.stateEl=b,this.states={"United States":["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","Washington D.C.","West Virginia","Wisconsin","Wyoming"],Canada:["Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon"],"United Kingdom":["Avon","Bedfordshire","Berkshire","Borders","Buckinghamshire","Cambridgeshire","Central","Cheshire","Cleveland","Clwyd","Cornwall","County Antrim","County Armagh","County Down","County Fermanagh","County Londonderry","County Tyrone","Cumbria","Derbyshire","Devon","Dorset","Dumfries and Galloway","Durham","Dyfed","East Sussex","Essex","Fife","Gloucestershire","Grampian","Greater Manchester","Gwent","Gwynedd County","Hampshire","Herefordshire","Hertfordshire","Highlands and Islands","Humberside","Isle of Wight","Kent","Lancashire","Leicestershire","Lincolnshire","Lothian","Merseyside","Mid Glamorgan","Norfolk","North Yorkshire","Northamptonshire","Northumberland","Nottinghamshire","Oxfordshire","Powys","Rutland","Shropshire","Somerset","South Glamorgan","South Yorkshire","Staffordshire","Strathclyde","Suffolk","Surrey","Tayside","Tyne and Wear","Warwickshire","West Glamorgan","West Midlands","West Sussex","West Yorkshire","Wiltshire","Worcestershire"]},this.countryEl.change(function(a){return c.updateStateSelector()}),this.updateStateSelector()}return a.prototype.updateStateSelector=function(){var a;return this.states[this.countryEl.val()]?a=this.generateStateSelect():a=this.generateTextInput(),$("#"+this.stateEl.attr("id")).replaceWith(a)},a.prototype.generateTextInput=function(){return $('<input type="text" id="'+this.stateEl.attr("id")+'" value="'+this.stateEl.val()+'" name="'+this.stateEl.attr("name")+'" />')},a.prototype.generateStateSelect=function(){var a,b,c,d,e;console.log("state select"),a=$('<select id="'+this.stateEl.attr("id")+'" name="'+this.stateEl.attr("name")+'"><option value=""></option></select>'),e=this.states[this.countryEl.val()];for(c=0,d=e.length;c<d;c++)b=e[c],a.append('<option value="'+b+'">'+b+"</option>");return a},a.prototype.forceStateValue=function(a,b){return a.val(b)},a}(),window.DynamicStateSelector=b,a=function(){function a(a,b,c,d,e,f){this.country_field=a,this.postal_field=b,this.city_field=c,this.state_field=d,this.url=e,this.callbacks=f,this.listedCountries=["United States"],this.callbacks.onCreate(this),this.bindEvents(),this.createSpinner(),this.changedCountry()}return a.prototype.kill=function(){return this.postal_field.unbind("keyup"),this.postal_field.unbind("change"),this.showCityState()},a.prototype.bindEvents=function(){var a=this;return this.country_field.bind("change",function(){return a.changedCountry()})},a.prototype.changedCountry=function(){var a=this;return this.listedCountries.indexOf(this.country_field.val())>=0?(this.hideCityState(),this.postal_field.bind("keyup",function(){return a.setCityStateBasedOnPostal(a.callbacks.onResult)}),this.callbacks.onSelectAutocompleteableCountry()):(this.showCityState(),this.postal_field.unbind("keyup"),this.callbacks.onBlurAutocompleteableCountry())},a.prototype.createSpinner=function(){return this.spinner=$('<img src="/images/spinner.gif" />').hide(),this.postal_field.after(this.spinner)},a.prototype.hideCityState=function(){return this.city_field.parent().parent("tr").hide(),this.state_field.parent().parent("tr").hide()},a.prototype.showCityState=function(){return this.city_field.parent().parent("tr").show(),this.state_field.parent().parent("tr").show()},a.prototype.setCityStateBasedOnPostal=function(a){var b=this;return $.ajax(this.url,{type:"get",data:{"query[postal_code]":this.postal_field.val()},beforeSend:function(){return b.spinner.show()},complete:function(c,d){var e;return b.city="",b.state="",c.status===200||c.status===304?(e=jQuery.parseJSON(c.responseText),e.length>0&&(b.city=e[0].location.place_name,b.state=e[0].location.state)):(b.city="",b.state=""),b.city_field.val(b.city),b.state_field.val(b.state),b.spinner.hide(),a(b.city,b.state)}})},a}(),window.DynamicLocation=a,c={show_form:function(a){return $("#add_note_form_container").show(),$("#add_note_form_container").css({top:"5px",left:"5px"})},remove_form:function(a){return $("#add_note_form_container").hide()},show_note:function(a){return $("#note_"+a).show(),$("#note_"+a).css({top:"5px",left:"5px",background:"white","z-index":100})},remove_note:function(a){return $("#note_"+a).hide()}},window.Note=c}.call(this),function(){var a;a=function(){function a(a){this.element=a,$("#payment_data").hide(),this.bindRadios()}return a.prototype.bindRadios=function(){var a,b,c,d,e,f=this;d=$(".basic_pro_selector"),e=[];for(b=0,c=d.length;b<c;b++)a=d[b],a=$(a),a.attr("checked")&&this.selectRadio(a),e.push(a.bind("change",{el:a},function(a){return f.selectRadio(a.data.el)}));return e},a.prototype.selectRadio=function(a){return this.price=a.val()==="yes"?500:1495,this.showPaymentData(),this.insertCycleSelector(),this.updatePaymentToday(!1),$(".selected-pro-tier").removeClass("selected-pro-tier"),a.parent("td").addClass("selected-pro-tier")},a.prototype.showPaymentData=function(){return $("#payment_data").show()},a.prototype.insertCycleSelector=function(){var a=this;return $("#cycle_selector_container").html(this.buildSelect()),$("#customer_custom_fields_periodicity").bind("change",function(b){return a.updatePaymentToday($("#customer_custom_fields_periodicity").val()==="yearly")})},a.prototype.updatePaymentToday=function(a){var b;return b=(this.price/(a?10:100)).toFixed(2),this.price===1495&&a&&(b=150),$("#payment_today").text("$"+b)},a.prototype.buildSelect=function(){var a,b,c;return b=$('<select name="customer[custom_fields][periodicity]" id="customer_custom_fields_periodicity"></select>'),a=this.price/100,c=a*10,this.price===1495&&(c=150),b.append($('<option value="monthly" selected="selected">Monthly ($'+a.toFixed(2)+" /month)</option>")),b.append($('<option value="yearly">Yearly ($'+c.toFixed(2)+" /year)</option>")),b},a}(),window.UpgradeForm=a}.call(this),window.debugMentions=function(){return $(".mention-input").mentionsInput("getMentions",function(a){return alert(JSON.stringify(a))})}
