/*
Name: js_main
Url: http://d1vgw4v7ja2ido.cloudfront.net/-3deff2da6551191e.js
Generated: 1283398274656642
Files: ['/json2.js', '/jquery.js', '/jquery.securepost.js', '/jquery.cookie.js', '/jquery.dialog.js', '/jquery.tooltip.js', '/jquery.menu.js', '/jquery.topic.js', '/jquery.viewport.js', '/jquery.testing.js', '/fnbind.js', '/Class.js', '/webnode2.js', '/jquery.ajax.js', '/swfobject.js', '/effects.core.js', '/effects.shake.js', '/effects.highlight.js', '/jquery.webnode2.js', '/jquery.quora.js', '/w2.dialog.js', '/w2.quora.js', '/w2.inputvalidate.js', '/w2.livenode.js', '/w2.rpc.js', '/w2.inspector.js', '/w2.interaction.js', '/Quora.js', '/dialog.js', '/qtexteditor.js', '/typeahead.js', '/mobile.js']

*/
if(!this.JSON)this.JSON={};
(function(){function b(u){return u<10?"0"+u:u}function h(u){o.lastIndex=0;return o.test(u)?'"'+u.replace(o,function(E){var F=p[E];return typeof F==="string"?F:"\\u"+("0000"+E.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+u+'"'}function c(u,E){var F,V,aa=m,O,M=E[u];if(M&&typeof M==="object"&&typeof M.toJSON==="function")M=M.toJSON(u);if(typeof r==="function")M=r.call(E,u,M);switch(typeof M){case "string":return h(M);case "number":return isFinite(M)?String(M):"null";case "boolean":case "null":return String(M);case "object":if(!M)return"null";
m+=l;O=[];if(Object.prototype.toString.apply(M)==="[object Array]"){V=M.length;for(u=0;u<V;u+=1)O[u]=c(u,M)||"null";E=O.length===0?"[]":m?"[\n"+m+O.join(",\n"+m)+"\n"+aa+"]":"["+O.join(",")+"]";m=aa;return E}if(r&&typeof r==="object"){V=r.length;for(u=0;u<V;u+=1){F=r[u];if(typeof F==="string")if(E=c(F,M))O.push(h(F)+(m?": ":":")+E)}}else for(F in M)if(Object.hasOwnProperty.call(M,F))if(E=c(F,M))O.push(h(F)+(m?": ":":")+E);E=O.length===0?"{}":m?"{\n"+m+O.join(",\n"+m)+"\n"+aa+"}":"{"+O.join(",")+"}";
m=aa;return E}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,m,l,p={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},r;if(typeof JSON.stringify!=="function")JSON.stringify=function(u,E,F){var V;l=m="";if(typeof F==="number")for(V=0;V<F;V+=1)l+=" ";else if(typeof F==="string")l=F;if((r=E)&&typeof E!=="function"&&(typeof E!=="object"||typeof E.length!=="number"))throw new Error("JSON.stringify");return c("",
{"":u})};if(typeof JSON.parse!=="function")JSON.parse=function(u,E){function F(V,aa){var O,M,e=V[aa];if(e&&typeof e==="object")for(O in e)if(Object.hasOwnProperty.call(e,O)){M=F(e,O);if(M!==undefined)e[O]=M;else delete e[O]}return E.call(V,aa,e)}f.lastIndex=0;if(f.test(u))u=u.replace(f,function(V){return"\\u"+("0000"+V.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(u.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){u=eval("("+u+")");return typeof E==="function"?F({"":u},""):u}throw new SyntaxError("JSON.parse");}})();(function(b,h){function c(){if(!e.isReady){try{I.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}e.ready()}}function f(a,d){d.src?e.ajax({url:d.src,async:false,dataType:"script"}):e.globalEval(d.text||d.textContent||d.innerHTML||"");d.parentNode&&d.parentNode.removeChild(d)}function o(a,d,g,j,k,s){var t=a.length;if(typeof d==="object"){for(var D in d)o(a,D,d[D],j,k,g);return a}if(g!==h){j=!s&&j&&e.isFunction(g);for(D=0;D<t;D++)k(a[D],d,j?g.call(a[D],D,k(a[D],d)):g,s);return a}return t?
k(a[0],d):h}function m(){return(new Date).getTime()}function l(){return false}function p(){return true}function r(a,d,g){g[0].type=a;return e.event.handle.apply(d,g)}function u(a){var d,g=[],j=[],k=arguments,s,t,D,x,C,K;t=e.data(this,"events");if(!(a.liveFired===this||!t||!t.live||a.button&&a.type==="click")){a.liveFired=this;var X=t.live.slice(0);for(x=0;x<X.length;x++){t=X[x];t.origType.replace(T,"")===a.type?j.push(t.selector):X.splice(x--,1)}s=e(a.target).closest(j,a.currentTarget);C=0;for(K=
s.length;C<K;C++)for(x=0;x<X.length;x++){t=X[x];if(s[C].selector===t.selector){D=s[C].elem;j=null;if(t.preType==="mouseenter"||t.preType==="mouseleave")j=e(a.relatedTarget).closest(t.selector)[0];if(!j||j!==D)g.push({elem:D,handleObj:t})}}C=0;for(K=g.length;C<K;C++){s=g[C];a.currentTarget=s.elem;a.data=s.handleObj.data;a.handleObj=s.handleObj;if(s.handleObj.origHandler.apply(s.elem,k)===false){d=false;break}}return d}}function E(a,d){return"live."+(a&&a!=="*"?a+".":"")+d.replace(/\./g,"`").replace(/ /g,
"&")}function F(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function V(a,d){var g=0;d.each(function(){if(this.nodeName===(a[g]&&a[g].nodeName)){var j=e.data(a[g++]),k=e.data(this,j);if(j=j&&j.events){delete k.handle;k.events={};for(var s in j)for(var t in j[s])e.event.add(this,s,j[s][t],j[s][t].data)}}})}function aa(a,d,g){var j,k,s;d=d&&d[0]?d[0].ownerDocument||d[0]:I;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&d===I&&!ab.test(a[0])&&(e.support.checkClone||!bb.test(a[0]))){k=
true;if(s=e.fragments[a[0]])if(s!==1)j=s}if(!j){j=d.createDocumentFragment();e.clean(a,d,j,g)}if(k)e.fragments[a[0]]=s?j:1;return{fragment:j,cacheable:k}}function O(a,d){var g={};e.each(cb.concat.apply([],cb.slice(0,d)),function(){g[this]=a});return g}function M(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var e=function(a,d){return new e.fn.init(a,d)},ia=b.jQuery,la=b.$,I=b.document,pa,ja=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,P=/^.[^:#\[\.,]*$/,ha=/\S/,
v=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,B=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,J=navigator.userAgent,N=false,ca=[],Y,R=Object.prototype.toString,qa=Object.prototype.hasOwnProperty,wa=Array.prototype.push,za=Array.prototype.slice,xa=Array.prototype.indexOf;e.fn=e.prototype={init:function(a,d){var g,j;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!d){this.context=I;this[0]=I.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((g=ja.exec(a))&&
(g[1]||!d))if(g[1]){j=d?d.ownerDocument||d:I;if(a=B.exec(a))if(e.isPlainObject(d)){a=[I.createElement(a[1])];e.fn.attr.call(a,d,true)}else a=[j.createElement(a[1])];else{a=aa([g[1]],[j]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return e.merge(this,a)}else{if(d=I.getElementById(g[2])){if(d.id!==g[2])return pa.find(a);this.length=1;this[0]=d}this.context=I;this.selector=a;return this}else if(!d&&/^\w+$/.test(a)){this.selector=a;this.context=I;a=I.getElementsByTagName(a);return e.merge(this,
a)}else return!d||d.jquery?(d||pa).find(a):e(d).find(a);else if(e.isFunction(a))return pa.ready(a);if(a.selector!==h){this.selector=a.selector;this.context=a.context}return e.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return za.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,d,g){var j=e();e.isArray(a)?wa.apply(j,a):e.merge(j,a);j.prevObject=this;j.context=this.context;
if(d==="find")j.selector=this.selector+(this.selector?" ":"")+g;else if(d)j.selector=this.selector+"."+d+"("+g+")";return j},each:function(a,d){return e.each(this,a,d)},ready:function(a){e.bindReady();if(e.isReady)a.call(I,e);else ca&&ca.push(a);return this},eq:function(a){return 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(za.apply(this,arguments),"slice",za.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,
function(d,g){return a.call(d,g,d)}))},end:function(){return this.prevObject||e(null)},push:wa,sort:[].sort,splice:[].splice};e.fn.init.prototype=e.fn;e.extend=e.fn.extend=function(){var a=arguments[0]||{},d=1,g=arguments.length,j=false,k,s,t,D;if(typeof a==="boolean"){j=a;a=arguments[1]||{};d=2}if(typeof a!=="object"&&!e.isFunction(a))a={};if(g===d){a=this;--d}for(;d<g;d++)if((k=arguments[d])!=null)for(s in k){t=a[s];D=k[s];if(a!==D)if(j&&D&&(e.isPlainObject(D)||e.isArray(D))){t=t&&(e.isPlainObject(t)||
e.isArray(t))?t:e.isArray(D)?[]:{};a[s]=e.extend(j,t,D)}else if(D!==h)a[s]=D}return a};e.extend({noConflict:function(a){b.$=la;if(a)b.jQuery=ia;return e},isReady:false,ready:function(){if(!e.isReady){if(!I.body)return setTimeout(e.ready,13);e.isReady=true;if(ca){for(var a,d=0;a=ca[d++];)a.call(I,e);ca=null}e.fn.triggerHandler&&e(I).triggerHandler("ready")}},bindReady:function(){if(!N){N=true;if(I.readyState==="complete")return e.ready();if(I.addEventListener){I.addEventListener("DOMContentLoaded",
Y,false);b.addEventListener("load",e.ready,false)}else if(I.attachEvent){I.attachEvent("onreadystatechange",Y);b.attachEvent("onload",e.ready);var a=false;try{a=b.frameElement==null}catch(d){}I.documentElement.doScroll&&a&&c()}}},isFunction:function(a){return R.call(a)==="[object Function]"},isArray:function(a){return R.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||R.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!qa.call(a,"constructor")&&!qa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var d;for(d in a);return d===h||qa.call(a,d)},isEmptyObject:function(a){for(var d in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=e.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return b.JSON&&b.JSON.parse?b.JSON.parse(a):(new Function("return "+
a))();else e.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&ha.test(a)){var d=I.getElementsByTagName("head")[0]||I.documentElement,g=I.createElement("script");g.type="text/javascript";if(e.support.scriptEval)g.appendChild(I.createTextNode(a));else g.text=a;d.insertBefore(g,d.firstChild);d.removeChild(g)}},nodeName:function(a,d){return a.nodeName&&a.nodeName.toUpperCase()===d.toUpperCase()},each:function(a,d,g){var j,k=0,s=a.length,t=s===h||e.isFunction(a);if(g)if(t)for(j in a){if(d.apply(a[j],
g)===false)break}else for(;k<s;){if(d.apply(a[k++],g)===false)break}else if(t)for(j in a){if(d.call(a[j],j,a[j])===false)break}else for(g=a[0];k<s&&d.call(g,k,g)!==false;g=a[++k]);return a},trim:function(a){return(a||"").replace(v,"")},makeArray:function(a,d){d=d||[];if(a!=null)a.length==null||typeof a==="string"||e.isFunction(a)||typeof a!=="function"&&a.setInterval?wa.call(d,a):e.merge(d,a);return d},inArray:function(a,d){if(d.indexOf)return d.indexOf(a);for(var g=0,j=d.length;g<j;g++)if(d[g]===
a)return g;return-1},merge:function(a,d){var g=a.length,j=0;if(typeof d.length==="number")for(var k=d.length;j<k;j++)a[g++]=d[j];else for(;d[j]!==h;)a[g++]=d[j++];a.length=g;return a},grep:function(a,d,g){for(var j=[],k=0,s=a.length;k<s;k++)!g!==!d(a[k],k)&&j.push(a[k]);return j},map:function(a,d,g){for(var j=[],k,s=0,t=a.length;s<t;s++){k=d(a[s],s,g);if(k!=null)j[j.length]=k}return j.concat.apply([],j)},guid:1,proxy:function(a,d,g){if(arguments.length===2)if(typeof d==="string"){g=a;a=g[d];d=h}else if(d&&
!e.isFunction(d)){g=d;d=h}if(!d&&a)d=function(){return a.apply(g||this,arguments)};if(a)d.guid=a.guid=a.guid||d.guid||e.guid++;return d},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});J=e.uaMatch(J);if(J.browser){e.browser[J.browser]=true;e.browser.version=J.version}if(e.browser.webkit)e.browser.safari=
true;if(xa)e.inArray=function(a,d){return xa.call(d,a)};pa=e(I);if(I.addEventListener)Y=function(){I.removeEventListener("DOMContentLoaded",Y,false);e.ready()};else if(I.attachEvent)Y=function(){if(I.readyState==="complete"){I.detachEvent("onreadystatechange",Y);e.ready()}};(function(){e.support={};var a=I.documentElement,d=I.createElement("script"),g=I.createElement("div"),j="script"+m();g.style.display="none";g.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var k=g.getElementsByTagName("*"),s=g.getElementsByTagName("a")[0];if(!(!k||!k.length||!s)){e.support={leadingWhitespace:g.firstChild.nodeType===3,tbody:!g.getElementsByTagName("tbody").length,htmlSerialize:!!g.getElementsByTagName("link").length,style:/red/.test(s.getAttribute("style")),hrefNormalized:s.getAttribute("href")==="/a",opacity:/^0.55$/.test(s.style.opacity),cssFloat:!!s.style.cssFloat,checkOn:g.getElementsByTagName("input")[0].value==="on",optSelected:I.createElement("select").appendChild(I.createElement("option")).selected,
parentNode:g.removeChild(g.appendChild(I.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};d.type="text/javascript";try{d.appendChild(I.createTextNode("window."+j+"=1;"))}catch(t){}a.insertBefore(d,a.firstChild);if(b[j]){e.support.scriptEval=true;delete b[j]}try{delete d.test}catch(D){e.support.deleteExpando=false}a.removeChild(d);if(g.attachEvent&&g.fireEvent){g.attachEvent("onclick",function x(){e.support.noCloneEvent=
false;g.detachEvent("onclick",x)});g.cloneNode(true).fireEvent("onclick")}g=I.createElement("div");g.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=I.createDocumentFragment();a.appendChild(g.firstChild);e.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;e(function(){var x=I.createElement("div");x.style.width=x.style.paddingLeft="1px";I.body.appendChild(x);e.boxModel=e.support.boxModel=x.offsetWidth===2;I.body.removeChild(x).style.display="none"});a=function(x){var C=
I.createElement("div");x="on"+x;var K=x in C;if(!K){C.setAttribute(x,"return;");K=typeof C[x]==="function"}return K};e.support.submitBubbles=a("submit");e.support.changeBubbles=a("change");a=d=g=k=s=null}})();e.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var ra="jQuery"+m(),Da=0,Ea={};e.extend({cache:{},expando:ra,noData:{embed:true,
object:true,applet:true},data:function(a,d,g){if(!(a.nodeName&&e.noData[a.nodeName.toLowerCase()])){a=a==b?Ea:a;var j=a[ra],k=e.cache;if(!j&&typeof d==="string"&&g===h)return null;j||(j=++Da);if(typeof d==="object"){a[ra]=j;k[j]=e.extend(true,{},d)}else if(!k[j]){a[ra]=j;k[j]={}}a=k[j];if(g!==h)a[d]=g;return typeof d==="string"?a[d]:a}},removeData:function(a,d){if(!(a.nodeName&&e.noData[a.nodeName.toLowerCase()])){a=a==b?Ea:a;var g=a[ra],j=e.cache,k=j[g];if(d){if(k){delete k[d];e.isEmptyObject(k)&&
e.removeData(a)}}else{if(e.support.deleteExpando)delete a[e.expando];else a.removeAttribute&&a.removeAttribute(e.expando);delete j[g]}}}});e.fn.extend({data:function(a,d){if(typeof a==="undefined"&&this.length)return e.data(this[0]);else if(typeof a==="object")return this.each(function(){e.data(this,a)});var g=a.split(".");g[1]=g[1]?"."+g[1]:"";if(d===h){var j=this.triggerHandler("getData"+g[1]+"!",[g[0]]);if(j===h&&this.length)j=e.data(this[0],a);return j===h&&g[1]?this.data(g[0]):j}else return this.trigger("setData"+
g[1]+"!",[g[0],d]).each(function(){e.data(this,a,d)})},removeData:function(a){return this.each(function(){e.removeData(this,a)})}});e.extend({queue:function(a,d,g){if(a){d=(d||"fx")+"queue";var j=e.data(a,d);if(!g)return j||[];if(!j||e.isArray(g))j=e.data(a,d,e.makeArray(g));else j.push(g);return j}},dequeue:function(a,d){d=d||"fx";var g=e.queue(a,d),j=g.shift();if(j==="inprogress")j=g.shift();if(j){d==="fx"&&g.unshift("inprogress");j.call(a,function(){e.dequeue(a,d)})}}});e.fn.extend({queue:function(a,
d){if(typeof a!=="string"){d=a;a="fx"}if(d===h)return e.queue(this[0],a);return this.each(function(){var g=e.queue(this,a,d);a==="fx"&&g[0]!=="inprogress"&&e.dequeue(this,a)})},dequeue:function(a){return this.each(function(){e.dequeue(this,a)})},delay:function(a,d){a=e.fx?e.fx.speeds[a]||a:a;d=d||"fx";return this.queue(d,function(){var g=this;setTimeout(function(){e.dequeue(g,d)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Ha=/[\n\t]/g,Ia=/\s+/,Sa=/\r/g,Ba=/href|src|style/,La=
/(button|input)/i,ya=/(button|input|object|select|textarea)/i,Pa=/^(a|area)$/i,Qa=/radio|checkbox/;e.fn.extend({attr:function(a,d){return o(this,a,d,true,e.attr)},removeAttr:function(a){return this.each(function(){e.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(e.isFunction(a))return this.each(function(C){var K=e(this);K.addClass(a.call(this,C,K.attr("class")))});if(a&&typeof a==="string")for(var d=(a||"").split(Ia),g=0,j=this.length;g<j;g++){var k=this[g];
if(k.nodeType===1)if(k.className){for(var s=" "+k.className+" ",t=k.className,D=0,x=d.length;D<x;D++)if(s.indexOf(" "+d[D]+" ")<0)t+=" "+d[D];k.className=e.trim(t)}else k.className=a}return this},removeClass:function(a){if(e.isFunction(a))return this.each(function(x){var C=e(this);C.removeClass(a.call(this,x,C.attr("class")))});if(a&&typeof a==="string"||a===h)for(var d=(a||"").split(Ia),g=0,j=this.length;g<j;g++){var k=this[g];if(k.nodeType===1&&k.className)if(a){for(var s=(" "+k.className+" ").replace(Ha,
" "),t=0,D=d.length;t<D;t++)s=s.replace(" "+d[t]+" "," ");k.className=e.trim(s)}else k.className=""}return this},toggleClass:function(a,d){var g=typeof a,j=typeof d==="boolean";if(e.isFunction(a))return this.each(function(k){var s=e(this);s.toggleClass(a.call(this,k,s.attr("class"),d),d)});return this.each(function(){if(g==="string")for(var k,s=0,t=e(this),D=d,x=a.split(Ia);k=x[s++];){D=j?D:!t.hasClass(k);t[D?"addClass":"removeClass"](k)}else if(g==="undefined"||g==="boolean"){this.className&&e.data(this,
"__className__",this.className);this.className=this.className||a===false?"":e.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var d=0,g=this.length;d<g;d++)if((" "+this[d].className+" ").replace(Ha," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===h){var d=this[0];if(d){if(e.nodeName(d,"option"))return(d.attributes.value||{}).specified?d.value:d.text;if(e.nodeName(d,"select")){var g=d.selectedIndex,j=[],k=d.options;d=d.type==="select-one";if(g<0)return null;
var s=d?g:0;for(g=d?g+1:k.length;s<g;s++){var t=k[s];if(t.selected){a=e(t).val();if(d)return a;j.push(a)}}return j}if(Qa.test(d.type)&&!e.support.checkOn)return d.getAttribute("value")===null?"on":d.value;return(d.value||"").replace(Sa,"")}}else{var D=e.isFunction(a);return this.each(function(x){var C=e(this),K=a;if(this.nodeType===1){if(D)K=a.call(this,x,C.val());if(typeof K==="number")K+="";if(e.isArray(K)&&Qa.test(this.type))this.checked=e.inArray(C.val(),K)>=0;else if(e.nodeName(this,"select")){var X=
e.makeArray(K);e("option",this).each(function(){this.selected=e.inArray(e(this).val(),X)>=0});if(!X.length)this.selectedIndex=-1}else this.value=K}})}}});e.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,d,g,j){if(!(!a||a.nodeType===3||a.nodeType===8)){if(j&&d in e.attrFn)return e(a)[d](g);j=a.nodeType!==1||!e.isXMLDoc(a);var k=g!==h;d=j&&e.props[d]||d;if(a.nodeType===1){var s=Ba.test(d);if(d in a&&j&&!s){if(k){d==="type"&&La.test(a.nodeName)&&
a.parentNode&&e.error("type property can't be changed");a[d]=g}if(e.nodeName(a,"form")&&a.getAttributeNode(d))return a.getAttributeNode(d).nodeValue;if(d==="tabIndex")return(d=a.getAttributeNode("tabIndex"))&&d.specified?d.value:ya.test(a.nodeName)||Pa.test(a.nodeName)&&a.href?0:h;return a[d]}if(!e.support.style&&j&&d==="style"){if(k)a.style.cssText=""+g;return a.style.cssText}k&&a.setAttribute(d,""+g);a=!e.support.hrefNormalized&&j&&s?a.getAttribute(d,2):a.getAttribute(d);return a===null?h:a}return e.style(a,
d,g)}}});var T=/\.(.*)$/,w=function(a){return a.replace(/[^\w\s\.\|`]/g,function(d){return"\\"+d})};e.event={add:function(a,d,g,j){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==b&&!a.frameElement)a=b;var k,s;if(g.handler){k=g;g=k.handler}if(!g.guid)g.guid=e.guid++;if(s=e.data(a)){var t=s.events=s.events||{},D=s.handle;if(!D)s.handle=D=function(){return typeof e!=="undefined"&&!e.event.triggered?e.event.handle.apply(D.elem,arguments):h};D.elem=a;d=d.split(" ");for(var x,C=0,K;x=d[C++];){s=
k?e.extend({},k):{handler:g,data:j};if(x.indexOf(".")>-1){K=x.split(".");x=K.shift();s.namespace=K.slice(0).sort().join(".")}else{K=[];s.namespace=""}s.type=x;s.guid=g.guid;var X=t[x],ga=e.event.special[x]||{};if(!X){X=t[x]=[];if(!ga.setup||ga.setup.call(a,j,K,D)===false)if(a.addEventListener)a.addEventListener(x,D,false);else a.attachEvent&&a.attachEvent("on"+x,D)}if(ga.add){ga.add.call(a,s);if(!s.handler.guid)s.handler.guid=g.guid}X.push(s);e.event.global[x]=true}a=null}}},global:{},remove:function(a,
d,g,j){if(!(a.nodeType===3||a.nodeType===8)){var k,s=0,t,D,x,C,K,X,ga=e.data(a),na=ga&&ga.events;if(ga&&na){if(d&&d.type){g=d.handler;d=d.type}if(!d||typeof d==="string"&&d.charAt(0)==="."){d=d||"";for(k in na)e.event.remove(a,k+d)}else{for(d=d.split(" ");k=d[s++];){C=k;t=k.indexOf(".")<0;D=[];if(!t){D=k.split(".");k=D.shift();x=new RegExp("(^|\\.)"+e.map(D.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(K=na[k])if(g){C=e.event.special[k]||{};for(ka=j||0;ka<K.length;ka++){X=K[ka];if(g.guid===
X.guid){if(t||x.test(X.namespace)){j==null&&K.splice(ka--,1);C.remove&&C.remove.call(a,X)}if(j!=null)break}}if(K.length===0||j!=null&&K.length===1){if(!C.teardown||C.teardown.call(a,D)===false)z(a,k,ga.handle);delete na[k]}}else for(var ka=0;ka<K.length;ka++){X=K[ka];if(t||x.test(X.namespace)){e.event.remove(a,C,X.handler,ka);K.splice(ka--,1)}}}if(e.isEmptyObject(na)){if(d=ga.handle)d.elem=null;delete ga.events;delete ga.handle;e.isEmptyObject(ga)&&e.removeData(a)}}}}},trigger:function(a,d,g,j){var k=
a.type||a;j=j;if(!j){a=typeof a==="object"?a[ra]?a:e.extend(e.Event(k),a):e.Event(k);if(k.indexOf("!")>=0){a.type=k=k.slice(0,-1);a.exclusive=true}if(!g){a.stopPropagation();e.event.global[k]&&e.each(e.cache,function(){this.events&&this.events[k]&&e.event.trigger(a,d,this.handle.elem)})}if(!g||g.nodeType===3||g.nodeType===8)return;a.result=h;a.target=g;d=e.makeArray(d);d.unshift(a)}a.currentTarget=g;(j=e.data(g,"handle"))&&j.apply(g,d);j=g.parentNode||g.ownerDocument;try{if(!(g&&g.nodeName&&e.noData[g.nodeName.toLowerCase()]))if(g["on"+
k]&&g["on"+k].apply(g,d)===false)a.result=false}catch(s){}if(!a.isPropagationStopped()&&j)e.event.trigger(a,d,j,true);else if(!a.isDefaultPrevented()){j=a.target;var t,D=e.nodeName(j,"a")&&k==="click",x=e.event.special[k]||{};if((!x._default||x._default.call(g,a)===false)&&!D&&!(j&&j.nodeName&&e.noData[j.nodeName.toLowerCase()])){try{if(j[k]){if(t=j["on"+k])j["on"+k]=null;e.event.triggered=true;j[k]()}}catch(C){}if(t)j["on"+k]=t;e.event.triggered=false}}},handle:function(a){var d,g,j,k;a=arguments[0]=
e.event.fix(a||b.event);a.currentTarget=this;d=a.type.indexOf(".")<0&&!a.exclusive;if(!d){g=a.type.split(".");a.type=g.shift();j=new RegExp("(^|\\.)"+g.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}k=e.data(this,"events");g=k[a.type];if(k&&g){g=g.slice(0);k=0;for(var s=g.length;k<s;k++){var t=g[k];if(d||j.test(t.namespace)){a.handler=t.handler;a.data=t.data;a.handleObj=t;t=t.handler.apply(this,arguments);if(t!==h){a.result=t;if(t===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},
props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[ra])return a;var d=a;a=e.Event(d);for(var g=this.props.length,j;g;){j=this.props[--g];a[j]=d[j]}if(!a.target)a.target=a.srcElement||
I;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){d=I.documentElement;g=I.body;a.pageX=a.clientX+(d&&d.scrollLeft||g&&g.scrollLeft||0)-(d&&d.clientLeft||g&&g.clientLeft||0);a.pageY=a.clientY+(d&&d.scrollTop||g&&g.scrollTop||0)-(d&&d.clientTop||g&&g.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&
a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==h)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:e.proxy,special:{ready:{setup:e.bindReady,teardown:e.noop},live:{add:function(a){e.event.add(this,a.origType,e.extend({},a,{handler:u}))},remove:function(a){var d=true,g=a.origType.replace(T,"");e.each(e.data(this,"events").live||[],function(){if(g===this.origType.replace(T,""))return d=false});d&&e.event.remove(this,a.origType,u)}},beforeunload:{setup:function(a,d,g){if(this.setInterval)this.onbeforeunload=
g;return false},teardown:function(a,d){if(this.onbeforeunload===d)this.onbeforeunload=null}}}};var z=I.removeEventListener?function(a,d,g){a.removeEventListener(d,g,false)}:function(a,d,g){a.detachEvent("on"+d,g)};e.Event=function(a){if(!this.preventDefault)return new e.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=m();this[ra]=true};e.Event.prototype={preventDefault:function(){this.isDefaultPrevented=p;var a=this.originalEvent;if(a){a.preventDefault&&
a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=p;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=p;this.stopPropagation()},isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l};var L=function(a){var d=a.relatedTarget;try{for(;d&&d!==this;)d=d.parentNode;if(d!==this){a.type=a.data;e.event.handle.apply(this,arguments)}}catch(g){}},
S=function(a){a.type=a.data;e.event.handle.apply(this,arguments)};e.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,d){e.event.special[a]={setup:function(g){e.event.add(this,d,g&&g.selector?S:L,a)},teardown:function(g){e.event.remove(this,d,g&&g.selector?S:L)}}});if(!e.support.submitBubbles)e.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){e.event.add(this,"click.specialSubmit",function(a){var d=a.target,g=d.type;if((g==="submit"||g==="image")&&e(d).closest("form").length)return r("submit",
this,arguments)});e.event.add(this,"keypress.specialSubmit",function(a){var d=a.target,g=d.type;if((g==="text"||g==="password")&&e(d).closest("form").length&&a.keyCode===13)return r("submit",this,arguments)})}else return false},teardown:function(){e.event.remove(this,".specialSubmit")}};if(!e.support.changeBubbles){var U=/textarea|input|select/i,da,ea=function(a){var d=a.type,g=a.value;if(d==="radio"||d==="checkbox")g=a.checked;else if(d==="select-multiple")g=a.selectedIndex>-1?e.map(a.options,function(j){return j.selected}).join("-"):
"";else if(a.nodeName.toLowerCase()==="select")g=a.selectedIndex;return g},ma=function a(d,g){var j=d.target,k,s;if(!(!U.test(j.nodeName)||j.readOnly)){k=e.data(j,"_change_data");s=ea(j);if(d.type!=="focusout"||j.type!=="radio")e.data(j,"_change_data",s);if(!(k===h||s===k))if(k!=null||s){d.type="change";return e.event.trigger(d,g,j)}}};e.event.special.change={filters:{focusout:ma,click:function(a){var d=a.target,g=d.type;if(g==="radio"||g==="checkbox"||d.nodeName.toLowerCase()==="select")return ma.call(this,
a)},keydown:function(a){var d=a.target,g=d.type;if(a.keyCode===13&&d.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(g==="checkbox"||g==="radio")||g==="select-multiple")return ma.call(this,a)},beforeactivate:function(a){a=a.target;e.data(a,"_change_data",ea(a))}},setup:function(){if(this.type==="file")return false;for(var a in da)e.event.add(this,a+".specialChange",da[a]);return U.test(this.nodeName)},teardown:function(){e.event.remove(this,".specialChange");return U.test(this.nodeName)}};da=
e.event.special.change.filters}I.addEventListener&&e.each({focus:"focusin",blur:"focusout"},function(a,d){function g(j){j=e.event.fix(j);j.type=d;return e.event.handle.call(this,j)}e.event.special[d]={setup:function(){this.addEventListener(a,g,true)},teardown:function(){this.removeEventListener(a,g,true)}}});e.each(["bind","one"],function(a,d){e.fn[d]=function(g,j,k){if(typeof g==="object"){for(var s in g)this[d](s,j,g[s],k);return this}if(e.isFunction(j)){k=j;j=h}var t=d==="one"?e.proxy(k,function(x){e(this).unbind(x,
t);return k.apply(this,arguments)}):k;if(g==="unload"&&d!=="one")this.one(g,j,k);else{s=0;for(var D=this.length;s<D;s++)e.event.add(this[s],g,t,j)}return this}});e.fn.extend({unbind:function(a,d){if(typeof a==="object"&&!a.preventDefault)for(var g in a)this.unbind(g,a[g]);else{g=0;for(var j=this.length;g<j;g++)e.event.remove(this[g],a,d)}return this},delegate:function(a,d,g,j){return this.live(d,g,j,a)},undelegate:function(a,d,g){return arguments.length===0?this.unbind("live"):this.die(d,null,g,a)},
trigger:function(a,d){return this.each(function(){e.event.trigger(a,d,this)})},triggerHandler:function(a,d){if(this[0]){a=e.Event(a);a.preventDefault();a.stopPropagation();e.event.trigger(a,d,this[0]);return a.result}},toggle:function(a){for(var d=arguments,g=1;g<d.length;)e.proxy(a,d[g++]);return this.click(e.proxy(a,function(j){var k=(e.data(this,"lastToggle"+a.guid)||0)%g;e.data(this,"lastToggle"+a.guid,k+1);j.preventDefault();return d[k].apply(this,arguments)||false}))},hover:function(a,d){return this.mouseenter(a).mouseleave(d||
a)}});var oa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};e.each(["live","die"],function(a,d){e.fn[d]=function(g,j,k,s){var t,D=0,x,C,K=s||this.selector,X=s?this:e(this.context);if(e.isFunction(j)){k=j;j=h}for(g=(g||"").split(" ");(t=g[D++])!=null;){s=T.exec(t);x="";if(s){x=s[0];t=t.replace(T,"")}if(t==="hover")g.push("mouseenter"+x,"mouseleave"+x);else{C=t;if(t==="focus"||t==="blur"){g.push(oa[t]+x);t+=x}else t=(oa[t]||t)+x;d==="live"?X.each(function(){e.event.add(this,
E(t,K),{data:j,selector:K,handler:k,origType:t,origHandler:k,preType:C})}):X.unbind(E(t,K),k)}}return this}});e.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".split(" "),function(a,d){e.fn[d]=function(g){return g?this.bind(d,g):this.trigger(d)};if(e.attrFn)e.attrFn[d]=true});b.attachEvent&&!b.addEventListener&&b.attachEvent("onunload",function(){for(var a in e.cache)if(e.cache[a].handle)try{e.event.remove(e.cache[a].handle.elem)}catch(d){}});
(function(){function a(n){for(var q="",y,A=0;n[A];A++){y=n[A];if(y.nodeType===3||y.nodeType===4)q+=y.nodeValue;else if(y.nodeType!==8)q+=a(y.childNodes)}return q}function d(n,q,y,A,H,G){H=0;for(var Z=A.length;H<Z;H++){var W=A[H];if(W){W=W[n];for(var fa=false;W;){if(W.sizcache===y){fa=A[W.sizset];break}if(W.nodeType===1&&!G){W.sizcache=y;W.sizset=H}if(W.nodeName.toLowerCase()===q){fa=W;break}W=W[n]}A[H]=fa}}}function g(n,q,y,A,H,G){H=0;for(var Z=A.length;H<Z;H++){var W=A[H];if(W){W=W[n];for(var fa=
false;W;){if(W.sizcache===y){fa=A[W.sizset];break}if(W.nodeType===1){if(!G){W.sizcache=y;W.sizset=H}if(typeof q!=="string"){if(W===q){fa=true;break}}else if(x.filter(q,[W]).length>0){fa=W;break}}W=W[n]}A[H]=fa}}}var j=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,k=0,s=Object.prototype.toString,t=false,D=true;[0,0].sort(function(){D=false;return 0});var x=function(n,q,y,A){y=y||[];var H=q=q||I;if(q.nodeType!==1&&
q.nodeType!==9)return[];if(!n||typeof n!=="string")return y;for(var G=[],Z,W,fa,Ra,Fa=true,Ma=ba(q),Ga=n;(j.exec(""),Z=j.exec(Ga))!==null;){Ga=Z[3];G.push(Z[1]);if(Z[2]){Ra=Z[3];break}}if(G.length>1&&K.exec(n))if(G.length===2&&C.relative[G[0]])W=Va(G[0]+G[1],q);else for(W=C.relative[G[0]]?[q]:x(G.shift(),q);G.length;){n=G.shift();if(C.relative[n])n+=G.shift();W=Va(n,W)}else{if(!A&&G.length>1&&q.nodeType===9&&!Ma&&C.match.ID.test(G[0])&&!C.match.ID.test(G[G.length-1])){Z=x.find(G.shift(),q,Ma);q=Z.expr?
x.filter(Z.expr,Z.set)[0]:Z.set[0]}if(q){Z=A?{expr:G.pop(),set:ga(A)}:x.find(G.pop(),G.length===1&&(G[0]==="~"||G[0]==="+")&&q.parentNode?q.parentNode:q,Ma);W=Z.expr?x.filter(Z.expr,Z.set):Z.set;if(G.length>0)fa=ga(W);else Fa=false;for(;G.length;){var sa=G.pop();Z=sa;if(C.relative[sa])Z=G.pop();else sa="";if(Z==null)Z=q;C.relative[sa](fa,Z,Ma)}}else fa=[]}fa||(fa=W);fa||x.error(sa||n);if(s.call(fa)==="[object Array]")if(Fa)if(q&&q.nodeType===1)for(n=0;fa[n]!=null;n++){if(fa[n]&&(fa[n]===true||fa[n].nodeType===
1&&ta(q,fa[n])))y.push(W[n])}else for(n=0;fa[n]!=null;n++)fa[n]&&fa[n].nodeType===1&&y.push(W[n]);else y.push.apply(y,fa);else ga(fa,y);if(Ra){x(Ra,H,y,A);x.uniqueSort(y)}return y};x.uniqueSort=function(n){if(ka){t=D;n.sort(ka);if(t)for(var q=1;q<n.length;q++)n[q]===n[q-1]&&n.splice(q--,1)}return n};x.matches=function(n,q){return x(n,null,null,q)};x.find=function(n,q,y){var A,H;if(!n)return[];for(var G=0,Z=C.order.length;G<Z;G++){var W=C.order[G];if(H=C.leftMatch[W].exec(n)){var fa=H[1];H.splice(1,
1);if(fa.substr(fa.length-1)!=="\\"){H[1]=(H[1]||"").replace(/\\/g,"");A=C.find[W](H,q,y);if(A!=null){n=n.replace(C.match[W],"");break}}}}A||(A=q.getElementsByTagName("*"));return{set:A,expr:n}};x.filter=function(n,q,y,A){for(var H=n,G=[],Z=q,W,fa,Ra=q&&q[0]&&ba(q[0]);n&&q.length;){for(var Fa in C.filter)if((W=C.leftMatch[Fa].exec(n))!=null&&W[2]){var Ma=C.filter[Fa],Ga,sa;sa=W[1];fa=false;W.splice(1,1);if(sa.substr(sa.length-1)!=="\\"){if(Z===G)G=[];if(C.preFilter[Fa])if(W=C.preFilter[Fa](W,Z,y,
G,A,Ra)){if(W===true)continue}else fa=Ga=true;if(W)for(var Ta=0;(sa=Z[Ta])!=null;Ta++)if(sa){Ga=Ma(sa,W,Ta,Z);var db=A^!!Ga;if(y&&Ga!=null)if(db)fa=true;else Z[Ta]=false;else if(db){G.push(sa);fa=true}}if(Ga!==h){y||(Z=G);n=n.replace(C.match[Fa],"");if(!fa)return[];break}}}if(n===H)if(fa==null)x.error(n);else break;H=n}return Z};x.error=function(n){throw"Syntax error, unrecognized expression: "+n;};var C=x.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(n){return n.getAttribute("href")}},
relative:{"+":function(n,q){var y=typeof q==="string",A=y&&!/\W/.test(q);y=y&&!A;if(A)q=q.toLowerCase();A=0;for(var H=n.length,G;A<H;A++)if(G=n[A]){for(;(G=G.previousSibling)&&G.nodeType!==1;);n[A]=y||G&&G.nodeName.toLowerCase()===q?G||false:G===q}y&&x.filter(q,n,true)},">":function(n,q){var y=typeof q==="string";if(y&&!/\W/.test(q)){q=q.toLowerCase();for(var A=0,H=n.length;A<H;A++){var G=n[A];if(G){y=G.parentNode;n[A]=y.nodeName.toLowerCase()===q?y:false}}}else{A=0;for(H=n.length;A<H;A++)if(G=n[A])n[A]=
y?G.parentNode:G.parentNode===q;y&&x.filter(q,n,true)}},"":function(n,q,y){var A=k++,H=g;if(typeof q==="string"&&!/\W/.test(q)){var G=q=q.toLowerCase();H=d}H("parentNode",q,A,n,G,y)},"~":function(n,q,y){var A=k++,H=g;if(typeof q==="string"&&!/\W/.test(q)){var G=q=q.toLowerCase();H=d}H("previousSibling",q,A,n,G,y)}},find:{ID:function(n,q,y){if(typeof q.getElementById!=="undefined"&&!y)return(n=q.getElementById(n[1]))?[n]:[]},NAME:function(n,q){if(typeof q.getElementsByName!=="undefined"){var y=[];
q=q.getElementsByName(n[1]);for(var A=0,H=q.length;A<H;A++)q[A].getAttribute("name")===n[1]&&y.push(q[A]);return y.length===0?null:y}},TAG:function(n,q){return q.getElementsByTagName(n[1])}},preFilter:{CLASS:function(n,q,y,A,H,G){n=" "+n[1].replace(/\\/g,"")+" ";if(G)return n;G=0;for(var Z;(Z=q[G])!=null;G++)if(Z)if(H^(Z.className&&(" "+Z.className+" ").replace(/[\t\n]/g," ").indexOf(n)>=0))y||A.push(Z);else if(y)q[G]=false;return false},ID:function(n){return n[1].replace(/\\/g,"")},TAG:function(n){return n[1].toLowerCase()},
CHILD:function(n){if(n[1]==="nth"){var q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(n[2]==="even"&&"2n"||n[2]==="odd"&&"2n+1"||!/\D/.test(n[2])&&"0n+"+n[2]||n[2]);n[2]=q[1]+(q[2]||1)-0;n[3]=q[3]-0}n[0]=k++;return n},ATTR:function(n,q,y,A,H,G){q=n[1].replace(/\\/g,"");if(!G&&C.attrMap[q])n[1]=C.attrMap[q];if(n[2]==="~=")n[4]=" "+n[4]+" ";return n},PSEUDO:function(n,q,y,A,H){if(n[1]==="not")if((j.exec(n[3])||"").length>1||/^\w/.test(n[3]))n[3]=x(n[3],null,null,q);else{n=x.filter(n[3],q,y,true^H);y||A.push.apply(A,
n);return false}else if(C.match.POS.test(n[0])||C.match.CHILD.test(n[0]))return true;return n},POS:function(n){n.unshift(true);return n}},filters:{enabled:function(n){return n.disabled===false&&n.type!=="hidden"},disabled:function(n){return n.disabled===true},checked:function(n){return n.checked===true},selected:function(n){return n.selected===true},parent:function(n){return!!n.firstChild},empty:function(n){return!n.firstChild},has:function(n,q,y){return!!x(y[3],n).length},header:function(n){return/h\d/i.test(n.nodeName)},
text:function(n){return"text"===n.type},radio:function(n){return"radio"===n.type},checkbox:function(n){return"checkbox"===n.type},file:function(n){return"file"===n.type},password:function(n){return"password"===n.type},submit:function(n){return"submit"===n.type},image:function(n){return"image"===n.type},reset:function(n){return"reset"===n.type},button:function(n){return"button"===n.type||n.nodeName.toLowerCase()==="button"},input:function(n){return/input|select|textarea|button/i.test(n.nodeName)}},
setFilters:{first:function(n,q){return q===0},last:function(n,q,y,A){return q===A.length-1},even:function(n,q){return q%2===0},odd:function(n,q){return q%2===1},lt:function(n,q,y){return q<y[3]-0},gt:function(n,q,y){return q>y[3]-0},nth:function(n,q,y){return y[3]-0===q},eq:function(n,q,y){return y[3]-0===q}},filter:{PSEUDO:function(n,q,y,A){var H=q[1],G=C.filters[H];if(G)return G(n,y,q,A);else if(H==="contains")return(n.textContent||n.innerText||a([n])||"").indexOf(q[3])>=0;else if(H==="not"){q=
q[3];y=0;for(A=q.length;y<A;y++)if(q[y]===n)return false;return true}else x.error("Syntax error, unrecognized expression: "+H)},CHILD:function(n,q){var y=q[1],A=n;switch(y){case "only":case "first":for(;A=A.previousSibling;)if(A.nodeType===1)return false;if(y==="first")return true;A=n;case "last":for(;A=A.nextSibling;)if(A.nodeType===1)return false;return true;case "nth":y=q[2];var H=q[3];if(y===1&&H===0)return true;q=q[0];var G=n.parentNode;if(G&&(G.sizcache!==q||!n.nodeIndex)){var Z=0;for(A=G.firstChild;A;A=
A.nextSibling)if(A.nodeType===1)A.nodeIndex=++Z;G.sizcache=q}n=n.nodeIndex-H;return y===0?n===0:n%y===0&&n/y>=0}},ID:function(n,q){return n.nodeType===1&&n.getAttribute("id")===q},TAG:function(n,q){return q==="*"&&n.nodeType===1||n.nodeName.toLowerCase()===q},CLASS:function(n,q){return(" "+(n.className||n.getAttribute("class"))+" ").indexOf(q)>-1},ATTR:function(n,q){var y=q[1];n=C.attrHandle[y]?C.attrHandle[y](n):n[y]!=null?n[y]:n.getAttribute(y);y=n+"";var A=q[2];q=q[4];return n==null?A==="!=":A===
"="?y===q:A==="*="?y.indexOf(q)>=0:A==="~="?(" "+y+" ").indexOf(q)>=0:!q?y&&n!==false:A==="!="?y!==q:A==="^="?y.indexOf(q)===0:A==="$="?y.substr(y.length-q.length)===q:A==="|="?y===q||y.substr(0,q.length+1)===q+"-":false},POS:function(n,q,y,A){var H=q[2];if(H=C.setFilters[H])return H(n,y,q,A)}}},K=C.match.POS;for(var X in C.match){C.match[X]=new RegExp(C.match[X].source+/(?![^\[]*\])(?![^\(]*\))/.source);C.leftMatch[X]=new RegExp(/(^(?:.|\r|\n)*?)/.source+C.match[X].source.replace(/\\(\d+)/g,function(n,
q){return"\\"+(q-0+1)}))}var ga=function(n,q){n=Array.prototype.slice.call(n,0);if(q){q.push.apply(q,n);return q}return n};try{Array.prototype.slice.call(I.documentElement.childNodes,0)}catch(na){ga=function(n,q){q=q||[];if(s.call(n)==="[object Array]")Array.prototype.push.apply(q,n);else if(typeof n.length==="number")for(var y=0,A=n.length;y<A;y++)q.push(n[y]);else for(y=0;n[y];y++)q.push(n[y]);return q}}var ka;if(I.documentElement.compareDocumentPosition)ka=function(n,q){if(!n.compareDocumentPosition||
!q.compareDocumentPosition){if(n==q)t=true;return n.compareDocumentPosition?-1:1}n=n.compareDocumentPosition(q)&4?-1:n===q?0:1;if(n===0)t=true;return n};else if("sourceIndex"in I.documentElement)ka=function(n,q){if(!n.sourceIndex||!q.sourceIndex){if(n==q)t=true;return n.sourceIndex?-1:1}n=n.sourceIndex-q.sourceIndex;if(n===0)t=true;return n};else if(I.createRange)ka=function(n,q){if(!n.ownerDocument||!q.ownerDocument){if(n==q)t=true;return n.ownerDocument?-1:1}var y=n.ownerDocument.createRange(),
A=q.ownerDocument.createRange();y.setStart(n,0);y.setEnd(n,0);A.setStart(q,0);A.setEnd(q,0);n=y.compareBoundaryPoints(Range.START_TO_END,A);if(n===0)t=true;return n};(function(){var n=I.createElement("div"),q="script"+(new Date).getTime();n.innerHTML="<a name='"+q+"'/>";var y=I.documentElement;y.insertBefore(n,y.firstChild);if(I.getElementById(q)){C.find.ID=function(A,H,G){if(typeof H.getElementById!=="undefined"&&!G)return(H=H.getElementById(A[1]))?H.id===A[1]||typeof H.getAttributeNode!=="undefined"&&
H.getAttributeNode("id").nodeValue===A[1]?[H]:h:[]};C.filter.ID=function(A,H){var G=typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id");return A.nodeType===1&&G&&G.nodeValue===H}}y.removeChild(n);y=n=null})();(function(){var n=I.createElement("div");n.appendChild(I.createComment(""));if(n.getElementsByTagName("*").length>0)C.find.TAG=function(q,y){y=y.getElementsByTagName(q[1]);if(q[1]==="*"){q=[];for(var A=0;y[A];A++)y[A].nodeType===1&&q.push(y[A]);y=q}return y};n.innerHTML="<a href='#'></a>";
if(n.firstChild&&typeof n.firstChild.getAttribute!=="undefined"&&n.firstChild.getAttribute("href")!=="#")C.attrHandle.href=function(q){return q.getAttribute("href",2)};n=null})();I.querySelectorAll&&function(){var n=x,q=I.createElement("div");q.innerHTML="<p class='TEST'></p>";if(!(q.querySelectorAll&&q.querySelectorAll(".TEST").length===0)){x=function(A,H,G,Z){H=H||I;if(!Z&&H.nodeType===9&&!ba(H))try{return ga(H.querySelectorAll(A),G)}catch(W){}return n(A,H,G,Z)};for(var y in n)x[y]=n[y];q=null}}();
(function(){var n=I.createElement("div");n.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!n.getElementsByClassName||n.getElementsByClassName("e").length===0)){n.lastChild.className="e";if(n.getElementsByClassName("e").length!==1){C.order.splice(1,0,"CLASS");C.find.CLASS=function(q,y,A){if(typeof y.getElementsByClassName!=="undefined"&&!A)return y.getElementsByClassName(q[1])};n=null}}})();var ta=I.compareDocumentPosition?function(n,q){return!!(n.compareDocumentPosition(q)&16)}:
function(n,q){return n!==q&&(n.contains?n.contains(q):true)},ba=function(n){return(n=(n?n.ownerDocument||n:0).documentElement)?n.nodeName!=="HTML":false},Va=function(n,q){var y=[],A="",H;for(q=q.nodeType?[q]:q;H=C.match.PSEUDO.exec(n);){A+=H[0];n=n.replace(C.match.PSEUDO,"")}n=C.relative[n]?n+"*":n;H=0;for(var G=q.length;H<G;H++)x(n,q[H],y);return x.filter(A,y)};e.find=x;e.expr=x.selectors;e.expr[":"]=e.expr.filters;e.unique=x.uniqueSort;e.text=a;e.isXMLDoc=ba;e.contains=ta})();var Ja=/Until$/,Na=
/^(?:parents|prevUntil|prevAll)/,Aa=/,/;za=Array.prototype.slice;var va=function(a,d,g){if(e.isFunction(d))return e.grep(a,function(k,s){return!!d.call(k,s,k)===g});else if(d.nodeType)return e.grep(a,function(k){return k===d===g});else if(typeof d==="string"){var j=e.grep(a,function(k){return k.nodeType===1});if(P.test(d))return e.filter(d,j,!g);else d=e.filter(d,j)}return e.grep(a,function(k){return e.inArray(k,d)>=0===g})};e.fn.extend({find:function(a){for(var d=this.pushStack("","find",a),g=0,
j=0,k=this.length;j<k;j++){g=d.length;e.find(a,this[j],d);if(j>0)for(var s=g;s<d.length;s++)for(var t=0;t<g;t++)if(d[t]===d[s]){d.splice(s--,1);break}}return d},has:function(a){var d=e(a);return this.filter(function(){for(var g=0,j=d.length;g<j;g++)if(e.contains(this,d[g]))return true})},not:function(a){return this.pushStack(va(this,a,false),"not",a)},filter:function(a){return this.pushStack(va(this,a,true),"filter",a)},is:function(a){return!!a&&e.filter(a,this).length>0},closest:function(a,d){if(e.isArray(a)){var g=
[],j=this[0],k,s={},t;if(j&&a.length){k=0;for(var D=a.length;k<D;k++){t=a[k];s[t]||(s[t]=e.expr.match.POS.test(t)?e(t,d||this.context):t)}for(;j&&j.ownerDocument&&j!==d;){for(t in s){k=s[t];if(k.jquery?k.index(j)>-1:e(j).is(k)){g.push({selector:t,elem:j});delete s[t]}}j=j.parentNode}}return g}var x=e.expr.match.POS.test(a)?e(a,d||this.context):null;return this.map(function(C,K){for(;K&&K.ownerDocument&&K!==d;){if(x?x.index(K)>-1:e(K).is(a))return K;K=K.parentNode}return null})},index:function(a){if(!a||
typeof a==="string")return e.inArray(this[0],a?e(a):this.parent().children());return e.inArray(a.jquery?a[0]:a,this)},add:function(a,d){a=typeof a==="string"?e(a,d||this.context):e.makeArray(a);d=e.merge(this.get(),a);return this.pushStack(F(a[0])||F(d[0])?d:e.unique(d))},andSelf:function(){return this.add(this.prevObject)}});e.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return e.dir(a,"parentNode")},parentsUntil:function(a,d,g){return e.dir(a,"parentNode",
g)},next:function(a){return e.nth(a,2,"nextSibling")},prev:function(a){return e.nth(a,2,"previousSibling")},nextAll:function(a){return e.dir(a,"nextSibling")},prevAll:function(a){return e.dir(a,"previousSibling")},nextUntil:function(a,d,g){return e.dir(a,"nextSibling",g)},prevUntil:function(a,d,g){return e.dir(a,"previousSibling",g)},siblings:function(a){return e.sibling(a.parentNode.firstChild,a)},children:function(a){return e.sibling(a.firstChild)},contents:function(a){return e.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:e.makeArray(a.childNodes)}},function(a,d){e.fn[a]=function(g,j){var k=e.map(this,d,g);Ja.test(a)||(j=g);if(j&&typeof j==="string")k=e.filter(j,k);k=this.length>1?e.unique(k):k;if((this.length>1||Aa.test(j))&&Na.test(a))k=k.reverse();return this.pushStack(k,a,za.call(arguments).join(","))}});e.extend({filter:function(a,d,g){if(g)a=":not("+a+")";return e.find.matches(a,d)},dir:function(a,d,g){var j=[];for(a=a[d];a&&a.nodeType!==9&&(g===h||a.nodeType!==1||
!e(a).is(g));){a.nodeType===1&&j.push(a);a=a[d]}return j},nth:function(a,d,g){d=d||1;for(var j=0;a;a=a[g])if(a.nodeType===1&&++j===d)break;return a},sibling:function(a,d){for(var g=[];a;a=a.nextSibling)a.nodeType===1&&a!==d&&g.push(a);return g}});var Ka=/ jQuery\d+="(?:\d+|null)"/g,Ca=/^\s+/,eb=/(<([\w:]+)[^>]*?)\/>/g,kb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,fb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,ab=/<script|<object|<embed|<option|<style/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,
gb=function(a,d,g){return kb.test(g)?a:d+"></"+g+">"},ua={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,"",""]};ua.optgroup=ua.option;ua.tbody=ua.tfoot=ua.colgroup=ua.caption=ua.thead;ua.th=ua.td;if(!e.support.htmlSerialize)ua._default=
[1,"div<div>","</div>"];e.fn.extend({text:function(a){if(e.isFunction(a))return this.each(function(d){var g=e(this);g.text(a.call(this,d,g.text()))});if(typeof a!=="object"&&a!==h)return this.empty().append((this[0]&&this[0].ownerDocument||I).createTextNode(a));return e.text(this)},wrapAll:function(a){if(e.isFunction(a))return this.each(function(g){e(this).wrapAll(a.call(this,g))});if(this[0]){var d=e(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&d.insertBefore(this[0]);d.map(function(){for(var g=
this;g.firstChild&&g.firstChild.nodeType===1;)g=g.firstChild;return g}).append(this)}return this},wrapInner:function(a){if(e.isFunction(a))return this.each(function(d){e(this).wrapInner(a.call(this,d))});return this.each(function(){var d=e(this),g=d.contents();g.length?g.wrapAll(a):d.append(a)})},wrap:function(a){return this.each(function(){e(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){e.nodeName(this,"body")||e(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,
true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(d){this.parentNode.insertBefore(d,this)});else if(arguments.length){var a=e(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,
false,function(d){this.parentNode.insertBefore(d,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,e(arguments[0]).toArray());return a}},remove:function(a,d){for(var g=0,j;(j=this[g])!=null;g++)if(!a||e.filter(a,[j]).length){if(!d&&j.nodeType===1){e.cleanData(j.getElementsByTagName("*"));e.cleanData([j])}j.parentNode&&j.parentNode.removeChild(j)}return this},empty:function(){for(var a=0,d;(d=this[a])!=null;a++)for(d.nodeType===1&&e.cleanData(d.getElementsByTagName("*"));d.firstChild;)d.removeChild(d.firstChild);
return this},clone:function(a){var d=this.map(function(){if(!e.support.noCloneEvent&&!e.isXMLDoc(this)){var g=this.outerHTML,j=this.ownerDocument;if(!g){g=j.createElement("div");g.appendChild(this.cloneNode(true));g=g.innerHTML}return e.clean([g.replace(Ka,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Ca,"")],j)[0]}else return this.cloneNode(true)});if(a===true){V(this,d);V(this.find("*"),d.find("*"))}return d},html:function(a){if(a===h)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ka,
""):null;else if(typeof a==="string"&&!ab.test(a)&&(e.support.leadingWhitespace||!Ca.test(a))&&!ua[(fb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(eb,gb);try{for(var d=0,g=this.length;d<g;d++)if(this[d].nodeType===1){e.cleanData(this[d].getElementsByTagName("*"));this[d].innerHTML=a}}catch(j){this.empty().append(a)}}else e.isFunction(a)?this.each(function(k){var s=e(this),t=s.html();s.empty().append(function(){return a.call(this,k,t)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(e.isFunction(a))return this.each(function(d){var g=e(this),j=g.html();g.replaceWith(a.call(this,d,j))});if(typeof a!=="string")a=e(a).detach();return this.each(function(){var d=this.nextSibling,g=this.parentNode;e(this).remove();d?e(d).before(a):e(g).append(a)})}else return this.pushStack(e(e.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,d,g){function j(X){return e.nodeName(X,"table")?X.getElementsByTagName("tbody")[0]||
X.appendChild(X.ownerDocument.createElement("tbody")):X}var k,s,t=a[0],D=[],x;if(!e.support.checkClone&&arguments.length===3&&typeof t==="string"&&bb.test(t))return this.each(function(){e(this).domManip(a,d,g,true)});if(e.isFunction(t))return this.each(function(X){var ga=e(this);a[0]=t.call(this,X,d?ga.html():h);ga.domManip(a,d,g)});if(this[0]){k=t&&t.parentNode;k=e.support.parentNode&&k&&k.nodeType===11&&k.childNodes.length===this.length?{fragment:k}:aa(a,this,D);x=k.fragment;if(s=x.childNodes.length===
1?(x=x.firstChild):x.firstChild){d=d&&e.nodeName(s,"tr");for(var C=0,K=this.length;C<K;C++)g.call(d?j(this[C],s):this[C],C>0||k.cacheable||this.length>1?x.cloneNode(true):x)}D.length&&e.each(D,f)}return this}});e.fragments={};e.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,d){e.fn[a]=function(g){var j=[];g=e(g);var k=this.length===1&&this[0].parentNode;if(k&&k.nodeType===11&&k.childNodes.length===1&&g.length===1){g[d](this[0]);
return this}else{k=0;for(var s=g.length;k<s;k++){var t=(k>0?this.clone(true):this).get();e.fn[d].apply(e(g[k]),t);j=j.concat(t)}return this.pushStack(j,a,g.selector)}}});e.extend({clean:function(a,d,g,j){d=d||I;if(typeof d.createElement==="undefined")d=d.ownerDocument||d[0]&&d[0].ownerDocument||I;for(var k=[],s=0,t;(t=a[s])!=null;s++){if(typeof t==="number")t+="";if(t){if(typeof t==="string"&&!mb.test(t))t=d.createTextNode(t);else if(typeof t==="string"){t=t.replace(eb,gb);var D=(fb.exec(t)||["",
""])[1].toLowerCase(),x=ua[D]||ua._default,C=x[0],K=d.createElement("div");for(K.innerHTML=x[1]+t+x[2];C--;)K=K.lastChild;if(!e.support.tbody){C=lb.test(t);D=D==="table"&&!C?K.firstChild&&K.firstChild.childNodes:x[1]==="<table>"&&!C?K.childNodes:[];for(x=D.length-1;x>=0;--x)e.nodeName(D[x],"tbody")&&!D[x].childNodes.length&&D[x].parentNode.removeChild(D[x])}!e.support.leadingWhitespace&&Ca.test(t)&&K.insertBefore(d.createTextNode(Ca.exec(t)[0]),K.firstChild);t=K.childNodes}if(t.nodeType)k.push(t);
else k=e.merge(k,t)}}if(g)for(s=0;k[s];s++)if(j&&e.nodeName(k[s],"script")&&(!k[s].type||k[s].type.toLowerCase()==="text/javascript"))j.push(k[s].parentNode?k[s].parentNode.removeChild(k[s]):k[s]);else{k[s].nodeType===1&&k.splice.apply(k,[s+1,0].concat(e.makeArray(k[s].getElementsByTagName("script"))));g.appendChild(k[s])}return k},cleanData:function(a){for(var d,g,j=e.cache,k=e.event.special,s=e.support.deleteExpando,t=0,D;(D=a[t])!=null;t++)if(g=D[e.expando]){d=j[g];if(d.events)for(var x in d.events)k[x]?
e.event.remove(D,x):z(D,x,d.handle);if(s)delete D[e.expando];else D.removeAttribute&&D.removeAttribute(e.expando);delete j[g]}}});var nb=/z-?index|font-?weight|opacity|zoom|line-?height/i,hb=/alpha\([^)]*\)/,ib=/opacity=([^)]*)/,Wa=/float/i,Xa=/-([a-z])/ig,ob=/([A-Z])/g,pb=/^-?\d+(?:px)?$/i,qb=/^-?\d/,rb={position:"absolute",visibility:"hidden",display:"block"},sb=["Left","Right"],tb=["Top","Bottom"],ub=I.defaultView&&I.defaultView.getComputedStyle,jb=e.support.cssFloat?"cssFloat":"styleFloat",Ya=
function(a,d){return d.toUpperCase()};e.fn.css=function(a,d){return o(this,a,d,true,function(g,j,k){if(k===h)return e.curCSS(g,j);if(typeof k==="number"&&!nb.test(j))k+="px";e.style(g,j,k)})};e.extend({style:function(a,d,g){if(!(!a||a.nodeType===3||a.nodeType===8)){if((d==="width"||d==="height")&&parseFloat(g)<0)g=h;var j=a.style||a,k=g!==h;if(!e.support.opacity&&d==="opacity"){if(k){j.zoom=1;d=parseInt(g,10)+""==="NaN"?"":"alpha(opacity="+g*100+")";a=j.filter||e.curCSS(a,"filter")||"";j.filter=hb.test(a)?
a.replace(hb,d):d}return j.filter&&j.filter.indexOf("opacity=")>=0?parseFloat(ib.exec(j.filter)[1])/100+"":""}if(Wa.test(d))d=jb;d=d.replace(Xa,Ya);if(k)j[d]=g;return j[d]}},css:function(a,d,g,j){if(d==="width"||d==="height"){var k;g=rb;var s=d==="width"?sb:tb;function t(){k=d==="width"?a.offsetWidth:a.offsetHeight;j!=="border"&&e.each(s,function(){j||(k-=parseFloat(e.curCSS(a,"padding"+this,true))||0);if(j==="margin")k+=parseFloat(e.curCSS(a,"margin"+this,true))||0;else k-=parseFloat(e.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?t():e.swap(a,g,t);return Math.max(0,Math.round(k))}return e.curCSS(a,d,g)},curCSS:function(a,d,g){var j,k=a.style;if(!e.support.opacity&&d==="opacity"&&a.currentStyle){j=ib.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return j===""?"1":j}if(Wa.test(d))d=jb;if(!g&&k&&k[d])j=k[d];else if(ub){if(Wa.test(d))d="float";d=d.replace(ob,"-$1").toLowerCase();k=a.ownerDocument.defaultView;if(!k)return null;if(a=k.getComputedStyle(a,null))j=
a.getPropertyValue(d);if(d==="opacity"&&j==="")j="1"}else if(a.currentStyle){g=d.replace(Xa,Ya);j=a.currentStyle[d]||a.currentStyle[g];if(!pb.test(j)&&qb.test(j)){d=k.left;var s=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;k.left=g==="fontSize"?"1em":j||0;j=k.pixelLeft+"px";k.left=d;a.runtimeStyle.left=s}}return j},swap:function(a,d,g){var j={};for(var k in d){j[k]=a.style[k];a.style[k]=d[k]}g.call(a);for(k in d)a.style[k]=j[k]}});if(e.expr&&e.expr.filters){e.expr.filters.hidden=function(a){var d=
a.offsetWidth,g=a.offsetHeight,j=a.nodeName.toLowerCase()==="tr";return d===0&&g===0&&!j?true:d>0&&g>0&&!j?false:e.curCSS(a,"display")==="none"};e.expr.filters.visible=function(a){return!e.expr.filters.hidden(a)}}var vb=m(),wb=/<script(.|\s)*?\/script>/gi,xb=/select|textarea/i,yb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,Oa=/=\?(&|$)/,Za=/\?/,zb=/(\?|&)_=.*?(&|$)/,Ab=/^(\w+:)?\/\/([^\/?#]+)/,Bb=/%20/g,Cb=e.fn.load;e.fn.extend({load:function(a,d,
g){if(typeof a!=="string")return Cb.call(this,a);else if(!this.length)return this;var j=a.indexOf(" ");if(j>=0){var k=a.slice(j,a.length);a=a.slice(0,j)}j="GET";if(d)if(e.isFunction(d)){g=d;d=null}else if(typeof d==="object"){d=e.param(d,e.ajaxSettings.traditional);j="POST"}var s=this;e.ajax({url:a,type:j,dataType:"html",data:d,complete:function(t,D){if(D==="success"||D==="notmodified")s.html(k?e("<div />").append(t.responseText.replace(wb,"")).find(k):t.responseText);g&&s.each(g,[t.responseText,
D,t])}});return this},serialize:function(){return e.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?e.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xb.test(this.nodeName)||yb.test(this.type))}).map(function(a,d){a=e(this).val();return a==null?null:e.isArray(a)?e.map(a,function(g){return{name:d.name,value:g}}):{name:d.name,value:a}}).get()}});e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,d){e.fn[d]=function(g){return this.bind(d,g)}});e.extend({get:function(a,d,g,j){if(e.isFunction(d)){j=j||g;g=d;d=null}return e.ajax({type:"GET",url:a,data:d,success:g,dataType:j})},getScript:function(a,d){return e.get(a,null,d,"script")},getJSON:function(a,d,g){return e.get(a,d,g,"json")},post:function(a,d,g,j){if(e.isFunction(d)){j=j||g;g=d;d={}}return e.ajax({type:"POST",url:a,data:d,success:g,dataType:j})},ajaxSetup:function(a){e.extend(e.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:b.XMLHttpRequest&&(b.location.protocol!=="file:"||!b.ActiveXObject)?function(){return new b.XMLHttpRequest}:function(){try{return new b.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function d(){k.success&&
k.success.call(x,D,t,ba);k.global&&j("ajaxSuccess",[ba,k])}function g(){k.complete&&k.complete.call(x,ba,t);k.global&&j("ajaxComplete",[ba,k]);k.global&&!--e.active&&e.event.trigger("ajaxStop")}function j(H,G){(k.context?e(k.context):e.event).trigger(H,G)}var k=e.extend(true,{},e.ajaxSettings,a),s,t,D,x=a&&a.context||k,C=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string")k.data=e.param(k.data,k.traditional);if(k.dataType==="jsonp"){if(C==="GET")Oa.test(k.url)||(k.url+=(Za.test(k.url)?
"&":"?")+(k.jsonp||"callback")+"=?");else if(!k.data||!Oa.test(k.data))k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?";k.dataType="json"}if(k.dataType==="json"&&(k.data&&Oa.test(k.data)||Oa.test(k.url))){s=k.jsonpCallback||"jsonp"+vb++;if(k.data)k.data=(k.data+"").replace(Oa,"="+s+"$1");k.url=k.url.replace(Oa,"="+s+"$1");k.dataType="script";b[s]=b[s]||function(H){D=H;d();g();b[s]=h;try{delete b[s]}catch(G){}ga&&ga.removeChild(na)}}if(k.dataType==="script"&&k.cache===null)k.cache=false;if(k.cache===
false&&C==="GET"){var K=m(),X=k.url.replace(zb,"$1_="+K+"$2");k.url=X+(X===k.url?(Za.test(k.url)?"&":"?")+"_="+K:"")}if(k.data&&C==="GET")k.url+=(Za.test(k.url)?"&":"?")+k.data;k.global&&!e.active++&&e.event.trigger("ajaxStart");K=(K=Ab.exec(k.url))&&(K[1]&&K[1]!==location.protocol||K[2]!==location.host);if(k.dataType==="script"&&C==="GET"&&K){var ga=I.getElementsByTagName("head")[0]||I.documentElement,na=I.createElement("script");na.src=k.url;if(k.scriptCharset)na.charset=k.scriptCharset;if(!s){var ka=
false;na.onload=na.onreadystatechange=function(){if(!ka&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){ka=true;d();g();na.onload=na.onreadystatechange=null;ga&&na.parentNode&&ga.removeChild(na)}}}ga.insertBefore(na,ga.firstChild)}else{var ta=false,ba=k.xhr();if(ba){k.username?ba.open(C,k.url,k.async,k.username,k.password):ba.open(C,k.url,k.async);try{if(k.data||a&&a.contentType)ba.setRequestHeader("Content-Type",k.contentType);if(k.ifModified){e.lastModified[k.url]&&
ba.setRequestHeader("If-Modified-Since",e.lastModified[k.url]);e.etag[k.url]&&ba.setRequestHeader("If-None-Match",e.etag[k.url])}K||ba.setRequestHeader("X-Requested-With","XMLHttpRequest");ba.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(Va){}if(k.beforeSend&&k.beforeSend.call(x,ba,k)===false){k.global&&!--e.active&&e.event.trigger("ajaxStop");ba.abort();return false}k.global&&j("ajaxSend",[ba,k]);var n=ba.onreadystatechange=function(H){if(!ba||
ba.readyState===0||H==="abort"){ta||g();ta=true;if(ba)ba.onreadystatechange=e.noop}else if(!ta&&ba&&(ba.readyState===4||H==="timeout")){ta=true;ba.onreadystatechange=e.noop;t=H==="timeout"?"timeout":!e.httpSuccess(ba)?"error":k.ifModified&&e.httpNotModified(ba,k.url)?"notmodified":"success";var G;if(t==="success")try{D=e.httpData(ba,k.dataType,k)}catch(Z){t="parsererror";G=Z}if(t==="success"||t==="notmodified")s||d();else e.handleError(k,ba,t,G);g();H==="timeout"&&ba.abort();if(k.async)ba=null}};
try{var q=ba.abort;ba.abort=function(){ba&&q.call(ba);n("abort")}}catch(y){}k.async&&k.timeout>0&&setTimeout(function(){ba&&!ta&&n("timeout")},k.timeout);try{ba.send(C==="POST"||C==="PUT"||C==="DELETE"?k.data:null)}catch(A){e.handleError(k,ba,null,A);g()}k.async||n();return ba}}},handleError:function(a,d,g,j){if(a.error)a.error.call(a.context||a,d,g,j);if(a.global)(a.context?e(a.context):e.event).trigger("ajaxError",[d,a,j])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol===
"file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0&&e.browser.opera}catch(d){}return false},httpNotModified:function(a,d){var g=a.getResponseHeader("Last-Modified"),j=a.getResponseHeader("Etag");if(g)e.lastModified[d]=g;if(j)e.etag[d]=j;return a.status===304||a.status===0&&e.browser.opera},httpData:function(a,d,g){var j=a.getResponseHeader("content-type")||"",k=d==="xml"||!d&&j.indexOf("xml")>=0;a=k?a.responseXML:a.responseText;k&&a.documentElement.nodeName==="parsererror"&&
e.error("parsererror");if(g&&g.dataFilter)a=g.dataFilter(a,d);if(typeof a==="string")if(d==="json"||!d&&j.indexOf("json")>=0)a=e.parseJSON(a);else if(d==="script"||!d&&j.indexOf("javascript")>=0)e.globalEval(a);return a},param:function(a,d){function g(t,D){if(e.isArray(D))e.each(D,function(x,C){d||/\[\]$/.test(t)?j(t,C):g(t+"["+(typeof C==="object"||e.isArray(C)?x:"")+"]",C)});else!d&&D!=null&&typeof D==="object"?e.each(D,function(x,C){g(t+"["+x+"]",C)}):j(t,D)}function j(t,D){D=e.isFunction(D)?D():
D;k[k.length]=encodeURIComponent(t)+"="+encodeURIComponent(D)}var k=[];if(d===h)d=e.ajaxSettings.traditional;if(e.isArray(a)||a.jquery)e.each(a,function(){j(this.name,this.value)});else for(var s in a)g(s,a[s]);return k.join("&").replace(Bb,"+")}});var $a={},Db=/toggle|show|hide/,Eb=/^([+-]=)?([\d+-.]+)(.*)$/,Ua,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];e.fn.extend({show:function(a,d){if(a||
a===0)return this.animate(O("show",3),a,d);else{a=0;for(d=this.length;a<d;a++){var g=e.data(this[a],"olddisplay");this[a].style.display=g||"";if(e.css(this[a],"display")==="none"){g=this[a].nodeName;var j;if($a[g])j=$a[g];else{var k=e("<"+g+" />").appendTo("body");j=k.css("display");if(j==="none")j="block";k.remove();$a[g]=j}e.data(this[a],"olddisplay",j)}}a=0;for(d=this.length;a<d;a++)this[a].style.display=e.data(this[a],"olddisplay")||"";return this}},hide:function(a,d){if(a||a===0)return this.animate(O("hide",
3),a,d);else{a=0;for(d=this.length;a<d;a++){var g=e.data(this[a],"olddisplay");!g&&g!=="none"&&e.data(this[a],"olddisplay",e.css(this[a],"display"))}a=0;for(d=this.length;a<d;a++)this[a].style.display="none";return this}},_toggle:e.fn.toggle,toggle:function(a,d){var g=typeof a==="boolean";if(e.isFunction(a)&&e.isFunction(d))this._toggle.apply(this,arguments);else a==null||g?this.each(function(){var j=g?a:e(this).is(":hidden");e(this)[j?"show":"hide"]()}):this.animate(O("toggle",3),a,d);return this},
fadeTo:function(a,d,g){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:d},a,g)},animate:function(a,d,g,j){var k=e.speed(d,g,j);if(e.isEmptyObject(a))return this.each(k.complete);return this[k.queue===false?"each":"queue"](function(){var s=e.extend({},k),t,D=this.nodeType===1&&e(this).is(":hidden"),x=this;for(t in a){var C=t.replace(Xa,Ya);if(t!==C){a[C]=a[t];delete a[t];t=C}if(a[t]==="hide"&&D||a[t]==="show"&&!D)return s.complete.call(this);if((t==="height"||t==="width")&&
this.style){s.display=e.css(this,"display");s.overflow=this.style.overflow}if(e.isArray(a[t])){(s.specialEasing=s.specialEasing||{})[t]=a[t][1];a[t]=a[t][0]}}if(s.overflow!=null)this.style.overflow="hidden";s.curAnim=e.extend({},a);e.each(a,function(K,X){var ga=new e.fx(x,s,K);if(Db.test(X))ga[X==="toggle"?D?"show":"hide":X](a);else{var na=Eb.exec(X),ka=ga.cur(true)||0;if(na){X=parseFloat(na[2]);var ta=na[3]||"px";if(ta!=="px"){x.style[K]=(X||1)+ta;ka=(X||1)/ga.cur(true)*ka;x.style[K]=ka+ta}if(na[1])X=
(na[1]==="-="?-1:1)*X+ka;ga.custom(ka,X,ta)}else ga.custom(ka,X,"")}});return true})},stop:function(a,d){var g=e.timers;a&&this.queue([]);this.each(function(){for(var j=g.length-1;j>=0;j--)if(g[j].elem===this){d&&g[j](true);g.splice(j,1)}});d||this.dequeue();return this}});e.each({slideDown:O("show",1),slideUp:O("hide",1),slideToggle:O("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,d){e.fn[a]=function(g,j){return this.animate(d,g,j)}});e.extend({speed:function(a,d,g){var j=
a&&typeof a==="object"?a:{complete:g||!g&&d||e.isFunction(a)&&a,duration:a,easing:g&&d||d&&!e.isFunction(d)&&d};j.duration=e.fx.off?0:typeof j.duration==="number"?j.duration:e.fx.speeds[j.duration]||e.fx.speeds._default;j.old=j.complete;j.complete=function(){j.queue!==false&&e(this).dequeue();e.isFunction(j.old)&&j.old.call(this)};return j},easing:{linear:function(a,d,g,j){return g+j*a},swing:function(a,d,g,j){return(-Math.cos(a*Math.PI)/2+0.5)*j+g}},timers:[],fx:function(a,d,g){this.options=d;this.elem=
a;this.prop=g;if(!d.orig)d.orig={}}});e.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(e.fx.step[this.prop]||e.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(e.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(e.curCSS(this.elem,
this.prop))||0},custom:function(a,d,g){function j(s){return k.step(s)}this.startTime=m();this.start=a;this.end=d;this.unit=g||this.unit||"px";this.now=this.start;this.pos=this.state=0;var k=this;j.elem=this.elem;if(j()&&e.timers.push(j)&&!Ua)Ua=setInterval(e.fx.tick,13)},show:function(){this.options.orig[this.prop]=e.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());e(this.elem).show()},hide:function(){this.options.orig[this.prop]=
e.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var d=m(),g=true;if(a||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var j in this.options.curAnim)if(this.options.curAnim[j]!==true)g=false;if(g){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=e.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(e.css(this.elem,
"display")==="none")this.elem.style.display="block"}this.options.hide&&e(this.elem).hide();if(this.options.hide||this.options.show)for(var k in this.options.curAnim)e.style(this.elem,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{k=d-this.startTime;this.state=k/this.options.duration;a=this.options.specialEasing&&this.options.specialEasing[this.prop];d=this.options.easing||(e.easing.swing?"swing":"linear");this.pos=e.easing[a||d](this.state,k,0,1,this.options.duration);
this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};e.extend(e.fx,{tick:function(){for(var a=e.timers,d=0;d<a.length;d++)a[d]()||a.splice(d--,1);a.length||e.fx.stop()},stop:function(){clearInterval(Ua);Ua=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){e.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=
a.now}}});if(e.expr&&e.expr.filters)e.expr.filters.animated=function(a){return e.grep(e.timers,function(d){return a===d.elem}).length};e.fn.offset="getBoundingClientRect"in I.documentElement?function(a){var d=this[0];if(a)return this.each(function(t){e.offset.setOffset(this,a,t)});if(!d||!d.ownerDocument)return null;if(d===d.ownerDocument.body)return e.offset.bodyOffset(d);var g=d.getBoundingClientRect(),j=d.ownerDocument;d=j.body;j=j.documentElement;var k=j.clientTop||d.clientTop||0,s=j.clientLeft||
d.clientLeft||0;k=g.top+(self.pageYOffset||e.support.boxModel&&j.scrollTop||d.scrollTop)-k;g=g.left+(self.pageXOffset||e.support.boxModel&&j.scrollLeft||d.scrollLeft)-s;return{top:k,left:g}}:function(a){var d=this[0];if(a)return this.each(function(K){e.offset.setOffset(this,a,K)});if(!d||!d.ownerDocument)return null;if(d===d.ownerDocument.body)return e.offset.bodyOffset(d);e.offset.initialize();var g=d.offsetParent,j=d,k=d.ownerDocument,s,t=k.documentElement,D=k.body;j=(k=k.defaultView)?k.getComputedStyle(d,
null):d.currentStyle;for(var x=d.offsetTop,C=d.offsetLeft;(d=d.parentNode)&&d!==D&&d!==t;){if(e.offset.supportsFixedPosition&&j.position==="fixed")break;s=k?k.getComputedStyle(d,null):d.currentStyle;x-=d.scrollTop;C-=d.scrollLeft;if(d===g){x+=d.offsetTop;C+=d.offsetLeft;if(e.offset.doesNotAddBorder&&!(e.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(d.nodeName))){x+=parseFloat(s.borderTopWidth)||0;C+=parseFloat(s.borderLeftWidth)||0}j=g;g=d.offsetParent}if(e.offset.subtractsBorderForOverflowNotVisible&&
s.overflow!=="visible"){x+=parseFloat(s.borderTopWidth)||0;C+=parseFloat(s.borderLeftWidth)||0}j=s}if(j.position==="relative"||j.position==="static"){x+=D.offsetTop;C+=D.offsetLeft}if(e.offset.supportsFixedPosition&&j.position==="fixed"){x+=Math.max(t.scrollTop,D.scrollTop);C+=Math.max(t.scrollLeft,D.scrollLeft)}return{top:x,left:C}};e.offset={initialize:function(){var a=I.body,d=I.createElement("div"),g,j,k,s=parseFloat(e.curCSS(a,"marginTop",true))||0;g="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
e.extend(d.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});d.innerHTML=g;a.insertBefore(d,a.firstChild);g=d.firstChild;j=g.firstChild;k=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=j.offsetTop!==5;this.doesAddBorderForTableAndCells=k.offsetTop===5;j.style.position="fixed";j.style.top="20px";this.supportsFixedPosition=j.offsetTop===20||j.offsetTop===15;j.style.position=j.style.top="";g.style.overflow="hidden";g.style.position="relative";
this.subtractsBorderForOverflowNotVisible=j.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==s;a.removeChild(d);e.offset.initialize=e.noop},bodyOffset:function(a){var d=a.offsetTop,g=a.offsetLeft;e.offset.initialize();if(e.offset.doesNotIncludeMarginInBodyOffset){d+=parseFloat(e.curCSS(a,"marginTop",true))||0;g+=parseFloat(e.curCSS(a,"marginLeft",true))||0}return{top:d,left:g}},setOffset:function(a,d,g){if(/static/.test(e.curCSS(a,"position")))a.style.position="relative";var j=e(a),
k=j.offset(),s=parseInt(e.curCSS(a,"top",true),10)||0,t=parseInt(e.curCSS(a,"left",true),10)||0;if(e.isFunction(d))d=d.call(a,g,k);g={top:d.top-k.top+s,left:d.left-k.left+t};"using"in d?d.using.call(a,g):j.css(g)}};e.fn.extend({position:function(){if(!this[0])return null;var a=this[0],d=this.offsetParent(),g=this.offset(),j=/^body|html$/i.test(d[0].nodeName)?{top:0,left:0}:d.offset();g.top-=parseFloat(e.curCSS(a,"marginTop",true))||0;g.left-=parseFloat(e.curCSS(a,"marginLeft",true))||0;j.top+=parseFloat(e.curCSS(d[0],
"borderTopWidth",true))||0;j.left+=parseFloat(e.curCSS(d[0],"borderLeftWidth",true))||0;return{top:g.top-j.top,left:g.left-j.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||I.body;a&&!/^body|html$/i.test(a.nodeName)&&e.css(a,"position")==="static";)a=a.offsetParent;return a})}});e.each(["Left","Top"],function(a,d){var g="scroll"+d;e.fn[g]=function(j){var k=this[0],s;if(!k)return null;if(j!==h)return this.each(function(){if(s=M(this))s.scrollTo(!a?j:e(s).scrollLeft(),
a?j:e(s).scrollTop());else this[g]=j});else return(s=M(k))?"pageXOffset"in s?s[a?"pageYOffset":"pageXOffset"]:e.support.boxModel&&s.document.documentElement[g]||s.document.body[g]:k[g]}});e.each(["Height","Width"],function(a,d){var g=d.toLowerCase();e.fn["inner"+d]=function(){return this[0]?e.css(this[0],g,false,"padding"):null};e.fn["outer"+d]=function(j){return this[0]?e.css(this[0],g,false,j?"margin":"border"):null};e.fn[g]=function(j){var k=this[0];if(!k)return j==null?null:this;if(e.isFunction(j))return this.each(function(s){var t=
e(this);t[g](j.call(this,s,t[g]()))});return"scrollTo"in k&&k.document?k.document.compatMode==="CSS1Compat"&&k.document.documentElement["client"+d]||k.document.body["client"+d]:k.nodeType===9?Math.max(k.documentElement["client"+d],k.body["scroll"+d],k.documentElement["scroll"+d],k.body["offset"+d],k.documentElement["offset"+d]):j===h?e.css(k,g):this.css(g,typeof j==="string"?j:j+"px")}});b.jQuery=b.$=e})(window);(function(b){b.securepost=function(c,f,o,m){f=f||{};var l=b.securepost.formkey;if(!l)throw new Error("No formkey set; can't securepost");f.formkey=l;return b.post(c,f,o,m)};b.secureData=function(){if(typeof arguments[0]=="object"){options=arguments[0];url=arguments[1];data=arguments[2];success=arguments[3];error=arguments[4]}else{url=arguments[0];data=arguments[1];success=arguments[2];error=arguments[3];options=arguments[4]||{}}var c=arguments.callee.formkey||Quora.formkey;if(!c)throw new Error("No formkey set; can't send data securely");
options.type=options.type||"POST";options.dataType=options.dataType||"json";options.url=url;var f=options.secureDataError;options.success=function(m){if(m.___ERROR___){var l=m.___ERROR___[0];m=m.___ERROR___[1];var p=new h("Got an error from the URL '"+url+"'",l,m);if(f)return f(l,m,p);else throw p;}else if(success)return success(m)};options.error=error;var o=options.data||data;options.data={formkey:c,data:JSON.stringify(o)};return b.ajax(options)};var h=function(c,f,o){this.message=o+": "+c+" <"+
JSON.stringify(f)+">"};h.prototype=new Error;h.prototype.constructor=h;b.secureData.SecureDataError=h})(jQuery);jQuery.cookie=function(b,h,c){if(typeof h!="undefined"){c=c||{};if(h===null){h="";c=$.extend({},c);c.expires=-1}var f="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){if(typeof c.expires=="number"){f=new Date;f.setTime(f.getTime()+c.expires*24*60*60*1E3)}else f=c.expires;f="; expires="+f.toUTCString()}var o=c.path?"; path="+c.path:"",m=c.domain?"; domain="+c.domain:"";c=c.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(h),f,o,m,c].join("")}else{h=null;if(document.cookie&&
document.cookie!=""){c=document.cookie.split(";");for(f=0;f<c.length;f++){o=jQuery.trim(c[f]);if(o.substring(0,b.length+1)==b+"="){h=decodeURIComponent(o.substring(b.length+1));break}}}return h}};(function(b){b.fn.dialog=function(f){return this.each(function(){new c(this,f)})};var h={id:"generic_dialog",title:"Title",contents:"",comment_form:"",mobile:null,buttons:{Ok:null,Cancel:null},class_:"",w:"w4"};b.dialog=function(f,o){var m=this;this.o=b(f);this.opts=b.extend({},h,o||{});this.mobile=this.opts.mobile!=null?this.opts.mobile:Q.mobile;if(b("#"+this.opts.id).length>0)b("#"+this.opts.id).show();else{if(this.opts.buttons!=null){if(this.opts.buttons.Ok===null)this.opts.buttons.Ok=function(){m.btnOk()};
if(this.opts.buttons.Cancel===null)this.opts.buttons.Cancel=function(){m.btnCancel()}}if(this.opts.url){var l=this.opts.id+"_loading";f=this.opts.contents||'<div style="overflow:hidden;"><span class="__wn2_loading"><span class="__wn2_loading_spinner"></span><span class="__wn2_loading_text">Loading...</span></span></div>';this.opts.contents='<div id="'+l+'"><div class="__wn2_loading_wrapper">'+f+"</div></div>";f=this.opts.urlData||{};f.___W2_scope="__dialog__";f.___W2_windowId=W2.windowId;b.get(this.opts.url,
f,function(p){var r=document.getElementById(l);W2.setContent(r,p)},"json")}if(this.mobile)this.opts.w="";this.render();return this}};var c=b.dialog;c.fn=c.prototype={dialog:"0.0.1"};c.fn.extend=c.extend=b.extend;c.fn.extend({btnOk:function(){this.close()},btnCancel:function(){this.close()},close:function(){b("#"+this.opts.id).remove()},hide:function(){b("#"+this.opts.id).hide()},render:function(){var f="";if(this.opts.title){f=b("<div/>").addClass("dialog_wrapper").append(b("<h2/>").addClass("dialog_frame").addClass("dialog_header").text(this.opts.title));
this.opts.contents&&f.append(b("<div/>").addClass("dialog_frame").addClass("dialog_contents").html(this.opts.contents));this.opts.comment_form!=""&&f.append(b("<div/>").addClass("dialog_frame").addClass("dialog_contents").append(this.renderCommentForm(this.opts.comment_form)))}else f=b("<div/>").addClass("dialog_component").html(this.opts.contents);this.o.append(b("<div/>").addClass("dialog").addClass(this.opts.w).addClass(this.opts.class_).attr("id",this.opts.id).append(f));this.opts.buttons!=null&&
b(".dialog_wrapper").append(b("<div/>").addClass("dialog_frame").addClass("dialog_buttons").append(b("<div/>").addClass("dialog_buttons_contents").html(this.renderButtons())));if(this.mobile){window.scrollTo(0,1);b(".dialog").css("top","0px");b(".dialog").css("left","0px")}else{f=150;var o=b(window).width()/2-b(".dialog").width()/2;b(".dialog").css("top",f+"px");b(".dialog").css("left",o+"px")}this.opts.comment_form!=""&&b("#dialog_comment").focus();var m=this;b(document).keydown(function(l){return m.keydown(l)});
return false},keydown:function(f){f=f||window.event;if(f.keyCode==27){this.close();b(document).unbind();return false}},renderCommentForm:function(f){if(!f||f=="")f="Add a Comment";return b("<div/>").append(b("<h3/>").text(f+":")).append(b("<textarea/>").attr("id","dialog_comment"))},renderButtons:function(){var f=this,o=b("<div/>");b.each(this.opts.buttons,function(m,l){btn_class=m=="Cancel"?"cancel":m=="Close"?"action_button":"submit_button";btn=b("<a/>").addClass("dialog_button").addClass(btn_class).attr("id",
m).html(m).click(l);btn=f.opts.buttons_hide_on_close?btn.click(function(){f.hide()}):btn.click(function(){f.close()});o.append(btn)});return o}})})(jQuery);(function(b){b.fn.tooltip=function(f){return this.each(function(){new c(this,f)})};var h={id:"tooltip",contents:"",delay:75,class_:"tooltip"};b.tooltip=function(f,o){if(!b("body").hasClass("mobile")){var m=this;this.o=b(f);this.opts=b.extend({},h,o||{});m=this;this.o.hover(function(){m.render()},function(){m.close()})}};var c=b.tooltip;c.fn=c.prototype={tooltip:"0.0.1"};c.fn.extend=c.extend=b.extend;c.fn.extend({to:null,btnOk:function(){this.close()},btnCancel:function(){this.close()},close:function(){clearTimeout(this.to);
this.to=null;this.o.removeClass("tooltip_parent");b("."+this.opts.class_).remove()},render:function(){this.set_tooltip();this.o.addClass("tooltip_parent");this.o.append(this.tt);this.tt.hide();var f=this.tt.height()+5;this.tt.css("top","-"+f+"px");var o=this;f=function(){o.tt.fadeIn(500)};this.to=setTimeout(f,this.opts.delay)},set_tooltip:function(){this.tt=b("<div/>").addClass("tooltip").append(b("<div/>").addClass("tooltip_contents").append(b("<span/>").text(this.opts.contents))).append(b("<div/>").addClass("tooltip_nub").html(""))}})})(jQuery);(function(b){b.fn.menu=function(o,m){return this.each(function(){new f(this,o,m)})};var h={id:"generic_menu",open:false,url:null,list_items:{},position_relative:false,position_adjust:null,align_right:false,close_on_click:true},c=null;b.menu=function(o,m,l){this.o=b(o);this.handle=m;this.opts=b.extend({},h,l||{});this.closeOldMenus();this.render();var p=this;b(document).click(function(){p.close()});this.opts.close_on_click&&b(".menu_list_item a").click(function(){p.close()});return false};var f=b.menu;
f.fn=f.prototype={menu:"0.0.1"};f.fn.extend=f.extend=b.extend;f.fn.extend({close:function(){this.o.addClass("hidden");this.handle.removeClass("menu_active")},render:function(){if(b("#"+this.opts.id).length>0)return false;this.handle.addClass("menu_active");if(this.opts.url)this.o.append(b("<div/>").addClass("menu").attr("id",this.opts.id).setContentFromAJAXComponent(this.opts.url,this.opts.pars));else{this.position();this.o.removeClass("hidden")}},position:function(){var o=null,m=this.handle.innerHeight();
o=this.opts.position_relative?this.handle.position():this.handle.offset();if(this.opts.position_adjust)m+=this.opts.position_adjust;var l=o.left;if(this.opts.align_right)l-=this.o.width()-this.handle.innerWidth();this.o.css("top",o.top+m+"px");this.o.css("left",l+"px")},closeOldMenus:function(){c&&c.close();c=this}})})(jQuery);jQuery.addTempTopic=function(b){this.id=b;this.topic_name=$("#"+b).val();$(".topic_placeholder").addClass("hidden");$(".topics_list").append($("<li/>").append($("<a/>").attr("href","#").attr("class","topic_name").text(this.topic_name)).append($("<a/>").attr("href","#").attr("class","topic_remove").text("").click(function(){$(this).parent().remove();return false})).attr("class","topic_list_item"));$("#"+b).val("");return false};(function(b){b.belowthefold=function(h,c){var f=b(window).height()+b(window).scrollTop();return f<=b(h).offset().top-c.threshold};b.abovethetop=function(h,c){var f=b(window).scrollTop();return f>=b(h).offset().top+b(h).height()-c.threshold};b.rightofscreen=function(h,c){var f=b(window).width()+b(window).scrollLeft();return f<=b(h).offset().left-c.threshold};b.leftofscreen=function(h,c){var f=b(window).scrollLeft();return f>=b(h).offset().left+b(h).width()-c.threshold};b.inviewport=function(h,c){return!b.rightofscreen(h,
c)&&!b.leftofscreen(h,c)&&!b.belowthefold(h,c)&&!b.abovethetop(h,c)};b.extend(b.expr[":"],{"below-the-fold":function(h){return b.belowthefold(h,{threshold:0})},"above-the-top":function(h){return b.abovethetop(h,{threshold:0})},"left-of-screen":function(h){return b.leftofscreen(h,{threshold:0})},"right-of-screen":function(h){return b.rightofscreen(h,{threshold:0})},"in-viewport":function(h){return b.inviewport(h,{threshold:0})}})})(jQuery);(function(b){document.domain=document.domain;b.fn.mouseEvent=function(f,o){if(!/^(click|mouse(down|up|over|out))$/.test(f))throw"unknown mouseEvent type: "+f;window.netscape&&netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");o=o||{};var m=o.window||window,l=m.document;l=l.createEvent("MouseEvents");l.initMouseEvent(f,true,true,m,o.detail||/^(click|mouse(down|up))$/.test(f)?1:0,o.screenX||0,o.screenY||0,o.clientX||0,o.clientY||0,!!o.ctrlKey,!!o.altKey,!!o.shiftKey,!!o.metaKey,
o.button||0,o.relatedTarget||null);for(f=0;f<this.length;++f)this[f].dispatchEvent(l);return this};b.fn.typeChars=function(f,o,m,l){function p(O,M,e,ia){var la=document.createEvent("KeyboardEvent");(la.initKeyEvent||la.initKeyboardEvent).call(la,M,true,true,window,o,m,ia,l,e.key,e.ch);return O.dispatchEvent(la)}function r(O){if(typeof O!="string")return false;var M=O.toUpperCase(),e=O.toLowerCase();return e!=M&&O==M}function u(O,M){if(!(O.nodeName.toLowerCase()!="input"||o||m||l))O.value=O.value.slice(0,
O.selectionStart)+M+O.value.slice(O.selectionEnd)}function E(O){if(typeof O=="string")return{key:0,ch:O.charCodeAt(0)};if(typeof O=="number")return{key:O,ch:0};throw"unknown key: "+O;}function F(O,M){var e=M.value,ia=r(O),la=E(O);if(p(M,"keydown",la,ia)){p(M,"keypress",la,ia)&&typeof e=="string"&&M.value==e&&u(M,O);p(M,"keyup",la,ia)}}window.netscape&&netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");for(var V=0;V<f.length;++V)for(var aa=0;aa<this.length;++aa)F(f.charAt(V),
this[aa]);return this};b.fn.component=function(){var f=[],o={};this.each(function(){for(var m=this;!m.hasAttribute("__debug_w2cid");)if(!(m=m.parentNode))return null;m=m.getAttribute("__debug_w2cid");if(!(m in o)){o[m]=true;f.push(W2._components[m])}});return f[0]||null};try{var h=opener&&opener.Quora.onChildLoad}catch(c){}if(h){b(document).ready(function(f){setTimeout(function(){h===opener.Quora.onChildLoad&&h.call(window,f)},10)});b("<iframe>").css("display","none").attr("src","/internal/gadget/index").appendTo("body")}})(jQuery);function fnbind(b,h){var c;args=[];for(c=2;c<arguments.length;c++)args.push(arguments[c]);c=function(){var f,o,m;f=b?b:this==window?null:this;o=args.slice();for(m=0;m<arguments.length;m++)o.push(arguments[m]);m=function(l){return function(){var p,r;switch(arguments.length){case 0:return l();case 1:return l(arguments[0]);case 2:return l(arguments[0],arguments[1]);case 3:return l(arguments[0],arguments[1],arguments[2])}p=[];for(r=0;r<arguments.length;r++)p.push("arguments["+r+"]");return eval("(func("+
p.join(",")+"))")}};if(typeof h=="function"&&typeof h.apply=="undefined")h=m(h);return h.apply(f,o)};c.name=h.name;c.toString=function(){return"["+h+" bound with "+b+" and with args "+args+" partially applied]"};return c};(function(){var b=false,h=/xyz/.test(function(){})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(c){function f(){this.fnbind=function(p){return fnbind(this,p)};!b&&this.__init__&&this.__init__.apply(this,arguments)}var o=this.prototype;b=true;var m=new this;b=false;for(var l in c)m[l]=typeof c[l]=="function"&&typeof o[l]=="function"&&h.test(c[l])?function(p,r){return function(){var u=this._super;this._super=o[p];var E=r.apply(this,arguments);this._super=u;return E}}(l,c[l]):c[l];
f.prototype=m;f.constructor=f;f.extend=arguments.callee;return f}})();webnode2=function(b){function h(v){var B,J;for(B in v)if(v.hasOwnProperty(B)){J=v[B];b._parents[B]=J;if(typeof b._allChildren[J]=="undefined")b._allChildren[J]=[];b._allChildren[J].push(B);if(typeof b._children[B]=="undefined")b._children[B]={};if(typeof b._knowsAbout[B]=="undefined")b._knowsAbout[B]={}}}function c(v){var B,J,N,ca,Y;for(N in v)if(v.hasOwnProperty(N)){B=v[N];Y=B.length;for(ca=0;ca<Y;ca++){J=B[ca];b._groups[N]||(b._groups[N]=[]);b._groups[N].push(J)}}}function f(v){var B;for(B in v)v.hasOwnProperty(B)&&
jQuery.extend(b._children[B],v[B])}function o(v){var B;for(B in v)v.hasOwnProperty(B)&&jQuery.extend(b._knowsAbout[B],v[B])}function m(v){var B;for(B in v)if(v.hasOwnProperty(B))b._domids[B]=v[B]}function l(v){var B;for(B in v)if(v.hasOwnProperty(B))b._debugInfo[B]=v[B]}function p(v){var B=v.parents,J=v.children,N=v.knowsAbout,ca=v.groups,Y=v.debugInfo;i=v.domids;b.addParents(B);b.addChildren(J);b.addLookups(N);b.addGroups(ca);b.addDomids(i);Y&&b.addDebugInfo(Y);$(document).trigger("w2addcomponents",
v);$(document).trigger("webnode_add_component_metadata",v)}function r(v,B){var J,N,ca,Y,R;for(J=0;J<B.length;J++){N=B[J];ca=b._parents[N];if(Y=b._allChildren[ca])for(R=0;R<Y.length;R++)if(Y[R]==N){Y.splice(R,1);break}if(Y=b._components[N])(Y=Y.cname)&&b._children[ca]&&delete b._children[ca][Y];delete b._parents[N];delete b._allChildren[N];delete b._children[N];delete b._knowsAbout[N];delete b._domids[N];delete b._debugInfo[N]}$(document).trigger("webnode_remove_component_metadata",v);return B}function u(v){var B=
[],J=b._allChildren[v],N;if(J)for(N=0;N<J.length;N++)B=B.concat(u(J[N]));B.push(v);return B}function E(v){return b._domids[v]}function F(v){return b._domids[v]?b._domids[v]:b._parents[v]?F(b._parents[v]):""}function V(v){var B,J;for(B=0;B<v.length;B++){J=v[B];b._components[J.cid]=J}return v}function aa(v,B){var J;args=[];for(J=2;J<arguments.length;J++)args.push(arguments[J]);J=function(){var N,ca,Y;N=v?v:this==window?null:this;ca=args.slice();for(Y=0;Y<arguments.length;Y++)ca.push(arguments[Y]);Y=
function(R){return function(){var qa,wa;switch(arguments.length){case 0:return R();case 1:return R(arguments[0]);case 2:return R(arguments[0],arguments[1]);case 3:return R(arguments[0],arguments[1],arguments[2])}qa=[];for(wa=0;wa<arguments.length;wa++)qa.push("arguments["+wa+"]");return eval("(func("+qa.join(",")+"))")}};if(typeof B=="function"&&typeof B.apply=="undefined")B=Y(B);return B.apply(N,ca)};J.name=B.name;J.toString=function(){return"["+B+" bound with "+v+" and with args "+args+" partially applied]"};
return J}function O(v,B){var J;for(J=0;J<v.length;J++)v[J].onLoad(B);B&&jQuery.isFunction(window._w2replay)&&window._w2replay(jQuery);return v}function M(v,B){var J;if(v&&v!="*ROOT*"){J=b._knowsAbout[v][B];return typeof J!="undefined"?ia(v,J):M(b._parents[v],B)}else return null}function e(v){var B;if(v)return(B=b._components[v])?B:new I(v);else return null}function ia(v,B){var J,N,ca,Y,R;if(B==".")return v;J=[];N="";ca="first";for(Y=0;Y<B.length;Y++){R=B.charAt(Y);if(R=="."){J.push([ca,N]);N="";ca=
"child"}else if(R==":"){J.push([ca,N]);N="";ca="lookup"}else if(R=="<"){J.push([ca,N]);N="";ca="parent"}else N+=R}J.push([ca,N]);N=v;for(Y=0;Y<J.length;Y++){R=J[Y];ca=R[0];R=R[1];if(ca=="first"){if(R){N=b._children[N];if(!N)return null;N=N[R];if(!N)throw new W2Error("Couldn't find child '"+R+"' in cQuery '"+B+"'",v);}if(!N)throw new W2Error("Started from an invalid node '"+N+"' in cQuery '"+B+"'",v);}else if(ca=="child"){N=b._children[N];if(!N)return null;N=N[R];if(!N)throw new W2Error("Couldn't find child '"+
R+"' in cQuery '"+B+"'",v);}else if(ca=="lookup"){N=M(N,R);if(!N)throw new W2Error("Lookup failed for '"+R+"' in cQuery '"+B+"'",v);}else if(ca=="parent"){N=b._parents[N];if(!N||N=="*ROOT*")throw new W2Error("No parent found in cQuery '"+B+"'",v);}else throw new W2Error("Bad token in Component query. '"+ca+"'",v);if(!N)throw new W2Error("Unknown Error in cQuery: '"+B+"'",v);}return N}var la,I,pa,ja,P;b._parents={};b._components={};b._children={};b._knowsAbout={};b._allChildren={};b._domids={};b._debugInfo=
{};b._groups={};b._GROUP_RE=/%([0-9a-zA-Z_]+)/;la=Class.extend({__init__:function(v,B,J,N){this.cid=v;this.cname=B;this.__vcon=N?N.split(":"):null;this.__js_init=J;this.init(J);return this},init:function(v){var B;if(typeof v=="object")for(B in v)if(v.hasOwnProperty(B))this[B]=v[B];return this},fnbind:function(v){return aa(this,v)},child:function(v){v=b._children[this.cid][v];return e(v)},children:function(){var v=b._allChildren[this.cid],B=[],J;for(J=0;J<v.length;J++)B.push(e(v[J]));return B},parent:function(){var v;
v=b._parents[this.cid];return e(v)},lookup:function(v){v=M(this.cid,v);return e(v)},cQuery:function(v){v=ia(this.cid,v);return e(v)},c:function(v){console&&console.warn&&console.warn("Using deprecated component.c() method");return this.cQuery(v)},$:function(v){var B,J;B=this._my();if(typeof v=="string"){v=v.replace(/@/g,B);if(v.indexOf("%")!=-1)for(;B=b._GROUP_RE.exec(v);){J=b._groups[B[1]];if(typeof J=="undefined")return $([]);v=v.replace(B[0],"#"+J.join(",#"))}}return $(v)},_my:function(){return"__w2_"+
this.cid+"_"},__children:function(){return b._children[this.cid]},__allChildren:function(){return b._allChildren[this.cid]},__parent:function(){return b._parents[this.cid]},__knowsAbout:function(){return b._knowsAbout[this.cid]},ge:function(v){return document.getElementById(v.replace("@",this._my()))},onLoad:function(){},onUnload:function(){},onInsertNode:function(){return true},onDeleteNode:function(){return true},onUpdate:function(){return true},controller:function(v){if(this.__vcon)return new b._Controller(this.__vcon,
v);else throw new W2Error("No vcon info for Component <cid="+this.cid+">");},serverCall:function(v){if(this.__vcon)switch(this.__vcon[0]){case "cls":return new b._ServerCall(this.__vcon,v,this);case "live":return new b._ServerCall(this.__vcon.slice(2),v,this);default:throw new W2Error("Unknown vcon type '"+this.__vcon[0]+"'");}else throw new W2Error("No vcon info for Component <cid="+this.cid+">");}});I=la.extend({__init__:function(v){this._super(v,null,{},null);this.isVirtual=true}});W2Error=function(v,
B){this.message=this.errorType+": "+v;if(B)this.message+=" <cid="+B+">"};W2Error.prototype=new Error;W2Error.prototype.errorType="W2Error";W2Error.prototype.contstructor=W2Error;pa=function(v,B){ja(v,B);P(v,B);return v};ja=function(v,B){v.innerHTML=B.html;return v};P=function(v,B){eval(B.js);return v};var ha=function(v){var B=u(v);for(i=0;i<B.length;i++){var J=b._components[B[i]];J&&J.onUnload()}r(v,B)};b.addParents=h;b.addChildren=f;b.addLookups=o;b.addDebugInfo=l;b.addGroups=c;b.addDomids=m;b.registerComponents=
V;b.getLiveDomId=E;b.getLiveParent=F;b.Component=la;b.VirtualComponent=I;b.onLoad=O;b.addComponentMetadata=p;b._safeGetComponentByCID=e;b.W2Error=W2Error;b.fnbind=aa;b.setContent=pa;b.setContentHTML=ja;b.setContentJS=P;b._getDescendants=u;b._removeComponentMetadata=r;b.unloadComponent=ha;b.C=b._components;return b}({});if(typeof W2=="undefined")W2=webnode2;__W2_ExampleJSComponent=W2.Component.extend({init:function(b){this.dataFromPython=b},onLoad:function(){a1ert("Hello webnode2!")}});(function(b){var h=["async","beforeSend","cache","complete","contentType","data","dataFilter","dataType","error","global","ifModified","jsonp","password","processData","scriptCharset","success","timeout","type","url","username","xhr"],c={};b.each(h,function(f,o){c[o]=function(m){this.__options[o]=m;return this};c["_"+o]=function(){return this.__options[o]}});c._options=function(){var f={},o=this;b.each(h,function(m,l){f[l]=o["_"+l]()});return f};c.options=function(f){if(f){var o=this;b.each(f,function(m,
l){o[m](l)})}return this};c.__init__=function(f){this.__options={data:null};window.THIS_=this;this.options(f);return this};c.send=function(f){this.options(f);return b.ajax(this._options())};b.Ajax=Class.extend(c)})(jQuery);var swfobject=function(){function b(){if(!Ba){try{var w=R.getElementsByTagName("body")[0].appendChild(e("span"));w.parentNode.removeChild(w)}catch(z){return}Ba=true;w=za.length;for(var L=0;L<w;L++)za[L]()}}function h(w){if(Ba)w();else za[za.length]=w}function c(w){if(typeof Y.addEventListener!=P)Y.addEventListener("load",w,false);else if(typeof R.addEventListener!=P)R.addEventListener("load",w,false);else if(typeof Y.attachEvent!=P)ia(Y,"onload",w);else if(typeof Y.onload=="function"){var z=Y.onload;
Y.onload=function(){z();w()}}else Y.onload=w}function f(){wa?o():m()}function o(){var w=R.getElementsByTagName("body")[0],z=e(ha);z.setAttribute("type",J);var L=w.appendChild(z);if(L){var S=0;(function(){if(typeof L.GetVariable!=P){var U=L.GetVariable("$version");if(U){U=U.split(" ")[1].split(",");T.pv=[parseInt(U[0],10),parseInt(U[1],10),parseInt(U[2],10)]}}else if(S<10){S++;setTimeout(arguments.callee,10);return}w.removeChild(z);L=null;m()})()}else m()}function m(){var w=xa.length;if(w>0)for(var z=
0;z<w;z++){var L=xa[z].id,S=xa[z].callbackFn,U={success:false,id:L};if(T.pv[0]>0){var da=M(L);if(da)if(la(xa[z].swfVersion)&&!(T.wk&&T.wk<312)){pa(L,true);if(S){U.success=true;U.ref=l(L);S(U)}}else if(xa[z].expressInstall&&p()){U={};U.data=xa[z].expressInstall;U.width=da.getAttribute("width")||"0";U.height=da.getAttribute("height")||"0";if(da.getAttribute("class"))U.styleclass=da.getAttribute("class");if(da.getAttribute("align"))U.align=da.getAttribute("align");var ea={};da=da.getElementsByTagName("param");
for(var ma=da.length,oa=0;oa<ma;oa++)if(da[oa].getAttribute("name").toLowerCase()!="movie")ea[da[oa].getAttribute("name")]=da[oa].getAttribute("value");r(U,ea,L,S)}else{u(da);S&&S(U)}}else{pa(L,true);if(S){if((L=l(L))&&typeof L.SetVariable!=P){U.success=true;U.ref=L}S(U)}}}}function l(w){var z=null;if((w=M(w))&&w.nodeName=="OBJECT")if(typeof w.SetVariable!=P)z=w;else if(w=w.getElementsByTagName(ha)[0])z=w;return z}function p(){return!La&&la("6.0.65")&&(T.win||T.mac)&&!(T.wk&&T.wk<312)}function r(w,
z,L,S){La=true;Ia=S||null;Sa={success:false,id:L};var U=M(L);if(U){if(U.nodeName=="OBJECT"){Ea=E(U);Ha=null}else{Ea=U;Ha=L}w.id=N;if(typeof w.width==P||!/%$/.test(w.width)&&parseInt(w.width,10)<310)w.width="310";if(typeof w.height==P||!/%$/.test(w.height)&&parseInt(w.height,10)<137)w.height="137";R.title=R.title.slice(0,47)+" - Flash Player Installation";S=T.ie&&T.win?"ActiveX":"PlugIn";S="MMredirectURL="+Y.location.toString().replace(/&/g,"%26")+"&MMplayerType="+S+"&MMdoctitle="+R.title;if(typeof z.flashvars!=
P)z.flashvars+="&"+S;else z.flashvars=S;if(T.ie&&T.win&&U.readyState!=4){S=e("div");L+="SWFObjectNew";S.setAttribute("id",L);U.parentNode.insertBefore(S,U);U.style.display="none";(function(){U.readyState==4?U.parentNode.removeChild(U):setTimeout(arguments.callee,10)})()}F(w,z,L)}}function u(w){if(T.ie&&T.win&&w.readyState!=4){var z=e("div");w.parentNode.insertBefore(z,w);z.parentNode.replaceChild(E(w),z);w.style.display="none";(function(){w.readyState==4?w.parentNode.removeChild(w):setTimeout(arguments.callee,
10)})()}else w.parentNode.replaceChild(E(w),w)}function E(w){var z=e("div");if(T.win&&T.ie)z.innerHTML=w.innerHTML;else if(w=w.getElementsByTagName(ha)[0])if(w=w.childNodes)for(var L=w.length,S=0;S<L;S++)!(w[S].nodeType==1&&w[S].nodeName=="PARAM")&&w[S].nodeType!=8&&z.appendChild(w[S].cloneNode(true));return z}function F(w,z,L){var S,U=M(L);if(T.wk&&T.wk<312)return S;if(U){if(typeof w.id==P)w.id=L;if(T.ie&&T.win){var da="";for(var ea in w)if(w[ea]!=Object.prototype[ea])if(ea.toLowerCase()=="data")z.movie=
w[ea];else if(ea.toLowerCase()=="styleclass")da+=' class="'+w[ea]+'"';else if(ea.toLowerCase()!="classid")da+=" "+ea+'="'+w[ea]+'"';ea="";for(var ma in z)if(z[ma]!=Object.prototype[ma])ea+='<param name="'+ma+'" value="'+z[ma]+'" />';U.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+da+">"+ea+"</object>";ra[ra.length]=w.id;S=M(w.id)}else{ma=e(ha);ma.setAttribute("type",J);for(da in w)if(w[da]!=Object.prototype[da])if(da.toLowerCase()=="styleclass")ma.setAttribute("class",w[da]);
else da.toLowerCase()!="classid"&&ma.setAttribute(da,w[da]);for(var oa in z)z[oa]!=Object.prototype[oa]&&oa.toLowerCase()!="movie"&&V(ma,oa,z[oa]);U.parentNode.replaceChild(ma,U);S=ma}}return S}function V(w,z,L){var S=e("param");S.setAttribute("name",z);S.setAttribute("value",L);w.appendChild(S)}function aa(w){var z=M(w);if(z&&z.nodeName=="OBJECT")if(T.ie&&T.win){z.style.display="none";(function(){z.readyState==4?O(w):setTimeout(arguments.callee,10)})()}else z.parentNode.removeChild(z)}function O(w){if(w=
M(w)){for(var z in w)if(typeof w[z]=="function")w[z]=null;w.parentNode.removeChild(w)}}function M(w){var z=null;try{z=R.getElementById(w)}catch(L){}return z}function e(w){return R.createElement(w)}function ia(w,z,L){w.attachEvent(z,L);Da[Da.length]=[w,z,L]}function la(w){var z=T.pv;w=w.split(".");w[0]=parseInt(w[0],10);w[1]=parseInt(w[1],10)||0;w[2]=parseInt(w[2],10)||0;return z[0]>w[0]||z[0]==w[0]&&z[1]>w[1]||z[0]==w[0]&&z[1]==w[1]&&z[2]>=w[2]?true:false}function I(w,z,L,S){if(!(T.ie&&T.mac)){var U=
R.getElementsByTagName("head")[0];if(U){L=L&&typeof L=="string"?L:"screen";if(S)Pa=ya=null;if(!ya||Pa!=L){S=e("style");S.setAttribute("type","text/css");S.setAttribute("media",L);ya=U.appendChild(S);if(T.ie&&T.win&&typeof R.styleSheets!=P&&R.styleSheets.length>0)ya=R.styleSheets[R.styleSheets.length-1];Pa=L}if(T.ie&&T.win)ya&&typeof ya.addRule==ha&&ya.addRule(w,z);else ya&&typeof R.createTextNode!=P&&ya.appendChild(R.createTextNode(w+" {"+z+"}"))}}}function pa(w,z){if(Qa){z=z?"visible":"hidden";if(Ba&&
M(w))M(w).style.visibility=z;else I("#"+w,"visibility:"+z)}}function ja(w){var z=/[\\\"<>\.;]/;return(z=z.exec(w)!=null)&&typeof encodeURIComponent!=P?encodeURIComponent(w):w}var P="undefined",ha="object",v="Shockwave Flash",B="ShockwaveFlash.ShockwaveFlash",J="application/x-shockwave-flash",N="SWFObjectExprInst",ca="onreadystatechange",Y=window,R=document,qa=navigator,wa=false,za=[f],xa=[],ra=[],Da=[],Ea,Ha,Ia,Sa,Ba=false,La=false,ya,Pa,Qa=true,T=function(){var w=typeof R.getElementById!=P&&typeof R.getElementsByTagName!=
P&&typeof R.createElement!=P,z=qa.userAgent.toLowerCase(),L=qa.platform.toLowerCase(),S=L?/win/.test(L):/win/.test(z);L=L?/mac/.test(L):/mac/.test(z);z=/webkit/.test(z)?parseFloat(z.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var U=!+"\u000b1",da=[0,0,0],ea=null;if(typeof qa.plugins!=P&&typeof qa.plugins[v]==ha){if((ea=qa.plugins[v].description)&&!(typeof qa.mimeTypes!=P&&qa.mimeTypes[J]&&!qa.mimeTypes[J].enabledPlugin)){wa=true;U=false;ea=ea.replace(/^.*\s+(\S+\s+\S+$)/,"$1");da[0]=parseInt(ea.replace(/^(.*)\..*$/,
"$1"),10);da[1]=parseInt(ea.replace(/^.*\.(.*)\s.*$/,"$1"),10);da[2]=/[a-zA-Z]/.test(ea)?parseInt(ea.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof Y.ActiveXObject!=P)try{var ma=new ActiveXObject(B);if(ma)if(ea=ma.GetVariable("$version")){U=true;ea=ea.split(" ")[1].split(",");da=[parseInt(ea[0],10),parseInt(ea[1],10),parseInt(ea[2],10)]}}catch(oa){}return{w3:w,pv:da,wk:z,ie:U,win:S,mac:L}}();(function(){if(T.w3){if(typeof R.readyState!=P&&R.readyState=="complete"||typeof R.readyState==P&&
(R.getElementsByTagName("body")[0]||R.body))b();if(!Ba){typeof R.addEventListener!=P&&R.addEventListener("DOMContentLoaded",b,false);if(T.ie&&T.win){R.attachEvent(ca,function(){if(R.readyState=="complete"){R.detachEvent(ca,arguments.callee);b()}});Y==top&&function(){if(!Ba){try{R.documentElement.doScroll("left")}catch(w){setTimeout(arguments.callee,0);return}b()}}()}T.wk&&function(){Ba||(/loaded|complete/.test(R.readyState)?b():setTimeout(arguments.callee,0))}();c(b)}}})();(function(){T.ie&&T.win&&
window.attachEvent("onunload",function(){for(var w=Da.length,z=0;z<w;z++)Da[z][0].detachEvent(Da[z][1],Da[z][2]);w=ra.length;for(z=0;z<w;z++)aa(ra[z]);for(var L in T)T[L]=null;T=null;for(var S in swfobject)swfobject[S]=null;swfobject=null})})();return{registerObject:function(w,z,L,S){if(T.w3&&w&&z){var U={};U.id=w;U.swfVersion=z;U.expressInstall=L;U.callbackFn=S;xa[xa.length]=U;pa(w,false)}else S&&S({success:false,id:w})},getObjectById:function(w){if(T.w3)return l(w)},embedSWF:function(w,z,L,S,U,
da,ea,ma,oa,Ja){var Na={success:false,id:z};if(T.w3&&!(T.wk&&T.wk<312)&&w&&z&&L&&S&&U){pa(z,false);h(function(){L+="";S+="";var Aa={};if(oa&&typeof oa===ha)for(var va in oa)Aa[va]=oa[va];Aa.data=w;Aa.width=L;Aa.height=S;va={};if(ma&&typeof ma===ha)for(var Ka in ma)va[Ka]=ma[Ka];if(ea&&typeof ea===ha)for(var Ca in ea)if(typeof va.flashvars!=P)va.flashvars+="&"+Ca+"="+ea[Ca];else va.flashvars=Ca+"="+ea[Ca];if(la(U)){Ka=F(Aa,va,z);Aa.id==z&&pa(z,true);Na.success=true;Na.ref=Ka}else if(da&&p()){Aa.data=
da;r(Aa,va,z,Ja);return}else pa(z,true);Ja&&Ja(Na)})}else Ja&&Ja(Na)},switchOffAutoHideShow:function(){Qa=false},ua:T,getFlashPlayerVersion:function(){return{major:T.pv[0],minor:T.pv[1],release:T.pv[2]}},hasFlashPlayerVersion:la,createSWF:function(w,z,L){if(T.w3)return F(w,z,L)},showExpressInstall:function(w,z,L,S){T.w3&&p()&&r(w,z,L,S)},removeSWF:function(w){T.w3&&aa(w)},createCSS:function(w,z,L,S){T.w3&&I(w,z,L,S)},addDomLoadEvent:h,addLoadEvent:c,getQueryParamValue:function(w){var z=R.location.search||
R.location.hash;if(z){if(/\?/.test(z))z=z.split("?")[1];if(w==null)return ja(z);z=z.split("&");for(var L=0;L<z.length;L++)if(z[L].substring(0,z[L].indexOf("="))==w)return ja(z[L].substring(z[L].indexOf("=")+1))}return""},expressInstallCallback:function(){if(La){var w=M(N);if(w&&Ea){w.parentNode.replaceChild(Ea,w);if(Ha){pa(Ha,true);if(T.ie&&T.win)Ea.style.display="block"}Ia&&Ia(Sa)}La=false}}}}();jQuery.effects||function(b){function h(m,l){var p=m[1]&&m[1].constructor==Object?m[1]:{};if(l)p.mode=l;l=m[1]&&m[1].constructor!=Object?m[1]:p.duration?p.duration:m[2];l=b.fx.off?0:typeof l==="number"?l:b.fx.speeds[l]||b.fx.speeds._default;var r=p.callback||b.isFunction(m[1])&&m[1]||b.isFunction(m[2])&&m[2]||b.isFunction(m[3])&&m[3];return[m[0],p,l,r]}function c(m){var l;if(m&&m.constructor==Array&&m.length==3)return m;if(l=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(m))return[parseInt(l[1],
10),parseInt(l[2],10),parseInt(l[3],10)];if(l=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(m))return[parseFloat(l[1])*2.55,parseFloat(l[2])*2.55,parseFloat(l[3])*2.55];if(l=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(m))return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)];if(l=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(m))return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(m))return o.transparent;
return o[b.trim(m).toLowerCase()]}function f(m,l){var p;do{p=b.curCSS(m,l);if(p!=""&&p!="transparent"||b.nodeName(m,"body"))break;l="backgroundColor"}while(m=m.parentNode);return c(p)}b.effects={version:"1.7.2",save:function(m,l){for(var p=0;p<l.length;p++)l[p]!==null&&m.data("ec.storage."+l[p],m[0].style[l[p]])},restore:function(m,l){for(var p=0;p<l.length;p++)l[p]!==null&&m.css(l[p],m.data("ec.storage."+l[p]))},setMode:function(m,l){if(l=="toggle")l=m.is(":hidden")?"show":"hide";return l},getBaseline:function(m,
l){var p;switch(m[0]){case "top":p=0;break;case "middle":p=0.5;break;case "bottom":p=1;break;default:p=m[0]/l.height}switch(m[1]){case "left":m=0;break;case "center":m=0.5;break;case "right":m=1;break;default:m=m[1]/l.width}return{x:m,y:p}},createWrapper:function(m){if(m.parent().is(".ui-effects-wrapper"))return m.parent();var l={width:m.outerWidth(true),height:m.outerHeight(true),"float":m.css("float")};m.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');
var p=m.parent();if(m.css("position")=="static"){p.css({position:"relative"});m.css({position:"relative"})}else{var r=m.css("top");if(isNaN(parseInt(r,10)))r="auto";var u=m.css("left");if(isNaN(parseInt(u,10)))u="auto";p.css({position:m.css("position"),top:r,left:u,zIndex:m.css("z-index")}).show();m.css({position:"relative",top:0,left:0})}p.css(l);return p},removeWrapper:function(m){if(m.parent().is(".ui-effects-wrapper"))return m.parent().replaceWith(m);return m},setTransition:function(m,l,p,r){r=
r||{};b.each(l,function(u,E){unit=m.cssUnit(E);if(unit[0]>0)r[E]=unit[0]*p+unit[1]});return r},animateClass:function(m,l,p,r){var u=typeof p=="function"?p:r?r:null,E=typeof p=="string"?p:null;return this.each(function(){var F={},V=b(this),aa=V.attr("style")||"";if(typeof aa=="object")aa=aa.cssText;if(m.toggle)V.hasClass(m.toggle)?(m.remove=m.toggle):(m.add=m.toggle);var O=b.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);m.add&&V.addClass(m.add);
m.remove&&V.removeClass(m.remove);var M=b.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);m.add&&V.removeClass(m.add);m.remove&&V.addClass(m.remove);for(var e in M)if(typeof M[e]!="function"&&M[e]&&e.indexOf("Moz")==-1&&e.indexOf("length")==-1&&M[e]!=O[e]&&(e.match(/color/i)||!e.match(/color/i)&&!isNaN(parseInt(M[e],10)))&&(O.position!="static"||O.position=="static"&&!e.match(/left|top|bottom|right/)))F[e]=M[e];V.animate(F,l,E,function(){if(typeof b(this).attr("style")==
"object"){b(this).attr("style").cssText="";b(this).attr("style").cssText=aa}else b(this).attr("style",aa);m.add&&b(this).addClass(m.add);m.remove&&b(this).removeClass(m.remove);u&&u.apply(this,arguments)})})}};b.fn.extend({_show:b.fn.show,_hide:b.fn.hide,__toggle:b.fn.toggle,_addClass:b.fn.addClass,_removeClass:b.fn.removeClass,_toggleClass:b.fn.toggleClass,effect:function(m,l,p,r){return b.effects[m]?b.effects[m].call(this,{method:m,options:l||{},duration:p,callback:r}):null},show:function(){return!arguments[0]||
arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._show.apply(this,arguments):this.effect.apply(this,h(arguments,"show"))},hide:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._hide.apply(this,arguments):this.effect.apply(this,h(arguments,"hide"))},toggle:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])||b.isFunction(arguments[0])||typeof arguments[0]==
"boolean"?this.__toggle.apply(this,arguments):this.effect.apply(this,h(arguments,"toggle"))},addClass:function(m,l,p,r){return l?b.effects.animateClass.apply(this,[{add:m},l,p,r]):this._addClass(m)},removeClass:function(m,l,p,r){return l?b.effects.animateClass.apply(this,[{remove:m},l,p,r]):this._removeClass(m)},toggleClass:function(m,l,p,r){return typeof l!=="boolean"&&l?b.effects.animateClass.apply(this,[{toggle:m},l,p,r]):this._toggleClass(m,l)},morph:function(m,l,p,r,u){return b.effects.animateClass.apply(this,
[{add:l,remove:m},p,r,u])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(m){var l=this.css(m),p=[];b.each(["em","px","%","pt"],function(r,u){if(l.indexOf(u)>0)p=[parseFloat(l),u]});return p}});b.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(m,l){b.fx.step[l]=function(p){p.end=[255,255,255];if(p.state==0){p.start=f(p.elem,l);p.end=c(p.end)}p.elem.style[l]="rgb("+[Math.max(Math.min(parseInt(p.pos*
(p.end[0]-p.start[0])+p.start[0],10),255),0),Math.max(Math.min(parseInt(p.pos*(p.end[1]-p.start[1])+p.start[1],10),255),0),Math.max(Math.min(parseInt(p.pos*(p.end[2]-p.start[2])+p.start[2],10),255),0)].join(",")+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,
47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,
0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};b.easing.jswing=b.easing.swing;b.extend(b.easing,{def:"easeOutQuad",swing:function(m,l,p,r,u){return b.easing[b.easing.def](m,l,p,r,u)},easeInQuad:function(m,l,p,r,u){return r*(l/=u)*l+p},easeOutQuad:function(m,l,p,r,u){return-r*(l/=u)*(l-2)+p},easeInOutQuad:function(m,l,p,r,u){if((l/=u/2)<1)return r/2*l*l+p;return-r/2*(--l*(l-2)-1)+p},easeInCubic:function(m,l,p,r,u){return r*(l/=u)*l*l+p},
easeOutCubic:function(m,l,p,r,u){return r*((l=l/u-1)*l*l+1)+p},easeInOutCubic:function(m,l,p,r,u){if((l/=u/2)<1)return r/2*l*l*l+p;return r/2*((l-=2)*l*l+2)+p},easeInQuart:function(m,l,p,r,u){return r*(l/=u)*l*l*l+p},easeOutQuart:function(m,l,p,r,u){return-r*((l=l/u-1)*l*l*l-1)+p},easeInOutQuart:function(m,l,p,r,u){if((l/=u/2)<1)return r/2*l*l*l*l+p;return-r/2*((l-=2)*l*l*l-2)+p},easeInQuint:function(m,l,p,r,u){return r*(l/=u)*l*l*l*l+p},easeOutQuint:function(m,l,p,r,u){return r*((l=l/u-1)*l*l*l*
l+1)+p},easeInOutQuint:function(m,l,p,r,u){if((l/=u/2)<1)return r/2*l*l*l*l*l+p;return r/2*((l-=2)*l*l*l*l+2)+p},easeInSine:function(m,l,p,r,u){return-r*Math.cos(l/u*(Math.PI/2))+r+p},easeOutSine:function(m,l,p,r,u){return r*Math.sin(l/u*(Math.PI/2))+p},easeInOutSine:function(m,l,p,r,u){return-r/2*(Math.cos(Math.PI*l/u)-1)+p},easeInExpo:function(m,l,p,r,u){return l==0?p:r*Math.pow(2,10*(l/u-1))+p},easeOutExpo:function(m,l,p,r,u){return l==u?p+r:r*(-Math.pow(2,-10*l/u)+1)+p},easeInOutExpo:function(m,
l,p,r,u){if(l==0)return p;if(l==u)return p+r;if((l/=u/2)<1)return r/2*Math.pow(2,10*(l-1))+p;return r/2*(-Math.pow(2,-10*--l)+2)+p},easeInCirc:function(m,l,p,r,u){return-r*(Math.sqrt(1-(l/=u)*l)-1)+p},easeOutCirc:function(m,l,p,r,u){return r*Math.sqrt(1-(l=l/u-1)*l)+p},easeInOutCirc:function(m,l,p,r,u){if((l/=u/2)<1)return-r/2*(Math.sqrt(1-l*l)-1)+p;return r/2*(Math.sqrt(1-(l-=2)*l)+1)+p},easeInElastic:function(m,l,p,r,u){m=1.70158;var E=0,F=r;if(l==0)return p;if((l/=u)==1)return p+r;E||(E=u*0.3);
if(F<Math.abs(r)){F=r;m=E/4}else m=E/(2*Math.PI)*Math.asin(r/F);return-(F*Math.pow(2,10*(l-=1))*Math.sin((l*u-m)*2*Math.PI/E))+p},easeOutElastic:function(m,l,p,r,u){m=1.70158;var E=0,F=r;if(l==0)return p;if((l/=u)==1)return p+r;E||(E=u*0.3);if(F<Math.abs(r)){F=r;m=E/4}else m=E/(2*Math.PI)*Math.asin(r/F);return F*Math.pow(2,-10*l)*Math.sin((l*u-m)*2*Math.PI/E)+r+p},easeInOutElastic:function(m,l,p,r,u){m=1.70158;var E=0,F=r;if(l==0)return p;if((l/=u/2)==2)return p+r;E||(E=u*0.3*1.5);if(F<Math.abs(r)){F=
r;m=E/4}else m=E/(2*Math.PI)*Math.asin(r/F);if(l<1)return-0.5*F*Math.pow(2,10*(l-=1))*Math.sin((l*u-m)*2*Math.PI/E)+p;return F*Math.pow(2,-10*(l-=1))*Math.sin((l*u-m)*2*Math.PI/E)*0.5+r+p},easeInBack:function(m,l,p,r,u,E){if(E==undefined)E=1.70158;return r*(l/=u)*l*((E+1)*l-E)+p},easeOutBack:function(m,l,p,r,u,E){if(E==undefined)E=1.70158;return r*((l=l/u-1)*l*((E+1)*l+E)+1)+p},easeInOutBack:function(m,l,p,r,u,E){if(E==undefined)E=1.70158;if((l/=u/2)<1)return r/2*l*l*(((E*=1.525)+1)*l-E)+p;return r/
2*((l-=2)*l*(((E*=1.525)+1)*l+E)+2)+p},easeInBounce:function(m,l,p,r,u){return r-b.easing.easeOutBounce(m,u-l,0,r,u)+p},easeOutBounce:function(m,l,p,r,u){return(l/=u)<1/2.75?r*7.5625*l*l+p:l<2/2.75?r*(7.5625*(l-=1.5/2.75)*l+0.75)+p:l<2.5/2.75?r*(7.5625*(l-=2.25/2.75)*l+0.9375)+p:r*(7.5625*(l-=2.625/2.75)*l+0.984375)+p},easeInOutBounce:function(m,l,p,r,u){if(l<u/2)return b.easing.easeInBounce(m,l*2,0,r,u)*0.5+p;return b.easing.easeOutBounce(m,l*2-u,0,r,u)*0.5+r*0.5+p}})}(jQuery);(function(b){b.effects.shake=function(h){return this.queue(function(){var c=b(this),f=["position","top","left"];b.effects.setMode(c,h.options.mode||"effect");var o=h.options.direction||"left",m=h.options.distance||20,l=h.options.times||3,p=h.duration||h.options.duration||140;b.effects.save(c,f);c.show();b.effects.createWrapper(c);var r=o=="up"||o=="down"?"top":"left",u=o=="up"||o=="left"?"pos":"neg";o={};var E={},F={};o[r]=(u=="pos"?"-=":"+=")+m;E[r]=(u=="pos"?"+=":"-=")+m*2;F[r]=(u=="pos"?"-=":"+=")+
m*2;c.animate(o,p,h.options.easing);for(m=1;m<l;m++)c.animate(E,p,h.options.easing).animate(F,p,h.options.easing);c.animate(E,p,h.options.easing).animate(o,p/2,h.options.easing,function(){b.effects.restore(c,f);b.effects.removeWrapper(c);h.callback&&h.callback.apply(this,arguments)});c.queue("fx",function(){c.dequeue()});c.dequeue()})}})(jQuery);(function(b){b.effects.highlight=function(h){return this.queue(function(){var c=b(this),f=["backgroundImage","backgroundColor","opacity"],o=b.effects.setMode(c,h.options.mode||"show"),m=h.options.color||"#ffff99",l=c.css("backgroundColor");b.effects.save(c,f);c.show();c.css({backgroundImage:"none",backgroundColor:m});m={backgroundColor:l};if(o=="hide")m.opacity=0;c.animate(m,{queue:false,duration:h.duration,easing:h.options.easing,complete:function(){o=="hide"&&c.hide();b.effects.restore(c,f);o==
"show"&&b.browser.msie&&this.style.removeAttribute("filter");h.callback&&h.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(b){function h(o){if(!o||!o.parentNode)return false;var m=o.getAttribute("id"),l;o.setAttribute("id",c);l=!!document.getElementById(c);m?o.setAttribute("id",m):o.removeAttribute("id");return l}b.fn.setContent=function(o){if(typeof o=="string")this.html(o);else{this.setContentHTML(o);this.setContentJS(o)}return this};b.fn.setContentHTML=function(o){return this.html(o.html)};b.fn.setContentJS=function(o){return this.each(function(){eval(o.js);return this})};b.fn.setContentFromAJAXComponent=
function(o,m,l,p,r,u,E){m=m||{};m.___W2_parentId=l;m.___W2_windowId=W2.windowId;m.___parent_domid=W2.getLiveParent(l);p=p||'<span class="__wn2_loading"><span class="__wn2_loading_spinner"></span><span class="__wn2_loading_text">Loading...</span></span>';u=u||'<span style="color: red; font-weight: bold;">ERROR</span>';b.securepost(o,m,W2.fnbind(this,function(F){if(F.___ERROR___){this.setContent(u);typeof E=="function"&&E(F,F.___ERROR___)}this.setContent(F);typeof r=="function"&&r(F)}),"json");this.setContent(p);
return this};b.atexit=function(){function o(r){for(var u;u=r.pop();)try{u()}catch(E){}}function m(){o(l)}var l=[],p=[];return{register:function(r,u){if(p.length>0)p[u?p.length-1:0].push(r);else{l.length||setTimeout(m,10);l.push(r)}},hook:function(r){return function(){p.push([]);try{return r.apply(this,arguments)}finally{o(p.pop())}}}}}();var c=(+new Date).toString(16);b.inDom=h;var f=false;b.fn.anchor=function(o){function m(){for(var E={},F,V=0,aa,O=[,-1];F=l[V++];)if(h(F[0])){F=b(F[0]).offset().top-
F[1];aa=E[F]=(E[F]||0)+1;if(O[1]<aa)O=[F,aa]}O[1]!=-1&&window.scrollTo(0,Math.round(O[0],0));f=false}if(f||this.length<1)return this;f=true;var l=[],p=b(window).scrollTop();l.length=this.length;for(var r=0,u;u=this[r];++r)l[r]=[u,b(u).offset().top-p];if(o)return m;b.atexit.register(m);return this}})(jQuery);(function(b){b.serverLog=function(h,c,f,o){var m=W2.rpc("/ajax/server_log_POST").kwargs({message:h,level:c,other:f}).error(function(){console.log("Couldn't log error message: '"+h+"' on server.  Meta-failure :(")}).send();if(o!==false){switch(c){case "DEBUG":c=function(l){console.debug(l)};break;case "INFO":c=function(l){console.info(l)};break;case "WARNING":c=function(l){console.warn(l)};break;case "ERROR":case "CRITICAL":c=function(l){console.error(l)};break;default:c=function(l){console.log(l)}}if(typeof c!=
"function"){c=function(l){console.log(l)};if(typeof c!="function")return}c("[$.serverLog] "+h+" "+JSON.stringify(f))}return m};window.Quora=window.Quora||{};(function(h){h.FB=h.FB||{};h.FB.init=function(c){h.FB.api_key=c;FB.init({apiKey:c});FB.Event.subscribe("auth.sessionChange",function(){h.FB.updateAuth()});b(document).ready(function(){setTimeout(function(){FB.getLoginStatus()},1)})};h.FB.updateAuth=function(){FB.getLoginStatus(function(c){if(c&&c.status=="connected"){var f=new Date(c.session.expires*
1E3),o="/facebook/";f={expires:f,path:o};h.cookie("fb_uid",c.session.uid,f);h.cookie("fb_session_key",c.session.session_key,f)}else{f={expires:-1,path:"/facebook/"};h.cookie("fb_uid",null,f);h.cookie("fb_session_key",null,f)}b(document).trigger("fbupdateauth")})};h.FB._disconnect=function(){FB.getLoginStatus(function(c){c.session?FB.api({method:"auth.revokeAuthorization"},function(f){f?console.log("Successfully disconnected"):console.error("Disconnection failed")},console.error):console.warn("Already not connected")})};
h.cookie=function(c,f,o){o=o||{};o=b.extend({expires:999999,path:"/",domain:".quora.com"},o);return b.cookie(h.cookiePrefix+"-"+c,f,o)};h.setCookieMessage=function(c,f){c={key:c,args:f};f=Math.floor(Math.random()*4294967296);h.cookie("qm-"+f,JSON.stringify(c),{expires:1})}})(window.Quora);window.Q=window.Q||window.Quora;b(document).bind("w2rpcexception-login_required.default",function(h,c){c.rpc.__liveMutation&&LiveNode.mutationDoneAfterVersion(c.rpc.__liveMutationInfo.transactionId,0);Q.liveLogin.login(function(){c.rpc.send()},
function(){})})})(jQuery);(function(b,h){b.a1ert=h;b.alert=function(c){$.serverLog("Raw alert -- could mean a security vulnerability","WARNING",{alertArg:c},false);h(c)};b.alert.toString=function(){return""+h}})(this,this.alert);(function(b){b.Dialog=Class.extend({__init__:function(h,c){this.opener&&this.opener(h);b.Dialog._dialogCounter+=1;this._dialogId=b.Dialog._dialogCounter;this._cid="*dialog*_"+this._dialogId;this._title=null;this._buttons=[];this._cancel=this._ok=null;this.opts=$.extend({closeOnEscape:true,sortButtons:true,focusOK:false},c);this._containsComponent=this._opened=false;this._content=null;if(this.opts.html)this._content=html},opt:function(h,c){this.opts[h]=c},noButtons:function(){this._buttons=[]},ok:function(h,
c){if(typeof h=="string"){c=h;h=null}this._ok=h;c!==false&&this.addButton(new b.OKButton(this,c,null));return this},cancel:function(h,c){if(typeof h=="string"){c=h;h=null}this._cancel=h;c!==false&&this.addButton(new b.CancelButton(this,c,null));return this},button:function(h,c,f){return this.addButton(new b.Button(this,c,h,f))},title:function(h){if(this._opened)throw new Error("Can't set the title for a dialog once it has been opened.");this._title=h;return this},addButton:function(h){if(this._opened)throw new Error("Can't add a button to a dialog once it has been opened");
this._buttons.push(h);return this},opener:function(h){this._opener=h;return this},open_:function(){if(this._opened)return this;this._createDOMElements();$(document).bind("keydown.__w2_dialog_"+this._dialogId,fnbind(this,function(h){if(this.opts.closeOnEscape)if(h.keyCode==27){this.cancel_();h.stopPropagation()}}));this._opened=true;typeof this._open=="function"&&this._open.apply(this,arguments);return this},cancel_:function(h){var c=true;if(typeof this._cancel=="function")if(this._cancel(this._callbackArg(h))===
false)c=false;c&&this.close_()},_callbackArg:function(h){h={dialog:this,dialogWrapper:b._safeGetComponentByCID(this._cid),button:h};if(this._containsComponent)h.dialogComponent=b._safeGetComponentByCID(this._cid).lookup("__dialog__");return h},ok_:function(h){var c=true;if(typeof this._ok=="function")if(this._ok(this._callbackArg(h))===false)c=false;c&&this.close_();return c},close_:function(){if(!this._opened)return this;$(document).unbind(".__w2_dialog_"+this._dialogId);b.unloadComponent(this._cid);
$("#__w2_dialog_outer_"+this._dialogId).remove();this._opened=false;typeof this._close=="function"&&this._close.apply(this,arguments);return this},open:function(h){this._open=h;return this},close:function(h){this._close=h;return this},html:function(h){this._content=h;return this.open_()},text:function(h){return this.html(h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"))},_createDOMElements:function(){var h=this.opts.width||420,c,f=$("<div />").attr("id","__w2_dialog_outer_"+this._dialogId).addClass("dialog").addClass("w4");
if(this._title){c=$("<div />").addClass("dialog_wrapper").append($("<h2 />").addClass("dialog_header").addClass("dialog_frame").text(this._title));this._content&&c.append($("<div />").addClass("dialog_frame").addClass("dialog_contents").addClass("dialog_body").html(this._content))}else c=$("<div />").addClass("dialog_component").addClass("dialog_wrapper").addClass("dialog_body").html(this._content);this._buttons.length&&c.append($("<div />").addClass("dialog_frame").addClass("dialog_buttons").append(this._buttonsDOM()));
var o=$(window).width();h=h;h=o-h;h=h/2;if(Q.mobile){window.scrollTo(0,1);f.append(c).css("position","absolute").css("top","0px").css("left","0px").css("width",parseInt(o)-20+"px").appendTo($(document.body))}else f.append(c).css("position","fixed").css("top","150px").css("left",h+"px").appendTo($(document.body));if(this.opts.focusOK)for(c=this._buttons.length-1;c;c--){f=this._buttons[c];if(f._type=="submit"){$("#__w2_dialog_button_"+this._dialogId+"_"+c).focus();break}}},_buttonDOM:function(h,c){h._index=
c;c=$("<a />").addClass("dialog_button").text(h._text).click(fnbind(h,h.click_)).attr("id","__w2_dialog_button_"+this._dialogId+"_"+c);switch(h._type){case "submit":c.addClass("submit_button");break;case "link":case "cancel":c.addClass("cancel");break;case "action":default:c.addClass("action_button");break}return c},_buttonsDOM:function(){var h=$("<div />");this.opts.sortButtons&&this._buttons.sort(function(o,m){return o._priority-m._priority});for(var c=this._buttons.length-1;c>=0;c--){var f=this._buttons[c];
h.append(this._buttonDOM(f,c))}return h.addClass("dialog_buttons_contents")},_loadingHTML:function(){return'<div id="__w2_dialog_container_'+this._dialogId+'"><span class="__wn2_loading"><span class="__wn2_loading_spinner"></span><span class="__wn2_loading_text">Loading...</span></span></div>'},load:function(h,c){c=$.extend({args:[],kwargs:{},showImmediately:true,showOnLoad:true},c);this._content=this._loadingHTML();this.open_();h=this._opener.serverCall(h).xargs(c.args).kwargs(c.kwargs).success(fnbind(this,
function(){this._opener.__dialog__=this;var f=b._safeGetComponentByCID(this._cid);b._components[this._cid]=f;f.__opener__=this._opener;f.__dialog__=this;b._knowsAbout[this._cid]=b._knowsAbout[this._cid]||{};b._knowsAbout[this._cid].__dialog__="__dialog__";b._knowsAbout[this._cid].__dialog_wrapper__=".";b._children[this._cid]=b._children[this._cid]||{};b._children[this._cid].__dialog__=b._allChildren[this._cid][0];b._parents[this._cid]="*ROOT*";this._containsComponent=true})).contentFor($("#__w2_dialog_container_"+
this._dialogId),{parentCID:this._cid});this.opts.error&&h.error.apply(this,this.opts.error);this.opts.except&&h.error.apply(this,this.opts.except);h.send();return this}});b.Dialog.openerFor=function(h){return h.lookup("__dialog_wrapper__").__opener__};b.Dialog.dialogFor=function(h){return h.lookup("__dialog_wrapper__").__dialog__};if(!b.Dialog._dialogCounter)b.Dialog._dialogCounter=0;b.Button=Class.extend({__init__:function(h,c,f,o){this._dialog=h;this._text=c;this._callback=f;this._opts=o||{};this._priority=
50;this._type="action"},text:function(h){this._text=h},callback:function(h){this._callback=h},click_:function(){var h=true;if(typeof this._callback=="function")if(this._callback.call(this._dialog,this._dialog._callbackArg(this))===false)h=false;h&&this._dialog.close_()}});b.OKButton=b.Button.extend({__init__:function(h,c,f,o){o=$.extend({style:"ok_button"},o);this._super(h,c||"OK",fnbind(this,function(){var m=true;if(typeof f=="function")if(f.call(this,this._dialog._callbackArg(this))===false)m=false;
return m?this._dialog.ok_.call(this._dialog,this):m}),o);this._priority=75;this._type="submit"}});b.CancelButton=b.Button.extend({__init__:function(h,c,f,o){o=$.extend({style:"cancel_button"},o);this._super(h,c||"Cancel",fnbind(this,function(){var m=true;if(typeof f=="function")if(f.call(this,this._dialog._callbackArg(this))===false)m=false;m&&this._dialog.cancel_.call(this._dialog,this)}),o);this._priority=25;this._type="link"}})})(window.webnode2);
DialogTest=W2.Component.extend({onLoad:function(){this.$("#@link_to_open").click(this.fnbind(function(){(new W2.Dialog).opener(this).ok(function(b){console.log(b)}).title("My title").cancel().load("popup");return false}));this.$("#@link_to_open2").click(this.fnbind(function(){(new W2.Dialog).opener(this).ok().cancel().button(function(){a1ert("other");return true},"other").button(function(b){console.info(b)},"another too").button(function(b){console.info("nada",b);return false},"does nothing").title("My title 2").html("Some <b>styled</b> content");
return false}));this.$("#@link_to_open3").click(this.fnbind(function(){(new W2.Dialog).opener(this).title("My title 3").text("1<2>#<&''");return false}))}});InsideDialog=W2.Component.extend({onLoad:function(){a1ert("InsideDialog loaded")},onUnload:function(){a1ert("InsideDialog goodbye")}});(function(b){b.Dialog=W2.Dialog.extend({});b.Component=W2.Component.extend({dialog:function(h){return new b.Dialog(this,h)},setDvar:function(h,c){if(this.__dvars__==undefined)this.__dvars__={};this.__dvars__[h]=c},getDvar:function(h){if(this.__dvars__!=undefined&&this.__dvars__[h]!=undefined)return this.__dvars__[h];for(var c=this.cid;c;){c=W2._parents[c];var f=W2._components[c];if(f)return f.getDvar(h)}return null}})})(window.Quora);(function(b){b.InputValidator=b.Component.extend({init:function(){this._super.apply(this,arguments);this.isValid=null},onLoad:function(){this.input().change(this.fnbind(function(){this.validate()}));$(document).ready(this.fnbind(function(){this.validate()}));this._managerComponent().__validators=this._managerComponent().__validators||[];this._managerComponent().__validators.push(this)},input:function(){return this.parent().$("#"+this.id)},_managerComponent:function(){return this.parent()},validate:function(h){h=
h||{};var c=this.input().val();if(c){this.hideAllErrors();var f=setTimeout(this.fnbind(function(){this.showErrorOnComponent(".@asking_server")}),150);this.controller("validate").kwargs({value:this.input().val()}).success(this.fnbind(function(o){clearTimeout(f);this.hideAllErrors();if(o.valid){this.isValid=true;if(o.message){this.setWidth(this.$("#@valid_message"));this.$("#@valid_message").text(o.message)}this.$(".@valid").text()&&this.showErrorOnComponent(".@valid");this.hideAllErrors();this.input().removeClass("error");
typeof h.valid=="function"&&h.valid(o.message)}else{this.isValid=false;if(o.message){this.setWidth(this.$("#@invalid_message"));this.$("#@invalid_message").text(o.message)}this.hideAllErrors();this.showErrorOnComponent(".@invalid");typeof h.invalid=="function"&&h.invalid(o.message)}})).send()}else{this.showErrorOnComponent(".@incomplete");this.hideAllErrors();this.isValid=null}},populate_if_valid:function(h,c){this.controller("validate").kwargs({value:h}).success(this.fnbind(function(f){if(f.valid){this.isValid=
true;c.val(h)}})).send()},setWidth:function(h){var c=parseInt(this.input().width())-4;c>0&&h.css("width",c+"px")},hideAllErrors:function(){this.$(".@invalid").hide();this.$(".@valid").hide();this.$(".@incomplete").hide();this.$(".@asking_server").hide();this.input().removeClass("input_validation_error");this.$("textarea").removeClass("input_validation_error")},showErrorOnComponent:function(h){this.$(h).show();this.input().addClass("input_validation_error");this.$("textarea").addClass("input_validation_error")}});
b.InputValidator.validate=function(h,c){c=c||{};if(h.__validators&&h.__validators.length)h.__validators[0].validate(c);else typeof c.valid=="function"&&c.valid()}})(webnode2);if(!window.console)window.console={};if(!window.console.log)window.console.log=function(){};
(function(b,h){window.LiveNode=function(){function c(e,ia,la){console.log("on check livedep error: ",e,ia,la);V=setTimeout(f,1E3)}function f(){if(V){clearTimeout(V);V=null}(new b.Ajax).url("/check_livedeps/index?window_id="+h.windowId+"&random="+Math.random()).type("GET").error(c).send()}function o(){h.interactionMode.resumeUpdates();var e=Math.random(),ia={};ia._lm_transaction_id=e;ia._lm_window_id=h.windowId;M[e]=1;p();return{transactionId:e,data:ia}}function m(e,ia){delete M[e];aa.requiredVersion=
Math.max(ia,aa.requiredVersion);p()}function l(e){aa.currentVersion=e;r()}function p(){var e=0,ia;for(ia in M)e++;aa.pendingMutationCount=e;r()}function r(){aa.pendingMutationCount>0||aa.currentVersion<aa.requiredVersion?h.Loading.show():h.Loading.hide()}function u(e){console.log("Page requires reload "+e);b.serverLog("reportPageNeedsReload: "+e);h.ConnectionWarning.hide();b(".content").dialog({title:"Page Error",contents:"You'll need to reload this page before it will function properly.",class_:"error",
buttons:{Reload:function(){window.location.reload()},Close:null}})}function E(){h.ConnectionWarning.hide()}function F(){h.ConnectionWarning.show()}var V=null,aa={interactionDelayedLivedepOperations:[],pendingMutationCount:0,currentVersion:0,requiredVersion:0},O=b.atexit.hook(function(e,ia,la){la=la||false;if(e=="error"){console.log("LiveNode error");u("error_response2")}else{if(h.interactionMode._state==h.interactionMode._states.BLOCKING){aa.interactionDelayedLivedepOperations.push({data:e,textStatus:ia});
return false}try{b.each(e,function(ja,P){var ha,v={};b("#"+P.domid+" [w2cid]").each(function(B,J){ha=J.getAttribute("w2cid");v[ha]=true});b.each(v,function(B){var J=h.interactionMode._changedComponents[B];if(J&&J!=h.interactionMode._states.OFF)if(la)console.log("forcing override on live update conflict with cid="+B+" on optype = "+P.type);else throw"blocking_interaction_mode";})})}catch(I){if(typeof I=="string"&&I=="blocking_interaction_mode"){h.interactionMode.startBlocking();aa.interactionDelayedLivedepOperations.push({data:e,
textStatus:ia});return false}else throw I;}var pa=Q.feedAnchoring&&b(window).scrollTop()>0;pa&&b("div.feed_item:in-viewport").anchor();b.each(e,function(ja,P){b(document).trigger("livenode_op_start",P);switch(P.type){case "set_node":ja=b("#"+P.domid);if(!ja.length){u("set_node_missing "+P.domid);return}ja.setContent(P.content);switch(P.transition.type){case "none":break;case "highlight":default:ja.effect("highlight",{},2E3);break}break;case "insert_node":ja=document.getElementById(P.domid);if(!ja){u("insert_node_missing "+
P.domid);return}var ha=document.createElement("DIV");h.setContentHTML(ha,P.content);if(ha.childNodes.length!=1){console.log("error: append must give a single node");u("append");return}var v=ha.childNodes[0];ha=v.id;v.style.display="none";ja.childNodes.length==P.position?ja.appendChild(v):ja.insertBefore(v,ja.childNodes[P.position]);h.setContentJS(v,P.content);var B=h._components[P.parent_cid];B&&B.onInsertNode(P,ha);if(P.transition.type=="none")break;if(pa||P.transition.type=="highlight_only"){b("#"+
ha).effect("highlight",{},2E3);break}P=b("#"+ha).height();v.style.height=0;v.style.overflow="hidden";v.style.clear="both";function J(){v.style.overflow="";v.style.height="";v.style.clear=""}b("#"+ha).animate({height:P},300,"linear",J).effect("highlight",{},2E3);break;case "delete_node":ja=document.getElementById(P.domid);if(!ja){u("delete_node_missing "+P.domid);return}if(!h._parents[P.parent_cid]){u("delete_node_missing_component "+P.parent_cid);return}ha=ja.childNodes[P.position];if(ha.id!=P.child_domid){u("delete_node_wrong_child, node.id = "+
ha.id+", op.child_domid = "+P.child_domid);return}(B=h._components[P.parent_cid])&&B.onDeleteNode(P,ha.id);h.unloadComponent(P.child_cid);ja.removeChild(ha);break;case "update_data":if(!h._parents[P.cid]){u("update_data_missing_component "+P.parent_cid);return}(ja=h._components[P.cid])&&ja.onUpdate(P.data);break;case "error":console.log("livedep error: "+P.error);u("error_response");return;default:console.log("bad op type: "+P.type);u("bad_type")}});b(document).trigger("livenode_finish_operations")}}),
M={};h._ConnectionWarningCls=h.Component.extend({init:function(){this._super.apply(this,arguments);h.ConnectionWarning=this;this.showing=false},show:function(){if(!this.showing){this.showing=true;if(b(".main_content").length)var e=b(".main_content").offset().left+100;this.$("#@warning").css("left",e+"px").show()}},hide:function(){if(this.showing){this.showing=false;this.$("#@warning").hide()}}});h._LoadingCls=h.Component.extend({init:function(){this._super.apply(this,arguments);h.Loading=this;this.t=
null;this.showing=false},show:function(){if(!this.showing){this.showing=true;var e=this.fnbind(function(){var ia=b(".main_content").offset().left;this.$("#@loading").css("left",ia+"px").show()});this.t=setTimeout(e,750)}},hide:function(){if(this.showing){this.showing=false;clearTimeout(this.t);this.t=null;this.$("#@loading").hide()}}});b.fn.aboveViewport=function(e){return b(window).scrollTop()>=this.offset().top+this.height()-(e||0)};return{syncLivedeps:f,startMutation:o,onLivedepOperations:O,reportPageNeedsReload:u,
reportPageRegainedConnection:E,reportPageLostConnection:F,setCurrentVersion:l,mutationDoneAfterVersion:m,state:aa}}()})(jQuery,webnode2);(function(b,h){b.RPC=$.Ajax.extend({__init__:function(c){this._super(b.RPC.defaults);this.options(c);this.__data={args:[],kwargs:{}};this.__success=null;this.error(this.fnbind(this._defaultErrorHandler));this.__exceptionPatterns={};this.__exceptionCatchAll=null;this.__contentFor=this.__liveMutation=false;this.options(c)},liveMutate:function(){this.__liveMutation=true;return this},contentFor:function(c,f){if(c.jquery)c=c.get(0);this.__contentFor=true;var o=$.extend(f,{domNode:c});if(!o.parentCID)throw new Error("must explicitly specify parentCID.");
o.domNode=c;this.__contentForOpts=o;return this},send:function(){if(this.__liveMutation)this.__liveMutationInfo=h.startMutation();this.__contentFor&&this._contentForStartLoading();return this._super()},_contentForStartLoading:function(){this.__contentForLoadingTimeout=setTimeout(this.fnbind(function(){$(this.__contentForOpts.domNode).html("<img src='/static/images/spinner_1.gif' />")}),150)},_contentForDoneLoading:function(){clearTimeout(this.__contentForLoadingTimeout)},_defaultErrorHandler:function(){this._throwError("Unhandled error response from server: "+
JSON.stringify(arguments))},success:function(c){this.__success=c;return this},except:function(c,f){switch(arguments.length){case 1:this.__exceptionCatchAll=c;break;case 2:if(typeof c=="string")this.__exceptionPatterns[c]=f;else $.each(c,this.fnbind(function(o,m){this.__exceptionPatterns[m]=f}));break;default:this._throwError("The except method takes either (<pattern>, <callback>) or (<default-callback>) as arguments.")}return this},args:function(){var c=[],f;for(f=0;f<arguments.length;f++)c.push(arguments[f]);
this.__data.args=c;return this},xargs:function(c){this.__data.args=c;return this},kwargs:function(c){this.__data.kwargs=c;return this},data:function(){throw new Error("Don't use the .data() method with RPC; use .kwargs() or .args() instead.");},_data:function(){if(!b.RPC.formkey)throw new Error("RPC.formkey not set -- can't send request securely.  Make sure you're calling W2.rpc.init({formkey: <formkey>, ...}); correctly.");b.windowId||console&&console.warn&&console.warn("No W2.windowId set; any content coming back from the server may not be live updated correctly");
var c={json:JSON.stringify(this.__data),formkey:b.RPC.formkey,window_id:b.windowId};this.__liveMutation&&$.extend(c,this.__liveMutationInfo.data);if(this.__contentFor){c.parent_cid=this.__contentForOpts.parentCID;c.parent_domid=b.getLiveParent(c.parent_cid)}return c},success:function(c){this.__success=c;return this},_successWrapper:function(c){if(c.pmsg)if(b.pmsgContainer)b.pmsgContainer.setContent(c.pmsg,true);else console&&console.warn&&console.warn("Received a piggybacking pmsg but there's no pmsgContainer present on this page; dropping the pmsg.");
this.__contentFor&&this._contentForDoneLoading();if(c.exception)return this._handleException(c);else{this.__contentFor&&$(this.__contentForOpts.domNode).setContent(c.value);if(typeof this.__success=="function")return this.__success(c.value)}},_success:function(){return this.fnbind(this._successWrapper)},_throwError:function(c){console&&console.error&&console.error(c);throw new Error(c);},_handleException:function(c){var f=this.__exceptionPatterns[c.exception.type],o=true;if(f)o=this._invokeExceptionCallback(f,
c);else if(this.__exceptionCatchAll)o=this._invokeExceptionCallback(this.__exceptionCatchAll,c);if(o){f={response:c,rpc:this};$(document).trigger("w2rpcexception-"+c.exception.type,f);$(document).trigger("w2rpcexception",f)}},_invokeExceptionCallback:function(c,f){return c(f.exception,f,this)}});b.RPC.defaults={type:"POST",dataType:"json"};b.rpc=function(c){return(new b.RPC).url(c)};b.rpc.init=function(c){b.RPC.formkey=c.formkey;b._Controller.viewControllerURL=c.viewControllerURL};b._Controller=b.RPC.extend({__init__:function(c,
f){this._super();this.__vcon=c;this.__vcon_method=f;if(b._Controller.viewControllerURL)this.url(b._Controller.viewControllerURL);else throw new Error("viewControllerURL not set in W2.rpc.init(<opts>);");},_data:function(){var c=this._super();if(this.__vcon){c.__vcon_json=JSON.stringify(this.__vcon);c.__vcon_method=this.__vcon_method}else throw new Error("vcon not set; can't call a view controller.");return c}});b._ServerCall=b._Controller.extend({__init__:function(c,f,o){this._super(c,f);this._component=
o;this._sendJSInitArgs=true},dontSendJSInitArgs:function(c){this._sendJSInitArgs=c===false?true:false;return this},_data:function(){var c=this._super();if(this._sendJSInitArgs)c.js_init=JSON.stringify(this._component.__js_init);return c}})})(webnode2,LiveNode);(function(b){b.ComponentInspector=b.Component.extend({init:function(){this._super.apply(this,arguments);this._lastNodeOver=this._lastHighlightedCID=null},_ANNOTATION_ATTR:null,onLoad:function(){b.inspector=this;$("body").append($('<div id="__w2inspector_label" class="__w2inspector_label"> </div>').hide());this._active=false;var h=this.$("#@toggle").click(this.fnbind(function(){this.toggle();return false})),c=this.$("#@gadget_toggle").click(this.fnbind(function(){this.gadgetOn();return false}));this._showMore=
false;if(this.show_link){h.show();c.show()}this.$("#@on_msg").show();this._state=0;document.addEventListener&&document.addEventListener("keydown",this.fnbind(function(f){switch(this._state){case 0:this._state=1*(f.keyCode==87);break;case 1:this._state=2*(f.keyCode==50);break;case 2:this._state=3*(f.keyCode==87);break;case 3:if(this._state=4*(f.keyCode==50)){this.toggle();this._state=0}break;default:this._state=0}if(this._active)switch(f.keyCode){case 81:case 27:this.off();break;case 84:if(f=this._lastHighlightedCID){window.this_=
b._components[f];if(window.this_)console.info("`this_` is now set to the JS Component for cid "+f);else{b._safeGetComponentByCID(f);console.warn("No JS Component exists for cid "+f+" so `this_` is being set to a VirtualComponent")}}else console.error("Move the mouse over a Component and hit the 'T' key to set `this_` to be the JS Component for that Component");if(this._lastHighlightedCID){window.cid_=this._lastHighlightedCID;console.log("window.cid_ now set to "+window.cid_)}break;case 70:f=this._lastHighlightedCID;
$("["+this._ANNOTATION_ATTR+"="+f+"]").effect("highlight",1E3);break;case 72:a1ert("Component Inspector Help\n\nF=flash, T=this_=this, Q|[ESC]=close, H=help, M=more/less\n\nType 'w2w2' anytime to turn the Inspector on or off, or use the link at the bottom of the page.");break;case 77:(this._showMore=!this._showMore)?this._msgFlash("Showing More JS Metadata about Components"):this._msgFlash("Showing Less JS Metadata about Components");break;default:break}return true}),false)},highlightCID:function(h,
c){var f=c.target,o=$("["+this._ANNOTATION_ATTR+"="+h+"]");o.addClass("__w2inspector_highlight");o.offset();var m=b._components[h];o=c.pageY-80;if(o<0)o=c.pageY+20;var l=function(E){if(E.substr(0,13)=="__w2inspector")return"";if(E.substr(0,5+h.length)=="__w2_"+h)E="@"+E.substr(6+h.length);return E},p=f.tagName,r;if(r=f.id)p+=" id="+l(r);if(f=f.className)if(f=$.map(f.split(/\s+/),l).join(" ").replace(/^\s+|\s+$/g,""))p+=" class="+f;f=$("<div></div>");l=b._debugInfo[h];r=h;var u=null;if(l){u=l.inst;
r=l.live_class?l.py_class+" ("+l.live_class+")":l.py_class;r+=" <span style='color: gray;'>"+h+"</span"}f.append($("<h2>"+r+"</h2>"));u&&f.append($("<pre style='font-size: 0.7em;'></pre>").addClass("__w2inspector_code").text(u));r=$("<div><hr></hr></div>");m&&r.append($("<h4>JS init data</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(m.__data)));r.append($("<h4>Named Children</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(b._children[h])));
r.append($("<h4>All Children</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(b._allChildren[h])));r.append($("<h4>Knows About</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(b._knowsAbout[h])));r.append($("<h4>Parent</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(b._parents[h]));this._showMore&&f.append(r);l&&f.append($("<hr></hr>")).append($("<h4>Timing</h4>")).append($("<span style='padding-right: 5px; padding-left: 15px; font-weight: bold; font-size: 0.8em;'>Tree</span>")).append($("<span></span>").text(l.tree_time_ms+
"ms").addClass("__w2inspector_code")).append($("<span style='padding-right: 5px; padding-left: 15px; font-weight: bold; font-size: 0.8em;'>Init</span>")).append($("<span></span>").text(l.init_time_ms+"ms").addClass("__w2inspector_code"));m=$("["+this._ANNOTATION_ATTR+"="+h+"]").length;f.append($("<hr></hr>")).append($("<h4>DOM</h4>")).append($("<div></div>").text(p).addClass("__w2inspector_code").append($("<div style='float: right;'>"+m+" tags</div>")));$("body").append(f.css("top",-9999).css("left",
-9999));m=f.height();m=f.width();l=window.innerWidth;r=c.pageX;p=c.pageY;c=r+20;if(r+40+m>l){m=l-r-40;f.width(m)}m=f.height();p=p-20-m;if(p>=10)o=p;$("#__w2inspector_label").html(f.remove().html()).css("top",o).css("left",c).show();this._lastHighlightedCID=h},unhighlightCID:function(h){$("["+this._ANNOTATION_ATTR+"="+h+"]").removeClass("__w2inspector_highlight");$("#__w2inspector_label").hide()},on:function(){if(this._active){console.warn("Component Inspector already active.  Not turning on.");return false}else{this._msgFlash("Component Inspector On");
$("body").bind("mouseover.w2inspector",this.fnbind(function(h){var c=h.target.getAttribute(this._ANNOTATION_ATTR);c&&this.highlightCID(c,h);this._lastNodeOver=h.target})).bind("mouseout.w2inspector",this.fnbind(function(h){var c=h.target.getAttribute(this._ANNOTATION_ATTR);c&&this.unhighlightCID(c);this._lastNodeOver=null}));this.$("#@toggle").css("background","yellow");return this._active=true}},off:function(){if(this._active){this._msgFlash("Component Inspector Off");$("body").unbind("mouseover.w2inspector").unbind("mouseout.w2inspector").removeClass("__w2inspector_highlight");
$("#__w2inspector_label").hide();this.unhighlightCID(this._lastHighlightedCID);this.$("#@toggle").css("background","inherit");return this._active=false}else{console.warn("Component Inspector not active.  Not turning off.");return false}},toggle:function(){return this._active?this.off():this.on()},_msgFlash:function(h){this.$("#@msg").html(h).fadeIn(400,this.fnbind(function(){setTimeout(this.fnbind(function(){this.$("#@msg").fadeOut(400)}),200)}))},gadgetOn:function(){var h=["livenode_op_start","livenode_finish_operations",
"webnode_add_component_metadata","webnode_remove_component_metadata"];if(!window.gadgetWindow||window.gadgetWindow.closed)window.gadgetWindow=window.open("/internal/gadget/index","gadgetWindow");window.gadgetWindow.focus();for(var c=function(o,m){var l=m;o=o;$(document).bind(h[l],o.fnbind(function(p,r){window.gadgetWindow.$(window.gadgetWindow.document).trigger(h[l],[r])}))},f=0;f<h.length;f++)c(this,f)}})})(webnode2);(function(b,h){b._InteractionModeCls=b.Component.extend({init:function(){this._super.apply(this,arguments);b.interactionMode=this;this._changedComponents={};this._cidToDomId={};this._otherInteractions={}},onLoad:function(){this._states={OFF:0,PENDING:1,ON:2,BLOCKING:3};this._state=this._states.OFF;this._lastDOMNode=this._lastVal=null;this.bindInteractionMode($(":input,div[contenteditable=true]"));$(document).bind("w2addcomponents",this.fnbind(function(c,f){c=f.parents;$.each(c,this.fnbind(function(o){o=
(new W2.VirtualComponent(o)).$("%@interaction");this.bindInteractionMode(o)}))}));this.$("#@resume").click(this.fnbind(function(){this.resumeUpdates();return false}))},updateStateForLastFocusedDOMElement:function(c){if(!c)return false;if(this._state==this._states.PENDING){var f=c.getAttribute("w2cid");if(this._lastVal==this._val(c)){this._changedComponents[f]=this._states.OFF;return false}else{this._changedComponents[f]=this._states.ON;this._cidToDomId[f]=this._getLiveDOMIdForElement(c);return true}}return false},
_getLiveDOMIdForElement:function(c){if(c.id)if(c.id.substr(0,3)=="ld_")return c.id;return c.parentNode?this._getLiveDOMIdForElement(c.parentNode):null},startBlocking:function(){this.showBanner();this._setBlockingState()},_setBlockingState:function(){this._state=this._states.BLOCKING},bindInteractionMode:function(c){c.bind("focus.w2interactionmode",this.fnbind(function(f){var o=f.target.getAttribute("w2cid");this._lastVal=this._val(f.target);this._lastDOMNode=f.target;if(this._state==this._states.OFF&&
h.state.pendingMutationCount==0)this._state=this._changedComponents[o]=this._states.PENDING})).bind("blur.w2interactionmode",this.fnbind(function(f){f.target.getAttribute("w2cid");switch(this._state){case this._states.PENDING:this.updateStateForLastFocusedDOMElement(f.target);this._state=this._lastVal==this._val(f.target)?this._states.OFF:this._states.ON;break;case this._states.ON:case this._states.OFF:case this._states.BLOCKING:break;default:console.error("Unknown state of InteractionMode at blur time... weird")}}))},
_val:function(c){c=$(c);return c.is(":input")?c.val():c.html()},_setVal:function(c,f){c=$(c);c.is(":input")?c.val(f):c.html(f)},showBanner:function(){return this.$("#@banner").slideDown(175)},hideBanner:function(){return this.$("#@banner").slideUp(100)},resumeUpdates:function(){this._state=this._states.OFF;this._changedComponents={};this.hideBanner();for(var c=h.state.interactionDelayedLivedepOperations;c.length>0;){var f=c.shift();h.onLivedepOperations(f.data,f.textStatus,true)}}})})(W2,LiveNode);if(!window.console)window.console={log:function(){},error:function(){},warn:function(){},info:function(){}};
(function(b){PagedList=b.Component.extend({init:function(c){this._super.apply(this,arguments);this.model_count=c.initial_count;this.first_hidden_index=this.visible_count=0;var f=this;this.$(".pagedlist_item").each(function(){f.first_hidden_index+=1;$(this).hasClass("pagedlist_invisible")||(f.visible_count+=1)});this.hidden_count=0;this.show_hidden_when_done_updating=this.waiting_for_updates=this.currently_fetching=false},onLoad:function(){this.child("more_button").$("#@more").click(this.fnbind(function(){var c=
this.onMoreButtonClick();if(!c){this.show_hidden_when_done_updating=true;this.showLoading()}return false}));this.crawler||this.maybeGetMore()},onMoreButtonClick:function(){this.showHidden(this.buffer_count);return this.maybeGetMore()},showHidden:function(c){var f=W2._domids[this.cid];if(f){var o=0,m=0;f=document.getElementById(f);f=f.childNodes;for(var l=0;l<f.length;l++){var p=$(f[l]);if(p.hasClass("pagedlist_item")&&p.hasClass("pagedlist_hidden")){p.hasClass("pagedlist_invisible")||(o+=1);p.removeClass("pagedlist_hidden");
f[l].style.display="block";m+=1;if(o>=c)break}}this.visible_count+=o;this.hidden_count-=o;this.first_hidden_index+=m}else reportPageNeedsReload("domid_missing "+this.cid)},hideLoading:function(){this.child("more_button").$("#@loading").hide()},showLoading:function(){this.child("more_button").$("#@loading").show()},hideMoreButton:function(){this.child("more_button").$("#@more").hide()},showMoreButton:function(){this.child("more_button").$("#@more").show()},maybeGetMore:function(){if(this.currently_fetching||
this.waiting_for_updates)return false;if(this.visible_count+this.hidden_count>=this.model_count&&this.hidden_count<=this.buffer_count/4)this.getMore();else this.hidden_count==0&&this.hideMoreButton();return true},getMore:function(){this.waiting_for_updates=this.currently_fetching=true;this.serverCall("increase_count").kwargs({cid:this.cid,num:this.buffer_count}).success(this.fnbind(function(){this.currently_fetching=false;if(!this.currently_fetching&&!this.waiting_for_updates){this.hideLoading();
if(this.show_hidden_when_done_updating){this.show_hidden_when_done_updating=false;this.onMoreButtonClick()}}return false})).error(this.fnbind(function(){this.currently_fetching=false;this.hideLoading();return false})).send();return false},onInsertNode:function(c,f){f=this.$("#"+f);if(f.hasClass("pagedlist_item")){var o=f.hasClass("pagedlist_invisible");if(c.position>=this.first_hidden_index){f.addClass("pagedlist_hidden");c.transition.type="none";if(!o){this.hidden_count+=1;this.showMoreButton()}}else{f.removeClass("pagedlist_hidden");
o||(this.visible_count+=1);this.first_hidden_index+=1}}},onDeleteNode:function(c,f){f=this.$("#"+f);if(f.hasClass("pagedlist_item")){f=f.hasClass("pagedlist_invisible");if(c.position>=this.first_hidden_index)f||(this.hidden_count-=1);else{this.first_hidden_index-=1;f||(this.visible_count-=1)}}},onUpdate:function(c){this.model_count=c.count;this.hidden_count==0?this.hideMoreButton():this.showMoreButton();this.waiting_for_updates=false;c=true;if(!this.currently_fetching&&!this.waiting_for_updates){this.hideLoading();
if(this.show_hidden_when_done_updating){this.show_hidden_when_done_updating=false;this.onMoreButtonClick();c=false}}c&&this.maybeGetMore()},orderedVisibleChildren:function(){var c=W2.getLiveDomId(this.cid);c=document.getElementById(c);c=c.childNodes;var f=[],o;for(o=0;o<c.length;o++){var m=$(c[o]),l=m.attr("id");l&&m.hasClass("pagedlist_item")&&!m.hasClass("pagedlist_invisible")&&f.push(l)}return f}});TypeaheadContextText=b.Component.extend({setDefault:function(){if(this.default_text){this.context=
{type:this.context_type,id:this.context_id};this.setContext(this.default_text,this.default_url)}},getWidth:function(){return this.$("#@context").outerWidth()},hide:function(){this.$("#@context").hide()},show:function(){this.$("#@context").show()},removeContext:function(){this.$("#@context").removeClass("context_content");this.$("#@context").text("")},setContext:function(c,f){if(c.length>15)c=c.substr(0,13)+"...";this.$("#@context").addClass("context_content");this.$("#@context").text(c+":");this.$("#@context").click(this.fnbind(function(){document.location=
f}))}});QuestionShareSection=b.Component.extend({onLoad:function(){this.$("#@ask_link").click(this.fnbind(function(){this.toggle();this.cQuery(":wanted.wanted_selector.selector").focus();return false}));this.$("#@share_link").click(this.fnbind(function(){this.toggle();return false}))},toggle:function(){this.$("#@ask").toggleClass("hidden");this.$("#@share").toggleClass("hidden")}});TopicEmailSettingsMenu=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu_items").menu(this.$("#@menu_link"));
return false}))}});QuestionDistributionMenu=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu_items").menu(this.$("#@menu_link"));return false}))}});AddQuestionDistributionMenu=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu_items").menu(this.$("#@menu_link"),{position_relative:true,position_adjust:-3});return false}));this.$("#@all").click(this.fnbind(function(){this.$("#@value").val(this.types.all);
this.setCurrent(this.$("#@all"));return false}));this.$("#@topic").click(this.fnbind(function(){this.$("#@value").val(this.types.topic_followers);this.setCurrent(this.$("#@topic"));return false}));this.$("#@anon").click(this.fnbind(function(){this.$("#@value").val(0);this.setCurrent(this.$("#@anon"));return false}));if(this.default_type==this.types.topic_followers){this.$("#@value").val(this.types.topic_followers);this.setCurrent(this.$("#@topic"))}},getValue:function(){if(this.$("#@value").val()>=
0)return this.$("#@value").val();return null},setCurrent:function(c){this.deselectAll();c.addClass("selected");this.$("#@current").text(c.text())},resetValue:function(){this.$("#@value").val(this.types.all);this.setCurrent(this.$("#@all"))},deselectAll:function(){this.$("#@menu_items .selected").removeClass("selected")}});DistributeToLink=b.Component.extend({onLoad:function(){this.$("#@activate").click(this.fnbind(function(){this.serverCall("activate").kwargs({qid:this.qid,distribution:this.distribution}).liveMutate().send();
return false}));this.$("#@deactivate").click(this.fnbind(function(){this.serverCall("deactivate").kwargs({qid:this.qid}).liveMutate().send();return false}))}});UnsubscribeQuestionEmailsLink=b.Component.extend({onLoad:function(){this.$("#@unsubscribe").click(this.fnbind(function(){this.serverCall("unsubscribe").kwargs({qid:this.qid}).liveMutate().send()}))}});LiveLoginDialog=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#view_live_login_dialog_login").addClass("hidden");
this.$("#live_login_dialog_login").removeClass("hidden");return false}))}});NotHelpfulViewLink=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#@nothelpful_row").addClass("hidden");this.$("%not_helpful").removeClass("hidden");return false}))}});NegativeVotesViewLink=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#@nothelpful_row").addClass("hidden");this.$("%neg_votes").removeClass("hidden");return false}))}});
AdminLogItemView=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#@details").toggleClass("hidden");return false}))}});ClaimQuestionButton=b.Component.extend({onLoad:function(){this.$("#@claim").click(this.fnbind(function(){this.controller("claim").liveMutate().send();return false}));this.$("#@unclaim").click(this.fnbind(function(){this.controller("unclaim").liveMutate().send();return false}))}});ReviewQuestionButton=b.Component.extend({onLoad:function(){this.$("#@review").click(this.fnbind(function(){this.controller("review").liveMutate().send();
return false}));this.$("#@unreview").click(this.fnbind(function(){this.controller("unreview").liveMutate().send();return false}))}});TopicEmailNewQuestionsControl=b.Component.extend({onLoad:function(){this.$("#@enable").click(this.fnbind(function(){this.controller("enable_email").liveMutate().send();return false}));this.$("#@undo").click(this.fnbind(function(){this.controller("undo_enable_email").liveMutate().send();return false}))}});PresenceEditor=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu").menu(this.$("#@menu_link"));
return false}))}});PresenceEditLink=b.Component.extend({onLoad:function(){this.$("#@set_visibility").click(this.fnbind(function(){this.controller("set_visibility").kwargs({type:this.type}).liveMutate().send();return false}))}});MentionItem=b.Component.extend({onLoad:function(){this.$("#@mention").hover(this.fnbind(function(){this.lookup("remove").show()}),this.fnbind(function(){this.lookup("remove").hide()}))},hide:function(){this.$("#@mention").hide()},hideUndo:function(){this.$("#@mention_undo").hide()},
show:function(){this.$("#@mention").show()},showUndo:function(){this.hide();this.$("#@mention_undo").show();this.serverCall("load_undo").contentFor(this.$("#@mention_undo"),{parentCID:this.cid}).send()}});MentionRemoveLink=b.Component.extend({onLoad:function(){this.$("#@remove").tooltip({contents:"Remove Mention"}).click(this.fnbind(function(){this.parent().showUndo();this.serverCall("remove").liveMutate().send();return false}))},hide:function(){this.$("#@button").hide()},show:function(){this.$("#@button").show()}});
UndoMentionRemoveLink=b.Component.extend({onLoad:function(){this.$("#@undo").click(this.fnbind(function(){this.parent().parent().show();this.serverCall("undo").liveMutate().success(this.fnbind(function(){this.parent().parent().hideUndo()})).send();return false}))}});TopTopicAnswerer=b.Component.extend({onLoad:function(){this.$("#@answerer").hover(this.fnbind(function(){this.lookup("remove").show()}),this.fnbind(function(){this.lookup("remove").hide()}))}});TopTopicAnswererRemoveLink=b.Component.extend({onLoad:function(){this.$("#@remove").tooltip({contents:"Remove from Top Answerers"}).click(this.fnbind(function(){this.controller("remove").kwargs({tid:this.tid}).liveMutate().send();
return false}))},hide:function(){this.$("#@button").hide()},show:function(){this.$("#@button").show()}});TopTopicAnswererUndoRemoveLink=b.Component.extend({onLoad:function(){this.$("#@undo_remove").click(this.fnbind(function(){this.controller("undo_remove").kwargs({tid:this.tid}).liveMutate().send();return false}))}});OrderChildItemButtons=b.Component.extend({onLoad:function(){this.$("#@up").click(this.fnbind(function(){this.controller("move_up").liveMutate().send();return false}));this.$("#@down").click(this.fnbind(function(){this.controller("move_down").liveMutate().send();
return false}))}});AddTopicChildren=b.Component.extend({onLoad:function(){this.$("#@existing_link").click(this.fnbind(function(){this.$("#@existing_link").addClass("hidden");this.$("#@existing").removeClass("hidden");this.lookup("selector").focus();return false}))}});TopicSubtopicSelectorMenu=b.Component.extend({onLoad:function(){var c=false,f=false;this.$("#@menu_link").tooltip({contents:"Specify a child topic"}).click(this.fnbind(function(){if(c)this.showMenu();else{load_threshold=150;to=setTimeout(this.fnbind(function(){f=
true;this.showMenu();this.$("#@menu_items").addClass("loading")}),load_threshold);this.serverCall("load_topic_replace_menu").contentFor(this.$("#@menu_items"),{parentCID:this.cid}).success(this.fnbind(function(){clearTimeout(to);this.$("#@menu_items").removeClass("loading");c=true;f||this.showMenu()})).send()}return false}))},showMenu:function(){this.$("#@menu_items").menu(this.$("#@menu_link"),{position_relative:true,position_adjust:-3})}});QuestionContextTopicEditorLink=b.Component.extend({onLoad:function(){this.$("#@set_context").click(this.fnbind(function(){this.serverCall("set_context").kwargs({qid:this.qid,
context_tid:this.context_tid}).liveMutate().send();return false}))}});RemoveQuestionContextTopicLink=b.Component.extend({onLoad:function(){this.$("#@remove_context").click(this.fnbind(function(){this.serverCall("remove_context").kwargs({qid:this.qid}).liveMutate().send();return false}))}});TopicReplaceMenuContents=b.Component.extend({onLoad:function(){this.$(".menu_list_items a").click(this.fnbind(function(c){c=$(c.currentTarget).find(".invisible_info").attr("quoraid");this.serverCall("add_child_topic").kwargs({new_tid:c}).liveMutate().send();
return false}));this.$("#@add_child_box").click(this.fnbind(function(){return false}));setTimeout(this.fnbind(function(){this.$("#@add_child_box input.question_box").blur()}),1)}});OrganizeChildItem=b.Component.extend({toggleInstruction:function(){this.$("#@instruction").toggleClass("hidden")}});EditTopicShortName=b.Component.extend({onLoad:function(){this.$("#@edit_link").click(this.fnbind(function(){this.parent().toggleInstruction();this.$("#@edit").addClass("hidden");this.$("#@editor").removeClass("hidden");
this.$("#@input").focus();return false}));this.$("#@cancel").click(this.fnbind(function(){this.parent().toggleInstruction();this.$("#@edit").removeClass("hidden");this.$("#@editor").addClass("hidden");return false}));this.$("#@update").click(this.fnbind(function(){this.parent().toggleInstruction();this.controller("edit_short_name").kwargs({short_name:this.$("#@input").val()}).liveMutate().send();return false}))}});AddTopicSectionItem=b.Component.extend({onLoad:function(){this.$("#@add").click(this.fnbind(function(){this.$("#@instruction").addClass("hidden");
this.$("#@create").removeClass("hidden");this.lookup("selector").focus();return false}))}});QuestionTopicsEditor=b.Component.extend({onLoad:function(){this.$("#@done").click(this.fnbind(function(){this.toggleClasses();return false}))},focusSelector:function(){this.cQuery(":topic_list.selector_wrapper.selector").focus()},toggleClasses:function(){this.$("#@selector").toggleClass("hidden");this.$("#@view_topics").toggleClass("hidden");this.$("#@edit_topics").toggleClass("hidden");this.$("#@edit").toggleClass("hidden");
this.$("#@done").toggleClass("hidden")}});QuestionTopicEditorButton=b.Component.extend({onLoad:function(){this.$("#@edit").click(this.fnbind(function(){this.parent().toggleClasses();this.parent().focusSelector();return false}));this.$("#@add").click(this.fnbind(function(){this.parent().toggleClasses();this.parent().focusSelector();return false}))}});SettingsOption=b.Component.extend({onLoad:function(){this.$("#@view_option_link").click(this.fnbind(function(){this.$("#@view_option").toggleClass("hidden");
this.$("#@option_content").toggleClass("hidden");return false}))}});ChangePasswordOption=SettingsOption.extend({onLoad:function(){this._super.apply(this,arguments);this.clear_passwords=function(){this.$("#@old_password").val("");this.$("#@new_password").val("");this.$("#@confirm_password").val("")};this.$("#@view_option_link").click(this.fnbind(function(){this.$("#@old_password").focus();return false}));this.$("#@change_password_submit").click(this.fnbind(function(){W2.rpc("/settings/change_password_POST").kwargs({old_password:this.$("#@old_password").val(),
new_password:this.$("#@new_password").val()}).success(this.fnbind(function(c){this.clear_passwords();if(c[0]){this.$("#@old_password_no_match").addClass("hidden");this.$("#@password_changed").removeClass("hidden")}else{this.$("#@old_password_no_match").text(c[1]).removeClass("hidden");this.$("#@password_changed").addClass("hidden")}})).error(this.fnbind(function(){})).send();return false}))}});DeactivateAccountOption=SettingsOption.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@deactivate_account_submit").click(this.fnbind(function(){$(".content").dialog({title:"Confirm Account Deactivation",
contents:"Are you sure you want to deactivate your account?",buttons:{Deactivate:this.fnbind(function(){W2.rpc("/settings/deactivate_account_POST").success(this.fnbind(function(){window.location="/login?__pmsg__=deactivate_account"})).error(this.fnbind(function(){})).send()}),Cancel:null}});return false}))}});AdultSettingsOptionToggle=b.Component.extend({onLoad:function(){this.$("#@no_adult_content").click(this.fnbind(function(){this.controller("no_adult_content").liveMutate().send();return false}));
this.$("#@allow_adult_content").click(this.fnbind(function(){this.controller("allow_adult_content").liveMutate().send();return false}))}});ReviewerAdminOptionToggle=b.Component.extend({onLoad:function(){this.$("#@hide_reviewer_controls").click(this.fnbind(function(){this.controller("hide_reviewer_controls").liveMutate().send();return false}));this.$("#@show_reviewer_controls").click(this.fnbind(function(){this.controller("show_reviewer_controls").liveMutate().send();return false}))}});PersonalSearchSettingsOptionToggle=
b.Component.extend({onLoad:function(){this.$("#@public_link").click(this.fnbind(function(){this.toggle();this.controller("public").liveMutate().send();return false}));this.$("#@no_crawl_link").click(this.fnbind(function(){this.toggle();this.controller("no_crawl").liveMutate().send();return false}))},toggle:function(){this.$("#@public").toggleClass("hidden");this.$("#@no_crawl").toggleClass("hidden")}});AnswerAddInstructions=b.Component.extend({onLoad:function(){this.$("#@view_deleted_answer").click(this.fnbind(function(){this.$("#@deleted_answer").toggleClass("hidden");
return false}))}});AgreeToTermsMain=b.Component.extend({onLoad:function(){this.$("#@agree").click(this.fnbind(function(){if(this.$("#@agree").attr("checked")==true){this.$("#@continue").removeClass("hidden");this.$("#@note").addClass("hidden")}else{this.$("#@continue").addClass("hidden");this.$("#@note").removeClass("hidden")}}));this.$("#@continue").click(this.fnbind(function(){this.controller("agree").liveMutate().kwargs({agree:this.$("#@agree").attr("checked")}).success(this.fnbind(function(){document.location=
"/"})).send();return false}))}});MultiPeopleSelector=b.Component.extend({onLoad:function(){this.successCallback=null;this.submitted=false;this.$("#@submit").click(this.fnbind(function(){this.request();return false}));this.$("#@cancel").click(this.fnbind(function(){this.reset();return false}));this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu_items").menu(this.$("#@menu_link"));return false}));this.$("#@counter").click(this.fnbind(function(){this.$("#@counter").hasClass("active")?this.showAll():
this.filterToSelected();return false}));this.$("#@filter_select_all").click(this.fnbind(function(){this.filterSelectAll();return false}));this.$("#@filter_remove").click(this.fnbind(function(){this.showAll();return false}))},request:function(){var c=[];$.each(this.$("#@people_list .selected input"),function(){$(this).val()&&c.push($(this).val())});if(this.submitted||c.length<=0)return false;this.submitted=true;this.controller("mps_submit_controller").liveMutate().kwargs({uids:c}).success(this.fnbind(function(f){this.successCallback&&
this.successCallback(f);this.reset()})).send()},clearCounter:function(){this.$("#@counter").text("");this.$("#@counter").removeClass("active");this.$("#@counter").addClass("hidden")},decrementCounter:function(){this.updateCounter()},incrementCounter:function(){this.updateCounter()},updateCounter:function(){var c=0;$.each(this.$("#@people_list .selected"),function(){c++});if(c>0){this.$("#@counter").removeClass("hidden");this.$("#@counter").text(c+" Selected")}else{this.clearCounter();this.showAll()}},
showAll:function(){this.$("#@filter_note").addClass("hidden");this.$("#@menu_link").removeClass("active");this.$("#@counter").removeClass("active");this.$("#@people_list .visible").removeClass("visible");this.$("#@people_list").removeClass("hide_all");this.$("#@people_list").removeClass("filter_to_selected")},hideAll:function(){this.$("#@people_list").addClass("hide_all")},filterToSelected:function(){this.showAll();this.$("#@counter").addClass("active");this.$("#@people_list").addClass("filter_to_selected")},
filterToGroup:function(c,f){this.showAll();this.hideAll();this.$("#@filter_note").removeClass("hidden");this.$("#@filter_topic").text(f);this.$("%"+c).addClass("visible");this.$("#@menu_link").addClass("active")},filterSelectAll:function(){this.$("#@people_list .visible").addClass("selected");this.updateCounter()},reset:function(){this.$("#@people_list .selected").removeClass("selected");this.clearCounter();this.showAll()},setSuccessCallback:function(c){this.successCallback=c}});MPSPerson=b.Component.extend({onLoad:function(){this.$("#@person").hover(this.fnbind(function(){this.$("#@person").addClass("hover")}),
this.fnbind(function(){this.$("#@person").removeClass("hover")}));this.$("#@person").click(this.fnbind(function(){this.$("#@person").toggleClass("selected");this.lookup("mps").updateCounter();return false}))}});MPSFilterItem=b.Component.extend({onLoad:function(){this.$("#@item").click(this.fnbind(function(){this.parent().filterToGroup(this.group,this.text);return false}))}});HoverMenu=b.Component.extend({onLoad:function(){this.on=750;this.off=500;this.ht=this.st=null;this.cancelHover=this.loading=
this.loaded=false;this.$("a#@link").click(this.fnbind(function(){if(!this.getKwargs().inactive_link){this.cancelHover=true;this.doHide()}}));if(this.show_menu){this.$("#@link").hover(this.fnbind(function(){this.show()}),this.fnbind(function(){this.hide();this.cancelHover=false}));this.$("#@menu").hover(this.fnbind(function(){this.show()}),this.fnbind(function(){this.hide()}));this.setPosition()}},setPosition:function(){var c=this.$("#@link").outerHeight(),f=this.$("#@link").position();this.$("#@menu").css("top",
f.top+c+1+"px");this.$("#@menu").css("left",f.left+"px")},hide:function(){clearTimeout(this.st);var c=this.fnbind(function(){this.doHide()});this.ht=setTimeout(c,this.off)},doHide:function(){this.$("#@menu").addClass("hidden")},getKwargs:function(){if(this.kwargs)return this.kwargs;return{}},okToShowHoverMenu:function(){return true},show:function(){if(this.okToShowHoverMenu()){clearTimeout(this.ht);var c=this.fnbind(function(){this.doShow()});this.st=setTimeout(c,this.on);this.setPosition();if(!this.loaded&&
!this.loading){this.loading=true;this.controller("load_menu").kwargs(this.getKwargs()).contentFor(this.$("#@menu_contents"),{parentCID:this.cid}).success(this.fnbind(function(){this.loaded=true;this.loading=false})).except(this.fnbind(function(){this.loading=false})).send()}}},doShow:function(){this.cancelHover||this.$("#@menu").removeClass("hidden").show()}});TopicParentsLink=b.Component.extend({onLoad:function(){this.$("#@view_parent").tooltip({contents:"View Topic Parent"}).click(this.fnbind(function(){this.$("#@view_parent").removeClass("topic_parent_link");
this.$("#@parents").removeClass("hidden");return false}))}});UserTopicEndorsementsText=b.Component.extend({onLoad:function(){this.$("#@toggle_endorsements").click(this.fnbind(function(){this.lookup("endorsements").$("#@endorsements").toggle();return false}))}});UserTopicEndorsements=b.Component.extend({toggle:function(){this.$("#@endorsements").toggleClass("hidden")}});AnswerSendNotificationsLink=b.Component.extend({onLoad:function(){this.$("#@send_notifications").click(this.fnbind(function(){this.controller("send_notifications").liveMutate().send();
return false}))}});ReviewAnswerItem=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#@answer").removeClass("hidden");this.$("#@view_answer").addClass("hidden");return false}))}});AddMonitorQuestionLink=b.Component.extend({onLoad:function(){this.$("#@add_monitor").click(this.fnbind(function(){this.controller("add_monitor").liveMutate().send();return false}))}});RemoveMonitorQuestionLink=b.Component.extend({onLoad:function(){this.$("#@remove_monitor").click(this.fnbind(function(){this.controller("remove_monitor").liveMutate().send();
return false}))}});RemoveAsSpamLink=b.Component.extend({onLoad:function(){this.$("#@undo_not_helpful").click(this.fnbind(function(){this.serverCall("undo_not_helpful").kwargs({aid:this.aid}).liveMutate().send();return false}))}});CollapseAnswerLink=b.Component.extend({onLoad:function(){this.$("#@undo_not_collapsible").click(this.fnbind(function(){this.serverCall("undo_not_collapsible").kwargs({aid:this.aid}).liveMutate().send();return false}));this.$("#@undo_collapse").click(this.fnbind(function(){this.serverCall("undo_collapse").kwargs({aid:this.aid}).liveMutate().send();
return false}));this.$("#@collapse").click(this.fnbind(function(){this.serverCall("collapse").kwargs({aid:this.aid}).liveMutate().send();return false}))}});SuggestedEditSaveButton=b.Component.extend({onLoad:function(){this.$("#@accept").click(this.fnbind(function(){this.controller("publish_edit").liveMutate().send();return false}))}});UserAdminMenuLink=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu").menu(this.$("#@menu_link"),{align_right:true});
return false}))}});AdminMode=b.Component.extend({toggle:function(){this.controller("toggle").success(this.fnbind(function(){})).liveMutate().send()},onLoad:function(){this.$("#@toggle").click(this.fnbind(function(){this.toggle();return false}));this._state=0;this.listen&&$(document).bind("keydown",this.fnbind(function(c){switch(this._state){case 0:this._state=1*(c.keyCode==81);break;case 1:this._state=2*(c.keyCode==49);break;case 2:this._state=3*(c.keyCode==81);break;case 3:if(this._state=4*(c.keyCode==
49)){this.toggle();this._state=0}break;default:this._state=0}}))}});TopicMergeUnmerge=b.Component.extend({onLoad:function(){this.$("#@show_merge").click(this.fnbind(function(){this.$("#@merge").removeClass("hidden");this.$("#@show_merge").addClass("hidden");this.cQuery(":standalone.selector").focus();return false}))}});TopicRelated=b.Component.extend({onLoad:function(){this.$("#@view_all").click(this.fnbind(function(){this.$("#@all").removeClass("hidden");this.$("#@preview").addClass("hidden");return false}))}});
TopicQuestionAdd=b.Component.extend({onLoad:function(){this.$("#@placeholder").focus(this.fnbind(function(){this.showQuestionForm();return false}))},showQuestionForm:function(){this.$("#@placeholder_row").addClass("hidden");this.$("#@add_question_row").removeClass("hidden");this.lookup("selector").focus()}});MobileQuestionTopics=b.Component.extend({onLoad:function(){},toggleTopicEditor:function(){this.$("#@view_topics_list").toggleClass("hidden");this.$("#@edit_topics_list").toggleClass("hidden")}});
MobileEditTopicsLink=b.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.lookup("question_topics").toggleTopicEditor();return false}))}});ThreadComposeMessageBox=b.Component.extend({onLoad:function(){this.$("#@submit").click(this.fnbind(function(){this.lookup("editor").request();return false}))}});TruncatePhraseList=b.Component.extend({onLoad:function(){this.show_tooltip_on_more&&this.$("#@view_all_link").tooltip({contents:"Click to view all"});this.$("#@view_all_link").click(this.fnbind(function(){this.$("#@view_all").addClass("hidden");
this.$("#@view_all_link").addClass("hidden");this.$("#@all_phrases").removeClass("hidden");return false}))}});FollowAllPeopleSuggestionsButton=b.Component.extend({onLoad:function(){this.$("#@follow_all").click(this.fnbind(function(){this.serverCall("follow_all").success(function(){$("#suggs").addClass("hidden")}).send();return false}))}});PeopleCardRow=b.Component.extend({onLoad:function(){this.$("#@person").hover(this.fnbind(function(){this.$("#@person").addClass("hover");this.$("#@buttons").removeClass("hidden")}),
this.fnbind(function(){this.$("#@person").removeClass("hover");this.$("#@buttons").addClass("hidden")}));this.$("#@remove").tooltip({contents:"Do not suggest"}).click(this.fnbind(function(){this.controller("do_not_suggest").success(this.fnbind(function(){this.$("#@person").addClass("hidden")})).send();return false}))}});InboxThreadPreviewItem=b.Component.extend({onLoad:function(){this.$("#@item").click(this.fnbind(function(){document.location=unescape(this.url);return false}));this.$("#@item a").each(function(){$(this).click(function(){document.location=
$(this).attr("href");return false})})}});DeleteContactsButton=b.Component.extend({onLoad:function(){this.$("#@delete").click(this.fnbind(function(){$(".content").dialog({title:"Delete Imported Contacts",contents:"Are you sure you want to delete your imported contacts?",buttons:{"Delete Contacts":this.fnbind(function(){this.controller("delete_contacts").success(this.fnbind(function(){this.close();location.reload(true)})).send()}),Cancel:null}});return false}))},close:function(){$("#generic_dialog").remove()}});
VoteButton=b.Component.extend({onLoad:function(){this.$("#@remove_vote_link").tooltip({contents:"Remove request to answer"}).click(this.fnbind(function(){this.serverCall("remove_wanted_answer").kwargs({qid:this.qid,asked_uid:this.uid}).liveMutate().send();return false}));this.$("#@vote_up_link").tooltip({contents:"Ask this person to answer"}).click(this.fnbind(function(){this.serverCall("add_wanted_answer").kwargs({qid:this.qid,asked_uid:this.uid}).success(this.fnbind(function(c){if(!c){this.lookup("wanted_selector").$("#@reason").removeClass("hidden");
this.lookup("wanted_selector").$("#@reason").setContentFromAJAXComponent("/question/ajax_wanted_answer_pass_reason_POST",{qid:this.qid,uid:this.uid})}})).liveMutate().send();return false}))}});RemoveMyEndorsementButton=b.Component.extend({onLoad:function(){this.$("#@remove_endorsement_link").tooltip({contents:"Remove this endorsement"}).click(this.fnbind(function(){this.serverCall("remove_endorsement").liveMutate().send();return false}))}});VoteCount=b.Component.extend({onLoad:function(){this.names&&
this.$("#@votes").tooltip({contents:"Asked by "+this.names})}});DeletePendingQuestionLink=b.Component.extend({onLoad:function(){this.$("#@delete").click(this.fnbind(function(){$(".content").dialog({title:"Delete Anonymous Question",contents:"Are you sure you want to delete this question from your pending questions list?",mobile:this.mobile,buttons:{Delete:this.fnbind(function(){this.controller("delete_pending").liveMutate().send()}),Cancel:null}});return false}))}});ApproveAnonQuestionLink=b.Component.extend({onLoad:function(){this.$("#@approve").tooltip({contents:"Anonymous questions must be approved before they are visible"}).click(this.fnbind(function(){this.controller("approve_pending").liveMutate().success(this.fnbind(function(c){document.location=
c})).send();return false}))}});WantedAnswerSelector=b.Component.extend({onLoad:function(){this.privacy_warned=false;this.lookup("selector").setExtraFocus(this.fnbind(function(){if(this.viewer_private&&!this.privacy_warned){this.privacy_warned=true;$(".content").dialog({title:"Privacy Note",contents:"Asking someone to answer a question will expose your name in the request and in this area of the question page.",mobile:this.mobile,buttons:{Ok:this.fnbind(function(){this.lookup("selector").focus()})}})}}));
this.lookup("selector").inputKeyup=this.fnbind(function(){this.lookup("selector").onInputChange();var c=this.lookup("selector").getValue();c.indexOf("@")>0?this.$("#@invite_button").removeClass("hidden"):this.$("#@invite_button").addClass("hidden")});this.$("#@invite").click(this.fnbind(function(){var c=this.lookup("selector").getValue();$(".content").dialog({mobile:this.mobile,title:"Invite "+escape(c)+" to Quora",url:"/contacts/ajax_invite_dialog_GET?email="+escape(c)+"&qid="+this.qid,id:"invite_dialog",
buttons:null});this.lookup("selector").setValue("");this.$("#@invite_button").addClass("hidden");return false}))},setTo:function(c){c&&c!=""&&this.controller("add_wanted_answer").kwargs({uid:c}).success(this.fnbind(function(f){if(!f){this.$("#@reason").removeClass("hidden");this.$("#@reason").setContentFromAJAXComponent("/question/ajax_wanted_answer_pass_reason_POST",{qid:this.qid,uid:c})}this.clear()})).liveMutate().send()},clear:function(){this.lookup("selector").inputBlur()}});AggregatedNotification=
b.Component.extend({onLoad:function(){this.$("#@expand").click(this.fnbind(function(){this.$("#@notifs").toggleClass("hidden");return false}))}});GlobalFeedLink=b.Component.extend({onLoad:function(){this.$("#@count").tooltip({contents:this.count+" Unorganized Question"+(this.count==1?"":"s")})},clicked:function(){this.lookup("tabs").selectTab("need_topics")}});QTextDiff=b.Component.extend({onLoad:function(){this.$("#@more_link").click(this.fnbind(function(){this.$("#@diff_snip").addClass("hidden");
this.$("#@full_diff").removeClass("hidden");return false}))}});SuggestedQuestionItem=b.Component.extend({onLoad:function(){this.$("#@ignore_button").tooltip({contents:"Ignore this Question Suggestion"}).click(this.fnbind(function(){this.controller("ignore_question").liveMutate().send();return false}))}});SendSuggestions=b.Component.extend({toggle:function(){this.$("#@suggestions").toggleClass("hidden")},show:function(){this.$("#@suggestions").removeClass("hidden")},hide:function(){this.$("#@suggestions").addClass("hidden")}});
InlineTabs=b.Component.extend({onLoad:function(){if(this.use_ajax){if(window.location.hash.substr(0,5)=="#tab_"){var c=window.location.hash.substr(5);c!=this.tab&&this.tabs.indexOf(c)>0&&this.selectTab(c)}$.each(this.tabs,this.fnbind(function(f,o){this.lookup("tabs").getTab(o).click(this.fnbind(function(){this.selectTab(o);return false}))}))}},selectTab:function(c){window.location.hash="#tab_"+c;$("body").css("height",$("body").height()+"px");this.lookup("tabs").setTab(c);$.each(this.tabs,this.fnbind(function(f,
o){this.$("#@"+o).addClass("hidden")}));this.$("#@"+c).removeClass("hidden");this.$("#@"+c).text()==""&&this.$("#@"+c).setContentFromAJAXComponent("/tabs/change_tab_POST",{tab:c,type:this.type,object_id:this.object_id},this.cid,null,this.fnbind(function(){$("body").css("height","auto")}))}});PillTabs=b.Component.extend({onLoad:function(){},setTab:function(c){this.$("#@tabs .selected").removeClass("selected");this.$("#@"+c).addClass("selected")},getTab:function(c){return this.$("#@"+c)}});QtextTruncate=
b.Component.extend({init:function(){this._super.apply(this,arguments);this.callback=null},onLoad:function(){this.$("#@more_link").click(this.fnbind(function(){this.viewMore();this.callback&&this.callback();return false}))},setCallback:function(c){this.callback=c},viewMore:function(){this.$("#@text_snip").addClass("hidden");this.$("#@full_text").removeClass("hidden")}});TruncatedQText=b.Component.extend({onLoad:function(){this.$("#@more_link").click(this.fnbind(function(){this.lookup("expandable_qtext").expand();
return false}))}});ExpandableQText=b.Component.extend({onLoad:function(){if(!this.callback)this.callback=null},setCallback:function(c){this.callback=c},expand:function(){this.$("#@truncated").addClass("hidden");this.$("#@expanded").removeClass("hidden");this.callback&&this.callback()}});FeedAnswerItem=b.Component.extend({onLoad:function(){this.$("#@answer_rating").tooltip({contents:this.tt}).click(this.fnbind(function(){if(!this.author&&this.truncated){this.child("expandable_qtext").expand();this.show()}return false}));
this.truncated&&this.child("expandable_qtext").setCallback(this.fnbind(function(){this.show()}))},show:function(){if(!this.author&&this.allow_voting){this.$("#@answer_rating").addClass("hidden");this.$("#@answer_voting").removeClass("hidden")}this.$("#@answer_voters").removeClass("hidden");this.$("#@answer_actions").removeClass("hidden");this.$("#@answer_user_sig .user_sig_source").show()}});ThreadMessage=b.Component.extend({onLoad:function(){window.scrollBy(0,5E5);window.scrollBy(0,5E5)}});ThreadPresenceMonitor=
b.Component.extend({onLoad:function(){if(this.monitor){this.disabled=false;$(document).mousemove(this.fnbind(function(c){this.onPresence(c)}));$(document).keypress(this.fnbind(function(c){this.onPresence(c)}))}},onPresence:function(){if(!this.disabled){this.disabled=true;W2.rpc("/thread/ajax_report_thread_presence_POST").kwargs({thread_id:this.thread_id}).send()}}});HomeFeedPresenceMonitor=b.Component.extend({onLoad:function(){if(this.monitor){this.disabled=false;$(document).mousemove(this.fnbind(function(c){this.onPresence(c)}));
$(document).keypress(this.fnbind(function(c){this.onPresence(c)}))}},onPresence:function(){if(!this.disabled){this.disabled=true;W2.rpc("/ajax/ajax_report_home_feed_presence_POST").send()}}});QuestionBestSourceIcon=b.Component.extend({onLoad:function(){this.comment?this.$("#@icon").tooltip({contents:"Best Source: "+this.comment}):this.$("#@icon").tooltip({contents:"Question marked as the best source for related information."})}});NotificationsClearButton=b.Component.extend({onLoad:function(){this.$("#@clear").click(this.fnbind(function(){this.serverCall("mark_as_seen").liveMutate().send();
return false}))}});NotificationPreview=b.Component.extend({onLoad:function(){this.$("#@details").click(this.fnbind(function(){this.$("#@notification_details").toggleClass("hidden");return false}));this.$("#@notification").click(this.fnbind(function(){this.$("#@notification_diff").toggleClass("hidden");return false}))}});FlagHasEnoughTopicsLink=b.Component.extend({onLoad:function(){this.$("#@has_enough_topics").click(this.fnbind(function(){this.controller("has_enough_topics").liveMutate().send();return false}));
this.$("#@doesnot_have_enough_topics").click(this.fnbind(function(){this.controller("doesnot_have_enough_topics").liveMutate().send();return false}))}});RelatedQuestionsMain=b.Component.extend({onLoad:function(){this.$(".@close_related_questions_editor_link").click(this.fnbind(function(){this.$("#@related_questions").removeClass("hidden");this.$("#@related_questions_editor").hide();this.$("#@related_questions_editor").addClass("hidden");return false}));this.$("#related_questions_editor_link").click(this.fnbind(function(){this.$("#@related_questions").addClass("hidden");
this.$("#@related_questions_editor").removeClass("hidden");this.$("#@related_questions_editor").hide();this.$("#@related_questions_editor").fadeIn();return false}))}});RelatedQuestions=b.Component.extend({onLoad:function(){this.$("#@related_questions_more_link").click(this.fnbind(function(){this.$("#@more_related_questions").removeClass("hidden");this.$("#@related_questions_more_link").addClass("hidden");return false}))}});RelatedQuestionsItemEditor=b.Component.extend({onLoad:function(){this.$("#@remove_related_question").tooltip({contents:"Remove"});
this.$("#@remove_related_question").click(this.fnbind(function(){$(".content").dialog({title:"Remove Related Question",contents:"Remove this question from the related questions list?",buttons:{Remove:this.fnbind(function(){this.serverCall("remove_related_question").kwargs({qid:this.qid,rel_qid:this.rel_qid}).liveMutate().send()}),Cancel:null}});return false}))}});NUXFollowingListMain=b.Component.extend({onLoad:function(){this.$("#@show_following_list").click(this.fnbind(function(){this.$("#@following_list").toggleClass("hidden");
return false}))}});NotifHeaderBar=b.Component.extend({onLoad:function(){this.num>0&&window.location.hash.substr(0,1)=="#"&&!this.mobile&&this.initBar()},initBar:function(){this.headerHeight=$("#layout_header").outerHeight();this.barHeight=this.$("#@bar").outerHeight();this.barMarginBtm=parseInt(this.$("#@bar").css("margin-bottom").replace("px",""));$(window).scroll(this.fnbind(function(){this.setPosition()}));var c=this.fnbind(function(){this.setPosition()});setTimeout(c,50)},setPosition:function(){var c=
$(window).scrollTop(),f=this.barHeight+this.barMarginBtm;if(c>this.headerHeight){this.$("#@bar").addClass("header_bar_fixed");$("#layout_header").css("margin-bottom",f+"px")}else{this.$("#@bar").removeClass("header_bar_fixed");$("#layout_header").css("margin-bottom","0px")}}});AdminModeBar=NotifHeaderBar.extend({onLoad:function(){this._super.apply(this,arguments);this.mobile||this.initBar()}});NotifHeaderBarButtons=b.Component.extend({onLoad:function(){this.locked=false;$(document).keydown(this.fnbind(function(c){return this.docKeydown(c)}));
this.$("#@next").click(this.fnbind(function(){this.gotoNext();return false}))},gotoNext:function(){if(this.next_url)document.location=this.next_url},isLocked:function(){var c=false;$("input, textarea, .qtext_editor_content").each(function(){if($(this).attr("focused")=="true")c=true});return this.locked||c},docKeydown:function(c){c=c||window.event;if(this.isLocked())return true;if(c.keyCode==39){this.gotoNext();return false}}});CreateAnswerWikiLink=b.Component.extend({onLoad:function(){this.$("#@create_answer_wiki").click(this.fnbind(function(){$("#answer_wiki").toggleClass("hidden");
return false}))}});ReportLink=b.Component.extend({onLoad:function(){var c={title:"Flag Content",comment_form:"Please explain why you are flagging this content",mobile:this.mobile,buttons:{Ok:this.fnbind(this._request),Cancel:null}};this.$("#@report_link").click(function(){$(".content").dialog(c);return false})},_request:function(){var c={};if(!(c.id=this.id)||!(c.type=this.type)||!(c.comment=$("#dialog_comment").val()))return false;this.serverCall("report").kwargs(c).success(this.fnbind(function(){$.serverLog("Content Flagged",
"INFO",c);a1ert("Content Flagged")})).liveMutate().send()}});AnswerThanksLink=b.Component.extend({onLoad:function(){this.$("#@answer_thanks_link").click(this.fnbind(function(){this.serverCall("send_thanks").kwargs({aid:this.aid}).liveMutate().send();return false}))}});LogoutNavElement=b.Component.extend({onLoad:function(){this.$("#@logout_link").click(this.fnbind(function(){this.$("#@logout_form").submit();return false}))}});ResetPassword=b.Component.extend({onLoad:function(){this.$("#@reset_email_submit").click(this.fnbind(function(){var c=
this.$("#@email_input").val();if(!c)return false;this.emailRequest("/settings/send_reset_password_email_POST",c);return false}));this.$("#@reset_password_submit").click(this.fnbind(function(){var c=this.$("#@reset_password_code").val(),f=this.$("#@new_password").val();if(!f)return false;this.passwordRequest("/settings/reset_password_POST",c,f);return false}))},emailRequest:function(c,f){W2.rpc(c).kwargs({email:f}).success(this.fnbind(function(){this.$("#@email_input").val("");this.$("#@reset_email_conf").removeClass("hidden");
this.$("#@reset_email_form").addClass("hidden")})).send();return false},passwordRequest:function(c,f,o){W2.rpc(c).kwargs({code:f,new_password:o}).success(this.fnbind(function(m){window.location=m?"/login/index?__pmsg__=password_changed":"/settings/reset_password?__pmsg__=password_change_error"})).send();return false}});SettingsMain=b.Component.extend({onLoad:function(){this.$("#@add_another_email_link").click(this.fnbind(function(){this.$("#@add_another_email_row").toggleClass("hidden");this.$("#@add_email_input_row").toggleClass("hidden");
this.$("#@new_email").focus();return false}));this.$("#@add_another_email").click(this.fnbind(function(){var c=this.$("#@new_email").val();if(!c)return false;this.serverCall("add_email").kwargs({email:c}).liveMutate().send();return false}))}});AdultContentSettings=b.Component.extend({isAllowChecked:function(){return this.$("#@adult_content_checkbox").attr("checked")}});EmailAddressRow=b.Component.extend({onLoad:function(){var c=this,f={resend:function(){return c._serverCallHelper("resend_email_confirmation")},
primary:function(){return c._serverCallHelper("set_primary_email")},remove:function(){return c._serverCallHelper("remove_email")}};this.$("#@confirm_email").click(function(){$(".content").dialog({title:"Resend Confirmation Email",contents:"Resend a confirmation email to "+c.email+".",buttons:{Send:f.resend,Cancel:null}});return false});this.$("#@make_primary").click(f.primary);this.$("#@delete_email").click(function(){$(".content").dialog({title:"Remove Email Address",contents:"Are you sure you want to delete the "+
c.email+" address?",buttons:{Delete:f.remove,Cancel:null}});return false})},_serverCallHelper:function(c){this.serverCall(c).kwargs({email:this.email}).liveMutate().send();return false}});EmailSettingsSection=b.Component.extend({onLoad:function(){this.$("#@view_section_link").click(this.fnbind(function(){this.$("#@view_section").removeClass("hidden");this.$("#@view_section_span").addClass("hidden");return false}))}});LoginButton=b.Component.extend({onLoad:function(){this.$("#@login_link").click(this.fnbind(function(){window.location=
"/login/index?next="+escape(window.location);return false}))}});ToFollowList=b.Component.extend({onLoad:function(){this.$("#selectall").click(this.fnbind(function(){this.selectAll()}))},selectAll:function(){if(this.$("#selectall").attr("checked")){this.$("input").attr("checked",true);this.$(".list_row").addClass("selected")}else{this.$("input").attr("checked",false);this.$(".list_row").removeClass("selected")}}});ToInviteList=ToFollowList.extend({onLoad:function(){this._super.apply(this,arguments);
this.$("#@view_add_emails").click(this.fnbind(function(){this.$("#@view_add_emails").addClass("hidden");this.$("#@manual_emails").removeClass("hidden");return false}))}});InviteButton=b.Component.extend({onLoad:function(){this.$("#@invite").click(this.fnbind(function(){var c=this.name?this.name:this.email;$(".content").dialog({title:"Invite "+unescape(c)+" to Quora",url:"/contacts/ajax_invite_dialog_GET?email="+this.email,mobile:this.mobile,id:"invite_dialog",buttons:null});return false}))}});InviteConfirmationDialog=
b.Component.extend({onLoad:function(){this.$("#@send").click(this.fnbind(function(){this.request();return false}));this.$("#@cancel").click(this.fnbind(function(){this.close();return false}))},request:function(){var c=this.lookup("msg").getVal(),f=[],o=[];$("#invite_dialog .temp_topics_list input").each(function(){f.push($(this).val())});$("#invite_dialog .temp_suggested_question input").each(function(){o.push($(this).val())});W2.rpc("/contacts/ajax_send_invite_POST").kwargs({email:this.email,msg:c,
topics:f,questions:o}).liveMutate().success(this.fnbind(function(){this.close()})).send()},close:function(){$("#invite_dialog").remove()}});PersonalMessage=ToFollowList.extend({onLoad:function(){this.$("#@view_personal_message").click(this.fnbind(function(){this.$("#@view_personal_message").addClass("hidden");this.$("#@personal_message").removeClass("hidden");return false}))},getVal:function(){return this.$("#@msg").val()}});ToFollowListItem=b.Component.extend({onLoad:function(){this.$("#@list_row").hover(this.fnbind(function(){this.$("#@list_row").addClass("hover")}),
this.fnbind(function(){this.$("#@list_row").removeClass("hover")}));this.$("#@chkbox").click(this.fnbind(function(c){this.onCheck();c.stopPropagation()}));this.$("#@list_row").click(this.fnbind(function(){if(!this.$("#@chkbox").attr("disabled")){if(this.$("#@chkbox").attr("checked"))this.$("#@chkbox").attr("checked",false);else{this.$("#@chkbox").attr("checked",true);this.$("#selectall").attr("checked",false)}this.onCheck()}}))},onCheck:function(){this.$("#@list_row").toggleClass("selected");this.max!=
null&&this.atMax()},atMax:function(){var c=0;$("input[type='checkbox']").each(function(){$(this).attr("checked")&&c++});if(c>=this.max){$("input[type='checkbox']").each(function(){$(this).attr("checked")||$(this).attr("disabled",true)});return true}else{$("input[type='checkbox']").attr("disabled",false);return false}}});ToInviteListItem=ToFollowListItem.extend({onLoad:function(){this._super.apply(this,arguments)},onCheck:function(){this.$("#@list_row").toggleClass("selected");this.$("#@list_row").removeClass("can_select");
this.max!=null&&this.atMax();this.lookup("suggestions").toggle();this.$("#@list_row").unbind("click")}});InviteByEmailAddress=b.Component.extend({onLoad:function(){this.$("#@more").click(this.fnbind(function(){this.$("#@more").addClass("hidden");this.$("#@email_addresses .hidden_fields").removeClass("hidden");return false}))}});InviteByEmailAddressItem=b.Component.extend({onLoad:function(){this.$("#@email").bind("blur",this.fnbind(function(){if(this.$("#@email").val()){this.lookup("suggestions").show();
this.cQuery(":suggestions.topic.topic_add").setoid(this.$("#@email").val());this.cQuery(":suggestions.question").setObjectID(this.$("#@email").val());return false}}))}});ClearAnswerDraft=b.Component.extend({onLoad:function(){this.$("#@clear_draft").click(this.fnbind(function(){$(".content").dialog({title:"Clear Answer Draft",contents:"Are you sure you want to delete this draft? You will lose your work.",buttons:{"Clear Draft":this.fnbind(function(){this.controller("clear_draft").liveMutate().send()}),
Cancel:null}});return false}))}});DraftStatus=b.Component.extend({onLoad:function(){this.$("#@draft_status_clear").click(this.fnbind(function(){$(".content").dialog({title:"Clear Draft",contents:"Are you sure you want to delete this draft? You will lose your work.",buttons:{"Clear Draft":this.fnbind(function(){W2.rpc("/ajax/ajax_clear_draft_POST").kwargs({draft_space:this.draft_space}).liveMutate().send()}),Cancel:null}});return false}))}});InlineEditor=b.Component.extend({onLoad:function(){this.input_obj=
this.$("#@"+this.input);this.input_button="inline_editor_submit";this.input_button_obj=this.$("#@"+this.input_button);if(this.draft_space){this.draft_button="inline_editor_save_draft";this.draft_button_obj=this.$("#@"+this.draft_button)}this.toggle_callback=null;this.locked=false;this.$("#@inline_editor_content").hover(this.fnbind(function(){this.$("#@inline_editor_content").addClass("hover")}),this.fnbind(function(){this.$("#@inline_editor_content").removeClass("hover")}));this.$("#@inline_editor_link").click(this.fnbind(function(){this.toggle_editor();
return false}));this.$("#@inline_editor_cancel").click(this.fnbind(function(){this.toggle_editor();var c=this.lookup("name_validator");c&&c.hideAllErrors();return false}));this.$("#@inline_editor_create_link").click(this.fnbind(function(){this.toggle_editor();return false}));this.input_button_obj.click(this.fnbind(function(){W2.InputValidator.validate(this,{valid:this.fnbind(this.trigger_request),invalid:function(){}});return false}));if(this.draft_space){this.lookup("editor").setFocusCallback(this.fnbind(function(){this.$("#@inline_editor_save_draft").removeClass("hidden")}));
this.draft_button_obj.click(this.fnbind(function(){this.save_draft(true);return false}));this.lookup("editor").setMeaningfulChangeCallback(this.fnbind(function(){this.save_draft(false)}))}this.focus_onload&&this.focusInput();this.typing_area&&this.lookup("editor").setTypingStateCallback(this.fnbind(function(c){this.serverCall("typing").kwargs({area:this.typing_area,state:c}).send()}))},get_value:function(){return this.is_qtext?this.lookup("editor").serialize():this.input_obj.val()},save_draft:function(c){var f=
c?"save_draft":"save_draft_auto";f=this.serverCall(f).kwargs({content:this.get_value(),window_id:W2.windowId,draft_space:this.draft_space});c&&f.liveMutate();f.send()},server_call_method:"edit",_get_kwargs:function(){return{id:this.id,input:this.get_value()}},trigger_request:function(){this.typing_area&&this.lookup("editor").stopTyping();if(this.locked)return false;this.locked=true;this.serverCall(this.server_call_method).kwargs(this._get_kwargs()).success(this.fnbind(function(){this.ajax_callback();
this.locked=false})).error(function(){a1ert("Error updating")}).liveMutate().send()},ajax_callback:function(){this.toggle_editor()},focusInput:function(){this.is_qtext?$(".qtext_editor_content").focus():this.input_obj.focus()},setToggleCallback:function(c){this.toggle_callback=c},toggle_editor:function(){this.$("#@inline_editor_content").toggleClass("hidden");this.$("#@inline_editor_form").toggleClass("hidden");this.input_obj.focus();this.toggle_callback&&this.toggle_callback()}});ThreadMessageInlineEditor=
InlineEditor.extend({trigger_request:function(){this.typing_area&&this.lookup("editor").stopTyping();this.lookup("editor").request()},server_call_method:"UNDEFINED_SERVER_CALL_METHOD",_get_kwargs:function(){$.serverLog("Tried to call ThreadMessageInlineEditor#_get_kwargs()","ERROR");throw"UNDEFINED_KWARGS";}});SuggestedAnswerEditor=InlineEditor.extend({onLoad:function(){this._super.apply(this,arguments);this.setToggleCallback(this.fnbind(function(){this.parent().toggleButtons&&this.parent().toggleButtons()}));
this.$("#@add_comment_link").click(this.fnbind(function(){this.$("#@comment_box").removeClass("hidden");this.$("#@add_comment_link").addClass("hidden");this.lookup("comment_editor").focus();return false}))},_get_kwargs:function(){var c="";if(this.has_comment&&!this.lookup("comment_editor").isEmpty())c=this.lookup("comment_editor").serialize();return{aid:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,notif:this.$("#@notif").attr("checked")?1:0,comment:c}}});NewAnswerEditor=InlineEditor.extend({onLoad:function(){this._super.apply(this,
arguments);this.lookup("editor").setFocusCallback(this.fnbind(function(){this.$("#@later").addClass("hidden");this.$("#@draft").removeClass("hidden")}))}});CreateAnswerWikiInlineEditor=InlineEditor.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@inline_editor_cancel").click(this.fnbind(function(){this.toggle_editor();$("#answer_wiki").addClass("hidden");return false}))},_get_kwargs:function(){return{qid:this.id,input:this.get_value()}}});AnswerWikiInlineEditor=InlineEditor.extend({_get_kwargs:function(){var c=
"";if(this.has_comment&&!this.lookup("comment_editor").isEmpty())c=this.lookup("comment_editor").serialize();return{qid:this.id,input:this.get_value(),sugg_exists:this.sugg_exists,comment:c,notif:this.$("#@notif").attr("checked")?1:0}}});AnswerContent=b.Component.extend({onLoad:function(){this.$("#@view_suggestion").click(this.fnbind(function(){this.toggleSuggestion();return false}))},toggleSuggestion:function(){this.$("#@original_answer").toggleClass("hidden");this.$("#@suggestion_diff").toggleClass("hidden")}});
SuggestedEditBar=b.Component.extend({toggleButtons:function(){this.$("#@suggested_answer_buttons").toggleClass("hidden")}});SuggestedEditButtons=b.Component.extend({onLoad:function(){this.$("#@view_original").click(this.fnbind(function(){this.parent().parent().toggleSuggestion();return false}))}});GiveUserSigInlineEditor=InlineEditor.extend({_get_kwargs:function(){return{tid:this.tid,to_uid:this.to_uid,bio:this.get_value()}}});TopicAliases=b.Component.extend({onLoad:function(){var c=this.fnbind(this.addAliasSubmit);
this.$("#@topic_alias_add").click(c);this.$("#@topic_alias_add_form").submit(c)},get_value:function(){return this.$("#@topic_alias_input").val()},addAliasSubmit:function(){this._request(this.get_value());return false},_request:function(c){if(!this.tid||!c)return false;this.serverCall("add_topic_alias").kwargs({tid:this.tid,alias:c}).success(this.fnbind(function(){this.$("#@topic_alias_input").val("");this.$("#@topic_alias_input").focus()})).liveMutate().send()}});TopicAlias=b.Component.extend({onLoad:function(){var c=
{title:"Topic Alias Deletion",contents:"Are you sure you wish to delete this alias?",buttons:{Ok:this.fnbind(this._request),Cancel:null}};this.$("#@topic_alias_remove").click(function(){$(".content").dialog(c);return false})},_request:function(){if(!this.tid||!this.alias)return false;this.serverCall("remove_topic_alias").kwargs({tid:this.tid,alias:this.alias}).liveMutate().send()}});TopicDialog=b.Component.extend({onLoad:function(){this.lookup("editor").focus();W2.topicDialog=this}});RevertDialog=
b.Component.extend({onLoad:function(){this.lookup("editor").focus();W2.revertDialog=this}});TopicSelectorAdd=b.Component.extend({onLoad:function(){this.$("#@add_btn").click(this.fnbind(function(){this.select();return false}))},select:function(){this.type=="to_tid"?$(".content").dialog({title:"Topic Merge",url:"/ajax/topic_merge_dialog",buttons:{Ok:this.fnbind(this._request),Cancel:null}}):this._request()},_get_kwargs:function(){var c,f={};if(!(f.tid=this.oid)||!(f.type=this.type)||!(f.topic_name=
this.parent().qValue)||/^\s*$/.test(f.topic_name)||this.type=="to_tid"&&(c=W2.topicDialog.lookup("editor")).isEmpty())return null;if(c)f.comment=c.serialize();return f},_request:function(){var c=this._get_kwargs();if(!c)return false;this.serverCall("add_topic").kwargs(c).success(this.fnbind(function(){this.parent().reset()})).liveMutate().send();this.hide&&this.parent().hideSelector()}});TempTopicSelectorAdd=TopicSelectorAdd.extend({select:function(){this.saveTempTopic(this.parent().qValue)},setoid:function(c){this.oid=
c},saveTempTopic:function(c){if(c){var f=$("<li/>").addClass("topic_list_item").append($("<input/>").attr("type","hidden").attr("name","tidsugg_"+this.oid).val(c)).append($("<a/>").addClass("topic_name").html(c)).append($("<a/>").addClass("topic_remove").attr("href","#").click(function(){f.remove();return false}));this.parent().addTempTopic(f);this.parent().setText("");this.parent().focus()}}});TopicSelectorAdd2=b.Component.extend({onLoad:function(c){this.$("#@add_btn").click(this.fnbind(function(){this.select();
return false}));c||this.parent().focus()},additionalKwargs:function(){return{}},select:function(){var c=this.parent().qValue;c&&this.controller("add").kwargs($.extend({selected_topic:c},this.additionalKwargs())).liveMutate().success(this.fnbind(function(){this.parent()&&this.parent().resetFocus()})).error(this.fnbind(function(){$(".content").dialog({title:"Unable to Add Topic",contents:"This topic may not be added.",buttons:{Close:null}})})).send()}});QuestionTopicSelectorAdd=TopicSelectorAdd2.extend({additionalKwargs:function(){return{viewer_private:this.viewer_private,
qid:this.qid}}});TopicDelete=b.Component.extend({onLoad:function(){var c=this;this.$("#@delete_topic_link").click(function(){$(".content").dialog({title:"Delete Topic",url:"/ajax/topic_delete_dialog",buttons:{Ok:function(){c._request("delete_topic")},Cancel:null}});return false});this.$("#@undelete_topic_link").click(function(){$(".content").dialog({title:"Undelete Topic",url:"/ajax/topic_undelete_dialog",buttons:{Ok:function(){c._request("undelete_topic")},Cancel:null}});return false})},_request:function(c){var f=
W2.topicDialog.lookup("editor");f.isEmpty()||this.serverCall(c).kwargs({tid:this.tid,comment:f.serialize()}).liveMutate().send()}});TopicAdultContent=b.Component.extend({onLoad:function(){this.$("#@remove_topic_as_adult").click(this.fnbind(function(){$(".content").dialog({title:"Modify Adult Content Setting",contents:"Are you sure you want to modify the Adult setting for this topic?",buttons:{"Remove Adult Mark":this.fnbind(function(){this.controller("remove_topic_as_adult").liveMutate().send()}),
Cancel:null}});return false}));this.$("#@set_topic_as_adult").click(this.fnbind(function(){$(".content").dialog({title:"Mark Topic as Adult Content",contents:"Are you sure you want to modify the Adult setting for this topic?",buttons:{"Mark as Adult":this.fnbind(function(){this.controller("set_topic_as_adult").liveMutate().send()}),Cancel:null}});return false}))}});TopicUnmergeLink=b.Component.extend({onLoad:function(){var c=this;this.$("#@unmerge").click(function(){c.serverCall("unmerge_topic").kwargs({tid:c.tid}).liveMutate().send()})}});
FeedSuggestions=b.Component.extend({onLoad:function(){this.$("#@view_suggestions_list_link").click(this.fnbind(function(){this.$("#@suggestions_list").toggleClass("hidden");return false}))}});CommentLink=b.Component.extend({onLoad:function(){this.$("#@view_comment_link").click(this.fnbind(function(){this.viewComments();return false}))},viewComments:function(){this.lookup("comments_list").viewComments()}});QuestionComments=b.Component.extend({viewComments:function(){if(this.$("#@question_comments").toggleClass("hidden").is(":visible")){if(this.mobile)window.location.hash=
"#question_comments";this.add_allowed&&this.lookup("add_comment").cQuery("editor").focus()}}});AnswerComments=b.Component.extend({viewComments:function(){this.$("#@answer_comments").toggleClass("hidden").is(":visible")&&!this.blocked&&this.add_allowed&&this.lookup("add_comment").focus&&this.lookup("add_comment").cQuery("editor").focus()}});CommentAdd=b.Component.extend({init:function(c){this._super.apply(this,arguments);this.object_id=c.id},onLoad:function(){this.$("#@add_comment_link").click(this.fnbind(function(){this._request();
return false}))},_request:function(){var c=this.lookup("editor");if(c.isEmpty())return false;this.serverCall("add_comment").kwargs({oid:this.object_id,comment:c.serialize()}).success(this.fnbind(function(f){this.ajax_callback(f)})).liveMutate().send()},ajax_callback:function(){this.lookup("editor").clear()}});Comment=b.Component.extend({onLoad:function(c){var f=this;this.$("#@delete_comment_link").click(function(){$(".content").dialog({title:"Delete Comment",contents:"Are you sure you want to delete this comment?",
buttons:{"Delete Comment":function(){f._request()},Cancel:null}});return false});if(c)if(window.location.hash.substr(0,1)=="#"){hash_contents=window.location.hash.substring(1);items=hash_contents.split("-");for(i=0;i<items.length;i++){item=items[i];if(item=="comment"+this.id){this.lookup("comments_list").viewComments();this.$("#@comment").effect("highlight",{},5E3)}}}},_request:function(){this.serverCall("delete_comment").kwargs({cid:this.id,oid:this.object_id,type:this.type}).liveMutate().send()}});
EndorseUserLink=b.Component.extend({onLoad:function(){this.show_tooltip&&this.$("#@endorse").tooltip({contents:"Endorse "+this.name+" on "+this.topic_name});this.$("#@endorse").click(this.fnbind(function(){this._request();return false}))},_request:function(){this.serverCall("endorse_user").kwargs({to_uid:this.uid,tid:this.tid}).liveMutate().send()}});UnendorseUserLink=b.Component.extend({onLoad:function(){this.$("#@remove_endorse").click(this.fnbind(function(){this.serverCall("remove_endorse_user").kwargs({enid:this.enid}).liveMutate().send();
return false}))}});UserTopicStatsRow=b.Component.extend({onLoad:function(){this.$(".@view_more").click(this.fnbind(function(){this.$("#@more").toggleClass("hidden");return false}))}});PhotoTooltip=b.Component.extend({onLoad:function(){this.$("#@photo_tooltip").tooltip({contents:this.text})}});QuestionFollowing=b.Component.extend({onLoad:function(){this.$("#@follow").click(this.fnbind(function(){this.serverCall("follow").kwargs({qid:this.qid}).liveMutate().send();return false}));this.$("#@unfollow").click(this.fnbind(function(){this.serverCall("unfollow").kwargs({qid:this.qid}).liveMutate().send();
return false}))}});QuestionFollowingLink=QuestionFollowing.extend({onLoad:function(){this.$("#@follow").mousedown(this.fnbind(function(){var c=this.getDvar("feed_story_hash");if(c){var f=this.getDvar("feed_story_position");if(f==null)f=0;var o=this.getDvar("feed_story_initial");o||(o=false);b.setCookieMessage("qfl",[c,true,f,o])}}));this._super.apply(this,arguments);this.$("#@follow").tooltip({contents:"Follow Question"});this.$("#@unfollow").tooltip({contents:"Unfollow Question"})}});QuestionRedirectLink=
b.Component.extend({onLoad:function(){this.$("#@remove_redirect").click(this.fnbind(function(){this.serverCall("remove_redirect_question").kwargs({qid:this.qid}).liveMutate().send();return false}))}});QuestionLink=b.Component.extend({onLoad:function(){this.$("#@link").mousedown(this.fnbind(function(){var c=this.getDvar("feed_story_hash");if(c){var f=this.getDvar("feed_story_position");if(f==null)f=0;var o=this.getDvar("feed_story_initial");o||(o=false);b.setCookieMessage("qfl",[c,true,f,o])}}))}});
QuestionAnonLink=b.Component.extend({onLoad:function(){this.$("#@set_anon").click(this.fnbind(function(){this.setAnon();return false}));this.$("#@set_public").click(this.fnbind(function(){this.setPublic();return false}))},setAnon:function(){this.serverCall("set_anon_question").kwargs({qid:this.qid}).liveMutate().send()},setPublic:function(){$(".content").dialog({title:"Remove Question Anonymity",contents:"Are you sure you want to be publicly associated with this question?",mobile:this.mobile,buttons:{"Remove Anonymity":this.fnbind(function(){this.serverCall("set_public_question").kwargs({qid:this.qid}).liveMutate().send()}),
Cancel:null}})}});QuestionContextTopicEditor=b.Component.extend({onLoad:function(){this.$("#@menu_link").click(this.fnbind(function(){this.$("#@menu").menu(this.$("#@menu_link"));return false}));this.$("#@search").click(this.fnbind(function(){this.$("#@selector").show();this.$("#@menu_link").hide();this.lookup("selector").focus();return false}));this.$("#@cancel").click(this.fnbind(function(){this.$("#@selector").hide();this.$("#@menu_link").show();return false}))}});QuestionSettingsLink=b.Component.extend({onLoad:function(){this.$("#@question_settings_link").click(this.fnbind(function(){this.$("#@question_settings_menu").menu(this.$("#@question_settings_link"));
return false}))}});AnswerSendEndorsementLink=HoverMenu.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.getKwargs().inactive_link||this.$("#@endorsements_topic_menu").menu(this.$("#@link"),{close_on_click:false});return false}));this.getKwargs().show_hover&&this._super.apply(this,arguments)},okToShowHoverMenu:function(){return!this.$("#@link").hasClass("menu_active")}});AnswerSendEndorsementNoLink=b.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){return false}))}});
AnswerOptionsMenuLink=b.Component.extend({onLoad:function(){this.$("#@answer_options_link").click(this.fnbind(function(){this.$("#@answer_options_menu").menu(this.$("#@answer_options_link"));return false}))}});EditPhotoDialogContents=b.Component.extend({onLoad:function(){this.$("#@web_upload_link").click(this.fnbind(function(){this.$("#@view_web_upload").hide();this.$("#@web_upload").show();this.lookup("upload_web").focus();return false}));this.child("photo_file_upload").success(this.fnbind(function(){this.serverCall("upload").kwargs({target_id:this.target_id,
target:this.target}).contentFor(this.$("#@iframe"),{parentCID:this.cid}).send()})).error(this.fnbind(function(){a1ert("Failure Uploading Photo")}))}});EditPhotoDialogLink=b.Component.extend({onLoad:function(){this.$("#@open_edit_photo").click(this.fnbind(function(){if(!this._dialog)this._dialog=this.dialog().title("Edit Photo").cancel(null,"Close").load("set_dialog_contents").close(this.fnbind(function(){this._dialog=null}));return false}))}});InlineUploadPhotoWeb=b.Component.extend({onLoad:function(){this.$("#@download").click(this.fnbind(function(){this.serverCall("download").kwargs({url:this.$("#@url").val(),
target_id:this.target_id,target:this.target}).contentFor(this.$("#@wrapper"),{parentCID:this.cid}).success(this.fnbind(function(){})).liveMutate().send();return false}))},focus:function(){this.$("#@url").focus()}});InlinePhotoEditor=b.Component.extend({onLoad:function(){this.$("#@photo").hover(this.fnbind(function(){this.$("#@edit").show()}),this.fnbind(function(){this.$("#@edit").hide()}))}});QuestionRedirectLinkWithDialog=b.Component.extend({onLoad:function(){this.$("#@redirect_question_with_dialog_link").click(this.fnbind(function(){this._dialog=
this.dialog().title("Redirect Into An Existing Question").ok(this.fnbind(function(c){component=c.dialogComponent;if((to_qid_as_string=component.lookup("to_qid_field").$("#@to_qid").val())&&to_qid_as_string!="")this.serverCall("add_question_redirect").kwargs({to_qid:to_qid_as_string}).success(this.fnbind(function(){})).liveMutate().send();else return false}),"Redirect Question").cancel(null,"Cancel").load("redirect_question_dialog_contents");return false}))}});QuestionRedirectPreview=b.Component.extend({onLoad:function(){this.lookup("to_qid_field").$("#@to_qid").val(this.to_qid)}});
TitleContentVerticalDisclosureItem=b.Component.extend({onLoad:function(){this.$("#@body_content_disclosure_link").click(this.fnbind(function(){this.$("#@body_content_to_disclose").toggle();return false}))}});QuestionDeleteLink=b.Component.extend({onLoad:function(){var c=this;this.$("#@delete_question_link").click(function(){$(".content").dialog({title:"Question Delete",contents:"Are you sure you wish to delete this question?",buttons:{Ok:function(){c._request("delete_question")},Cancel:null}});return false});
this.$("#@undelete_question_link").click(function(){$(".content").dialog({title:"Restore Question",contents:"Are you sure you wish to restore this question?",buttons:{Ok:function(){c._request("undelete_question")},Cancel:null}});return false})},_request:function(c){this.serverCall(c).kwargs({qid:this.qid}).liveMutate().send()}});AnswerActions=b.Component.extend({init:function(){this._super.apply(this,arguments);this.ajax_path="/question/ajax_edit_answer_POST"},onLoad:function(c){if(c)if(window.location.hash.substr(0,
1)=="#"){hash_contents=window.location.hash.substring(1);items=hash_contents.split("-");for(i=0;i<items.length;i++){item=items[i];item=="ans"+this.aid&&this.$("#@answer").effect("highlight",{},5E3)}}this.$("#@answer_delete").click(this.fnbind(function(){$(".content").dialog({title:"Answer Delete",contents:"Are you sure you wish to delete this answer?",buttons:{Ok:this.fnbind(function(){this.request("remove_answer")}),Cancel:null}});return false}));this.$("#@answer_undelete").click(this.fnbind(function(){$(".content").dialog({title:"Restore Answer",
contents:"Are you sure you wish to restore this answer?",buttons:{Ok:this.fnbind(function(){this.request("unremove_answer")}),Cancel:null}});return false}));this.$("#@answer_versions_link").click(this.fnbind(function(){this.$("#@answer_versions").toggleClass("hidden");return false}));this.$("#@answer_content_uncollapse_link").click(this.fnbind(function(){this.$("#@answer").toggleClass("hidden");this.$("#@bad_answer").toggleClass("hidden");return false}));this.$("#@show_actions").click(this.fnbind(function(){this.$("#@show_actions").addClass("hidden");
this.$("#@show_actions_bullet").addClass("hidden");this.$("#@actions_list").removeClass("hidden");return false}));this.$("#@view_log").click(this.fnbind(function(){this.$("#@view_log").addClass("hidden");this.$("#@log").removeClass("hidden");return false}))},request:function(c){this.serverCall(c).kwargs({aid:this.aid}).liveMutate().send()}});AnswerVotingButtons=b.Component.extend({onLoad:function(){this.$("#@answer_vote_up_link").mousedown(this.fnbind(function(){var c=this.getDvar("feed_story_hash");
if(c){var f=this.getDvar("feed_story_position");if(f==null)f=0;var o=this.getDvar("feed_story_initial");o||(o=false);b.setCookieMessage("qfl",[c,true,f,o])}}));this.$("#@answer_vote_up_cancel_link").click(this.fnbind(function(){this.serverCall("answer_vote_up_cancel").kwargs({aid:this.aid}).liveMutate().send();return false}));this.$("#@answer_vote_up_link").click(this.fnbind(function(){this.serverCall("answer_vote_up").kwargs({aid:this.aid}).liveMutate().send();return false}));this.$("#@answer_vote_down_cancel_link").click(this.fnbind(function(){this.serverCall("answer_vote_down_cancel").kwargs({aid:this.aid}).liveMutate().send();
return false}));this.$("#@answer_vote_down_link").click(this.fnbind(function(){this.serverCall("answer_vote_down").kwargs({aid:this.aid}).liveMutate().send();return false}));this.$(".answer_vote_up_tooltip").tooltip({contents:"Good answer? Click the check to vote for this answer."});this.$(".answer_vote_down_tooltip").tooltip({contents:"Bad answer? Click the x to downvote this answer."})}});RemoveFlagAsNotForReproduction=b.Component.extend({onLoad:function(){this.$("#@reproduction").click(this.fnbind(function(){this.controller("available_for_reproduction").liveMutate().send();
return false}))}});TopicListItem=b.Component.extend({onLoad:function(){this.$("#@remove_topic").tooltip({contents:"Remove"}).click(this.fnbind(function(){this.controller("remove_topic").liveMutate().send();return false}))}});UserFollowLink=b.Component.extend({onLoad:function(){this.$("#@follow_user").click(this.fnbind(function(){this.controller("follow_user").liveMutate().send();return false}));this.$("#@unfollow_user").click(this.fnbind(function(){this.controller("unfollow_user").liveMutate().send();
return false}))}});FeedAnchoringPref=b.Component.extend({onLoad:function(){b.feedAnchoring=this.enabled}});FeedStoryItem=b.Component.extend({init:function(){this._super.apply(this,arguments);this.setDvar("feed_story_hash",this.hash)},onLoad:function(){this.$("#@item").hover(this.fnbind(function(){this.$("#@item").addClass("hover")}),this.fnbind(function(){this.$("#@item").removeClass("hover")}));this.$("#@feed_item_info").click(this.fnbind(function(){this.$("#@item").toggleClass("item_selected");
this.$("#@feed_item_info").toggleClass("feed_item_info_selected");return false}))},getHash:function(){return this.hash},getURL:function(){return"/q/"+this.q_path},getId:function(){return this.qid},getItem:function(){return this.$("#@item")}});QuestionHomepageFeed=PagedList.extend({init:function(){this._super.apply(this,arguments);this.hash_impressions={};this.hash_clicks={};this.last_check_time=0;this.rate_limiter_ms=2500;this.setDvar("feed_story_hash",null);this.setDvar("feed_story_position",null);
this.setDvar("feed_story_initial",null)},onLoad:function(){this._super.apply(this,arguments);this.recordImpressions(true);$(document).mousemove(this.fnbind(function(){this.recordImpressions(false)}));$(document).keypress(this.fnbind(function(){this.recordImpressions(false)}));$(document).scroll(this.fnbind(function(){this.recordImpressions(false)}))},recordImpressions:function(c){var f=+new Date;if(!(f<this.last_check_time+this.rate_limiter_ms)){this.last_check_time=f;f=[];var o=this.children(),m=
null,l;for(l=0;l<o.length;l++){var p=o[l];if(p.getHash){var r=p.getHash();if(!(!r||this.hash_impressions[r])){var u=W2._domids[p.cid];if(u){var E=document.getElementById(u);if(E){E=$(E);if(E.children("div:first").is(":in-viewport"))if(E.is(":visible")){if(m==null&&c){E=this.orderedVisibleChildren();m={};for(var F=0;F<E.length;F++)m[E[F]]=F}this.hash_impressions[r]=true;E=0;if(c){E=m[u];p.setDvar("feed_story_position",E);p.setDvar("feed_story_initial",true)}f.push({hash:r,initially_visible:c,position:E})}}}}}}f.length>
0&&this.serverCall("log_impressions").kwargs({data:f}).send()}}});QuestionTopics=b.Component.extend({onLoad:function(){this.$("#@view_all_link").tooltip({contents:"Click to view all topics"});this.$("#@view_all_link").click(this.fnbind(function(){this.$("#@view_all").addClass("hidden");this.$("#@view_all_link").addClass("hidden");this.$("#@all_topics").removeClass("hidden");return false}))}});ObjectBrowser=b.Component.extend({onLoad:function(){this.$("#@browser_submit").click(this.fnbind(function(){this.shareRequest();
this.close();return false}));this.$(".@browser_close").click(this.fnbind(function(){this.close();return false}));this.$("#@browser_next").click(this.fnbind(function(){if(this.countObjects()<=0)return false;this.$("#@number_contacts").text(this.countObjects());this.$("#@browser_list").addClass("hidden");this.$("#@browser_preview").removeClass("hidden");return false}));this.$("#@browser_prev").click(this.fnbind(function(){this.$("#@browser_list").toggleClass("hidden");this.$("#@browser_preview").toggleClass("hidden");
return false}))},countObjects:function(){count=0;$(":input").each(function(){$(this).attr("checked")&&count++});return count},close:function(){$("#object_browser").remove()},shareRequest:function(){var c={object_id:this.object_id,type:this.type,msg_json:this.lookup("editor").serialize()};$(":input").each(function(){if($(this).attr("checked"))c[$(this).attr("name")]=1});this.controller("share").liveMutate().kwargs(c).send()}});TopicBrowser=ObjectBrowser.extend({onLoad:function(){this._super.apply(this,
arguments);this.$("#@browser_next").click(this.fnbind(function(){var c=0,f="";$(".dialog .selected .topic_name").each(function(){if(c>0)f+=", ";f+='<a href="#">'+$(this).text()+"</a>";c++});c==1?this.$(".@topic_plural").text(""):this.$(".@topic_plural").text("s");this.$("#@object_names_preview").html(f)}))}});var h=null;PagerBase=b.Component.extend({onLoad:function(c){this.last=parseInt(this.limit)+parseInt(this.offset);if(c&&this.is_hot_keyed&&!h)h=this.parent();if(this.is_hot_keyed&&h)if(c){h.registerPager(this);
h.setPager(0)}else{h.registerPager(this);if(h.active&&!h.focusedIndex){h.setPager(1);h.setFocusIndex(this.offset)}}}});SimplePageMore=b.Component.extend({init:function(){this._super.apply(this,arguments);this.open=false},onLoad:function(){this.$("#@pager_next").click(this.fnbind(function(){if(this.open){this.$("#@pager_next").addClass("hidden");this.$("#@pager_next_tray").removeClass("hidden")}else{this.more();this.$("#@pager_preload_tray").removeClass("hidden")}return false}));this.load(this.$("#@pager_preload_tray"),
"/pager/preload_POST")},more:function(){this.open=true;this.load(this.$("#@pager_next_tray"),"/pager/next_POST")},load:function(c,f){this.offset+=this.limit;var o={object_id:this.object_id,type:this.type,offset:this.offset,limit:this.limit};c.setContentFromAJAXComponent(f,o,this.cid,null,this.fnbind(function(){if(!c.text()||c.text()=="")this.$("#@pager_next").addClass("hidden")}))}});TextareaAutoSize=b.Component.extend({onLoad:function(){var c=null;if(this.max)c=this.max;this.t=$("textarea");this.t.each(function(){var f=
W2.fnbind(this,function(){var o=$(this).height(),m=parseInt($(this)[0].scrollHeight)-8;if(c&&m>c)m=c;if(o<m)$(this).css("height",(m<=8?12:m)+"px")});$(this).bind("keypress",f).bind("focus",f)})}});UserTopicPromote=b.Component.extend({onLoad:function(){this.$("#@add_featured_topic").tooltip({contents:"Move to Top"});this.$("#@add_featured_topic").click(this.fnbind(function(){this.controller("add_featured_topic").liveMutate().send();return false}));this.$("#@remove_featured_topic").tooltip({contents:"Remove from Top"});
this.$("#@remove_featured_topic").click(this.fnbind(function(){this.controller("remove_featured_topic").liveMutate().send();return false}))}});UserTopicFinder=b.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.$("#@link").addClass("hidden");this.$("#@topic_selector").removeClass("hidden");this.lookup("selector").focus();return false}))}});OperationApprove=b.Component.extend({onLoad:function(){this.$("#@operation_undo_approve").click(this.fnbind(function(){this._request("approve_revision_remove");
return false}));this.$("#@operation_approve").tooltip({contents:"Confirm this change has been reviewed"}).click(this.fnbind(function(){this._request("approve_revision");return false}))},_request:function(c){this.serverCall(c).kwargs({oid:this.oid}).liveMutate().send()}});OperationRevert=b.Component.extend({onLoad:function(){this.$("#@operation_revert").click(this.fnbind(function(){$(".content").dialog({title:"Revert Edit",url:"/ajax/revert_dialog",mobile:this.mobile,buttons:{Ok:this.fnbind(function(){var c=
W2.revertDialog.lookup("editor");c.isEmpty()||this.serverCall("revert_revision").kwargs({oid:this.oid,comment:c.serialize()}).liveMutate().send()}),Cancel:null}});return false}))}});LoginProfile=b.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.passwordless?this.passwordlessLoginAs():this.select();return false}));this.$("#@container").hover(this.fnbind(function(){this.$("#@x_person").css("visibility","");this.lookup("login_box").selected&&this.lookup("login_box").$(".@select_user").fadeTo("fast",
1)}),this.fnbind(function(){this.$("#@x_person").css("visibility","hidden");this.lookup("login_box").selected&&this.lookup("login_box").$(".@select_user").fadeTo("fast",0.3)}));this.$("#@x_person").click(this.fnbind(function(){W2.rpc("/login/x_person_POST").kwargs({uid:this.uid}).liveMutate().send()}));this.passwordless&&this.$("#@passwordless").hover(this.fnbind(function(){this.$("#@x").css("visibility","")}),this.fnbind(function(){this.$("#@x").css("visibility","hidden")})).click(this.fnbind(function(){W2.rpc("/login/x_passwordless_POST").kwargs({uid:this.uid}).liveMutate().send();
return false}))},select:function(){this.lookup("login_box").select({uid:this.uid})},passwordlessLoginAs:function(){W2.rpc("/login/login_ajax_POST").kwargs({uid:this.uid}).success(this.fnbind(function(){var c=this.lookup("login_box").next||"/";window.location=c})).error(function(){a1ert("There was a problem logging you in. :(")}).send()}});LiveTestDialog=b.Component.extend({onLoad:function(){this.$("link").bind("click",function(){$(".content").dialog({title:"LiveDep Dialog",url:"dialog"})})}});TestAC=
b.Component.extend({onLoad:function(){this.$("click_me").click(this.fnbind(function(){this.$("x").setContentFromAJAXComponent("ac_POST")}))}});PasswordInput=b.Component.extend({onLoad:function(){this.$("#@next").val(window.location);this.$("#@cancel_button").click(this.fnbind(function(){this.lookup("login_box").deselect()}));this.$("#@password_form").submit(this.fnbind(function(){W2.rpc("/login/check_password_POST").kwargs({uid:this.uid,password:this.$("#@password").val()}).success(this.fnbind(function(c){if(c){this.$("#@password_form").unbind("submit");
this.$("#@password_form").submit()}else{this.$("#@incorrect_password").show();this.$("#@password").focus()}})).send();return false}));this.$("#@password").focus()}});LoginBox=b.Component.extend({init:function(){this._super.apply(this,arguments);this.selected=null;this.submitting=false},onLoad:function(){this.$("#@email").val()&&this.select({email:this.$("#@email").val()});this.$("#@email").bind("focus",this.fnbind(function(){this.deselect();return true})).bind("blur",this.fnbind(function(){this.select({email:this.$("#@email").val()});
return true}));this.$("#@email_form").submit(this.fnbind(function(){this.$("#@email").blur();return false}))},select:function(c){this.selected=c;var f={};if(typeof c.uid=="undefined"){f={email:c.email};if(!c.email)return false}else f={uid:c.uid};this.$("#@password_placeholder").setContentFromAJAXComponent("/login/password_input_POST",f,this.cid,null,this.fnbind(function(){this.$("#@login_uid").val(f.uid);this.$("#@login_email").val(f.email);this.$("#@next").val(this.next)}),null,this.fnbind(function(o,
m){switch(m[0][0]){case "no_uid":this.$("#@password_placeholder").setContent('<span style="color: red; font-weight: bold;">No user registered with that e-mail address.</span>');break;case "unconfirmed_email":this.$("#@password_placeholder").setContent('<span style="color: red; font-weight: bold;">You need to confirm that e-mail address before you can use it to login.  If you need, we can <a href="#" id="resend_confirmation">send another confirmation e-mail</a> to you.</span>');this.$("#resend_confirmation").click(this.fnbind(function(){this.$("#@password_placeholder").setContent("Sending...");
W2.rpc("/signup/resend_confirmation_email_POST").kwargs({email:f.email}).error(this.fnbind(function(){this.$("#@password_placeholder").setContent("There was a problem resending the confirmation e-mail.")})).success(this.fnbind(function(){this.$("#@password_placeholder").setContent("Sent.")})).send();return false}));break;default:console.error("UNKNOWN ERROR: "+m[0]);break}})).show();this.$(".@select_user").fadeTo("slow",0.3);this.$("#@email_form_buttons").hide();return this},deselect:function(){this.selected=
null;this.$("#@password_placeholder").hide();this.$("#@email_form_buttons").show();this.$(".@select_user").fadeTo("slow",1);return this}});DateTimeComponent=b.Component.extend({onLoad:function(){if(this.js_disp){var c=new Date;c.setTime(this.epoch_us/1E3);this.ge("@datespan").innerHTML=""+c}}});SessionRow=b.Component.extend({onLoad:function(){this.$("#@logout_session_form").click(this.fnbind(function(){W2.rpc("/login/logout_session_POST").kwargs({hash:this.hash,time:this.time,uid:this.uid}).liveMutate().send();
return false}))}});PMsg=b.Component.extend({onLoad:function(){this.$("#@x").click(this.fnbind(function(){this.close();return false}))},close:function(){$("#layout_header").css("margin-bottom","");this.$("#@container").hide();$(".pmsg_container").hide()}});UndoTopicRemoval=PMsg.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@undo").click(this.fnbind(function(){this.controller("undo").kwargs({poid:this.poid}).liveMutate().success(this.fnbind(function(){clearTimeout(this.t);this.close()})).send();
return false}))}});UndoTopicReplacement=PMsg.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@undo").click(this.fnbind(function(){this.controller("undo").kwargs({add_oid:this.add_oid}).liveMutate().success(this.fnbind(function(){clearTimeout(this.t);this.close()})).send();return false}))}});PMsgContainer=b.Component.extend({onLoad:function(){W2.pmsgContainer=this;this.headerMargin=$("#layout_header").css("margin-bottom");this.headerHeight=$("#layout_header").outerHeight();$(window).scroll(this.fnbind(function(){this.setPosition()}));
var c=this.fnbind(function(){this.setPosition()});setTimeout(c,50)},setPosition:function(){if(this.$("#@pmsg_container").html()&&!this.mobile){this.$("#@pmsg_container").show();var c=this.$("#@pmsg_container").outerHeight(),f=parseInt(this.$("#@pmsg_container").css("margin-bottom").replace("px","")),o=$(window).scrollTop();c=c+f;if(o>this.headerHeight){this.$("#@pmsg_container").addClass("header_bar_fixed");$("#layout_header").css("margin-bottom",c+"px")}else{this.$("#@pmsg_container").removeClass("header_bar_fixed");
$("#layout_header").css("margin-bottom","0px")}}},setContent:function(c){if(this.$("#@pmsg_container").is(":visible"))this.$("#@pmsg_container").find(".contents").fadeOut(350,this.fnbind(function(){this.$("#@pmsg_container").setContent(c);this.$("#@pmsg_container").find(".contents").slideDown(350)}));else{this.$("#@pmsg_container").setContent(c);this.setPosition();this.$("#@pmsg_container").hide();this.$("#@pmsg_container").slideDown(350)}return this}});SWFComponent=b.Component.extend({onLoad:function(){swfobject.embedSWF(this.swf_url,
this.id,this.width,this.height,this.version,this.express_install_swf_url,this.flashvars,this.params,this.attributes,this.fnbind(this.callback))},callback:function(c){if(c.success)typeof this.success=="function"&&this.success(c);else $.serverLog("Flash embed failed for SWF","ERROR",{swf_url:this.swf_url})},obj:function(){return document.getElementById(this.id)}});MouseTracker=SWFComponent.extend({success:function(){W2.MouseTracker=this;$("body").append($('<div id="__w2mousetracker_label" class="mouse_tracker_label"> </div>').hide());
this._componentInspectorOn=false;$("#__w2mousetracker_component_inspector_toggle").click(this.fnbind(function(){this.componentInspectorToggle();return false})).show()},highlightCID:function(c,f){var o=f.target,m=$("[__w2_cid="+c+"]");m.addClass("mouse_tracker_highlight");m.offset();m=W2._components[c];var l="<h3>"+c+"</h3>";if(m)l+='<pre id="__w2mousetracker_component_data"> </pre>';if(o=o.getAttribute("id")){if(o.substr(0,5+c.length)=="__wn_"+c)o="@"+o.substr(6+c.length);l+="<br /><span>id="+o+"</span>"}c=
f.pageY-80;if(c<0)c=f.pageY+20;o=$("#__w2mousetracker_label");o.html(l).css("top",c).css("left",f.pageX);o.show();if(m)o.get(0).childNodes.item(1).childNodes.item(0).textContent=JSON.stringify(m.__js_init)},unhighlightCID:function(c){$("[__w2_cid="+c+"]").removeClass("mouse_tracker_highlight");$("#__w2mousetracker_label").hide()},componentInspectorOn:function(){if(this._componentInspectorOn)console.warn("Component Inspector already active.  Not turning on.");else{$("body").bind("mouseover.component_inspector",
this.fnbind(function(c){var f=c.target.getAttribute("__w2_cid");f&&this.highlightCID(f,c)})).bind("mouseout.component_inspector",this.fnbind(function(c){var f=c.target.getAttribute("__w2_cid");f&&this.unhighlightCID(f,c)}));return this._componentInspectorOn=true}},componentInspectorOff:function(){if(this._componentInspectorOn){$("body").unbind("mouseover.component_inspector").unbind("mouseout.component_inspector");return this._componentInspectorOn=false}else console.warn("Component Inspector not active.  Not turning off.")},
componentInspectorToggle:function(){return this._componentInspectorOn?this.componentInspectorOff():this.componentInspectorOn()},flashReady:function(){this.obj().init(Quora.instance+"-tracker");this.obj().startRecording(W2.windowId);$("body").mouseover(this.fnbind(function(c){this.recordMouseover(c);return true})).click(this.fnbind(function(c){this.recordClick(c);return true}))},recordMouseover:function(){},recordClick:function(c){console.log("Got a click"+c)},_getClicks:function(){}});EditPhoto=b.Component.extend({onLoad:function(){FB.getLoginStatus(this.fnbind(function(c){switch(c.status){case "connected":case "notConnected":this.$("#@use_fb_photo").show();
break;default:}}));this.$("#@from_facebook").click(this.fnbind(function(){FB.login(this.fnbind(function(c){if(c.session){c=c.session.uid;FB.api({method:"fql.query",query:"SELECT pic_big FROM user WHERE uid = "+c},this.fnbind(function(f){f=f[0];if(f.pic_big){this.$("#@url").hide().val(f.pic_big);this.$("#@photo_from_web_form").submit()}else a1ert("You don't seem to have a profile picture on Facebook.")}))}else console.log("Not using Facebook photo since logging in failed")}));return false}))}});FacebookSessionRequired=
b.Component.extend({init:function(){this._super.apply(this,arguments);$(document).bind("fbupdateauth",this.fnbind(function(){FB.getSession()&&window.location.reload()}))},onLoad:function(){FB.getLoginStatus(this.fnbind(function(c){if(!(c&&c.status=="connected")){this.$("#@dialog").show();FB.login()}}));this.$("#@connect").click(this.fnbind(function(){FB.login();return false}))}});FacebookFriends=b.Component.extend({onLoad:function(){this.$("#@follow_all").click(this.fnbind(function(){this.followAll();
return false}))},followAll:function(c){this.serverCall("follow_all").kwargs({uids:this.uids}).success(c).liveMutate().send()}});FacebookAccountConnectedTo=b.Component.extend({onLoad:function(){this.$("#@connect").click(function(){FB.login(function(c){Quora.FB.updateAuth();c&&c.status=="connected"&&W2.rpc("/facebook/connect_POST").liveMutate().send()});return false});this.$("#@disconnect").click(function(){W2.rpc("/facebook/disconnect_POST").liveMutate().send();return false})}});FacebookSync=b.Component.extend({onLoad:function(){$(document).bind("fbupdateauth",
this.fnbind(function(){FB.getLoginStatus(this.fnbind(function(c){c.session&&FB.api({method:"fql.query",query:"SELECT uid2 FROM friend WHERE uid1 = "+this.fb_uid},this.fnbind(function(f){f&&f.length&&f.length!=this.friend_count&&W2.rpc("/facebook/set_friends_POST").kwargs({}).send()}))}))}))}});FacebookProfile=b.Component.extend({onLoad:function(){$(document).bind("fbupdateauth",this.fnbind(function(){FB.api({method:"fql.query",query:"SELECT uid, name, pic FROM user WHERE uid = "+this.fb_uid},this.fnbind(function(c){if(c){c=
c[0];c.pic&&this.$("#@photo").attr("src",c.pic);c.name?this.$("#@name").text(c.name):this.$("#@name").html("<span style='color: gray;'>Couldn't retrieve info from Facebook; you may not be logged in to Facebook.</span>")}}))}));b.FB.updateAuth()}});FacebookFriendsNUX=b.Component.extend({onLoad:function(){this.$("#@follow_all_and_continue").click(this.fnbind(function(){try{this.child("fbfriends").followAll(this.fnbind(function(){window.location=this.next}))}catch(c){window.location=this.next}}))}});
GrowlNotification=b.Component.extend({onLoad:function(c){var f=this.fnbind(function(){this.setPosition()});$(window).scroll(this.fnbind(function(){this.setPosition()}));setTimeout(f,1);f=this.age_us/1E3/1E3;if(c)f<1.5&&this.show();else f<15&&this.show();this.$("#@notif").mouseover(this.fnbind(function(){clearTimeout(this._timeout);var o=this.$("#@notif");if(o.is(":animated")){o.stop();o.css("opacity",100)}W2.rpc("/notifications/mark_as_read_POST").kwargs({snid:this.snid}).send()}));this.$("#@notif").mouseout(this.fnbind(function(){this.startFade(1E3)}));
this.startFade(4E3)},setPosition:function(){var c=$(window).scrollTop(),f=$("#layout_header").outerHeight();if(c>f){this.$("#@notif").addClass("fixed_hover_menu");this.$("#@notif").css("top","0px")}else{this.$("#@notif").removeClass("fixed_hover_menu");this.$("#@notif").css("top","")}},show:function(){this.$("#@notif").fadeIn(1E3)},startFade:function(c){clearTimeout(this._timeout);this._timeout=setTimeout(this.fnbind(function(){this.$("#@notif").fadeOut(1250)}),c)}});EditPhotoChoice=b.Component.extend({onLoad:function(){this.$(".@img_choice").click(this.fnbind(function(c){c=
$(c.target).attr("choice");this.serverCall("choose_photo").kwargs({choice:c}).success(this.fnbind(function(){if(this.next_url)window.location=this.next_url;else W2.Dialog.dialogFor(this).close_()})).send();this.$("#@choices").text("Setting photo...");return false}))}});EventYouMissedItem=b.Component.extend({onLoad:function(){this.$("#@view").click(this.fnbind(function(){this.$("#@events").toggle();return false}))}});OnOffControlPanelSetting=b.Component.extend({onLoad:function(){this.$("#@on").click(this.fnbind(function(){this.controller("set_value").kwargs({new_val:true}).liveMutate().send()}));
this.$("#@off").click(this.fnbind(function(){this.controller("set_value").kwargs({new_val:false}).liveMutate().send()}));this.$("#@default").click(this.fnbind(function(){this.controller("set_to_default").liveMutate().success(this.fnbind(function(c){this.$("#@on").attr("checked",c);this.$("#@off").attr("checked",!c)})).send();return false}))}});SignupForm2=b.Component.extend({onLoad:function(){if(this.inline_login)this.controller("record_signup_step").kwargs({signup_action:"signup_dialog_begin"}).send();
else window.location.pathname=="/"&&this.controller("record_signup_step").kwargs({signup_action:"signup_homepage_visit"}).send();this.$("#@more_what_happens").click(this.fnbind(function(){this.controller("record_signup_step").kwargs({signup_action:"signup_more_what_happens"}).send();this.dialog().title("Connecting your Facebook or Twitter Account to Quora").cancel(null,"Close").html("<div class='w3_5'><p>To get you started, we'll have you follow all your Facebook or Twitter friends who are already on Quora when you sign up.</p><br /><p>We won't message your contacts who aren't on the site or post anything to your Facebook or Twitter unless you choose to.</p><br /><p>For Quora to become a great knowledge resource for everyone, it's important that users trust the site.  If Quora ever fails to meet your expectations of trust, please let us know by e-mailing <a href='mailto:feedback@quora.com'>feedback@quora.com</a> and we'll try to do better.</div>");
return false}));this.$("#@twitter_signup_link, #@twitter_signup_icon").click(this.fnbind(function(){$("#live_login_dialog_login").addClass("hidden");$("#view_live_login_dialog_login").removeClass("hidden");this.controller("record_signup_step").kwargs({signup_action:"signup_connect_to_twitter"}).send();window.open("/twitter/oauth_window","_BLANK","height=400,width=800");return false}));$(document).bind("twitter_oauth_approved",this.fnbind(function(c,f){this.controller("record_signup_step").kwargs({signup_action:"signup_twitter_connected"}).send();
c=f.userData;this.$("#@step1").hide();c.photo_url?this.$("#@tw_pic").attr("src",c.photo_url):this.$("#@tw_pic").hide();this.$("#@tw_name").text("@"+c.twitter_screen_name);this.$("#@twitter_info").show();this.$("#@step2").show();this.$("#@step2finish").show();this.$("#@email_form").addClass("stacked_form");this.$("#@connect_buttons").hide();this.$("#@create_account").show();this.$("#@tw_oauth_key").val(f.accessToken.key);this.$("#@tw_uid").val(c.twitter_uid);this.$("#@tw_screen_name").val(c.twitter_screen_name);
this.child("name_validator").populate_if_valid(c.name,this.$("#@name"))}));this.$("#@facebook_connect_button").click(this.fnbind(function(){$("#live_login_dialog_login").addClass("hidden");$("#view_live_login_dialog_login").removeClass("hidden");this.controller("record_signup_step").kwargs({signup_action:"signup_connect_to_facebook"}).send();FB.login(this.fnbind(function(c){if(c.session){this.$("#@step1").hide();FB.api({method:"fql.query",query:"SELECT name, pic_big FROM user WHERE uid = "+c.session.uid},
this.fnbind(function(f){this.$("#@step2").show();this.$("#@step2finish").show();this.$("#@connect_buttons").hide();this.$("#@create_account").show();this.$("#@email_form").addClass("stacked_form");if(f){f[0].pic_big?this.$("#@fb_pic").attr("src",f[0].pic_big):this.$("#@fb_pic").hide();this.$("#@fb_name").text(f[0].name);this.$("#@fb_info").show();this.$("#@name").val(f[0].name);this.child("name_validator").validate()}else console&&console.error&&console.error("Error retrieving data from Facebook.")}))}else this.$("#@err_must_connect").show()}));
this.controller("record_signup_step").kwargs({signup_action:"signup_facebook_connected"}).send()}));this.$("#@form").submit(this.fnbind(function(){if(!this.child("name_validator").isValid)if(!(this.$("#@name")&&this.child("name_validator")===null)){this.controller("record_signup_step").kwargs({signup_action:"signup_name_invalid"}).send();a1ert("Check the name that you entered before submitting.");return false}if(!this.child("email_validator").isValid)if(!(this.$("#@email")&&this.child("email_validator").isValid===
null)){this.controller("record_signup_step").kwargs({signup_action:"signup_email_invalid"}).send();a1ert("Check the e-mail that you're using before submitting.");return false}if(this.child("password_validator").isValid)console.log("validator hasn't responded yet, allowing through");else if(!(this.$("#@password")&&this.child("password_validator").isValid===null)){this.controller("record_signup_step").kwargs({signup_action:"signup_password_invalid"}).send();a1ert("Check the password that you're using before submitting.");
return false}if(this.inline_login||this.next_url){var c=FB.getSession(),f=null,o=null;if(c){f=c.uid;o=c.session_key}if(c=this.$("#@tw_oauth_key").val())o=f=null;this.serverCall("signup_dont_redirect").kwargs({fb_uid:f,fb_session_key:o,name:this.$("#@name").val(),email:this.$("#@email").val(),password:this.$("#@password").val(),code:this.$("#@code").val(),group:this.$("#@group").val(),tw_oauth_key:c,tid:this.tid}).success(this.fnbind(function(){if(this.next_url)window.location=this.next_url})).send();
this.$("#@submit").attr("disabled","disabled");return false}else{this.$("#@submit").attr("disabled","disabled");return true}}))}});TopicFollowButton=b.Component.extend({onLoad:function(){this.$("#@follow").click(this.fnbind(function(){this.serverCall("follow").kwargs({tid:this.tid}).liveMutate().send();return false}));this.$("#@unfollow").click(this.fnbind(function(){this.serverCall("unfollow").kwargs({tid:this.tid}).liveMutate().send();return false}))}});TopicFollowAllButton=b.Component.extend({onLoad:function(){this.$("#@follow").click(this.fnbind(function(){this.serverCall("follow").liveMutate().send();
return false}));this.$("#@unfollow").click(this.fnbind(function(){this.serverCall("unfollow").liveMutate().send();return false}))}});TitleNotificationsCount=b.Component.extend({onLoad:function(){this.setTitle()},setTitle:function(){var c=document.title,f=c;f="";if(this.notif_count||this.inbox_count){f+="(";if(this.notif_count)f+=this.notif_count;if(this.inbox_count)f+="/"+this.inbox_count;f+=") "}f=c.replace(/^\(((\d+)?\/)?\d+\) |/,f);if(c!=f)document.title=f}});MobileFooter=b.Component.extend({onLoad:function(){this.$("#@full_site").click(this.fnbind(function(){Quora.cookie("m",
"0");location.reload(true);return false}))}});UseMobileSite=b.Component.extend({onLoad:function(){this.$("#@mobile_site").click(this.fnbind(function(){Quora.cookie("m","1");location.reload(true);return false}))}});InlineLogin=b.Component.extend({onLoad:function(){this.$("#@resend_confirmation").click(this.fnbind(function(){this.controller("resend_confirmation_link").kwargs({email:this._email()}).success(this.fnbind(function(){this.hideAllErrors()})).send();return false}));this.$("#@reset_password_link").click(this.fnbind(function(){this.controller("reset_password").kwargs({email:this._email()}).success(this.fnbind(function(){this.hideAllErrors()})).send();
return false}));$(document).bind("quora_login.InlineLogin",this.fnbind(function(){$(document).unbind("quora_login.InlineLogin")}));this.$("#@cancel_button").click(this.fnbind(function(){this.updatePreview()}));this.$("#@email").blur(this.fnbind(function(){this.updatePreview();return true}));this.$("#@submit_button").click(this.fnbind(function(){this.checkPassword();return false}));this.$("#@login_link").click(this.fnbind(function(){this.$("#@associated").addClass("hidden");this.$("#@alt_login_row").addClass("hidden");
this.$("#@login_form").removeClass("hidden");this.$("#@email").focus();return false}));$(document).ready(this.fnbind(function(){this.updatePreview()}))},updatePreview:function(){var c=this._email();this.controller("preview_info").args(c).success(this.fnbind(function(f){this.$(".usercard_big").fadeTo(1,1);this.$("#@preview").hide();found_passwordless_login=false;first_name=f.name.split(" ")[0];this.$("%passwordless_users").find(".name_span:visible").each(function(){if($(this).text()!=first_name)$(this).parents(".usercard_big").fadeTo(1,
0.3);else found_passwordless_login=true});if(!found_passwordless_login){this.$("#@name").text(f.name);this.$("#@pic").attr("src",f.photo_url);this.$("#@preview").show()}this.hideAllErrors()})).except("email_not_found",this.fnbind(function(){this.hideAllErrors();this.showErrorOnComponent("#@email_not_found_error","#@email");this.$("#@preview").hide();return false})).except("no_email",this.fnbind(function(){this.hideAllErrors();this.$("#@preview").hide()})).except("email_unconfirmed",this.fnbind(function(){this.$("#@preview").hide();
this.hideAllErrors();this.showErrorOnComponent("#@email_not_confirmed_error","#@email")})).send()},checkPassword:function(){this.hideAllErrors();var c=this.$("#@email").val(),f=this.$("#@password").val(),o=this.$("#@allow_passwordless").attr("checked");this.controller("do_login").args(c,f,o).success(this.fnbind(function(m){this.hideAllErrors();window.Quora.uid==m&&$(document).trigger("quora_login",this.uid)})).except("email_not_found",this.fnbind(function(){this.hideAllErrors();this.showErrorOnComponent("#@email_not_found_error",
"#@email")})).except("incorrect_password",this.fnbind(function(){this.hideAllErrors();this.showErrorOnComponent("#@incorrect_password_error","#@password")})).except("email_unconfirmed",this.fnbind(function(){this.hideAllErrors();this.showErrorOnComponent("#@email_not_confirmed_error","#@email")})).except("banned_user",this.fnbind(function(){this.hideAllErrors();this.controller("login_user_is_banned").args().send()})).send()},_email:function(){return this.$("#@email").val()},hideAllErrors:function(){this.$("#@email_not_found_error").hide();
this.$("#@email_not_confirmed_error").hide();this.$("#@incorrect_password_error").hide();this.$("#@email, #@password").removeClass("input_validation_error")},showErrorOnComponent:function(c,f){this.$(c).show();this.$(f).addClass("input_validation_error")}});InlineLoginProfile=b.Component.extend({onLoad:function(){this.$("#@container").click(this.fnbind(function(){if(window.Quora.uid==this.uid){$(document).trigger("quora_login",this.uid);return false}if(this.passwordless)this.controller("do_login").liveMutate().success(this.fnbind(function(){})).send();
else{var c=this.lookup("inline_login");c.$("#@email").val(this.email);c.$("#@allow_passwordless").removeAttr("checked");c.updatePreview();c.$("#@password").focus()}return false}));this.$("#@passwordless").click(this.fnbind(function(){this.controller("x_passwordless").liveMutate().send();return false}));this.$("#@x_person").click(this.fnbind(function(){this.controller("x_person").liveMutate().send();return false}));this.$("#@passwordless").hover(this.fnbind(function(){this.$("#@x").css("visibility",
"")}),this.fnbind(function(){this.$("#@x").css("visibility","hidden")})).click(this.fnbind(function(){this.controller("x_passwordless").liveMutate().send();return false}))}});AnonUser=b.Component.extend({onLoad:function(){this.$("#@reveal").click(this.fnbind(function(){$(".content").dialog({title:"Reveal Anon User Identity",contents:"You may only reveal identities to properly administer the site and the person you reveal will be notified with your reason.",comment_form:"Explain your reason for revealing this name",
buttons:{"Reveal Identity":this.fnbind(function(){this.controller("anonreveal_content").args(this.eauid).contentFor(this.$("#@reveal"),{parentCID:this.cid}).success(this.fnbind(function(){this.$("#@reveal").unbind("click")})).send();return false}),Cancel:null}});return false}))}});CCTest1=b.Component.extend({onLoad:function(){this.$("#@button").click(this.fnbind(function(){this.controller("get_content").contentFor(this.$("#@placeholder"),{parentCID:this.cid}).send();return false}))}});LoginSignal=
b.Component.extend({onLoad:function(c){if(!c){Quora.uid==this.uid&&$.serverLog("Strange... got a login signal for uid="+this.uid+" but that uid was already logged in");(Quora.uid=this.uid)?$(document).trigger("quora_login",this.uid):$(document).trigger("quora_logout")}}});InfoToggle=b.Component.extend({onLoad:function(){this._state=false;this.$("#@switch").click(this.toggle);this.setupKeyboardShortcut()},toggle:function(){if(this._state){this._state=false;$(".invisible_info").hide()}else{this._state=
true;$(".invisible_info").show().effect("highlight",{},1E3)}},setupKeyboardShortcut:function(){if(document.addEventListener){this._ks=0;document.addEventListener("keydown",this.fnbind(function(c){switch(this._ks){case 0:this._ks=1*(c.keyCode==81);break;case 1:this._ks=2*(c.keyCode==73);break;case 2:this._ks=3*(c.keyCode==68);break;case 3:this._ks=4*(c.keyCode==81);break;case 4:this._ks=5*(c.keyCode==73);break;case 5:(this._ks=6*(c.keyCode==68))&&this.toggle();default:this._ks=0}}),false)}}});TwitterConnectCallbackPage=
b.Component.extend({onLoad:function(){opts={path:"/twitter/"};b.cookie("twitter_oauth_access_key",this.access_token.key,opts);if(window.opener){window.opener.$(window.opener.document).trigger("twitter_oauth_approved",{accessToken:this.access_token,userData:this.user_data});window.close()}else this.$("#@me").text("access token: "+JSON.stringify(this.access_token))}});TestUnload=b.Component.extend({onLoad:function(c){console.log("onLoad called for cid="+this.cid+", isPageLoad="+c)},onUnload:function(){console.log("onUnload called for cid="+
this.cid)}});TwitterConnectButton=b.Component.extend({onLoad:function(){this.$("#@twitter_connect_button").click(this.fnbind(function(){window.open("/twitter/oauth_window","_BLANK","height=400,width=800")}));$(document).bind("twitter_oauth_approved",this.fnbind(function(c,f){c=f.accessToken;f=f.userData;this.controller("connect_twitter").kwargs({access_token_key:c.key,screen_name:f.twitter_screen_name,tw_uid:f.twitter_uid}).liveMutate().send()}))}});TwitterConnect=b.Component.extend({onLoad:function(){this.$("#@twitter_disconnect_button").click(this.fnbind(function(){this.controller("twitter_disconnect").liveMutate().send()}))}});
Announcement=b.Component.extend({onLoad:function(){this.$("#@close").click(this.fnbind(function(){this.controller("close_announcement").kwargs({closing_action:"x"}).liveMutate().send();return false}))}});LoginPageLoginListener=b.Component.extend({init:function(){this._super.apply(this,arguments);b.loginPageLoginListener=this;this._enabled=true},onLoad:function(){this.$(document).bind("quora_login.LoginPageLoginListener",this.fnbind(function(){if(this._enabled)window.location=this.next}))}});PresenceZoneMonitor=
b.Component.extend({onLoad:function(){var c=b.presencePageMonitor;if(c)for(var f=0;f<this.zones.length;f++){if(c.zones[this.zones[f]]==undefined)c.zones[this.zones[f]]={};c.zones[this.zones[f]][this.cid]=true}else $.serverLog("PresenceZoneMonitor cannot add zone because singleton Q.presencePageMonitor is missing")},onUnload:function(){var c=b.presencePageMonitor;if(c)for(var f=0;f<this.zones.length;f++){c.zones[this.zones[f]]!=undefined&&delete c.zones[this.zones[f]][this.cid];var o=true;for(var m in c.zones[this.zones[f]]){o=
false;break}o&&delete page_monitor_zones[this.zones[f]]}else $.serverLog("PresenceZoneMonitor cannot remove zone because singleton Q.presencePageMonitor is missing")}});PresencePageMonitor=b.Component.extend({init:function(){b.presencePageMonitor=this;this.zones={};this.last_activity_time=+new Date;this.last_connect_time=+new Date;this.rate_limit_activity_ms=55E3;this.rate_limit_connect_ms=6E4},onLoad:function(){$(document).mousemove(this.fnbind(function(){this.reportActivity()}));$(document).keypress(this.fnbind(function(){this.reportActivity()}));
$(document).scroll(this.fnbind(function(){this.reportActivity()}));setTimeout(this.fnbind(function(){this.reportConnect()}),this.rate_limit_connect_ms);$(window).bind("beforeunload",this.fnbind(function(){this.reportDisconnect()}))},reportActivity:function(){var c=+new Date;if(!(c<this.last_activity_time+this.rate_limit_activity_ms)){this.last_activity_time=c;this._report(true)}},reportConnect:function(){var c=+new Date,f=Math.max(this.last_activity_time,this.last_connect_time);f=c-f;var o=this.rate_limit_connect_ms-
f+100;if(f>this.rate_limit_connect_ms){this.last_connect_time=c;this._report(false);o=this.rate_limit_connect_ms+100}setTimeout(this.fnbind(function(){this.reportConnect()}),o)},_report:function(c){var f=[];for(var o in this.zones)f.push(o);f.length>0&&this.serverCall("report").kwargs({zones:f,is_activity:c}).send()},reportDisconnect:function(){var c=false;for(var f in this.zones){c=true;break}if(c)(c=W2.windowId)&&b.setCookieMessage("prd",[c])}});LiveLogin=b.Component.extend({init:function(){this._super.apply(this,
arguments);this._dialog=null;b.liveLogin=this},login:function(c,f){if(!this._dialog)this._dialog=this.dialog().title("Login or Signup").cancel(f).open(this.fnbind(function(){this._loginListener=this.$(document).bind("quora_login",this.fnbind(function(){this._dialog.ok_();c()}))})).close(this.fnbind(function(){this._loginListener.unbind();this._dialog=null})).load("login_signup_combo_dialog")},_logout:function(){this.controller("_logout").send()}});ServerCallTest=b.Component.extend({onLoad:function(){this.$("#@click_me").click(this.fnbind(function(){this.serverCall("click_me").success(this.fnbind(function(c){a1ert(c)})).send();
console.log("clicked");return false}))}});ShareAction=b.Component.extend({onLoad:function(){this.$("#@share").click(this.fnbind(function(){if(b._sharePopupActive)return false;b._sharePopupActive=true;this._dialog=this.dialog().title("Share "+this.what).close(this.fnbind(function(){b._sharePopupActive=false})).load("share_dialog");return false}))}});ShareDialog=b.Component.extend({onLoad:function(){var c=this;this.$("%@tabs").click(function(){c.select($(this).attr("show"));return false});this.$("#@url_select").click(this.fnbind(function(){this.lookup("url_tab").$("#@url").focus().select();
return false}));this.select(this.default_tab)},select:function(c){this.$("%@contents").hide();this.$("#@"+c).show();this.$("%@tabs").removeClass("selected");this.$("#@"+c+"_select").addClass("selected")}});TwitterShare=b.Component.extend({onLoad:function(){var c=this.fnbind(function(){var f=140-this.$("#@tweet").val().length;this.$("#@counter").text(f);f<0?this.$("#@counter").addClass("diffdelete"):this.$("#@counter").removeClass("diffdelete")});this.$("#@tweet").bind("keyup",c).bind("focus",c);this.tweeted=
false;this.$("#@tweet_button").click(this.fnbind(function(){if(!this.$("#@tweet").val()||this.tweeted)return false;this.tweeted=true;this.serverCall("tweet").kwargs({tweet:this.$("#@tweet").val()}).success(this.fnbind(function(){W2.Dialog.dialogFor(this).close_()})).send();this.$("#@tweet_button").addClass("submit_button_disabled");this.$("#@tweet_form").hide();this.$("#@tweet_sending").show();return false}));this.$("#@close").click(this.fnbind(function(){W2.Dialog.dialogFor(this).close_();return false}))}});
URLShare=b.Component.extend({onLoad:function(){this.$("#@url,#@short_url,#@permalink").click(this.fnbind(function(c){c.target.focus();c.target.select()}));this.$("#@close").click(this.fnbind(function(){W2.Dialog.dialogFor(this).close_();return false}))}});EmailShare=b.Component.extend({onLoad:function(){this.$("#@send").click(this.fnbind(function(){if(!this.$("#@email").val()||!this.$("#@subject").val()||!this.$("#@body").val())return false;this.serverCall("email").kwargs({email:this.$("#@email").val(),
subject:this.$("#@subject").val(),body:this.$("#@body").val()}).success(this.fnbind(function(){W2.Dialog.dialogFor(this).close_()})).send();return false}));this.$("#@close").click(this.fnbind(function(){W2.Dialog.dialogFor(this).close_();return false}))}});UploadPhotoFileIFrame=b.Component.extend({onLoad:function(){this.uploadListener=$(document).bind("quora_image_uploaded",this.fnbind(function(c,f){this.onUpload(f)}))},onUnload:function(){$(document).unbind("quora_image_uploaded",this.uploadListener)},
onUpload:function(c){if(c.success)typeof this._success=="function"&&this._success(c);else typeof this._error=="function"&&this._error(c)},success:function(c){this._success=c;return this},error:function(c){this._error=c;return this}});PostUploadPhotoFile=b.Component.extend({onLoad:function(){window.parent?window.parent.$(window.parent.document).trigger("quora_image_uploaded",this.__js_init):$.serverLog("UploadPhotoFile Components should appear in IFrames always, and this isn't.")}});PhotoUploadExample=
b.Component.extend({onLoad:function(){this.child("photo_file_upload").success(this.fnbind(function(){a1ert("successful upload")})).error(this.fnbind(function(c){a1ert("failure in uploading: "+c.error_msg)}))}});Fall2010PartyRSVPButton=b.Component.extend({onLoad:function(){this.$("#@select").click(this.fnbind(function(){this.serverCall("select").liveMutate().send();return false}))}})})(window.Quora);Dialog=Q.Component.extend({onLoad:function(){this.successCallback=null;this.ok2Submit=true;this.submitted=false;this.$("#@submit").click(this.fnbind(function(){this.request();return false}));this.$("#@cancel").click(this.fnbind(function(){this.close();return false}))},request:function(){var b=this.getPars();if(this.submitted||!b||!this.ok2Submit)return false;this.submitted=true;this.controller("dialog_submit_controller").liveMutate().kwargs(b).success(this.fnbind(function(h){this.successCallback&&
this.successCallback(h);this.close()})).send()},ok2Submit:function(){return true},getPars:function(){return{}},setSetup:function(b){b.each(this.fnbdin(function(h,c){this.options[h]=c}))},setSuccessCallback:function(b){this.successCallback=b},setFocusCallback:function(b){this.lookup("editor").setFocusCallback(b)},setBlurCallback:function(b){this.lookup("editor").setBlurCallback(b)},close:function(){$("#generic_dialog").length?$("#generic_dialog").remove():W2.Dialog.dialogFor(this).close_()}});
AddCommentDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.lookup("editor").focus()},getPars:function(){if(this.comment_required&&this.lookup("editor").isEmpty())return false;return{comment:this.lookup("editor").serialize()}}});QuestionDeleteDialog=AddCommentDialog.extend({getPars:function(){if(this.comment_required&&this.lookup("editor").isEmpty())return false;return{comment:this.lookup("editor").serialize(),review:this.review}}});
DialogLink=Q.Component.extend({onLoad:function(){this.tooltip&&this.$("#@link").tooltip({contents:this.tooltip});this.$("#@link").click(this.fnbind(function(){this.click();return false}))},addOption:function(b,h){this.options[b]=h},click:function(){var b=escape(JSON.stringify(this.options));$(".content").dialog({title:null,url:"/dialog/ajax_get_dialog_GET?type="+this.type+"&object_id="+this.object_id+"&options="+b,buttons_hide_on_close:this.buttons_hide_on_close,buttons:null})},triggerClick:function(b){$.each(b,
this.fnbind(function(h,c){this.addOption(h,c)}));this.click()}});NotHelpfulDialogLink=DialogLink.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@link").unbind("click");this.$("#@link").click(this.fnbind(function(){this.click();this.serverCall("mark_not_helpful").kwargs({object_id:this.object_id}).liveMutate().send();return false}))}});
QuestionAddLink=DialogLink.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@link").unbind("click");this.$("#@link").click(this.fnbind(function(){this.triggerClick({q:this.parent().qValue});this.options.selector&&this.lookup("selector").reset();return false}))}});AdultTopicFollowButton=DialogLink.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@link").click(this.fnbind(function(){this.controller("follow").liveMutate().send();return false}))}});
QuestionRedirectDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false;this.id=""}});AddPassOnVoteDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false;this.lookup("editor").focus()},getPars:function(){var b=this.lookup("editor").serialize();if(b&&this.object_id)this.ok2Submit=true;return{qid:this.object_id,reason:b}}});
NotHelpfulDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.lookup("editor").focus();this.$("#@reasons").change(this.fnbind(function(){var b="";switch(this.$("#@reasons").val()){case "wrong":b="This answer is factually incorrect.";break;case "different_question":b="I think this is an answer to a different question from the one that this page is about.";break;case "comment_question":b="I think this text would make more sense as a comment on the question rather than a standalone answer.";
break;case "comment_answer":b="I think this text would make more sense as a comment on another answer rather than a standalone answer.";break;case "follow_up":b="I think this would make more sense as a new follow-up question rather than as an answer here.";break;case "not_helpful":b="I think this answer wouldn't help someone who wanted to know about the question - maybe it should be a comment on the question instead.";break;case "other":default:b="[Please explain how this answer could be improved.]";
break}this.lookup("editor").setHtml(b);return false}))},getPars:function(){if(this.lookup("editor").isEmpty())return false;var b=this.lookup("editor").serialize();return{comment:b}}});AdminMessageDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.lookup("editor").focus()},getPars:function(){if(this.lookup("editor").isEmpty())return false;var b=this.lookup("editor").serialize();return{msg:b}}});
TopicTaggerDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false},getPars:function(){var b=[];this.$("#@topic_tagger_component .temp_topics_list input").each(function(){b.push($(this).val())});if(!b)return false;this.ok2Submit=true;return{topics:b}}});
ComposeMessageDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@change_person").click(this.fnbind(function(){this.change();return false}));this.lookup("people_selector").inputFocus();this.load()},load:function(){this.object_id&&this.setTo(this.object_id)},getPars:function(){if(this.$("#@compose_message_to_uid").val())this.object_id=this.$("#@compose_message_to_uid").val();if(!this.object_id||this.lookup("editor").isEmpty())return false;return{to_uid:this.object_id,
msg:this.lookup("editor").serialize()}},change:function(){this.lookup("people_selector").reset();this.$("#@pick_people").removeClass("hidden");this.$("#@picked_person").addClass("hidden");this.$("#@to_name").html("")},setTo:function(b){this.lookup("people_selector").reset();this.$("#@pick_people").addClass("hidden");this.$("#@picked_person").removeClass("hidden");this.$("#@compose_message_to_uid").val(b);this.getName(b)},getName:function(b){this.$("#@to_name").setContentFromAJAXComponent("/inbox/ajax_get_name_POST",
{uid:b})}});
AddUserToTopicDialog=ComposeMessageDialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false;this.lookup("people_selector").inputFocus()},load:function(){return false},getPars:function(){var b=null;if(this.$("#@compose_message_to_uid").length>0)b=this.$("#@compose_message_to_uid").val();if(!b)return false;var h="";this.lookup("editor").isEmpty()||(h=this.lookup("editor").serialize());this.ok2Submit=true;return{uid:b,msg:h}},getName:function(b){this.$("#@to_name").setContentFromAJAXComponent("/topic/ajax_add_user_to_topic_name_POST",{uid:b})}});
QuestionAdd=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.setSuccessCallback(this.fnbind(function(b){if(b)document.location=b;this.clear();this.lookup("editor").setHtml(this.default_text);this.focus();this.submitted=false}));!this.click_expand&&this.lookup("editor").html().slice(0,this.default_text.length)==this.default_text&&this.focus();this.$("#@question_details_link").click(this.fnbind(function(){this.$("#@question_details_link").addClass("hidden");this.$(".@question_details").toggleClass("hidden");
this.lookup("details_editor").focus();return false}));this.click_expand==true&&this.setFocusCallback(this.fnbind(function(){this.expand()}))},request:function(){var b=this.getPars();if(this.submitted||!b||!this.ok2Submit)return false;this.submitted=true;if(Q.loginPageLoginListener)Q.loginPageLoginListener._enabled=false;this.serverCall("dialog_submit_controller").liveMutate().kwargs(b).success(this.fnbind(function(h){this.successCallback&&this.successCallback(h);this.close()})).send()},expand:function(){this.$("#@form_option_row").removeClass("hidden");
this.$("#@details_link_row").removeClass("hidden")},clear:function(){this.lookup("editor").clear();this.lookup("details_editor").clear();this.$("#@question_privacy").attr("checked",false);this.$("#@question_details_link").removeClass("hidden");this.$(".@question_details").addClass("hidden")},focus:function(){this.lookup("editor").focus()},getPars:function(){var b=this.default_text!=""&&this.lookup("editor").html().slice(0,this.default_text.length)==this.default_text,h={};h.question=this.lookup("editor").serialize();
h.question_details=this.lookup("details_editor").serialize();h.rel_qid=this.$("#@rel_qid").val()?this.$("#@rel_qid").val():0;h.tid=this.$("#@tid").val()?this.$("#@tid").val():0;h.interview_uid=this.$("#@interview_uid").val()?this.$("#@interview_uid").val():0;if(this.mobile){h["private"]=this.$("#@question_privacy").attr("checked")==true?1:0;h.distribution_type=this.$("#@question_distribution").attr("checked")==true?this.$("#@question_distribution").val():0}else{h["private"]=this.lookup("distribution_menu").getValue()==
0?1:0;h.distribution_type=this.lookup("distribution_menu").getValue()}if(!h.question||h.question==" "||b||this.lookup("editor").isEmpty()){this.$("#@question_text").select();return false}return h}});
WantedAnswerDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.child("question_selector").focus();this.setSuccessCallback(this.fnbind(function(b){if(b)document.location=b}))},getPars:function(){var b=this.child("question_selector").getQid(),h=this.child("question_selector").qValue;return{qid:b,text:h}}});function now_us(){return(new Date).getTime()*1E3}function is_bold_style(b){var h=parseInt(b);return isNaN(h)?b!="normal"&&b!="lighter":h>400}
QTextEditor=Q.Component.extend({onUnload:function(){if(this.typingTimeout){clearTimeout(this.typingTimeout);this.typingTimeout=null}if(this.meaningfulChangeTimeout){clearTimeout(this.meaningfulChangeTimeout);this.meaningfulChangeTimeout=null}},onLoad:function(){if(!this.enterCallback)this.enterCallback=null;if(!this.focusCallback)this.focusCallback=null;if(!this.blurCallback)this.blurCallback=null;if(!this.typingStateCallback)this.typingStateCallback=function(){};this.typingTimeout=null;this.lastTypingReportTime=
this.lastInputTime=0;this.lastReportedTypingState="empty";this.typingStopped=false;if(!this.meaningfulChangeCallback)this.meaningfulChangeCallback=function(){};this.meaningfulChangeBase=this.serialize();this.lastMeaningfulChangeReport=0;this.meaningfulChangeTimeout=null;this.$("#@add_qlink").tooltip({contents:"Link to questions, topics and people."});this.$("#@cmd_blockquote").tooltip({contents:"Blockquote a section of text."});this.$("#@cmd_code").tooltip({contents:"Code Block [code][/code]"});this.$("#@cmd_latex").tooltip({contents:"LaTeX [math][/math]"});
ff=function(){return false};this.$("#@add_qlink").click(ff);this.$("#@add_qlink").mousedown(this.fnbind(function(){this.addLink();return false}));this.$("#@cmd_blockquote").click(ff);this.$("#@cmd_blockquote").mousedown(this.fnbind(function(){this.$("#@editor").focus();this.$("#@cmd_blockquote").toggleClass("qtext_editor_button_active");document.execCommand("formatBlock",false,"<address>");return false}));this.$("#@cmd_code").click(ff);this.$("#@cmd_code").mousedown(this.fnbind(function(){this.$("#@editor").focus();
this.addTag("code");return false}));this.$("#@cmd_latex").click(ff);this.$("#@cmd_latex").mousedown(this.fnbind(function(){this.$("#@editor").focus();this.addTag("math");return false}));this.$("#@cmd_bold").click(ff);this.$("#@cmd_bold").mousedown(this.fnbind(function(){this.cmd("bold");return false}));this.$("#@cmd_italic").click(ff);this.$("#@cmd_italic").mousedown(this.fnbind(function(){this.cmd("italic");return false}));this.$("#@cmd_underline").click(ff);this.$("#@cmd_underline").mousedown(this.fnbind(function(){this.cmd("underline");
return false}));this.$("#@cmd_insertorderedlist").click(ff);this.$("#@cmd_insertorderedlist").mousedown(this.fnbind(function(){this.cmd("insertorderedlist");return false}));this.$("#@cmd_insertunorderedlist").click(ff);this.$("#@cmd_insertunorderedlist").mousedown(this.fnbind(function(){this.cmd("insertunorderedlist");return false}));this.$("#@save").click(this.fnbind(function(){this.save()}));this.$("#@editor").keydown(this.fnbind(function(h){return this.editorKeyDown(h)}));this.$("#@editor").keyup(this.fnbind(function(h){return this.editorKeyUp(h)}));
this.$("#@editor").focus(this.fnbind(function(){this.$("#@editor").attr("focused",true);this.focusCallback&&this.focusCallback()}));this.$("#@editor").blur(this.fnbind(function(){this.$("#@editor").attr("focused",false);this.blurCallback&&this.blurCallback()}));this.$("#@editor .qlink").click(this.fnbind(function(){var h=this.$("#@editor .qlink").attr("id").substr(6);this.editLink(h);return false}));this.$("#@editor").click(this.fnbind(function(h){this.setFormattingButtons(h.target)}));var b=this.fnbind(function(){this.qlinkSync()});
this.$("#@qlink_text").keydown(b);this.$("#@qlink_text").keyup(b);this.$("#@qlink_text").keypress(b);this.$("#@qlink_text").change(b);this.$(".@qlink_close").click(this.fnbind(function(){this.closeEditLink();return false}));this.plaintext||this.child("link_selector").setCallback(this.fnbind(function(){this.onLinkSelection()}))},getSelection:function(){return window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection?document.selection.createRange().text:
null},makeKey:function(){for(var b="",h="abcdefghijklmnopqrstuvwxyz0123456789",c=0;c<10;c++)b+=h[Math.floor(Math.random()*h.length)];return b},syncTypingState:function(){var b=1E7;state=this.isEmpty()||this.typingStopped?"empty":this.lastInputTime<now_us()-b?"paused":"typing";var h=false;if(state!=this.lastReportedTypingState)h=true;if(state!="empty")if(this.lastTypingReportTime<now_us()-55E6)h=true;if(h){this.typingStateCallback(state);this.lastReportedTypingState=state;this.lastTypingReportTime=
now_us()}if(this.typingTimeout){clearTimeout(this.typingTimeout);this.typingTimeout=null}if(state=="typing"||state=="paused")this.typingTimeout=setTimeout(this.fnbind(function(){this.syncTypingState()}),b/1E3)},checkMeaningfulChange:function(){var b=3E4;if(!this.meaningfulChangeTimeout)this.meaningfulChangeTimeout=setTimeout(this.fnbind(function(){var h=this.serialize();h!=this.meaningfulChangeBase&&this.meaningfulChangeCallback();this.meaningfulChangeBase=h;this.meaningfulChangeTimeout=null}),b)},
editorKeyUp:function(){this.typingStopped=false;this.lastInputTime=now_us();this.syncTypingState();this.checkMeaningfulChange()},editorKeyDown:function(b){if(b.shiftKey&&b.keyCode==50){this.addLink();return false}if(this.enterCallback&&!b.shiftKey&&b.keyCode==13){this.enterCallback();return false}return true},addDummySpan:function(){var b='<span id="just_inserted">.</span>&nbsp;';if(document.selection){var h=document.selection.createRange();h&&h.pasteHTML(b)}else document.execCommand("inserthtml",
false,b)},addLink:function(){this.addDummySpan();var b=this.$("#@editor #just_inserted").get(0);if(b){b.id="";var h=b.parentNode,c=b.previousSibling;if(c==null||c.nodeName!="#text"){c=document.createTextNode("\u00a0");h.insertBefore(c,b)}var f=this.makeKey();c=document.createElement("span");c.id="qlink_"+f;c.contentEditable="false";c.onclick=this.fnbind(function(){this.editLink(f);return false});c.innerHTML="...";var o=document.createElement("a");o.contentEditable="false";o.style.textDecoration="none";
o.className="qlink";o.href="#";o.appendChild(c);h.insertBefore(o,b);h.removeChild(b);this.qlink_data[f]={target:{},text:""};this.editLink(f)}else a1ert("Click the textarea before adding a reference.")},addTag:function(b){function h(F,V){if(F===V)return true;return V&&V!=document.body&&h(F,V.parentNode)}function c(F,V){if(!h(o,F))return false;return F===V||h(o,V)}var f="["+b+"]";b="[/"+b+"]";var o=this.$("#@editor").get(0),m;if(window.getSelection){m=window.getSelection().getRangeAt(0);if(!(!m||m.isCollapsed)){function l(F,
V,aa){if(F.nodeType==3){var O=F.nodeValue;F.nodeValue=O.slice(0,V)+aa+O.slice(V)}else F.parentNode.insertBefore(document.createTextNode(aa),V==0?F:F.nextSibling)}function p(F,V,aa,O){var M=window.getSelection(),e=document.createRange();M.removeAllRanges();e.setStart(F,V);e.setEnd(aa,O);M.addRange(e)}var r=m.endContainer,u=m.endOffset,E=m.startContainer;m=m.startOffset;if(c(E,r)){l(r,u,b);l(E,m,f);p(E,m+f.length,r,u+(r===E?f.length:0))}}}else if(document.selection)if((m=document.selection.createRange())&&
m.htmlText){r=m.duplicate();u=m.duplicate();r.collapse(true);u.collapse(false);if(c(r.parentElement(),u.parentElement())){u.pasteHTML(b);r.pasteHTML(f);m.select()}}},editLink:function(b){this.closeEditLink();var h=window.getSelection();this.lastSelectionRange=h.rangeCount?h.getRangeAt(0):null;h=this.qlink_data[b].text;this.$("#@qlink_key").val(b);this.$("#@qlink_text").val(h);var c=h?"qlink_tab_selector":"";this.editLinkTabs(c);var f=this.$("#@editor_wrapper").offset(),o=this.$("#@editor #qlink_"+
b).offset();c=o.left-f.left;f=o.top-f.top;this.$("#@qlink_editor").css("left",c-10);this.$("#@qlink_editor").css("top",f+20);this.$("#@qlink_editor").removeClass("hidden");this.child("link_selector").clear();this.child("link_selector").setText(h);this.child("link_selector").focus();this.child("link_selector").setEscKeyDown(this.fnbind(function(m){var l=this.child("link_selector").getValue(),p=m.keyCode==27,r=!l&&m.keyCode==13;m=!l&&m.keyCode==8;if(r||p||m){p=this.$("#@editor #qlink_"+b);r=p.parent();
if(p.text()=="..."){r.css("color","#333");r.removeClass("qlink");r.html("@");delete this.qlink_data[b]}this.refocusEditor();this.closeEditLink();return false}}));this.$("#@editor").focus(this.fnbind(this.closeEditLink));this.$("#@editor #qlink_"+b).addClass("qlink_active")},editLinkTabs:function(b){this.editLinkTabsSelect("qlink_tab_selector","qlink_selector_row");this.$("#@qlink_tab_selector").click(this.fnbind(function(){this.editLinkTabsSelect("qlink_tab_selector","qlink_selector_row")}));this.$("#@qlink_text_edit").click(this.fnbind(function(){this.editLinkTabsSelect("qlink_text_edit",
"qlink_text_edit_row")}));this.$("#@qlink_tab_ext_link").click(this.fnbind(function(){this.editLinkTabsSelect("qlink_tab_ext_link","qlink_tab_ext_link_row")}));this.$("#@qlink_tab_cite").click(this.fnbind(function(){this.editLinkTabsSelect("qlink_tab_cite","qlink_tab_cite_row")}));if(b=="qlink_tab_selector"){this.$("#@qlink_tab_ext_link").addClass("hidden");this.$("#@qlink_tab_cite").addClass("hidden");this.$("#@qlink_text_edit").removeClass("hidden")}else{this.$("#@qlink_tab_ext_link").removeClass("hidden");
this.$("#@qlink_tab_cite").removeClass("hidden");this.$("#@qlink_text_edit").addClass("hidden")}},editLinkTabsReset:function(){this.$("#@qlink_tabs_row .selected").removeClass("selected");this.$("#@qlink_editor .row").addClass("hidden")},editLinkTabsSelect:function(b,h){this.editLinkTabsReset();this.$("#@"+b).addClass("selected");this.$("#@"+h).removeClass("hidden")},closeEditLink:function(){var b=this.$("#@qlink_key").val();if(b){this.$("#@qlink_editor").addClass("hidden");this.$("#@editor #qlink_"+
b).removeClass("qlink_active")}},qlinkSync:function(){var b=this.$("#@qlink_key").val(),h=this.$("#@qlink_text").val();h?this.$("#@editor #qlink_"+b).html(h):this.$("#@editor #qlink_"+b).html("...");var c=this.child("link_selector").result;this.qlink_data[b]={text:h,target:c}},onLinkSelection:function(){var b=this.child("link_selector").qValue;this.$("#@qlink_text").val(b);this.qlinkSync();this.refocusEditor();this.closeEditLink()},refocusEditor:function(){this.$("#@editor").focus();var b=window.getSelection();
b.removeAllRanges();this.lastSelectionRange&&b.addRange(this.lastSelectionRange)},cmd:function(b){this.$("#@editor").focus();this.$("#@cmd_"+b).toggleClass("qtext_editor_button_active");document.execCommand(b,false,false);return false},setFormattingButtons:function(b){b=$(b);b={bold:is_bold_style(b.css("font-weight")),italic:b.css("font-style")=="italic",underline:b.css("text-decoration")=="underline"};for(style in b)b[style]?this.$("#@cmd_"+style).addClass("qtext_editor_button_active"):this.$("#@cmd_"+
style).removeClass("qtext_editor_button_active")},setEnterCallback:function(b){this.enterCallback=b},setTypingStateCallback:function(b){this.typingStateCallback=this.plaintext?null:b},setMeaningfulChangeCallback:function(b){this.meaningfulChangeCallback=this.plaintext?null:b},setFocusCallback:function(b){this.focusCallback=b},setBlurCallback:function(b){this.blurCallback=b},serialize:function(){var b=this.html();b=this.plaintext?{html:b,data:{}}:{html:b,data:this.qlink_data};return JSON.stringify(b)},
html:function(){if(this.plaintext){var b=this.$("#@editor").val();b||(b="");return b.replace(/\n/g,"<br>")}else return this.$("#@editor").html()},setHtml:function(b){return this.$("#@editor").html(b)},isEmpty:function(){if(this.plaintext)return this.$("#@editor").val()=="";var b=this.$("#@editor").get(0);if(!b)return true;if(b.childNodes.length==1)if(b.childNodes[0].tagName=="BR")return true;b=this.html();return b==""},clear:function(){if(this.plaintext)this.$("#@editor").val("");else{this.$("#@editor").html("<br>");
this.qlink_data={};this.lastInputTime=now_us();this.syncTypingState()}},stopTyping:function(){if(!this.plaintext){this.typingStopped=true;this.syncTypingState()}},focus:function(){if(this.plaintext){this.$("#@editor").focus();this.$("#@editor").select()}else{this.$("#@editor").focus();this.$("#@editor").attr("focused",true)}},blur:function(){this.$("#@editor").blur();this.plaintext||this.$("#@editor").attr("focused",false)}});
(function(){var b=function(h,c){for(var f=0;f<h.length;f++)if(h[f]==c)return f;return-1};QTextEditor.getCursorPosition=function(){var h;if(window.getSelection){h=window.getSelection();h.getRangeAt(0);return h=b(h.anchorNode.parentNode.childNodes,h.anchorNode)+h.anchorOffset}else if(document.selection){h=document.selection.createRange();h=h.getBookmark();return h=h.charCodeAt(2)-11}}})();
ThreadMessageQTextEditor=QTextEditor.extend({onLoad:function(){this.is_disabled=false;this._super.apply(this,arguments);this.setTypingStateCallback(this.fnbind(function(b){this.serverCall("typing").kwargs({area:"thread-"+this.thread_id,state:b}).send()}));this.focus()},request:function(){if(this.is_disabled||this.isEmpty()&&!this.plaintext)return false;var b={};b.thread_id=this.thread_id;b.object_id=this.object_id;b.msg=this.isEmpty()&&this.plaintext?JSON.stringify({html:this.$("#@editor").val()}):
this.serialize();W2.rpc("/thread/"+this.ajax_POST).kwargs(b).liveMutate().success(this.fnbind(function(){this.cleanUp()})).send();this.disable()},disable:function(){this.is_disabled=true;this.$("#@editor").addClass("qtext_editor_content_disabled")},cleanUp:function(){this.is_disabled=false;this.$("#@editor").removeClass("qtext_editor_content_disabled");this.clear();this.blur();this.focus()}});
TestSaveButton=Q.Component.extend({onLoad:function(){this.$("#@save").click(this.fnbind(function(){var b=this.lookup("editor").serialize();$.securepost("/internal/qtexttest/save_POST",{content:b})}))}});function now(){return new Date}
TypeaheadResults=Q.Component.extend({onLoad:function(){function b(f){var o=h.$("#@list_item_"+f);o.mouseover(h.fnbind(function(){h.setFocusIndex(f);return false}));o.mousedown(h.fnbind(function(){h.goResult(f);return false}))}this.hideDropdown();this.instructions=this.focusedIndex=null;for(var h=this,c=0;c<this.results.length;c++)b(c)},hideDropdown:function(){this.$("#@results_frame").hide()},showDropdown:function(){this.$("#@results_frame").show()},hide:function(){this.hideDropdown();this.setFocusIndex(null)},
getResult:function(b){return this.results[b]},goResult:function(b){if(this.actionType=="url")document.location=this.actionOfIndex[b];else if(this.actionType=="value"){this.hide();this.qValue=this.actionOfIndex[b];this.parent().setValue(this.qValue,this.results[b])}else assert(0)},down:function(){if(this.focusedIndex==null)this.setFocusIndex(0);else if(this.focusedIndex<this.nResults-1)this.setFocusIndex(this.focusedIndex+1);else this.focusedIndex==this.nResults-1&&this.setFocusIndex(null)},up:function(){if(this.focusedIndex==
null)this.setFocusIndex(this.nResults-1);else if(0==this.focusedIndex)this.setFocusIndex(null);else 0<this.focusedIndex&&this.setFocusIndex(this.focusedIndex-1)},go:function(){if(this.focusedIndex!=null){this.goResult(this.focusedIndex);return true}return false},setFocusIndex:function(b){if(!(this.empty||this.$("#@list_item_"+b).hasClass("instruction"))){this.focusedIndex!=null&&this.$("#@list_item_"+this.focusedIndex).removeClass("selected");b!=null&&this.$("#@list_item_"+b).addClass("selected");
this.focusedIndex=b}}});
Typeahead=Q.Component.extend({onLoad:function(){this.focusOnLoad&&this.focus();this.qValue=this.initialValue;this.selectionChosen=this.closed=this.requestOutstanding=false;this.selectionlessCallback=null;this.placeholderActive=false;this.extraKeydown=null;this.$("#@input").keyup(this.fnbind(function(){this.inputKeyup();return false}));this.$("#@input").keydown(this.fnbind(function(b){return this.inputKeydown(b)}));this.$("#@input").blur(this.fnbind(function(){this.inputBlur()}));this.$("#@input").focus(this.fnbind(function(){this.inputFocus();
this.extraFocus&&this.extraFocus()}));this.$("#@view_selector").click(this.fnbind(function(){this.$("#@selector_wrapper").removeClass("hidden");this.$("#@view_selector_wrapper").addClass("hidden");this.focus();return false}));this.$("#@input").attr("focused")||this.setPlaceholder()},getRequestUpdatePostData:function(){return{q:this.qValue,data:this.data}},requestUpdate:function(){this.requestOutstanding=true;this.requestStartTime=now();var b=this.getRequestUpdatePostData();b.___W2_parentId=this.cid;
b.___W2_windowId=W2.windowId;$.ajax({type:"GET",url:this.resultsQueryPath,dataType:"json",data:b,success:this.fnbind(function(h){this.ajaxCallback(h)}),error:this.fnbind(function(h,c,f){console.log(c,f);this.requestOutstanding=false;this.$("#@results_shell").html("Could not retrieve results: "+c)})})},close:function(){this.closed=true;this.child("results").hide()},clear:function(){this.clearInput();this.close()},clearInput:function(){this.$("#@input").val("");this.$("#@input").get(0).style.backgroundColor=
"#fff"},reset:function(){this.qValue=this.initialValue;this.clearInput();this.$("#@input").blur()},resetFocus:function(){this.reset();this.focus()},setCallback:function(b){this.callback=b},setSelectionlessCallback:function(b){this.selectionlessCallback=b},setExtraFocus:function(b){this.extraFocus=b},setExtraKeydown:function(b){this.extraKeydown=b},setValue:function(b,h){this.qValue=b;this.$("#@input").val(this.qValue);this.result=h;question_selector=this.$("#@input");if(!question_selector.hasClass("maintain_background_white"))question_selector.get(0).style.backgroundColor=
"#eee";this.$("#@input").get(0).blur();this.selectionChosen=true;this.callback&&this.callback()},getValue:function(){return this.placeholderActive?"":this.$("#@input").val()},ajaxCallback:function(b){var h=now();if(this.requestOutstanding){this.requestOutstanding=false;if(!this.closed){W2.unloadComponent(this.child("results").cid);this.$("#@results_shell").setContent(b);!this.child("results").empty&&this.child("results").query&&this.child("results").showDropdown();b=(now()-this.requestStartTime)/
1E3;h=(now()-h)/1E3;console&&console.log("js saw "+b+" ms and "+h+" in callback");this.child("results").query!=this.qValue&&this.requestUpdate()}}},inputKeydown:function(b){b=b||window.event;var h=this.$("#@input");if(h.val()==""){if(b.keyCode==40){h.blur();window.scrollBy(0,32);return false}if(b.keyCode==32){h.blur();window.innerHeight&&window.scrollBy(0,0.85*window.innerHeight);return false}}if(h.val()==""||h.val()==this.initialValue)if(b.keyCode==34||b.keyCode==18){h.blur();window.innerHeight&&
window.scrollBy(0,0.85*window.innerHeight);return false}if(b.keyCode==40){this.requestOutstanding=false;this.child("results").down();return false}else if(b.keyCode==38){this.child("results").up();return false}else if(b.keyCode==27){this.child("results").hide();return false}else if(b.keyCode==13)if(this.child("results").go())return false;else if(this.selectionlessCallback&&this.selectionlessCallback())return false;if(this.extraKeydown)return this.extraKeydown(b.keyCode);return true},inputKeyup:function(){this.onInputChange()},
onInputChange:function(){newQValue=this.$("#@input").val();if(newQValue!=this.qValue){this.qValue=newQValue;this.requestOutstanding||this.requestUpdate();if(this.qValue=="")this.closed=false}},inputBlur:function(){this.$("#@input").attr("focused",false);this.child("results").hide();this.setPlaceholder()},setText:function(b){this.$("#@input").val(b);this.onInputChange()},setPlaceholder:function(){var b=this.$("#@input").attr("placeholder");if(b&&!this.getValue()){this.placeholderActive=true;this.$("#@input").addClass("light");
this.$("#@input").val(b)}},removePlaceholder:function(){if(this.placeholderActive){this.placeholderActive=false;this.$("#@input").removeClass("light");this.clearInput()}},focus:function(){this.$("#@input").attr("focused",true);this.closed=false;this.$("#@input").focus();this.removePlaceholder()},inputFocus:function(){this.$("#@input").attr("focused",true);this.removePlaceholder();if(this.selectionChosen){this.selectionChosen=false;this.$("#@input").get(0).style.backgroundColor="";this.result=null;
this.requestUpdate()}else this.child("results").showDropdown()},cursorPosition:function(b){b=b.get(0);var h=null;if(b.selectionStart!=undefined){if(b.selectionStart==b.selectionEnd)h=b.selectionStart}else if(document.selection){var c=document.selection.createRange().duplicate();if(c.text==""){c.moveEnd("character",b.value.length);h=c.text==""?b.value.length:b.value.lastIndexOf(c.text)}}return h}});
ContextTypeahead=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.width=this.$("#@input").outerWidth();this.orgPlaceholder=this.$("#@input").attr("placeholder");this.child("context").setDefault();this.child("context").default_text&&this.updateInstruction(this.child("context").default_text);this.resizeInput();this.setExtraKeydown(this.fnbind(function(b){if(b==9){b=this.child("results").focusedIndex?this.child("results").focusedIndex:0;b=this.child("results").getResult(b);
if(b.text){this.updateInstruction(b.text);this.context={type:b.type,id:b.id};this.child("context").setContext(b.text,b.url);this.$("#@input").val("");this.resizeInput();return false}}else if(b==8){b=this.$("#@input");if(b.val()==""||this.cursorPosition(b)==0)this.resetContext()}return true}));this.focusOnLoad&&this.focus()},updateInstruction:function(b){b="Find "+b+" questions and topics";this.$("#@input").attr("placeholder",b);this.setPlaceholder()},resizeInput:function(){var b=this.child("context").getWidth();
b=this.width-b-10;this.$("#@input").css("width",b+"px")},resetContext:function(){this.context={};this.child("context").removeContext();this.$("#@input").attr("placeholder",this.orgPlaceholder);this.resizeInput();this.requestUpdate()},getRequestUpdatePostData:function(){return{q:this.qValue,context_type:this.context.type,context_id:this.context.id,data:this.data}}});
TopicSelector=Typeahead.extend({onLoad:function(b){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.lookup("topic_add").select();this.type!="to_tid"&&this.type!="replace_topic"&&this.reset()}));var h=false;$("input, textarea, .qtext_editor_content").each(function(){if($(this).attr("focused")=="true")h=true});!b&&!h&&this.$("#@view_selector").focus()},addTempTopic:function(b){this.$("#@temp_topics_list").append(b)},hideSelector:function(){this.$("#@selector_wrapper").addClass("hidden");
this.$("#@view_selector_wrapper").removeClass("hidden");this.$("#@view_selector").focus()}});Navigator=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@add_new_question").click(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue});return false}));this.setSelectionlessCallback(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue})}))}});
ContextNavigator=ContextTypeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@add_new_question").click(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue,tid:this.getTopic()});return false}));this.setSelectionlessCallback(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue,tid:this.getTopic()})}))},getTopic:function(){if(this.context&&this.context.type=="topic")return this.context.id;return null}});
MobileNavigator=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@input").focus(this.fnbind(function(){this.mobileInputFocus()}));this.$("#@input").blur(this.fnbind(function(){this.$("#@input").attr("placeholder")==this.$("#@input").val()&&this.mobileInputBlur()}));this.$("#@add_new_question").click(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue});return false}));this.setSelectionlessCallback(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue})}))},
mobileInputFocus:function(){this.parent().miniLogo();this.$("#@add").removeClass("hidden")},mobileInputBlur:function(){this.parent().resetLogo();this.$("#@add").addClass("hidden")}});
RelatedQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.rel_qid=this.qValue;this.reset();this.serverCall("add_related_question").kwargs({qid:this.qid,rel_qid:this.rel_qid}).liveMutate().send()}));this.setSelectionlessCallback(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue});this.reset()}))}});
TopicAddQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setSelectionlessCallback(this.fnbind(function(){this.lookup("add_question").triggerClick({q:this.qValue,tid:this.tid});this.reset()}))}});
RedirectQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.$("#@input").val($.trim($("<div>"+this.result.html+"</div>").text()));this.serverCall("question_redirect_preview").kwargs({to_qid:this.qValue}).contentFor(this.lookup("question_details_area").$("#@question_redirect_preview_area"),{parentCID:this.cid}).send()}))}});
WantedAnswerQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.qid=null;this.setCallback(this.fnbind(function(){this.setQid(this.qValue);this.$("#@selector").addClass("hidden");this.$("#@question").removeClass("hidden");this.$("#@question").setContentFromAJAXComponent("/question/ajax_question_name_POST",{qid:this.qValue});this.reset()}))},setQid:function(b){this.qid=b},getQid:function(){return this.qid}});
TempQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){var b=this.object_id;this.qid=this.qValue;this.reset();this.$("#@temp_question").setContentFromAJAXComponent("/question/ajax_temp_question_POST",{qid:this.qid,email:b},this.cid,null,this.fnbind(function(){this.addToList()}))}))},setObjectID:function(b){this.object_id=b},addToList:function(){this.$("#@selector_results").append($("<li/>").addClass("clear").append($("<a/>").attr("href",
"#").attr("style","float:left;padding:0 0 2px;margin:3px 3px 0 0;").addClass("remove").addClass("br3").click(function(){$(this).parent().remove();return false}).append("")).append(this.$("#@temp_question").html()));this.$("#@temp_question").html("")}});PeopleSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.to_uid=this.qValue;this.reset();this.parent().setTo(this.to_uid)}))}});
LinkSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments)},setEscKeyDown:function(b){this.$("#@input").keydown(b)}});MobileStandardLayout=Q.Component.extend({onLoad:function(){},hideURLBar:function(){!this.touched&&window.location.hash.substr(0,1)!="#"&&setTimeout(function(){window.scrollTo(0,1)},0)}});MobileHeader=Q.Component.extend({onLoad:function(){this.org=this.$("#@logo_text").text()},miniLogo:function(){setTimeout(function(){window.scrollTo(0,1)},0);this.$("#@logo_text").text("Q");this.$("#@logo").addClass("logo_mini")},resetLogo:function(){this.$("#@logo_text").text(this.org);this.$("#@logo").removeClass("logo_mini")}});
MobileHomeButtons=Q.Component.extend({onLoad:function(){this.org=this.$("#@more").html();this.$("#@more").click(this.fnbind(function(){var b=this.$("#@mobile_more_buttons");if(b.hasClass("hidden")){this.$("#@more").html("Less");b.removeClass("hidden")}else{this.$("#@more").html(this.org);b.addClass("hidden")}return false}))}});

