/*
Name: js_main
Url: http://d1vgw4v7ja2ido.cloudfront.net/-4603733cec3fa8a0.js
Generated: Mar 09, 2010 02:45 AM PST
Files: ['/json2.js', '/jquery.js', '/jquery.securepost.js', '/jquery.cookie.js', '/jquery.dialog.js', '/jquery.tooltip.js', '/jquery.menu.js', '/jquery.topic.js', '/fnbind.js', '/Class.js', '/webnode2.js', '/jquery.ajax.js', '/jquery.webnode2.js', '/swfobject.js', '/w2.inputvalidate.js', '/Quora.js', '/dialog.js', '/mobile.js', '/effects.core.js', '/effects.shake.js', '/effects.highlight.js', '/w2.livenode.js', '/qtexteditor.js', '/typeahead.js', '/w2.rpc.js', '/jquery.quora.js', '/w2.inspector.js', '/w2.interaction.js']

*/
if(!this.JSON)this.JSON={};
(function(){function b(s){return s<10?"0"+s:s}function f(s){x.lastIndex=0;return x.test(s)?'"'+s.replace(x,function(z){var H=p[z];return typeof H==="string"?H:"\\u"+("0000"+z.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'}function g(s,z){var H,S,d=m,I,G=z[s];if(G&&typeof G==="object"&&typeof G.toJSON==="function")G=G.toJSON(s);if(typeof r==="function")G=r.call(z,s,G);switch(typeof G){case "string":return f(G);case "number":return isFinite(G)?String(G):"null";case "boolean":case "null":return String(G);case "object":if(!G)return"null";
m+=h;I=[];if(Object.prototype.toString.apply(G)==="[object Array]"){S=G.length;for(s=0;s<S;s+=1)I[s]=g(s,G)||"null";z=I.length===0?"[]":m?"[\n"+m+I.join(",\n"+m)+"\n"+d+"]":"["+I.join(",")+"]";m=d;return z}if(r&&typeof r==="object"){S=r.length;for(s=0;s<S;s+=1){H=r[s];if(typeof H==="string")if(z=g(H,G))I.push(f(H)+(m?": ":":")+z)}}else for(H in G)if(Object.hasOwnProperty.call(G,H))if(z=g(H,G))I.push(f(H)+(m?": ":":")+z);z=I.length===0?"{}":m?"{\n"+m+I.join(",\n"+m)+"\n"+d+"}":"{"+I.join(",")+"}";
m=d;return z}}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 o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
x=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,m,h,p={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},r;if(typeof JSON.stringify!=="function")JSON.stringify=function(s,z,H){var S;h=m="";if(typeof H==="number")for(S=0;S<H;S+=1)h+=" ";else if(typeof H==="string")h=H;if((r=z)&&typeof z!=="function"&&(typeof z!=="object"||typeof z.length!=="number"))throw new Error("JSON.stringify");return g("",
{"":s})};if(typeof JSON.parse!=="function")JSON.parse=function(s,z){function H(S,d){var I,G,L=S[d];if(L&&typeof L==="object")for(I in L)if(Object.hasOwnProperty.call(L,I)){G=H(L,I);if(G!==undefined)L[I]=G;else delete L[I]}return z.call(S,d,L)}o.lastIndex=0;if(o.test(s))s=s.replace(o,function(S){return"\\u"+("0000"+S.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(s.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){s=eval("("+s+")");return typeof z==="function"?H({"":s},""):s}throw new SyntaxError("JSON.parse");}})();(function(){function b(a,c){c.src?d.ajax({url:c.src,async:false,dataType:"script"}):d.globalEval(c.text||c.textContent||c.innerHTML||"");c.parentNode&&c.parentNode.removeChild(c)}function f(){return+new Date}function g(a,c){return a[0]&&parseInt(d.curCSS(a[0],c,true),10)||0}function o(){return false}function x(){return true}function m(a){var c=RegExp("(^|\\.)"+a.type+"(\\.|$)"),e=true,k=[];d.each(d.data(this,"events").live||[],function(q,v){if(c.test(v.type))(q=d(a.target).closest(v.data)[0])&&k.push({elem:q,
fn:v})});k.sort(function(q,v){return d.data(q.elem,"closest")-d.data(v.elem,"closest")});d.each(k,function(){if(this.fn.call(this.elem,a,this.fn.data)===false)return e=false});return e}function h(a,c){return["live",a,c.replace(/\./g,"`").replace(/ /g,"|")].join(".")}function p(){if(!O){O=true;if(document.addEventListener)document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);d.ready()},false);else if(document.attachEvent){document.attachEvent("onreadystatechange",
function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);d.ready()}});document.documentElement.doScroll&&s==s.top&&function(){if(!d.isReady){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}d.ready()}}()}d.event.add(s,"load",d.ready)}}function r(a,c){var e={};d.each(aa.concat.apply([],aa.slice(0,c)),function(){e[this]=a});return e}var s=this,z,H=s.jQuery,S=s.$,d=s.jQuery=s.$=function(a,c){return new d.fn.init(a,
c)},I=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,G=/^.[^:#\[\.,]*$/;d.fn=d.prototype={init:function(a,c){a=a||document;if(a.nodeType){this[0]=a;this.length=1;this.context=a;return this}if(typeof a==="string"){var e=I.exec(a);if(e&&(e[1]||!c))if(e[1])a=d.clean([e[1]],c);else{if((c=document.getElementById(e[3]))&&c.id!=e[3])return d().find(a);e=d(c||[]);e.context=document;e.selector=a;return e}else return d(c).find(a)}else if(d.isFunction(a))return d(document).ready(a);if(a.selector&&a.context){this.selector=
a.selector;this.context=a.context}return this.setArray(d.isArray(a)?a:d.makeArray(a))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===z?Array.prototype.slice.call(this):this[a]},pushStack:function(a,c,e){a=d(a);a.prevObject=this;a.context=this.context;if(c==="find")a.selector=this.selector+(this.selector?" ":"")+e;else if(c)a.selector=this.selector+"."+c+"("+e+")";return a},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},
each:function(a,c){return d.each(this,a,c)},index:function(a){return d.inArray(a&&a.jquery?a[0]:a,this)},attr:function(a,c,e){var k=a;if(typeof a==="string")if(c===z)return this[0]&&d[e||"attr"](this[0],a);else{k={};k[a]=c}return this.each(function(q){for(a in k)d.attr(e?this.style:this,a,d.prop(this,k[a],e,q,a))})},css:function(a,c){if((a=="width"||a=="height")&&parseFloat(c)<0)c=z;return this.attr(a,c,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null)return this.empty().append((this[0]&&
this[0].ownerDocument||document).createTextNode(a));var c="";d.each(a||this,function(){d.each(this.childNodes,function(){if(this.nodeType!=8)c+=this.nodeType!=1?this.nodeValue:d.fn.text([this])})});return c},wrapAll:function(a){if(this[0]){a=d(a,this[0].ownerDocument).clone();this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var c=this;c.firstChild;)c=c.firstChild;return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){d(this).contents().wrapAll(a)})},
wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},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(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,
this.nextSibling)})},end:function(){return this.prevObject||d([])},push:[].push,sort:[].sort,splice:[].splice,find:function(a){if(this.length===1){var c=this.pushStack([],"find",a);c.length=0;d.find(a,this[0],c);return c}else return this.pushStack(d.unique(d.map(this,function(e){return d.find(a,e)})),"find",a)},clone:function(a){var c=this.map(function(){if(!d.support.noCloneEvent&&!d.isXMLDoc(this)){var q=this.outerHTML;if(!q){q=this.ownerDocument.createElement("div");q.appendChild(this.cloneNode(true));
q=q.innerHTML}return d.clean([q.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else return this.cloneNode(true)});if(a===true){var e=this.find("*").andSelf(),k=0;c.find("*").andSelf().each(function(){if(this.nodeName===e[k].nodeName){var q=d.data(e[k],"events");for(var v in q)for(var y in q[v])d.event.add(this,v,q[v][y],q[v][y].data);k++}})}return c},filter:function(a){return this.pushStack(d.isFunction(a)&&d.grep(this,function(c,e){return a.call(c,e)})||d.multiFilter(a,d.grep(this,
function(c){return c.nodeType===1})),"filter",a)},closest:function(a){var c=d.expr.match.POS.test(a)?d(a):null,e=0;return this.map(function(){for(var k=this;k&&k.ownerDocument;){if(c?c.index(k)>-1:d(k).is(a)){d.data(k,"closest",e);return k}k=k.parentNode;e++}})},not:function(a){if(typeof a==="string")if(G.test(a))return this.pushStack(d.multiFilter(a,this,true),"not",a);else a=d.multiFilter(a,this);var c=a.length&&a[a.length-1]!==z&&!a.nodeType;return this.filter(function(){return c?d.inArray(this,
a)<0:this!=a})},add:function(a){return this.pushStack(d.unique(d.merge(this.get(),typeof a==="string"?d(a):d.makeArray(a))))},is:function(a){return!!a&&d.multiFilter(a,this).length>0},hasClass:function(a){return!!a&&this.is("."+a)},val:function(a){if(a===z){var c=this[0];if(c){if(d.nodeName(c,"option"))return(c.attributes.value||{}).specified?c.value:c.text;if(d.nodeName(c,"select")){var e=c.selectedIndex,k=[],q=c.options;c=c.type=="select-one";if(e<0)return null;var v=c?e:0;for(e=c?e+1:q.length;v<
e;v++){var y=q[v];if(y.selected){a=d(y).val();if(c)return a;k.push(a)}}return k}return(c.value||"").replace(/\r/g,"")}}else{if(typeof a==="number")a+="";return this.each(function(){if(this.nodeType==1)if(d.isArray(a)&&/radio|checkbox/.test(this.type))this.checked=d.inArray(this.value,a)>=0||d.inArray(this.name,a)>=0;else if(d.nodeName(this,"select")){var D=d.makeArray(a);d("option",this).each(function(){this.selected=d.inArray(this.value,D)>=0||d.inArray(this.text,D)>=0});if(!D.length)this.selectedIndex=
-1}else this.value=a})}},html:function(a){return a===z?this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null:this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(c,e){return a.call(c,e,c)}))},andSelf:function(){return this.add(this.prevObject)},
domManip:function(a,c,e){function k(M,T){return c&&d.nodeName(M,"table")&&d.nodeName(T,"tr")?M.getElementsByTagName("tbody")[0]||M.appendChild(M.ownerDocument.createElement("tbody")):M}if(this[0]){var q=(this[0].ownerDocument||this[0]).createDocumentFragment();a=d.clean(a,this[0].ownerDocument||this[0],q);var v=q.firstChild;if(v)for(var y=0,D=this.length;y<D;y++)e.call(k(this[y],v),this.length>1||y>0?q.cloneNode(true):q);a&&d.each(a,b)}return this}};d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a=
arguments[0]||{},c=1,e=arguments.length,k=false,q;if(typeof a==="boolean"){k=a;a=arguments[1]||{};c=2}if(typeof a!=="object"&&!d.isFunction(a))a={};if(e==c){a=this;--c}for(;c<e;c++)if((q=arguments[c])!=null)for(var v in q){var y=a[v],D=q[v];if(a!==D)if(k&&D&&typeof D==="object"&&!D.nodeType)a[v]=d.extend(k,y||(D.length!=null?[]:{}),D);else if(D!==z)a[v]=D}return a};var L=/z-?index|font-?weight|opacity|zoom|line-?height/i,ca=document.defaultView||{},U=Object.prototype.toString;d.extend({noConflict:function(a){s.$=
S;if(a)s.jQuery=H;return d},isFunction:function(a){return U.call(a)==="[object Function]"},isArray:function(a){return U.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&d.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var c=document.getElementsByTagName("head")[0]||document.documentElement,e=document.createElement("script");e.type="text/javascript";if(d.support.scriptEval)e.appendChild(document.createTextNode(a));
else e.text=a;c.insertBefore(e,c.firstChild);c.removeChild(e)}},nodeName:function(a,c){return a.nodeName&&a.nodeName.toUpperCase()==c.toUpperCase()},each:function(a,c,e){var k,q=0,v=a.length;if(e)if(v===z)for(k in a){if(c.apply(a[k],e)===false)break}else for(;q<v;){if(c.apply(a[q++],e)===false)break}else if(v===z)for(k in a){if(c.call(a[k],k,a[k])===false)break}else for(e=a[0];q<v&&c.call(e,q,e)!==false;e=a[++q]);return a},prop:function(a,c,e,k,q){if(d.isFunction(c))c=c.call(a,k);return typeof c===
"number"&&e=="curCSS"&&!L.test(q)?c+"px":c},className:{add:function(a,c){d.each((c||"").split(/\s+/),function(e,k){if(a.nodeType==1&&!d.className.has(a.className,k))a.className+=(a.className?" ":"")+k})},remove:function(a,c){if(a.nodeType==1)a.className=c!==z?d.grep(a.className.split(/\s+/),function(e){return!d.className.has(c,e)}).join(" "):""},has:function(a,c){return a&&d.inArray(c,(a.className||a).toString().split(/\s+/))>-1}},swap:function(a,c,e){var k={};for(var q in c){k[q]=a.style[q];a.style[q]=
c[q]}e.call(a);for(q in c)a.style[q]=k[q]},css:function(a,c,e,k){if(c=="width"||c=="height"){var q;e={position:"absolute",visibility:"hidden",display:"block"};var v=c=="width"?["Left","Right"]:["Top","Bottom"];function y(){q=c=="width"?a.offsetWidth:a.offsetHeight;k!=="border"&&d.each(v,function(){k||(q-=parseFloat(d.curCSS(a,"padding"+this,true))||0);if(k==="margin")q+=parseFloat(d.curCSS(a,"margin"+this,true))||0;else q-=parseFloat(d.curCSS(a,"border"+this+"Width",true))||0})}a.offsetWidth!==0?
y():d.swap(a,e,y);return Math.max(0,Math.round(q))}return d.curCSS(a,c,e)},curCSS:function(a,c,e){var k,q=a.style;if(c=="opacity"&&!d.support.opacity){k=d.attr(q,"opacity");return k==""?"1":k}if(c.match(/float/i))c=R;if(!e&&q&&q[c])k=q[c];else if(ca.getComputedStyle){if(c.match(/float/i))c="float";c=c.replace(/([A-Z])/g,"-$1").toLowerCase();if(a=ca.getComputedStyle(a,null))k=a.getPropertyValue(c);if(c=="opacity"&&k=="")k="1"}else if(a.currentStyle){k=c.replace(/\-(\w)/g,function(v,y){return y.toUpperCase()});
k=a.currentStyle[c]||a.currentStyle[k];if(!/^\d+(px)?$/i.test(k)&&/^\d/.test(k)){c=q.left;e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;q.left=k||0;k=q.pixelLeft+"px";q.left=c;a.runtimeStyle.left=e}}return k},clean:function(a,c,e){c=c||document;if(typeof c.createElement==="undefined")c=c.ownerDocument||c[0]&&c[0].ownerDocument||document;if(!e&&a.length===1&&typeof a[0]==="string"){var k=/^<(\w+)\s*\/?>$/.exec(a[0]);if(k)return[c.createElement(k[1])]}var q=[];k=[];var v=c.createElement("div");
d.each(a,function(y,D){if(typeof D==="number")D+="";if(D){if(typeof D==="string"){D=D.replace(/(<(\w+)[^>]*?)\/>/g,function(X,Y,Z){return Z.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?X:Y+"></"+Z+">"});y=D.replace(/^\s+/,"").substring(0,10).toLowerCase();var M=!y.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!y.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||y.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!y.indexOf("<tr")&&[2,"<table><tbody>",
"</tbody></table>"]||(!y.indexOf("<td")||!y.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!y.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!d.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];for(v.innerHTML=M[1]+D+M[2];M[0]--;)v=v.lastChild;if(!d.support.tbody){var T=/<tbody/i.test(D);y=!y.indexOf("<table")&&!T?v.firstChild&&v.firstChild.childNodes:M[1]=="<table>"&&!T?v.childNodes:[];for(M=y.length-1;M>=0;--M)d.nodeName(y[M],"tbody")&&
!y[M].childNodes.length&&y[M].parentNode.removeChild(y[M])}!d.support.leadingWhitespace&&/^\s/.test(D)&&v.insertBefore(c.createTextNode(D.match(/^\s*/)[0]),v.firstChild);D=d.makeArray(v.childNodes)}if(D.nodeType)q.push(D);else q=d.merge(q,D)}});if(e){for(a=0;q[a];a++)if(d.nodeName(q[a],"script")&&(!q[a].type||q[a].type.toLowerCase()==="text/javascript"))k.push(q[a].parentNode?q[a].parentNode.removeChild(q[a]):q[a]);else{q[a].nodeType===1&&q.splice.apply(q,[a+1,0].concat(d.makeArray(q[a].getElementsByTagName("script"))));
e.appendChild(q[a])}return k}return q},attr:function(a,c,e){if(!(!a||a.nodeType==3||a.nodeType==8)){var k=!d.isXMLDoc(a),q=e!==z;c=k&&d.props[c]||c;if(a.tagName){var v=/href|src|style/.test(c);if(c in a&&k&&!v){if(q){if(c=="type"&&d.nodeName(a,"input")&&a.parentNode)throw"type property can't be changed";a[c]=e}if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c=="tabIndex")return(c=a.getAttributeNode("tabIndex"))&&c.specified?c.value:a.nodeName.match(/(button|input|object|select|textarea)/i)?
0:a.nodeName.match(/^(a|area)$/i)&&a.href?0:z;return a[c]}if(!d.support.style&&k&&c=="style")return d.attr(a.style,"cssText",e);q&&a.setAttribute(c,""+e);a=!d.support.hrefNormalized&&k&&v?a.getAttribute(c,2):a.getAttribute(c);return a===null?z:a}if(!d.support.opacity&&c=="opacity"){if(q){a.zoom=1;a.filter=(a.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(e)+""=="NaN"?"":"alpha(opacity="+e*100+")")}return a.filter&&a.filter.indexOf("opacity=")>=0?parseFloat(a.filter.match(/opacity=([^)]*)/)[1])/
100+"":""}c=c.replace(/-([a-z])/ig,function(y,D){return D.toUpperCase()});if(q)a[c]=e;return a[c]}},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var e=a.length;if(e==null||typeof a==="string"||d.isFunction(a)||a.setInterval)c[0]=a;else for(;e;)c[--e]=a[e]}return c},inArray:function(a,c){for(var e=0,k=c.length;e<k;e++)if(c[e]===a)return e;return-1},merge:function(a,c){var e=0,k,q=a.length;if(d.support.getAll)for(;(k=c[e++])!=null;)a[q++]=k;else for(;(k=
c[e++])!=null;)if(k.nodeType!=8)a[q++]=k;return a},unique:function(a){var c=[],e={};try{for(var k=0,q=a.length;k<q;k++){var v=d.data(a[k]);if(!e[v]){e[v]=true;c.push(a[k])}}}catch(y){c=a}return c},grep:function(a,c,e){for(var k=[],q=0,v=a.length;q<v;q++)!e!=!c(a[q],q)&&k.push(a[q]);return k},map:function(a,c){for(var e=[],k=0,q=a.length;k<q;k++){var v=c(a[k],k);if(v!=null)e[e.length]=v}return e.concat.apply([],e)}});var N=navigator.userAgent.toLowerCase();d.browser={version:(N.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||
[0,"0"])[1],safari:/webkit/.test(N),opera:/opera/.test(N),msie:/msie/.test(N)&&!/opera/.test(N),mozilla:/mozilla/.test(N)&&!/(compatible|webkit)/.test(N)};d.each({parent:function(a){return a.parentNode},parents:function(a){return d.dir(a,"parentNode")},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},siblings:function(a){return d.sibling(a.parentNode.firstChild,
a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,c){d.fn[a]=function(e){var k=d.map(this,c);if(e&&typeof e=="string")k=d.multiFilter(e,k);return this.pushStack(d.unique(k),a,e)}});d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,c){d.fn[a]=function(e){for(var k=[],q=d(e),v=0,y=q.length;v<
y;v++){var D=(v>0?this.clone(true):this).get();d.fn[c].apply(d(q[v]),D);k=k.concat(D)}return this.pushStack(k,a,e)}});d.each({removeAttr:function(a){d.attr(this,a,"");this.nodeType==1&&this.removeAttribute(a)},addClass:function(a){d.className.add(this,a)},removeClass:function(a){d.className.remove(this,a)},toggleClass:function(a,c){if(typeof c!=="boolean")c=!d.className.has(this,a);d.className[c?"add":"remove"](this,a)},remove:function(a){if(!a||d.filter(a,[this]).length){d("*",this).add([this]).each(function(){d.event.remove(this);
d.removeData(this)});this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(d(this).children().remove();this.firstChild;)this.removeChild(this.firstChild)}},function(a,c){d.fn[a]=function(){return this.each(c,arguments)}});var u="jQuery"+f(),A=0,C={};d.extend({cache:{},data:function(a,c,e){a=a==s?C:a;var k=a[u];k||(k=a[u]=++A);if(c&&!d.cache[k])d.cache[k]={};if(e!==z)d.cache[k][c]=e;return c?d.cache[k][c]:k},removeData:function(a,c){a=a==s?C:a;var e=a[u];if(c){if(d.cache[e]){delete d.cache[e][c];
c="";for(c in d.cache[e])break;c||d.removeData(a)}}else{try{delete a[u]}catch(k){a.removeAttribute&&a.removeAttribute(u)}delete d.cache[e]}},queue:function(a,c,e){if(a){c=(c||"fx")+"queue";var k=d.data(a,c);if(!k||d.isArray(e))k=d.data(a,c,d.makeArray(e));else e&&k.push(e)}return k},dequeue:function(a,c){var e=d.queue(a,c),k=e.shift();if(!c||c==="fx")k=e[0];k!==z&&k.call(a)}});d.fn.extend({data:function(a,c){var e=a.split(".");e[1]=e[1]?"."+e[1]:"";if(c===z){var k=this.triggerHandler("getData"+e[1]+
"!",[e[0]]);if(k===z&&this.length)k=d.data(this[0],a);return k===z&&e[1]?this.data(e[0]):k}else return this.trigger("setData"+e[1]+"!",[e[0],c]).each(function(){d.data(this,a,c)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})},queue:function(a,c){if(typeof a!=="string"){c=a;a="fx"}if(c===z)return d.queue(this[0],a);return this.each(function(){var e=d.queue(this,a,c);a=="fx"&&e.length==1&&e[0].call(this)})},dequeue:function(a){return this.each(function(){d.dequeue(this,
a)})}});(function(){function a(i,l,j,n,t,w){t=i=="previousSibling"&&!w;for(var B=0,J=n.length;B<J;B++){var E=n[B];if(E){if(t&&E.nodeType===1){E.sizcache=j;E.sizset=B}E=E[i];for(var P=false;E;){if(E.sizcache===j){P=n[E.sizset];break}if(E.nodeType===1&&!w){E.sizcache=j;E.sizset=B}if(E.nodeName===l){P=E;break}E=E[i]}n[B]=P}}}function c(i,l,j,n,t,w){t=i=="previousSibling"&&!w;for(var B=0,J=n.length;B<J;B++){var E=n[B];if(E){if(t&&E.nodeType===1){E.sizcache=j;E.sizset=B}E=E[i];for(var P=false;E;){if(E.sizcache===
j){P=n[E.sizset];break}if(E.nodeType===1){if(!w){E.sizcache=j;E.sizset=B}if(typeof l!=="string"){if(E===l){P=true;break}}else if(v.filter(l,[E]).length>0){P=E;break}}E=E[i]}n[B]=P}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,k=0,q=Object.prototype.toString,v=function(i,l,j,n){j=j||[];l=l||document;if(l.nodeType!==1&&l.nodeType!==9)return[];if(!i||typeof i!=="string")return j;var t=[],w,B,J,E=true;for(e.lastIndex=0;(w=
e.exec(i))!==null;){t.push(w[1]);if(w[2]){J=RegExp.rightContext;break}}if(t.length>1&&D.exec(i))if(t.length===2&&y.relative[t[0]])w=ea(t[0]+t[1],l);else for(w=y.relative[t[0]]?[l]:v(t.shift(),l);t.length;){i=t.shift();if(y.relative[i])i+=t.shift();w=ea(i,w)}else{w=n?{expr:t.pop(),set:T(n)}:v.find(t.pop(),t.length===1&&l.parentNode?l.parentNode:l,K(l));w=v.filter(w.expr,w.set);if(t.length>0)B=T(w);else E=false;for(;t.length;){var P=t.pop(),V=P;if(y.relative[P])V=t.pop();else P="";if(V==null)V=l;y.relative[P](B,
V,K(l))}}B||(B=w);if(!B)throw"Syntax error, unrecognized expression: "+(P||i);if(q.call(B)==="[object Array]")if(E)if(l.nodeType===1)for(i=0;B[i]!=null;i++){if(B[i]&&(B[i]===true||B[i].nodeType===1&&Z(l,B[i])))j.push(w[i])}else for(i=0;B[i]!=null;i++)B[i]&&B[i].nodeType===1&&j.push(w[i]);else j.push.apply(j,B);else T(B,j);if(J){v(J,l,j,n);if(Y){hasDuplicate=false;j.sort(Y);if(hasDuplicate)for(i=1;i<j.length;i++)j[i]===j[i-1]&&j.splice(i--,1)}}return j};v.matches=function(i,l){return v(i,null,null,
l)};v.find=function(i,l,j){var n,t;if(!i)return[];for(var w=0,B=y.order.length;w<B;w++){var J=y.order[w];if(t=y.match[J].exec(i)){var E=RegExp.leftContext;if(E.substr(E.length-1)!=="\\"){t[1]=(t[1]||"").replace(/\\/g,"");n=y.find[J](t,l,j);if(n!=null){i=i.replace(y.match[J],"");break}}}}n||(n=l.getElementsByTagName("*"));return{set:n,expr:i}};v.filter=function(i,l,j,n){for(var t=i,w=[],B=l,J,E,P=l&&l[0]&&K(l[0]);i&&l.length;){for(var V in y.filter)if((J=y.match[V].exec(i))!=null){var ia=y.filter[V],
ga,da;E=false;if(B==w)w=[];if(y.preFilter[V])if(J=y.preFilter[V](J,B,j,w,n,P)){if(J===true)continue}else E=ga=true;if(J)for(var ba=0;(da=B[ba])!=null;ba++)if(da){ga=ia(da,J,ba,B);var ja=n^!!ga;if(j&&ga!=null)if(ja)E=true;else B[ba]=false;else if(ja){w.push(da);E=true}}if(ga!==z){j||(B=w);i=i.replace(y.match[V],"");if(!E)return[];break}}if(i==t)if(E==null)throw"Syntax error, unrecognized expression: "+i;else break;t=i}return B};var y=v.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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(i){return i.getAttribute("href")}},
relative:{"+":function(i,l,j){var n=typeof l==="string",t=n&&!/\W/.test(l);n=n&&!t;if(t&&!j)l=l.toUpperCase();j=0;t=i.length;for(var w;j<t;j++)if(w=i[j]){for(;(w=w.previousSibling)&&w.nodeType!==1;);i[j]=n||w&&w.nodeName===l?w||false:w===l}n&&v.filter(l,i,true)},">":function(i,l,j){var n=typeof l==="string";if(n&&!/\W/.test(l)){l=j?l:l.toUpperCase();j=0;for(var t=i.length;j<t;j++){var w=i[j];if(w){n=w.parentNode;i[j]=n.nodeName===l?n:false}}}else{j=0;for(t=i.length;j<t;j++)if(w=i[j])i[j]=n?w.parentNode:
w.parentNode===l;n&&v.filter(l,i,true)}},"":function(i,l,j){var n=k++,t=c;if(!l.match(/\W/)){var w=l=j?l:l.toUpperCase();t=a}t("parentNode",l,n,i,w,j)},"~":function(i,l,j){var n=k++,t=c;if(typeof l==="string"&&!l.match(/\W/)){var w=l=j?l:l.toUpperCase();t=a}t("previousSibling",l,n,i,w,j)}},find:{ID:function(i,l,j){if(typeof l.getElementById!=="undefined"&&!j)return(i=l.getElementById(i[1]))?[i]:[]},NAME:function(i,l){if(typeof l.getElementsByName!=="undefined"){var j=[];l=l.getElementsByName(i[1]);
for(var n=0,t=l.length;n<t;n++)l[n].getAttribute("name")===i[1]&&j.push(l[n]);return j.length===0?null:j}},TAG:function(i,l){return l.getElementsByTagName(i[1])}},preFilter:{CLASS:function(i,l,j,n,t,w){i=" "+i[1].replace(/\\/g,"")+" ";if(w)return i;w=0;for(var B;(B=l[w])!=null;w++)if(B)if(t^(B.className&&(" "+B.className+" ").indexOf(i)>=0))j||n.push(B);else if(j)l[w]=false;return false},ID:function(i){return i[1].replace(/\\/g,"")},TAG:function(i,l){for(var j=0;l[j]===false;j++);return l[j]&&K(l[j])?
i[1]:i[1].toUpperCase()},CHILD:function(i){if(i[1]=="nth"){var l=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(i[2]=="even"&&"2n"||i[2]=="odd"&&"2n+1"||!/\D/.test(i[2])&&"0n+"+i[2]||i[2]);i[2]=l[1]+(l[2]||1)-0;i[3]=l[3]-0}i[0]=k++;return i},ATTR:function(i,l,j,n,t,w){l=i[1].replace(/\\/g,"");if(!w&&y.attrMap[l])i[1]=y.attrMap[l];if(i[2]==="~=")i[4]=" "+i[4]+" ";return i},PSEUDO:function(i,l,j,n,t){if(i[1]==="not")if(i[3].match(e).length>1||/^\w/.test(i[3]))i[3]=v(i[3],null,null,l);else{i=v.filter(i[3],l,j,true^
t);j||n.push.apply(n,i);return false}else if(y.match.POS.test(i[0])||y.match.CHILD.test(i[0]))return true;return i},POS:function(i){i.unshift(true);return i}},filters:{enabled:function(i){return i.disabled===false&&i.type!=="hidden"},disabled:function(i){return i.disabled===true},checked:function(i){return i.checked===true},selected:function(i){return i.selected===true},parent:function(i){return!!i.firstChild},empty:function(i){return!i.firstChild},has:function(i,l,j){return!!v(j[3],i).length},header:function(i){return/h\d/i.test(i.nodeName)},
text:function(i){return"text"===i.type},radio:function(i){return"radio"===i.type},checkbox:function(i){return"checkbox"===i.type},file:function(i){return"file"===i.type},password:function(i){return"password"===i.type},submit:function(i){return"submit"===i.type},image:function(i){return"image"===i.type},reset:function(i){return"reset"===i.type},button:function(i){return"button"===i.type||i.nodeName.toUpperCase()==="BUTTON"},input:function(i){return/input|select|textarea|button/i.test(i.nodeName)}},
setFilters:{first:function(i,l){return l===0},last:function(i,l,j,n){return l===n.length-1},even:function(i,l){return l%2===0},odd:function(i,l){return l%2===1},lt:function(i,l,j){return l<j[3]-0},gt:function(i,l,j){return l>j[3]-0},nth:function(i,l,j){return j[3]-0==l},eq:function(i,l,j){return j[3]-0==l}},filter:{PSEUDO:function(i,l,j,n){var t=l[1],w=y.filters[t];if(w)return w(i,j,l,n);else if(t==="contains")return(i.textContent||i.innerText||"").indexOf(l[3])>=0;else if(t==="not"){l=l[3];j=0;for(n=
l.length;j<n;j++)if(l[j]===i)return false;return true}},CHILD:function(i,l){var j=l[1],n=i;switch(j){case "only":case "first":for(;n=n.previousSibling;)if(n.nodeType===1)return false;if(j=="first")return true;n=i;case "last":for(;n=n.nextSibling;)if(n.nodeType===1)return false;return true;case "nth":j=l[2];var t=l[3];if(j==1&&t==0)return true;l=l[0];var w=i.parentNode;if(w&&(w.sizcache!==l||!i.nodeIndex)){var B=0;for(n=w.firstChild;n;n=n.nextSibling)if(n.nodeType===1)n.nodeIndex=++B;w.sizcache=l}i=
i.nodeIndex-t;return j==0?i==0:i%j==0&&i/j>=0}},ID:function(i,l){return i.nodeType===1&&i.getAttribute("id")===l},TAG:function(i,l){return l==="*"&&i.nodeType===1||i.nodeName===l},CLASS:function(i,l){return(" "+(i.className||i.getAttribute("class"))+" ").indexOf(l)>-1},ATTR:function(i,l){var j=l[1];i=y.attrHandle[j]?y.attrHandle[j](i):i[j]!=null?i[j]:i.getAttribute(j);j=i+"";var n=l[2];l=l[4];return i==null?n==="!=":n==="="?j===l:n==="*="?j.indexOf(l)>=0:n==="~="?(" "+j+" ").indexOf(l)>=0:!l?j&&i!==
false:n==="!="?j!=l:n==="^="?j.indexOf(l)===0:n==="$="?j.substr(j.length-l.length)===l:n==="|="?j===l||j.substr(0,l.length+1)===l+"-":false},POS:function(i,l,j,n){var t=l[2];if(t=y.setFilters[t])return t(i,j,l,n)}}},D=y.match.POS;for(var M in y.match)y.match[M]=RegExp(y.match[M].source+/(?![^\[]*\])(?![^\(]*\))/.source);var T=function(i,l){i=Array.prototype.slice.call(i);if(l){l.push.apply(l,i);return l}return i};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(X){T=function(i,
l){l=l||[];if(q.call(i)==="[object Array]")Array.prototype.push.apply(l,i);else if(typeof i.length==="number")for(var j=0,n=i.length;j<n;j++)l.push(i[j]);else for(j=0;i[j];j++)l.push(i[j]);return l}}var Y;if(document.documentElement.compareDocumentPosition)Y=function(i,l){i=i.compareDocumentPosition(l)&4?-1:i===l?0:1;if(i===0)hasDuplicate=true;return i};else if("sourceIndex"in document.documentElement)Y=function(i,l){i=i.sourceIndex-l.sourceIndex;if(i===0)hasDuplicate=true;return i};else if(document.createRange)Y=
function(i,l){var j=i.ownerDocument.createRange(),n=l.ownerDocument.createRange();j.selectNode(i);j.collapse(true);n.selectNode(l);n.collapse(true);i=j.compareBoundaryPoints(Range.START_TO_END,n);if(i===0)hasDuplicate=true;return i};(function(){var i=document.createElement("form"),l="script"+(new Date).getTime();i.innerHTML="<input name='"+l+"'/>";var j=document.documentElement;j.insertBefore(i,j.firstChild);if(document.getElementById(l)){y.find.ID=function(n,t,w){if(typeof t.getElementById!=="undefined"&&
!w)return(t=t.getElementById(n[1]))?t.id===n[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===n[1]?[t]:z:[]};y.filter.ID=function(n,t){var w=typeof n.getAttributeNode!=="undefined"&&n.getAttributeNode("id");return n.nodeType===1&&w&&w.nodeValue===t}}j.removeChild(i)})();(function(){var i=document.createElement("div");i.appendChild(document.createComment(""));if(i.getElementsByTagName("*").length>0)y.find.TAG=function(l,j){j=j.getElementsByTagName(l[1]);if(l[1]==="*"){l=
[];for(var n=0;j[n];n++)j[n].nodeType===1&&l.push(j[n]);j=l}return j};i.innerHTML="<a href='#'></a>";if(i.firstChild&&typeof i.firstChild.getAttribute!=="undefined"&&i.firstChild.getAttribute("href")!=="#")y.attrHandle.href=function(l){return l.getAttribute("href",2)}})();document.querySelectorAll&&function(){var i=v,l=document.createElement("div");l.innerHTML="<p class='TEST'></p>";if(!(l.querySelectorAll&&l.querySelectorAll(".TEST").length===0)){v=function(j,n,t,w){n=n||document;if(!w&&n.nodeType===
9&&!K(n))try{return T(n.querySelectorAll(j),t)}catch(B){}return i(j,n,t,w)};v.find=i.find;v.filter=i.filter;v.selectors=i.selectors;v.matches=i.matches}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var i=document.createElement("div");i.innerHTML="<div class='test e'></div><div class='test'></div>";if(i.getElementsByClassName("e").length!==0){i.lastChild.className="e";if(i.getElementsByClassName("e").length!==1){y.order.splice(1,0,"CLASS");y.find.CLASS=
function(l,j,n){if(typeof j.getElementsByClassName!=="undefined"&&!n)return j.getElementsByClassName(l[1])}}}}();var Z=document.compareDocumentPosition?function(i,l){return i.compareDocumentPosition(l)&16}:function(i,l){return i!==l&&(i.contains?i.contains(l):true)},K=function(i){return i.nodeType===9&&i.documentElement.nodeName!=="HTML"||!!i.ownerDocument&&K(i.ownerDocument)},ea=function(i,l){var j=[],n="",t;for(l=l.nodeType?[l]:l;t=y.match.PSEUDO.exec(i);){n+=t[0];i=i.replace(y.match.PSEUDO,"")}i=
y.relative[i]?i+"*":i;t=0;for(var w=l.length;t<w;t++)v(i,l[t],j);return v.filter(n,j)};d.find=v;d.filter=v.filter;d.expr=v.selectors;d.expr[":"]=d.expr.filters;v.selectors.filters.hidden=function(i){return i.offsetWidth===0||i.offsetHeight===0};v.selectors.filters.visible=function(i){return i.offsetWidth>0||i.offsetHeight>0};v.selectors.filters.animated=function(i){return d.grep(d.timers,function(l){return i===l.elem}).length};d.multiFilter=function(i,l,j){if(j)i=":not("+i+")";return v.matches(i,
l)};d.dir=function(i,l){var j=[];for(i=i[l];i&&i!=document;){i.nodeType==1&&j.push(i);i=i[l]}return j};d.nth=function(i,l,j){l=l||1;for(var n=0;i;i=i[j])if(i.nodeType==1&&++n==l)break;return i};d.sibling=function(i,l){for(var j=[];i;i=i.nextSibling)i.nodeType==1&&i!=l&&j.push(i);return j}})();d.event={add:function(a,c,e,k){if(!(a.nodeType==3||a.nodeType==8)){if(a.setInterval&&a!=s)a=s;if(!e.guid)e.guid=this.guid++;if(k!==z){var q=e;e=this.proxy(q);e.data=k}var v=d.data(a,"events")||d.data(a,"events",
{}),y=d.data(a,"handle")||d.data(a,"handle",function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(arguments.callee.elem,arguments):z});y.elem=a;d.each(c.split(/\s+/),function(D,M){D=M.split(".");M=D.shift();e.type=D.slice().sort().join(".");var T=v[M];d.event.specialAll[M]&&d.event.specialAll[M].setup.call(a,k,D);if(!T){T=v[M]={};if(!d.event.special[M]||d.event.special[M].setup.call(a,k,D)===false)if(a.addEventListener)a.addEventListener(M,y,false);else a.attachEvent&&
a.attachEvent("on"+M,y)}T[e.guid]=e;d.event.global[M]=true});a=null}},guid:1,global:{},remove:function(a,c,e){if(!(a.nodeType==3||a.nodeType==8)){var k=d.data(a,"events"),q;if(k){if(c===z||typeof c==="string"&&c.charAt(0)==".")for(var v in k)this.remove(a,v+(c||""));else{if(c.type){e=c.handler;c=c.type}d.each(c.split(/\s+/),function(y,D){y=D.split(".");D=y.shift();var M=RegExp("(^|\\.)"+y.slice().sort().join(".*\\.")+"(\\.|$)");if(k[D]){if(e)delete k[D][e.guid];else for(var T in k[D])M.test(k[D][T].type)&&
delete k[D][T];d.event.specialAll[D]&&d.event.specialAll[D].teardown.call(a,y);for(q in k[D])break;if(!q){if(!d.event.special[D]||d.event.special[D].teardown.call(a,y)===false)if(a.removeEventListener)a.removeEventListener(D,d.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+D,d.data(a,"handle"));q=null;delete k[D]}}})}for(q in k)break;if(!q){if(c=d.data(a,"handle"))c.elem=null;d.removeData(a,"events");d.removeData(a,"handle")}}}},trigger:function(a,c,e,k){var q=a.type||a;if(!k){a=typeof a===
"object"?a[u]?a:d.extend(d.Event(q),a):d.Event(q);if(q.indexOf("!")>=0){a.type=q=q.slice(0,-1);a.exclusive=true}if(!e){a.stopPropagation();this.global[q]&&d.each(d.cache,function(){this.events&&this.events[q]&&d.event.trigger(a,c,this.handle.elem)})}if(!e||e.nodeType==3||e.nodeType==8)return;a.result=z;a.target=e;c=d.makeArray(c);c.unshift(a)}a.currentTarget=e;var v=d.data(e,"handle");v&&v.apply(e,c);if((!e[q]||d.nodeName(e,"a")&&q=="click")&&e["on"+q]&&e["on"+q].apply(e,c)===false)a.result=false;
if(!k&&e[q]&&!a.isDefaultPrevented()&&!(d.nodeName(e,"a")&&q=="click")){this.triggered=true;try{e[q]()}catch(y){}}this.triggered=false;if(!a.isPropagationStopped())(e=e.parentNode||e.ownerDocument)&&d.event.trigger(a,c,e,true)},handle:function(a){var c,e;a=arguments[0]=d.event.fix(a||s.event);a.currentTarget=this;e=a.type.split(".");a.type=e.shift();c=!e.length&&!a.exclusive;var k=RegExp("(^|\\.)"+e.slice().sort().join(".*\\.")+"(\\.|$)");e=(d.data(this,"events")||{})[a.type];for(var q in e){var v=
e[q];if(c||k.test(v.type)){a.handler=v;a.data=v.data;v=v.apply(this,arguments);if(v!==z){a.result=v;if(v===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[u])return a;var c=a;a=d.Event(c);for(var e=this.props.length,k;e;){k=this.props[--e];a[k]=c[k]}if(!a.target)a.target=a.srcElement||document;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){c=document.documentElement;e=document.body;a.pageX=a.clientX+(c&&c.scrollLeft||e&&e.scrollLeft||0)-(c.clientLeft||0);a.pageY=a.clientY+(c&&c.scrollTop||
e&&e.scrollTop||0)-(c.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)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},proxy:function(a,c){c=c||function(){return a.apply(this,arguments)};c.guid=a.guid=a.guid||c.guid||this.guid++;return c},special:{ready:{setup:p,teardown:function(){}}},specialAll:{live:{setup:function(a,c){d.event.add(this,c[0],m)},teardown:function(a){if(a.length){var c=
0,e=RegExp("(^|\\.)"+a[0]+"(\\.|$)");d.each(d.data(this,"events").live||{},function(){e.test(this.type)&&c++});c<1&&d.event.remove(this,a[0],m)}}}}};d.Event=function(a){if(!this.preventDefault)return new d.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=f();this[u]=true};d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=x;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
x;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=x;this.stopPropagation()},isDefaultPrevented:o,isPropagationStopped:o,isImmediatePropagationStopped:o};var F=function(a){for(var c=a.relatedTarget;c&&c!=this;)try{c=c.parentNode}catch(e){c=this}if(c!=this){a.type=a.data;d.event.handle.apply(this,arguments)}};d.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,c){d.event.special[c]=
{setup:function(){d.event.add(this,a,F,c)},teardown:function(){d.event.remove(this,a,F)}}});d.fn.extend({bind:function(a,c,e){return a=="unload"?this.one(a,c,e):this.each(function(){d.event.add(this,a,e||c,e&&c)})},one:function(a,c,e){var k=d.event.proxy(e||c,function(q){d(this).unbind(q,k);return(e||c).apply(this,arguments)});return this.each(function(){d.event.add(this,a,k,e&&c)})},unbind:function(a,c){return this.each(function(){d.event.remove(this,a,c)})},trigger:function(a,c){return this.each(function(){d.event.trigger(a,
c,this)})},triggerHandler:function(a,c){if(this[0]){a=d.Event(a);a.preventDefault();a.stopPropagation();d.event.trigger(a,c,this[0]);return a.result}},toggle:function(a){for(var c=arguments,e=1;e<c.length;)d.event.proxy(a,c[e++]);return this.click(d.event.proxy(a,function(k){this.lastToggle=(this.lastToggle||0)%e;k.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(a,c){return this.mouseenter(a).mouseleave(c)},ready:function(a){p();d.isReady?a.call(document,
d):d.readyList.push(a);return this},live:function(a,c){c=d.event.proxy(c);c.guid+=this.selector+a;d(document).bind(h(a,this.selector),this.selector,c);return this},die:function(a,c){d(document).unbind(h(a,this.selector),c?{guid:c.guid+this.selector+a}:null);return this}});d.extend({isReady:false,readyList:[],ready:function(){if(!d.isReady){d.isReady=true;if(d.readyList){d.each(d.readyList,function(){this.call(document,d)});d.readyList=null}d(document).triggerHandler("ready")}}});var O=false;d.each("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error".split(","),
function(a,c){d.fn[c]=function(e){return e?this.bind(c,e):this.trigger(c)}});d(s).bind("unload",function(){for(var a in d.cache)a!=1&&d.cache[a].handle&&d.event.remove(d.cache[a].handle.elem)});(function(){d.support={};var a=document.documentElement,c=document.createElement("script"),e=document.createElement("div"),k="script"+(new Date).getTime();e.style.display="none";e.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
var q=e.getElementsByTagName("*"),v=e.getElementsByTagName("a")[0];if(!(!q||!q.length||!v)){d.support={leadingWhitespace:e.firstChild.nodeType==3,tbody:!e.getElementsByTagName("tbody").length,objectAll:!!e.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!e.getElementsByTagName("link").length,style:/red/.test(v.getAttribute("style")),hrefNormalized:v.getAttribute("href")==="/a",opacity:v.style.opacity==="0.5",cssFloat:!!v.style.cssFloat,scriptEval:false,noCloneEvent:true,
boxModel:null};c.type="text/javascript";try{c.appendChild(document.createTextNode("window."+k+"=1;"))}catch(y){}a.insertBefore(c,a.firstChild);if(s[k]){d.support.scriptEval=true;delete s[k]}a.removeChild(c);if(e.attachEvent&&e.fireEvent){e.attachEvent("onclick",function(){d.support.noCloneEvent=false;e.detachEvent("onclick",arguments.callee)});e.cloneNode(true).fireEvent("onclick")}d(function(){var D=document.createElement("div");D.style.width=D.style.paddingLeft="1px";document.body.appendChild(D);
d.boxModel=d.support.boxModel=D.offsetWidth===2;document.body.removeChild(D).style.display="none"})}})();var R=d.support.cssFloat?"cssFloat":"styleFloat";d.props={"for":"htmlFor","class":"className","float":R,cssFloat:R,styleFloat:R,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};d.fn.extend({_load:d.fn.load,load:function(a,c,e){if(typeof a!=="string")return this._load(a);var k=a.indexOf(" ");if(k>=0){var q=a.slice(k,a.length);a=a.slice(0,
k)}k="GET";if(c)if(d.isFunction(c)){e=c;c=null}else if(typeof c==="object"){c=d.param(c);k="POST"}var v=this;d.ajax({url:a,type:k,dataType:"html",data:c,complete:function(y,D){if(D=="success"||D=="notmodified")v.html(q?d("<div/>").append(y.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(q):y.responseText);e&&v.each(e,[y.responseText,D,y])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?
d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(a,c){a=d(this).val();return a==null?null:d.isArray(a)?d.map(a,function(e){return{name:c.name,value:e}}):{name:c.name,value:a}}).get()}});d.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(a,c){d.fn[c]=function(e){return this.bind(c,e)}});var W=f();d.extend({get:function(a,
c,e,k){if(d.isFunction(c)){e=c;c=null}return d.ajax({type:"GET",url:a,data:c,success:e,dataType:k})},getScript:function(a,c){return d.get(a,null,c,"script")},getJSON:function(a,c,e){return d.get(a,c,e,"json")},post:function(a,c,e,k){if(d.isFunction(c)){e=c;c={}}return d.ajax({type:"POST",url:a,data:c,success:e,dataType:k})},ajaxSetup:function(a){d.extend(d.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,
xhr:function(){return s.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(a){function c(){a.success&&a.success(y,v);a.global&&d.event.trigger("ajaxSuccess",[K,a])}function e(){a.complete&&a.complete(K,v);a.global&&d.event.trigger("ajaxComplete",[K,a]);a.global&&!--d.active&&
d.event.trigger("ajaxStop")}a=d.extend(true,a,d.extend(true,{},d.ajaxSettings,a));var k,q=/=\?(&|$)/g,v,y,D=a.type.toUpperCase();if(a.data&&a.processData&&typeof a.data!=="string")a.data=d.param(a.data);if(a.dataType=="jsonp"){if(D=="GET")a.url.match(q)||(a.url+=(a.url.match(/\?/)?"&":"?")+(a.jsonp||"callback")+"=?");else if(!a.data||!a.data.match(q))a.data=(a.data?a.data+"&":"")+(a.jsonp||"callback")+"=?";a.dataType="json"}if(a.dataType=="json"&&(a.data&&a.data.match(q)||a.url.match(q))){k="jsonp"+
W++;if(a.data)a.data=(a.data+"").replace(q,"="+k+"$1");a.url=a.url.replace(q,"="+k+"$1");a.dataType="script";s[k]=function(n){y=n;c();e();s[k]=z;try{delete s[k]}catch(t){}T&&T.removeChild(X)}}if(a.dataType=="script"&&a.cache==null)a.cache=false;if(a.cache===false&&D=="GET"){q=f();var M=a.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+q+"$2");a.url=M+(M==a.url?(a.url.match(/\?/)?"&":"?")+"_="+q:"")}if(a.data&&D=="GET"){a.url+=(a.url.match(/\?/)?"&":"?")+a.data;a.data=null}a.global&&!d.active++&&d.event.trigger("ajaxStart");
q=/^(\w+:)?\/\/([^\/?#]+)/.exec(a.url);if(a.dataType=="script"&&D=="GET"&&q&&(q[1]&&q[1]!=location.protocol||q[2]!=location.host)){var T=document.getElementsByTagName("head")[0],X=document.createElement("script");X.src=a.url;if(a.scriptCharset)X.charset=a.scriptCharset;if(!k){var Y=false;X.onload=X.onreadystatechange=function(){if(!Y&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){Y=true;c();e();X.onload=X.onreadystatechange=null;T.removeChild(X)}}}T.appendChild(X)}else{var Z=
false,K=a.xhr();a.username?K.open(D,a.url,a.async,a.username,a.password):K.open(D,a.url,a.async);try{a.data&&K.setRequestHeader("Content-Type",a.contentType);if(a.ifModified)K.setRequestHeader("If-Modified-Since",d.lastModified[a.url]||"Thu, 01 Jan 1970 00:00:00 GMT");K.setRequestHeader("X-Requested-With","XMLHttpRequest");K.setRequestHeader("Accept",a.dataType&&a.accepts[a.dataType]?a.accepts[a.dataType]+", */*":a.accepts._default)}catch(ea){}if(a.beforeSend&&a.beforeSend(K,a)===false){a.global&&
!--d.active&&d.event.trigger("ajaxStop");K.abort();return false}a.global&&d.event.trigger("ajaxSend",[K,a]);var i=function(n){if(K.readyState==0){if(l){clearInterval(l);l=null;a.global&&!--d.active&&d.event.trigger("ajaxStop")}}else if(!Z&&K&&(K.readyState==4||n=="timeout")){Z=true;if(l){clearInterval(l);l=null}v=n=="timeout"?"timeout":!d.httpSuccess(K)?"error":a.ifModified&&d.httpNotModified(K,a.url)?"notmodified":"success";if(v=="success")try{y=d.httpData(K,a.dataType,a)}catch(t){v="parsererror"}if(v==
"success"){var w;try{w=K.getResponseHeader("Last-Modified")}catch(B){}if(a.ifModified&&w)d.lastModified[a.url]=w;k||c()}else d.handleError(a,K,v);e();n&&K.abort();if(a.async)K=null}};if(a.async){var l=setInterval(i,13);a.timeout>0&&setTimeout(function(){K&&!Z&&i("timeout")},a.timeout)}try{K.send(a.data)}catch(j){d.handleError(a,K,null,j)}a.async||i();return K}},handleError:function(a,c,e,k){a.error&&a.error(c,e,k);a.global&&d.event.trigger("ajaxError",[c,a,k])},active:0,httpSuccess:function(a){try{return!a.status&&
location.protocol=="file:"||a.status>=200&&a.status<300||a.status==304||a.status==1223}catch(c){}return false},httpNotModified:function(a,c){try{var e=a.getResponseHeader("Last-Modified");return a.status==304||e==d.lastModified[c]}catch(k){}return false},httpData:function(a,c,e){var k=a.getResponseHeader("content-type");a=(k=c=="xml"||!c&&k&&k.indexOf("xml")>=0)?a.responseXML:a.responseText;if(k&&a.documentElement.tagName=="parsererror")throw"parsererror";if(e&&e.dataFilter)a=e.dataFilter(a,c);if(typeof a===
"string"){c=="script"&&d.globalEval(a);if(c=="json")a=s.eval("("+a+")")}return a},param:function(a){function c(q,v){e[e.length]=encodeURIComponent(q)+"="+encodeURIComponent(v)}var e=[];if(d.isArray(a)||a.jquery)d.each(a,function(){c(this.name,this.value)});else for(var k in a)d.isArray(a[k])?d.each(a[k],function(){c(k,this)}):c(k,d.isFunction(a[k])?a[k]():a[k]);return e.join("&").replace(/%20/g,"+")}});var ha={},fa,aa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft",
"marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,c){if(a)return this.animate(r("show",3),a,c);else{a=0;for(c=this.length;a<c;a++){var e=d.data(this[a],"olddisplay");this[a].style.display=e||"";if(d.css(this[a],"display")==="none"){e=this[a].tagName;var k;if(ha[e])k=ha[e];else{var q=d("<"+e+" />").appendTo("body");k=q.css("display");if(k==="none")k="block";q.remove();ha[e]=k}d.data(this[a],"olddisplay",k)}}a=0;for(c=this.length;a<c;a++)this[a].style.display=d.data(this[a],
"olddisplay")||"";return this}},hide:function(a,c){if(a)return this.animate(r("hide",3),a,c);else{a=0;for(c=this.length;a<c;a++){var e=d.data(this[a],"olddisplay");!e&&e!=="none"&&d.data(this[a],"olddisplay",d.css(this[a],"display"))}a=0;for(c=this.length;a<c;a++)this[a].style.display="none";return this}},_toggle:d.fn.toggle,toggle:function(a,c){var e=typeof a==="boolean";return d.isFunction(a)&&d.isFunction(c)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var k=e?a:d(this).is(":hidden");
d(this)[k?"show":"hide"]()}):this.animate(r("toggle",3),a,c)},fadeTo:function(a,c,e){return this.animate({opacity:c},a,e)},animate:function(a,c,e,k){var q=d.speed(c,e,k);return this[q.queue===false?"each":"queue"](function(){var v=d.extend({},q),y,D=this.nodeType==1&&d(this).is(":hidden"),M=this;for(y in a){if(a[y]=="hide"&&D||a[y]=="show"&&!D)return v.complete.call(this);if((y=="height"||y=="width")&&this.style){v.display=d.css(this,"display");v.overflow=this.style.overflow}}if(v.overflow!=null)this.style.overflow=
"hidden";v.curAnim=d.extend({},a);d.each(a,function(T,X){var Y=new d.fx(M,v,T);if(/toggle|show|hide/.test(X))Y[X=="toggle"?D?"show":"hide":X](a);else{var Z=X.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),K=Y.cur(true)||0;if(Z){X=parseFloat(Z[2]);var ea=Z[3]||"px";if(ea!="px"){M.style[T]=(X||1)+ea;K=(X||1)/Y.cur(true)*K;M.style[T]=K+ea}if(Z[1])X=(Z[1]=="-="?-1:1)*X+K;Y.custom(K,X,ea)}else Y.custom(K,X,"")}});return true})},stop:function(a,c){var e=d.timers;a&&this.queue([]);this.each(function(){for(var k=
e.length-1;k>=0;k--)if(e[k].elem==this){c&&e[k](true);e.splice(k,1)}});c||this.dequeue();return this}});d.each({slideDown:r("show",1),slideUp:r("hide",1),slideToggle:r("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,c){d.fn[a]=function(e,k){return this.animate(c,e,k)}});d.extend({speed:function(a,c,e){var k=typeof a==="object"?a:{complete:e||!e&&c||d.isFunction(a)&&a,duration:a,easing:e&&c||c&&!d.isFunction(c)&&c};k.duration=d.fx.off?0:typeof k.duration==="number"?k.duration:
d.fx.speeds[k.duration]||d.fx.speeds._default;k.old=k.complete;k.complete=function(){k.queue!==false&&d(this).dequeue();d.isFunction(k.old)&&k.old.call(this)};return k},easing:{linear:function(a,c,e,k){return e+k*a},swing:function(a,c,e,k){return(-Math.cos(a*Math.PI)/2+0.5)*k+e}},timers:[],fx:function(a,c,e){this.options=c;this.elem=a;this.prop=e;if(!c.orig)c.orig={}}});d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(d.fx.step[this.prop]||d.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(d.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(d.curCSS(this.elem,this.prop))||0},custom:function(a,c,e){function k(v){return q.step(v)}this.startTime=f();this.start=a;this.end=c;this.unit=e||this.unit||"px";this.now=this.start;this.pos=this.state=0;var q=
this;k.elem=this.elem;if(k()&&d.timers.push(k)&&!fa)fa=setInterval(function(){for(var v=d.timers,y=0;y<v.length;y++)v[y]()||v.splice(y--,1);if(!v.length){clearInterval(fa);fa=z}},13)},show:function(){this.options.orig[this.prop]=d.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},
step:function(a){var c=f();if(a||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)a=false;if(a){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(d.css(this.elem,"display")=="none")this.elem.style.display="block"}this.options.hide&&d(this.elem).hide();if(this.options.hide||
this.options.show)for(var k in this.options.curAnim)d.attr(this.elem.style,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{e=c-this.startTime;this.state=e/this.options.duration;this.pos=d.easing[this.options.easing||(d.easing.swing?"swing":"linear")](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};d.extend(d.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.attr(a.elem.style,
"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=a.now+a.unit;else a.elem[a.prop]=a.now}}});d.fn.offset=document.documentElement.getBoundingClientRect?function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return d.offset.bodyOffset(this[0]);var a=this[0].getBoundingClientRect(),c=this[0].ownerDocument,e=c.body;c=c.documentElement;var k=c.clientTop||e.clientTop||0,q=c.clientLeft||e.clientLeft||0;k=a.top+(self.pageYOffset||
d.boxModel&&c.scrollTop||e.scrollTop)-k;a=a.left+(self.pageXOffset||d.boxModel&&c.scrollLeft||e.scrollLeft)-q;return{top:k,left:a}}:function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return d.offset.bodyOffset(this[0]);d.offset.initialized||d.offset.initialize();var a=this[0],c=a.offsetParent,e=a.ownerDocument,k,q=e.documentElement,v=e.body;e=e.defaultView;k=e.getComputedStyle(a,null);for(var y=a.offsetTop,D=a.offsetLeft;(a=a.parentNode)&&a!==v&&a!==q;){k=e.getComputedStyle(a,
null);y-=a.scrollTop;D-=a.scrollLeft;if(a===c){y+=a.offsetTop;D+=a.offsetLeft;if(d.offset.doesNotAddBorder&&!(d.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a.tagName))){y+=parseInt(k.borderTopWidth,10)||0;D+=parseInt(k.borderLeftWidth,10)||0}c=a.offsetParent}if(d.offset.subtractsBorderForOverflowNotVisible&&k.overflow!=="visible"){y+=parseInt(k.borderTopWidth,10)||0;D+=parseInt(k.borderLeftWidth,10)||0}k=k}if(k.position==="relative"||k.position==="static"){y+=v.offsetTop;D+=v.offsetLeft}if(k.position===
"fixed"){y+=Math.max(q.scrollTop,v.scrollTop);D+=Math.max(q.scrollLeft,v.scrollLeft)}return{top:y,left:D}};d.offset={initialize:function(){if(!this.initialized){var a=document.body,c=document.createElement("div"),e,k,q,v=a.style.marginTop;q='<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={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(k in e)c.style[k]=e[k];c.innerHTML=q;a.insertBefore(c,a.firstChild);e=c.firstChild;k=e.firstChild;q=e.nextSibling.firstChild.firstChild;this.doesNotAddBorder=k.offsetTop!==5;this.doesAddBorderForTableAndCells=q.offsetTop===5;e.style.overflow="hidden";e.style.position="relative";this.subtractsBorderForOverflowNotVisible=k.offsetTop===-5;a.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=
a.offsetTop===0;a.style.marginTop=v;a.removeChild(c);this.initialized=true}},bodyOffset:function(a){d.offset.initialized||d.offset.initialize();var c=a.offsetTop,e=a.offsetLeft;if(d.offset.doesNotIncludeMarginInBodyOffset){c+=parseInt(d.curCSS(a,"marginTop",true),10)||0;e+=parseInt(d.curCSS(a,"marginLeft",true),10)||0}return{top:c,left:e}}};d.fn.extend({position:function(){var a;if(this[0]){a=this.offsetParent();var c=this.offset(),e=/^body|html$/i.test(a[0].tagName)?{top:0,left:0}:a.offset();c.top-=
g(this,"marginTop");c.left-=g(this,"marginLeft");e.top+=g(a,"borderTopWidth");e.left+=g(a,"borderLeftWidth");a={top:c.top-e.top,left:c.left-e.left}}return a},offsetParent:function(){for(var a=this[0].offsetParent||document.body;a&&!/^body|html$/i.test(a.tagName)&&d.css(a,"position")=="static";)a=a.offsetParent;return d(a)}});d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(k){if(!this[0])return null;return k!==z?this.each(function(){this==s||this==document?s.scrollTo(!a?k:d(s).scrollLeft(),
a?k:d(s).scrollTop()):(this[e]=k)}):this[0]==s||this[0]==document?self[a?"pageYOffset":"pageXOffset"]||d.boxModel&&document.documentElement[e]||document.body[e]:this[0][e]}});d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?d.css(this[0],e,false,"padding"):null};d.fn["outer"+c]=function(q){return this[0]?d.css(this[0],e,false,q?"margin":"border"):null};var k=c.toLowerCase();d.fn[k]=function(q){return this[0]==s?document.compatMode=="CSS1Compat"&&
document.documentElement["client"+c]||document.body["client"+c]:this[0]==document?Math.max(document.documentElement["client"+c],document.body["scroll"+c],document.documentElement["scroll"+c],document.body["offset"+c],document.documentElement["offset"+c]):q===z?this.length?d.css(this[0],k):null:this.css(k,typeof q==="string"?q:q+"px")}})})();(function(b){b.securepost=function(g,o,x,m){o=o||{};var h=b.securepost.formkey;if(!h)throw new Error("No formkey set; can't securepost");o.formkey=h;return b.post(g,o,x,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 g=arguments.callee.formkey||Quora.formkey;if(!g)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 o=options.secureDataError;options.success=function(m){if(m.___ERROR___){var h=m.___ERROR___[0];m=m.___ERROR___[1];var p=new f("Got an error from the URL '"+url+"'",h,m);if(o)return o(h,m,p);else throw p;}else if(success)return success(m)};options.error=error;var x=options.data||data;options.data={formkey:g,data:JSON.stringify(x)};return b.ajax(options)};var f=function(g,o,x){this.message=x+": "+g+" <"+
JSON.stringify(o)+">"};f.prototype=new Error;f.prototype.constructor=f;b.secureData.SecureDataError=f})(jQuery);jQuery.cookie=function(b,f,g){if(typeof f!="undefined"){g=g||{};if(f===null){f="";g=$.extend({},g);g.expires=-1}var o="";if(g.expires&&(typeof g.expires=="number"||g.expires.toUTCString)){if(typeof g.expires=="number"){o=new Date;o.setTime(o.getTime()+g.expires*24*60*60*1E3)}else o=g.expires;o="; expires="+o.toUTCString()}var x=g.path?"; path="+g.path:"",m=g.domain?"; domain="+g.domain:"";g=g.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(f),o,x,m,g].join("")}else{f=null;if(document.cookie&&
document.cookie!=""){g=document.cookie.split(";");for(o=0;o<g.length;o++){x=jQuery.trim(g[o]);if(x.substring(0,b.length+1)==b+"="){f=decodeURIComponent(x.substring(b.length+1));break}}}return f}};(function(b){b.fn.dialog=function(o){return this.each(function(){new g(this,o)})};var f={id:"generic_dialog",title:"Title",contents:"",comment_form:"",mobile:false,buttons:{Ok:null,Cancel:null},class_:"",w:"w4"};b.dialog=function(o,x){var m=this;this.o=b(o);this.opts=b.extend({},f,x||{});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 h=this.opts.id+"_loading";o=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="'+h+'"><div class="__wn2_loading_wrapper">'+o+"</div></div>";o=this.opts.urlData||{};o.___W2_scope="__dialog__";o.___W2_windowId=W2.windowId;b.get(this.opts.url,o,function(p){var r=document.getElementById(h);W2.setContent(r,
p)},"json")}if(this.opts.comment_form!="")this.opts.contents=this.renderCommentForm(this.opts.comment_form);if(this.opts.mobile)this.opts.w="";this.render()}};var g=b.dialog;g.fn=g.prototype={dialog:"0.0.1"};g.fn.extend=g.extend=b.extend;g.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 o="";o=this.opts.title?b("<div/>").addClass("dialog_wrapper").append(b("<h2/>").addClass("dialog_frame").addClass("dialog_header").text(this.opts.title)).append(b("<div/>").addClass("dialog_frame").addClass("dialog_contents").html(this.opts.contents)):
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(o));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.opts.mobile){window.scrollTo(0,1);b(".dialog").css("top","0px");b(".dialog").css("left","0px")}else{o=
150;Q.mobile&&b(".dialog").width(290);var x=b(window).width()/2-b(".dialog").width()/2;if(Q.mobile)x-=10;b(".dialog").css("top",o+"px");b(".dialog").css("left",x+"px")}this.opts.comment_form!=""&&b("#dialog_comment").focus();var m=this;b(document).keydown(function(h){return m.keydown(h)});return false},keydown:function(o){o=o||window.event;if(o.keyCode==27){this.close();b(document).unbind();return false}},renderCommentForm:function(o){if(!o||o=="")o="Add a Comment";return comment_form=b("<div/>").append(b("<h3/>").text(o+
":")).append(b("<textarea/>").attr("id","dialog_comment"))},renderButtons:function(){var o=this,x=b("<div/>");b.each(this.opts.buttons,function(m,h){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(h);btn=o.opts.buttons_hide_on_close?btn.click(function(){o.hide()}):btn.click(function(){o.close()});x.append(btn)});return x}})})(jQuery);(function(b){b.fn.tooltip=function(o){return this.each(function(){new g(this,o)})};var f={id:"tooltip",contents:"",delay:75,class_:"tooltip"};b.tooltip=function(o,x){if(!b("body").hasClass("mobile")){var m=this;this.o=b(o);this.opts=b.extend({},f,x||{});m=this;this.o.hover(function(){m.render()},function(){m.close()})}};var g=b.tooltip;g.fn=g.prototype={tooltip:"0.0.1"};g.fn.extend=g.extend=b.extend;g.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 o=this.tt.height()+5;this.tt.css("top","-"+o+"px");var x=this;o=function(){x.tt.fadeIn(500)};this.to=setTimeout(o,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){return this.each(function(){new g(this,o)})};var f={id:"generic_menu",open:false,url:null,list_items:{}};b.menu=function(o,x,m){this.o=b(o);this.handle=x;this.opts=b.extend({},f,m||{});this.render();event.stopPropagation();var h=this;b("body").click(function(){h.close()});b(".menu_list_item a").click(function(){h.close()});return false};var g=b.menu;g.fn=g.prototype={menu:"0.0.1"};g.fn.extend=g.extend=b.extend;g.fn.extend({close:function(){this.o.addClass("hidden");
this.handle.removeClass("menu_active");event.stopPropagation()},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=this.handle.offset(),x=this.handle.innerHeight();this.o.css("top",o.top+x+"px");this.o.css("left",o.left+"px")}})})(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 fnbind(b,f){var g;args=[];for(g=2;g<arguments.length;g++)args.push(arguments[g]);g=function(){var o,x,m;o=b?b:this==window?null:this;x=args.slice();for(m=0;m<arguments.length;m++)x.push(arguments[m]);m=function(h){return function(){var p,r;switch(arguments.length){case 0:return h();case 1:return h(arguments[0]);case 2:return h(arguments[0],arguments[1]);case 3:return h(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 f=="function"&&typeof f.apply=="undefined")f=m(f);return f.apply(o,x)};g.name=f.name;g.toString=function(){return"["+f+" bound with "+b+" and with args "+args+" partially applied]"};return g};(function(){var b=false,f=/xyz/.test(function(){})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){function o(){this.fnbind=function(p){return fnbind(this,p)};!b&&this.__init__&&this.__init__.apply(this,arguments)}var x=this.prototype;b=true;var m=new this;b=false;for(var h in g)m[h]=typeof g[h]=="function"&&typeof x[h]=="function"&&f.test(g[h])?function(p,r){return function(){var s=this._super;this._super=x[p];var z=r.apply(this,arguments);this._super=s;return z}}(h,g[h]):g[h];
o.prototype=m;o.constructor=o;o.extend=arguments.callee;return o}})();webnode2=function(b){function f(u){var A,C;for(A in u)if(u.hasOwnProperty(A)){C=u[A];b._parents[A]=C;if(typeof b._allChildren[C]=="undefined")b._allChildren[C]=[];b._allChildren[C].push(A);if(typeof b._children[A]=="undefined")b._children[A]={};if(typeof b._knowsAbout[A]=="undefined")b._knowsAbout[A]={}}}function g(u){var A,C,F,O,R;for(F in u)if(u.hasOwnProperty(F)){A=u[F];R=A.length;for(O=0;O<R;O++){C=A[O];b._groups[F]||(b._groups[F]=[]);b._groups[F].push(C)}}}function o(u){var A;for(A in u)u.hasOwnProperty(A)&&
jQuery.extend(b._children[A],u[A])}function x(u){var A;for(A in u)u.hasOwnProperty(A)&&jQuery.extend(b._knowsAbout[A],u[A])}function m(u){var A;for(A in u)if(u.hasOwnProperty(A))b._debugInfo[A]=u[A]}function h(u){var A=u.parents,C=u.children,F=u.knowsAbout,O=u.groups,R=u.debugInfo;b.addParents(A);b.addChildren(C);b.addLookups(F);b.addGroups(O);R&&b.addDebugInfo(R);$(document).trigger("w2addcomponents",u)}function p(u){u=r(u);var A,C,F,O,R;for(A=0;A<u.length;A++){C=u[A];F=b._parents[C];if(O=b._allChildren[F])for(R=
0;R<O.length;R++)if(O[R]==C){O.splice(R,1);break}if(O=b._components[C])(O=O.cname)&&b._children[F]&&delete b._children[F][O];delete b._parents[C];delete b._allChildren[C];delete b._children[C];delete b._knowsAbout[C];delete b._debugInfo[C]}return u}function r(u){var A=[u];u=b._allChildren[u];var C;if(u)for(C=0;C<u.length;C++)A=A.concat(r(u[C]));return A}function s(u){var A,C;for(A=0;A<u.length;A++){C=u[A];b._components[C.cid]=C}return u}function z(u,A){var C;args=[];for(C=2;C<arguments.length;C++)args.push(arguments[C]);
C=function(){var F,O,R;F=u?u:this==window?null:this;O=args.slice();for(R=0;R<arguments.length;R++)O.push(arguments[R]);R=function(W){return function(){var ha,fa;switch(arguments.length){case 0:return W();case 1:return W(arguments[0]);case 2:return W(arguments[0],arguments[1]);case 3:return W(arguments[0],arguments[1],arguments[2])}ha=[];for(fa=0;fa<arguments.length;fa++)ha.push("arguments["+fa+"]");return eval("(func("+ha.join(",")+"))")}};if(typeof A=="function"&&typeof A.apply=="undefined")A=R(A);
return A.apply(F,O)};C.name=A.name;C.toString=function(){return"["+A+" bound with "+u+" and with args "+args+" partially applied]"};return C}function H(u,A){var C;for(C=0;C<u.length;C++)u[C].onLoad(A);if(typeof window._w2ec=="object"){A=window._w2ec;C=0;for(var F=A.length;C<F;C++){var O=A[C];$(O).attr("onclick",null).trigger("click")}window._w2ec=[]}return u}function S(u,A){var C;if(u&&u!="*ROOT*"){C=b._knowsAbout[u][A];return typeof C!="undefined"?I(u,C):S(b._parents[u],A)}else return null}function d(u){var A;
if(u)return(A=b._components[u])?A:new L(u);else return null}function I(u,A){var C,F,O,R,W;if(A==".")return u;C=[];F="";O="first";for(R=0;R<A.length;R++){W=A.charAt(R);if(W=="."){C.push([O,F]);F="";O="child"}else if(W==":"){C.push([O,F]);F="";O="lookup"}else if(W=="<"){C.push([O,F]);F="";O="parent"}else F+=W}C.push([O,F]);F=u;for(R=0;R<C.length;R++){W=C[R];O=W[0];W=W[1];if(O=="first"){if(W){F=b._children[F];if(!F)return null;F=F[W];if(!F)throw new W2Error("Couldn't find child '"+W+"' in cQuery '"+
A+"'",u);}if(!F)throw new W2Error("Started from an invalid node '"+F+"' in cQuery '"+A+"'",u);}else if(O=="child"){F=b._children[F];if(!F)return null;F=F[W];if(!F)throw new W2Error("Couldn't find child '"+W+"' in cQuery '"+A+"'",u);}else if(O=="lookup"){F=S(F,W);if(!F)throw new W2Error("Lookup failed for '"+W+"' in cQuery '"+A+"'",u);}else if(O=="parent"){F=b._parents[F];if(!F||F=="*ROOT*")throw new W2Error("No parent found in cQuery '"+A+"'",u);}else throw new W2Error("Bad token in Component query. '"+
O+"'",u);if(!F)throw new W2Error("Unknown Error in cQuery: '"+A+"'",u);}return F}var G,L,ca,U,N;b._parents={};b._components={};b._children={};b._knowsAbout={};b._allChildren={};b._debugInfo={};b._groups={};b.GROUP_RE=/%([0-9a-zA-Z_]+)/;G=Class.extend({__init__:function(u,A,C,F){this.cid=u;this.cname=A;this.__vcon=F?F.split(":"):null;this.init(C);return this},init:function(u){var A;if(typeof u=="object")for(A in u)if(u.hasOwnProperty(A))this[A]=u[A];this.__data=u;return this},fnbind:function(u){return z(this,
u)},child:function(u){u=b._children[this.cid][u];return d(u)},parent_:function(){var u;u=b._parents[this.cid];return d(u)},lookup:function(u){u=S(this.cid,u);return d(u)},c:function(u){u=I(this.cid,u);return d(u)},$:function(u){var A,C;A=this._my();if(typeof u=="string"){u=u.replace("@",A,"g");if(u.indexOf("%")!=-1)for(;A=b.GROUP_RE.exec(u);){C=b._groups[A[1]];if(typeof C=="undefined")return $([]);u=u.replace(A[0],"#"+C.join(",#"))}}return $(u)},_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(u){return document.getElementById(u.replace("@",this._my()))},onLoad:function(){},controller:function(u){if(this.__vcon)return new b._Controller(this.__vcon,u);else throw new W2Error("No vcon info for Component <cid="+this.cid+">");}});L=G.extend({__init__:function(u){this._super(u,null,{},null);this.isVirtual=true}});W2Error=
function(u,A){this.message=this.errorType+": "+u;if(A)this.message+=" <cid="+A+">"};W2Error.prototype=new Error;W2Error.prototype.errorType="W2Error";W2Error.prototype.contstructor=W2Error;ca=function(u,A){U(u,A);N(u,A);return u};U=function(u,A){u.innerHTML=A.html;return u};N=function(u,A){eval(A.js);return u};b.addParents=f;b.addChildren=o;b.addLookups=x;b.addDebugInfo=m;b.addGroups=g;b.registerComponents=s;b.Component=G;b.VirtualComponent=L;b.onLoad=H;b.addComponentMetadata=h;b._safeGetComponentByCID=
d;b.W2Error=W2Error;b.fnbind=z;b.setContent=ca;b.setContentHTML=U;b.setContentJS=N;b._getDescendants=r;b.removeComponentMetadata=p;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(){alert("Hello webnode2!")}});(function(b){var f=["async","beforeSend","cache","complete","contentType","data","dataFilter","dataType","error","global","ifModified","jsonp","password","processData","scriptCharset","success","timeout","type","url","username","xhr"],g={};b.each(f,function(o,x){g[x]=function(m){this.__options[x]=m;return this};g["_"+x]=function(){return this.__options[x]}});g._options=function(){var o={},x=this;b.each(f,function(m,h){o[h]=x["_"+h]()});return o};g.options=function(o){if(o){var x=this;b.each(o,function(m,
h){x[m](h)})}return this};g.__init__=function(o){this.__options={data:null};this.options(o);return this};g.send=function(o){this.options(o);return b.ajax(this._options())};b.Ajax=Class.extend(g)})(jQuery);(function(b){b.fn.setContent=function(f){if(typeof f=="string")this.html(f);else{this.setContentHTML(f);this.setContentJS(f)}return this};b.fn.setContentHTML=function(f){return this.html(f.html)};b.fn.setContentJS=function(f){return this.each(function(){eval(f.js);return this})};b.fn.setContentFromAJAXComponent=function(f,g,o,x,m,h,p){g=g||{};g.___W2_parentId=o;g.___W2_windowId=W2.windowId;x=x||'<span class="__wn2_loading"><span class="__wn2_loading_spinner"></span><span class="__wn2_loading_text">Loading...</span></span>';
h=h||'<span style="color: red; font-weight: bold;">ERROR</span>';b.securepost(f,g,W2.fnbind(this,function(r){if(r.___ERROR___){this.setContent(h);typeof p=="function"&&p(r,r.___ERROR___)}this.setContent(r);typeof m=="function"&&m(r)}),"json");this.setContent(x);return this}})(jQuery);var swfobject=function(){function b(){if(!Y){try{var j=a.getElementsByTagName("body")[0].appendChild(L("span"));j.parentNode.removeChild(j)}catch(n){return}Y=true;j=k.length;for(var t=0;t<j;t++)k[t]()}}function f(j){if(Y)j();else k[k.length]=j}function g(j){if(typeof aa.addEventListener!=C)aa.addEventListener("load",j,false);else if(typeof a.addEventListener!=C)a.addEventListener("load",j,false);else if(typeof aa.attachEvent!=C)ca(aa,"onload",j);else if(typeof aa.onload=="function"){var n=aa.onload;
aa.onload=function(){n();j()}}else aa.onload=j}function o(){e?x():m()}function x(){var j=a.getElementsByTagName("body")[0],n=L(F);n.setAttribute("type",W);var t=j.appendChild(n);if(t){var w=0;(function(){if(typeof t.GetVariable!=C){var B=t.GetVariable("$version");if(B){B=B.split(" ")[1].split(",");l.pv=[parseInt(B[0],10),parseInt(B[1],10),parseInt(B[2],10)]}}else if(w<10){w++;setTimeout(arguments.callee,10);return}j.removeChild(n);t=null;m()})()}else m()}function m(){var j=q.length;if(j>0)for(var n=
0;n<j;n++){var t=q[n].id,w=q[n].callbackFn,B={success:false,id:t};if(l.pv[0]>0){var J=G(t);if(J)if(U(q[n].swfVersion)&&!(l.wk&&l.wk<312)){u(t,true);if(w){B.success=true;B.ref=h(t);w(B)}}else if(q[n].expressInstall&&p()){B={};B.data=q[n].expressInstall;B.width=J.getAttribute("width")||"0";B.height=J.getAttribute("height")||"0";if(J.getAttribute("class"))B.styleclass=J.getAttribute("class");if(J.getAttribute("align"))B.align=J.getAttribute("align");var E={};J=J.getElementsByTagName("param");for(var P=
J.length,V=0;V<P;V++)if(J[V].getAttribute("name").toLowerCase()!="movie")E[J[V].getAttribute("name")]=J[V].getAttribute("value");r(B,E,t,w)}else{s(J);w&&w(B)}}else{u(t,true);if(w){if((t=h(t))&&typeof t.SetVariable!=C){B.success=true;B.ref=t}w(B)}}}}function h(j){var n=null;if((j=G(j))&&j.nodeName=="OBJECT")if(typeof j.SetVariable!=C)n=j;else if(j=j.getElementsByTagName(F)[0])n=j;return n}function p(){return!Z&&U("6.0.65")&&(l.win||l.mac)&&!(l.wk&&l.wk<312)}function r(j,n,t,w){Z=true;T=w||null;X={success:false,
id:t};var B=G(t);if(B){if(B.nodeName=="OBJECT"){D=z(B);M=null}else{D=B;M=t}j.id=ha;if(typeof j.width==C||!/%$/.test(j.width)&&parseInt(j.width,10)<310)j.width="310";if(typeof j.height==C||!/%$/.test(j.height)&&parseInt(j.height,10)<137)j.height="137";a.title=a.title.slice(0,47)+" - Flash Player Installation";w=l.ie&&l.win?"ActiveX":"PlugIn";w="MMredirectURL="+aa.location.toString().replace(/&/g,"%26")+"&MMplayerType="+w+"&MMdoctitle="+a.title;if(typeof n.flashvars!=C)n.flashvars+="&"+w;else n.flashvars=
w;if(l.ie&&l.win&&B.readyState!=4){w=L("div");t+="SWFObjectNew";w.setAttribute("id",t);B.parentNode.insertBefore(w,B);B.style.display="none";(function(){B.readyState==4?B.parentNode.removeChild(B):setTimeout(arguments.callee,10)})()}H(j,n,t)}}function s(j){if(l.ie&&l.win&&j.readyState!=4){var n=L("div");j.parentNode.insertBefore(n,j);n.parentNode.replaceChild(z(j),n);j.style.display="none";(function(){j.readyState==4?j.parentNode.removeChild(j):setTimeout(arguments.callee,10)})()}else j.parentNode.replaceChild(z(j),
j)}function z(j){var n=L("div");if(l.win&&l.ie)n.innerHTML=j.innerHTML;else if(j=j.getElementsByTagName(F)[0])if(j=j.childNodes)for(var t=j.length,w=0;w<t;w++)!(j[w].nodeType==1&&j[w].nodeName=="PARAM")&&j[w].nodeType!=8&&n.appendChild(j[w].cloneNode(true));return n}function H(j,n,t){var w,B=G(t);if(l.wk&&l.wk<312)return w;if(B){if(typeof j.id==C)j.id=t;if(l.ie&&l.win){var J="";for(var E in j)if(j[E]!=Object.prototype[E])if(E.toLowerCase()=="data")n.movie=j[E];else if(E.toLowerCase()=="styleclass")J+=
' class="'+j[E]+'"';else if(E.toLowerCase()!="classid")J+=" "+E+'="'+j[E]+'"';E="";for(var P in n)if(n[P]!=Object.prototype[P])E+='<param name="'+P+'" value="'+n[P]+'" />';B.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+J+">"+E+"</object>";v[v.length]=j.id;w=G(j.id)}else{P=L(F);P.setAttribute("type",W);for(J in j)if(j[J]!=Object.prototype[J])if(J.toLowerCase()=="styleclass")P.setAttribute("class",j[J]);else J.toLowerCase()!="classid"&&P.setAttribute(J,j[J]);for(var V in n)n[V]!=
Object.prototype[V]&&V.toLowerCase()!="movie"&&S(P,V,n[V]);B.parentNode.replaceChild(P,B);w=P}}return w}function S(j,n,t){var w=L("param");w.setAttribute("name",n);w.setAttribute("value",t);j.appendChild(w)}function d(j){var n=G(j);if(n&&n.nodeName=="OBJECT")if(l.ie&&l.win){n.style.display="none";(function(){n.readyState==4?I(j):setTimeout(arguments.callee,10)})()}else n.parentNode.removeChild(n)}function I(j){if(j=G(j)){for(var n in j)if(typeof j[n]=="function")j[n]=null;j.parentNode.removeChild(j)}}
function G(j){var n=null;try{n=a.getElementById(j)}catch(t){}return n}function L(j){return a.createElement(j)}function ca(j,n,t){j.attachEvent(n,t);y[y.length]=[j,n,t]}function U(j){var n=l.pv;j=j.split(".");j[0]=parseInt(j[0],10);j[1]=parseInt(j[1],10)||0;j[2]=parseInt(j[2],10)||0;return n[0]>j[0]||n[0]==j[0]&&n[1]>j[1]||n[0]==j[0]&&n[1]==j[1]&&n[2]>=j[2]?true:false}function N(j,n,t,w){if(!(l.ie&&l.mac)){var B=a.getElementsByTagName("head")[0];if(B){t=t&&typeof t=="string"?t:"screen";if(w)ea=K=null;
if(!K||ea!=t){w=L("style");w.setAttribute("type","text/css");w.setAttribute("media",t);K=B.appendChild(w);if(l.ie&&l.win&&typeof a.styleSheets!=C&&a.styleSheets.length>0)K=a.styleSheets[a.styleSheets.length-1];ea=t}if(l.ie&&l.win)K&&typeof K.addRule==F&&K.addRule(j,n);else K&&typeof a.createTextNode!=C&&K.appendChild(a.createTextNode(j+" {"+n+"}"))}}}function u(j,n){if(i){n=n?"visible":"hidden";if(Y&&G(j))G(j).style.visibility=n;else N("#"+j,"visibility:"+n)}}function A(j){var n=/[\\\"<>\.;]/;return(n=
n.exec(j)!=null)&&typeof encodeURIComponent!=C?encodeURIComponent(j):j}var C="undefined",F="object",O="Shockwave Flash",R="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",ha="SWFObjectExprInst",fa="onreadystatechange",aa=window,a=document,c=navigator,e=false,k=[o],q=[],v=[],y=[],D,M,T,X,Y=false,Z=false,K,ea,i=true,l=function(){var j=typeof a.getElementById!=C&&typeof a.getElementsByTagName!=C&&typeof a.createElement!=C,n=c.userAgent.toLowerCase(),t=c.platform.toLowerCase(),w=t?/win/.test(t):
/win/.test(n);t=t?/mac/.test(t):/mac/.test(n);n=/webkit/.test(n)?parseFloat(n.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var B=!+"\u000b1",J=[0,0,0],E=null;if(typeof c.plugins!=C&&typeof c.plugins[O]==F){if((E=c.plugins[O].description)&&!(typeof c.mimeTypes!=C&&c.mimeTypes[W]&&!c.mimeTypes[W].enabledPlugin)){e=true;B=false;E=E.replace(/^.*\s+(\S+\s+\S+$)/,"$1");J[0]=parseInt(E.replace(/^(.*)\..*$/,"$1"),10);J[1]=parseInt(E.replace(/^.*\.(.*)\s.*$/,"$1"),10);J[2]=/[a-zA-Z]/.test(E)?parseInt(E.replace(/^.*[a-zA-Z]+(.*)$/,
"$1"),10):0}}else if(typeof aa.ActiveXObject!=C)try{var P=new ActiveXObject(R);if(P)if(E=P.GetVariable("$version")){B=true;E=E.split(" ")[1].split(",");J=[parseInt(E[0],10),parseInt(E[1],10),parseInt(E[2],10)]}}catch(V){}return{w3:j,pv:J,wk:n,ie:B,win:w,mac:t}}();(function(){if(l.w3){if(typeof a.readyState!=C&&a.readyState=="complete"||typeof a.readyState==C&&(a.getElementsByTagName("body")[0]||a.body))b();if(!Y){typeof a.addEventListener!=C&&a.addEventListener("DOMContentLoaded",b,false);if(l.ie&&
l.win){a.attachEvent(fa,function(){if(a.readyState=="complete"){a.detachEvent(fa,arguments.callee);b()}});aa==top&&function(){if(!Y){try{a.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}b()}}()}l.wk&&function(){Y||(/loaded|complete/.test(a.readyState)?b():setTimeout(arguments.callee,0))}();g(b)}}})();(function(){l.ie&&l.win&&window.attachEvent("onunload",function(){for(var j=y.length,n=0;n<j;n++)y[n][0].detachEvent(y[n][1],y[n][2]);j=v.length;for(n=0;n<j;n++)d(v[n]);
for(var t in l)l[t]=null;l=null;for(var w in swfobject)swfobject[w]=null;swfobject=null})})();return{registerObject:function(j,n,t,w){if(l.w3&&j&&n){var B={};B.id=j;B.swfVersion=n;B.expressInstall=t;B.callbackFn=w;q[q.length]=B;u(j,false)}else w&&w({success:false,id:j})},getObjectById:function(j){if(l.w3)return h(j)},embedSWF:function(j,n,t,w,B,J,E,P,V,ia){var ga={success:false,id:n};if(l.w3&&!(l.wk&&l.wk<312)&&j&&n&&t&&w&&B){u(n,false);f(function(){t+="";w+="";var da={};if(V&&typeof V===F)for(var ba in V)da[ba]=
V[ba];da.data=j;da.width=t;da.height=w;ba={};if(P&&typeof P===F)for(var ja in P)ba[ja]=P[ja];if(E&&typeof E===F)for(var ka in E)if(typeof ba.flashvars!=C)ba.flashvars+="&"+ka+"="+E[ka];else ba.flashvars=ka+"="+E[ka];if(U(B)){ja=H(da,ba,n);da.id==n&&u(n,true);ga.success=true;ga.ref=ja}else if(J&&p()){da.data=J;r(da,ba,n,ia);return}else u(n,true);ia&&ia(ga)})}else ia&&ia(ga)},switchOffAutoHideShow:function(){i=false},ua:l,getFlashPlayerVersion:function(){return{major:l.pv[0],minor:l.pv[1],release:l.pv[2]}},
hasFlashPlayerVersion:U,createSWF:function(j,n,t){if(l.w3)return H(j,n,t)},showExpressInstall:function(j,n,t,w){l.w3&&p()&&r(j,n,t,w)},removeSWF:function(j){l.w3&&d(j)},createCSS:function(j,n,t,w){l.w3&&N(j,n,t,w)},addDomLoadEvent:f,addLoadEvent:g,getQueryParamValue:function(j){var n=a.location.search||a.location.hash;if(n){if(/\?/.test(n))n=n.split("?")[1];if(j==null)return A(n);n=n.split("&");for(var t=0;t<n.length;t++)if(n[t].substring(0,n[t].indexOf("="))==j)return A(n[t].substring(n[t].indexOf("=")+
1))}return""},expressInstallCallback:function(){if(Z){var j=G(ha);if(j&&D){j.parentNode.replaceChild(D,j);if(M){u(M,true);if(l.ie&&l.win)D.style.display="block"}T&&T(X)}Z=false}}}}();(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.c("<").$("#"+this.id)},_managerComponent:function(){return this.c("<")},validate:function(f){f=
f||{};var g=this.input().val();if(g){this.$(".@incomplete").hide();var o=setTimeout(this.fnbind(function(){this.$(".@asking_server").show()}),150);this.controller("validate").kwargs({value:this.input().val()}).success(this.fnbind(function(x){clearTimeout(o);this.$(".@asking_server").hide();if(x.valid){this.isValid=true;if(x.message){this.setWidth(this.$("#@valid_message"));this.$("#@valid_message").text(x.message)}this.$(".@valid").text()&&this.$(".@valid").show();this.$(".@invalid").hide();this.input().removeClass("error");
typeof f.valid=="function"&&f.valid(x.message)}else{this.isValid=false;if(x.message){this.setWidth(this.$("#@invalid_message"));this.$("#@invalid_message").text(x.message)}this.$(".@valid").hide();this.$(".@invalid").show();this.input().addClass("error");typeof f.invalid=="function"&&f.invalid(x.message)}})).send()}else{this.$(".@incomplete").show();this.$(".@invalid").hide();this.$(".@valid").hide();this.isValid=null}},setWidth:function(f){var g=parseInt(this.input().width())-4;g>0&&f.css("width",
g+"px")}});b.InputValidator.validate=function(f,g){g=g||{};if(f.__validators&&f.__validators.length)f.__validators[0].validate(g);else typeof g.valid=="function"&&g.valid()}})(webnode2);TopicMergeUnmerge=W2.Component.extend({onLoad:function(){this.$("#@show_merge").click(this.fnbind(function(){this.$("#@merge").removeClass("hidden");this.$("#@show_merge").addClass("hidden");this.c(":standalone.selector").focus();return false}))}});TopicRelated=W2.Component.extend({onLoad:function(){this.$("#@view_all").click(this.fnbind(function(){this.$("#@all").removeClass("hidden");this.$("#@preview").addClass("hidden");return false}))}});
TopicQuestionAdd=W2.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.c(":add_question").clear();this.c(":add_question").focus()}});MobileQuestionTopics=W2.Component.extend({onLoad:function(){},toggleTopicEditor:function(){this.$("#@view_topics_list").toggleClass("hidden");this.$("#@edit_topics_list").toggleClass("hidden")}});
MobileEditTopicsLink=W2.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.c(":question_topics").toggleTopicEditor();return false}))}});ThreadComposeMessageBox=W2.Component.extend({onLoad:function(){this.$("#@submit").click(this.fnbind(function(){this.c(":editor").request();return false}))}});
TruncatePhraseList=W2.Component.extend({onLoad:function(){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=W2.Component.extend({onLoad:function(){this.$("#@follow_all").click(this.fnbind(function(){this.controller("follow_all").success(this.fnbind(function(){$("#suggs").addClass("hidden")})).send();return false}))}});ViewAllPeopleSuggestions=W2.Component.extend({onLoad:function(){this.$("#@more").click(this.fnbind(function(){$("#suggs .hidden_person").removeClass("hidden");this.$("#@more").addClass("hidden");return false}))}});
PeopleCardRow=W2.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=W2.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=W2.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=W2.Component.extend({onLoad:function(){this.$("#@remove_vote_link").tooltip({contents:"Remove vote"}).click(this.fnbind(function(){this.controller("remove_wanted_answer").liveMutate().send();return false}));this.$("#@vote_up_link").tooltip({contents:"Vote for this person"}).click(this.fnbind(function(){this.controller("add_wanted_answer").liveMutate().send();return false}))}});
VoteCount=W2.Component.extend({onLoad:function(){this.names&&this.$("#@votes").tooltip({contents:"Vote"+this.s+" by "+this.names})}});
WantedAnswerSelector=W2.Component.extend({onLoad:function(){this.privacy_warned=false;this.c(":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.c(":selector").focus()})}})}}));this.c(":selector").inputKeyup=
this.fnbind(function(){this.c(":selector").onInputChange();var b=this.c(":selector").getValue();b.indexOf("@")>0?this.$("#@invite_button").removeClass("hidden"):this.$("#@invite_button").addClass("hidden")});this.$("#@invite").click(this.fnbind(function(){var b=this.c(":selector").getValue();$(".content").dialog({mobile:this.mobile,title:"Invite "+escape(b)+" to Quora",url:"/contacts/ajax_invite_dialog_GET?email="+escape(b)+"&qid="+this.qid,id:"invite_dialog",buttons:null});this.c(":selector").setValue("");
this.$("#@invite_button").addClass("hidden");return false}))},setTo:function(b){b&&b!=""&&this.controller("add_wanted_answer").kwargs({uid:b}).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:b})}this.clear()})).liveMutate().send()},clear:function(){this.c(":selector").inputBlur()}});
AggregatedNotification=W2.Component.extend({onLoad:function(){this.$("#@expand").click(this.fnbind(function(){this.$("#@notifs").toggleClass("hidden");return false}))}});GlobalFeedLink=W2.Component.extend({onLoad:function(){this.$("#@count").tooltip({contents:this.count+" Unorganized Question"+(this.count==1?"":"s")})},clicked:function(){this.c(":tabs").selectTab("need_topics")}});
QTextDiff=W2.Component.extend({onLoad:function(){this.$("#@more_link").click(this.fnbind(function(){this.$("#@diff_snip").addClass("hidden");this.$("#@full_diff").removeClass("hidden");return false}))}});SuggestedQuestionItem=W2.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=W2.Component.extend({toggle:function(){this.$("#@suggestions").toggleClass("hidden")},show:function(){this.$("#@suggestions").removeClass("hidden")},hide:function(){this.$("#@suggestions").addClass("hidden")}});
InlineTabs=W2.Component.extend({onLoad:function(){if(this.use_ajax){if(window.location.hash.substr(0,5)=="#tab_"){var b=window.location.hash.substr(5);b!=this.tab&&this.tabs.indexOf(b)>0&&this.selectTab(b)}$.each(this.tabs,this.fnbind(function(f,g){this.c(":tabs").getTab(g).click(this.fnbind(function(){this.selectTab(g);return false}))}))}},selectTab:function(b){window.location.hash="#tab_"+b;$("body").css("height",$("body").height()+"px");this.c(":tabs").setTab(b);$.each(this.tabs,this.fnbind(function(f,
g){this.$("#@"+g).addClass("hidden")}));this.$("#@"+b).removeClass("hidden");this.$("#@"+b).text()==""&&this.$("#@"+b).setContentFromAJAXComponent("/tabs/change_tab_POST",{tab:b,type:this.type,object_id:this.object_id},this.cid,null,this.fnbind(function(){$("body").css("height","auto")}))}});PillTabs=W2.Component.extend({onLoad:function(){},setTab:function(b){this.$("#@tabs .selected").removeClass("selected");this.$("#@"+b).addClass("selected")},getTab:function(b){return this.$("#@"+b)}});
QtextTruncate=W2.Component.extend({init:function(){this.callback=null},onLoad:function(){this.$("#@more_link").click(this.fnbind(function(){this.viewMore();this.callback&&this.callback();return false}))},setCallback:function(b){this.callback=b},viewMore:function(){this.$("#@text_snip").addClass("hidden");this.$("#@full_text").removeClass("hidden")}});
FeedAnswerItem=W2.Component.extend({onLoad:function(){this.$("#@answer_rating").tooltip({contents:"Current answer rating"});this.author||this.c(":answer_text").setCallback(this.fnbind(function(){this.$("#@answer_rating").addClass("hidden");this.$("#@answer_voting").removeClass("hidden")}))}});ThreadMessage=W2.Component.extend({onLoad:function(){window.scrollBy(0,5E5);window.scrollBy(0,5E5)}});
ThreadPresenceMonitor=W2.Component.extend({onLoad:function(){if(this.monitor){this.disabled=false;$(document).mousemove(this.fnbind(function(b){this.onPresence(b)}));$(document).keypress(this.fnbind(function(b){this.onPresence(b)}))}},onPresence:function(){if(!this.disabled){this.disabled=true;W2.rpc("/thread/ajax_report_thread_presence_POST").kwargs({thread_id:this.thread_id}).send()}}});
QuestionBestSourceIcon=W2.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=W2.Component.extend({onLoad:function(){this.$("#@clear").click(this.fnbind(function(){this.controller("clear_unseen").liveMutate().send();return false}))}});
NotificationPreview=W2.Component.extend({onLoad:function(){this.$("#@notification").click(this.fnbind(function(){this.$("#@notification_diff").toggleClass("hidden");return false}))}});
FlagHasEnoughTopicsLink=W2.Component.extend({onLoad:function(){this.$("#@has_enough_topics").click(this.fnbind(function(){this.controller("has_enough_topics").liveMutate().send();return false})).tooltip({contents:"Flag as Having Enough Topics"});this.$("#@doesnot_have_enough_topics").click(this.fnbind(function(){this.controller("doesnot_have_enough_topics").liveMutate().send();return false})).tooltip({contents:"Flag as Not Having Enough Topics"})}});
RelatedQuestionsMain=W2.Component.extend({init:function(b){this.qid=b.qid},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=W2.Component.extend({init:function(b){this.qid=b.qid},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=W2.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(){$.liveMutate("/question/ajax_remove_related_question_POST",{rel_qid:this.rel_qid,qid:this.qid})}),Cancel:null}});return false}))}});UserSig=W2.Component.extend({onLoad:function(){this.$("#@sig").tooltip({contents:this.sig})}});
NUXFollowingListMain=W2.Component.extend({onLoad:function(){this.$("#@show_following_list").click(this.fnbind(function(){this.$("#@following_list").toggleClass("hidden");return false}))}});
NotifHeaderBar=W2.Component.extend({onLoad:function(){if(this.num>0&&window.location.hash.substr(0,1)=="#"&&!this.mobile){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 b=this.fnbind(function(){this.setPosition()});setTimeout(b,50)}},setPosition:function(){var b=$(window).scrollTop(),f=this.barHeight+this.barMarginBtm;
if(b>this.headerHeight){this.$("#@bar").addClass("notif_header_bar_fixed");$("#layout_header").css("margin-bottom",f+"px")}else{this.$("#@bar").removeClass("notif_header_bar_fixed");$("#layout_header").css("margin-bottom","0px")}}});
NotifHeaderBarButtons=W2.Component.extend({onLoad:function(){this.locked=false;$(document).keydown(this.fnbind(function(b){return this.docKeydown(b)}));this.$("#@next").click(this.fnbind(function(){this.gotoNext();return false}))},gotoNext:function(){if(this.next_url)document.location=this.next_url},isLocked:function(){var b=false;$("input, textarea, .qtext_editor_content").each(function(){if($(this).attr("focused")=="true")b=true});return this.locked||b},docKeydown:function(b){b=b||window.event;
if(this.isLocked())return true;if(b.keyCode==39){this.gotoNext();return false}}});CreateAnswerWikiLink=W2.Component.extend({onLoad:function(){this.$("#@create_answer_wiki").click(this.fnbind(function(){$("#answer_wiki").toggleClass("hidden");return false}))}});
ReportLink=W2.Component.extend({onLoad:function(){this.$("#@report_link").click(this.fnbind(function(){$(".content").dialog({title:"Flag Content",comment_form:"Please explain why you are flagging this content",mobile:this.mobile,buttons:{Ok:this.fnbind(function(){this.comment=$("#dialog_comment").val();this.request("/ajax/ajax_report_POST")}),Cancel:null}});return false}))},request:function(b){if(!this.id||!this.type||!this.comment)return false;$.liveMutate(b,{id:this.id,type:this.type,comment:this.comment},
this.fnbind(function(){$.serverLog("Content Flagged","INFO",{id:this.id,type:this.type,comment:this.comment});alert("Content Flagged")}))}});AnswerThanksLink=W2.Component.extend({onLoad:function(){this.$("#@answer_thanks_link").click(this.fnbind(function(){$.liveMutate("/question/ajax_answer_thanks_POST",{aid:this.aid});return false}))}});LogoutNavElement=W2.Component.extend({onLoad:function(){this.$("#@logout_link").click(this.fnbind(function(){this.$("#@logout_form").submit();return false}))}});
ResetPassword=W2.Component.extend({onLoad:function(){this.$("#@reset_email_submit").click(this.fnbind(function(){var b=this.$("#@email_input").val();if(!b)return false;this.emailRequest("/settings/send_reset_password_email_POST",b);return false}));this.$("#@reset_password_submit").click(this.fnbind(function(){var b=this.$("#@reset_password_code").val(),f=this.$("#@new_password").val();if(!f)return false;this.passwordRequest("/settings/reset_password_POST",b,f);return false}))},emailRequest:function(b,
f){W2.rpc(b).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(b,f,g){W2.rpc(b).kwargs({code:f,new_password:g}).success(this.fnbind(function(o){window.location=o?"/login/index?__pmsg__=password_changed":"/settings/reset_password?__pmsg__=password_change_error"})).send();return false}});
SettingsMain=W2.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 b=this.$("#@new_email").val();if(!b)return false;this.request("/settings/add_email_POST",b);return false}));this.clear_passwords=function(){this.$("#@old_password").val("");
this.$("#@new_password").val("");this.$("#@confirm_password").val("")};this.$("#@change_password_link").click(this.fnbind(function(){this.$("#@change_password_row").toggleClass("hidden");this.$("#@change_password_input_row").toggleClass("hidden");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(b){this.clear_passwords();
if(b){this.$("#@old_password_no_match").addClass("hidden");this.$("#@password_changed").removeClass("hidden")}else{this.$("#@old_password_no_match").removeClass("hidden");this.$("#@password_changed").addClass("hidden")}})).error(this.fnbind(function(){})).send();return false}))},request:function(b,f){$.liveMutate(b,{email:f},this.fnbind(function(){}))}});
EmailAddressRow=W2.Component.extend({onLoad:function(){this.$("#@confirm_email").click(this.fnbind(function(){$(".content").dialog({title:"Resend Confirmation Email",contents:"Resend a confirmation email to "+this.email+".",buttons:{Send:this.fnbind(function(){this.request("/settings/resend_email_confirmation_POST",this.email)}),Cancel:null}});return false}));this.$("#@make_primary").click(this.fnbind(function(){this.request("/settings/set_primary_email_POST",this.email);return false}));this.$("#@delete_email").click(this.fnbind(function(){$(".content").dialog({title:"Remove Email Address",
contents:"Are you sure you want to delete the "+this.email+" address?",buttons:{Delete:this.fnbind(function(){this.request("/settings/remove_email_POST",this.email)}),Cancel:null}});return false}))},request:function(b,f){$.liveMutate(b,{email:f},this.fnbind(function(){}))}});EmailSettingsSection=W2.Component.extend({onLoad:function(){this.$("#@view_section_link").click(this.fnbind(function(){this.$("#@view_section").removeClass("hidden");this.$("#@view_section_link").addClass("hidden");return false}))}});
LoginButton=W2.Component.extend({onLoad:function(){this.$("#@login_link").click(this.fnbind(function(){window.location="/login/index?next="+escape(window.location);return false}))}});AlertExampleComponent=W2.Component.extend({init:function(b){this.n=b},onLoad:function(){alert("AlertExampleComponent "+this.n)}});
ToFollowList=W2.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=W2.Component.extend({onLoad:function(){this.$("#@invite").click(this.fnbind(function(){var b=this.name?this.name:this.email;$(".content").dialog({title:"Invite "+unescape(b)+" to Quora",url:"/contacts/ajax_invite_dialog_GET?email="+this.email,mobile:this.mobile,id:"invite_dialog",buttons:null});return false}))}});
InviteConfirmationDialog=W2.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 b=this.c(":msg").getVal(),f=[],g=[];$("#invite_dialog .temp_topics_list input").each(function(){f.push($(this).val())});$("#invite_dialog .temp_suggested_question input").each(function(){g.push($(this).val())});W2.rpc("/contacts/ajax_send_invite_POST").kwargs({email:this.email,
msg:b,topics:f,questions:g}).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=W2.Component.extend({init:function(b){this.len=b.len;this.max=b.max},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(b){this.onCheck();b.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 b=0;$("input[type='checkbox']").each(function(){$(this).attr("checked")&&b++});if(b>=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.c(":suggestions").toggle();this.$("#@list_row").unbind("click")}});
InviteByEmailAddress=W2.Component.extend({onLoad:function(){this.$("#@more").click(this.fnbind(function(){this.$("#@more").addClass("hidden");this.$("#@email_addresses .hidden_fields").removeClass("hidden");return false}))}});
InviteByEmailAddressItem=W2.Component.extend({onLoad:function(){this.$("#@email").bind("blur",this.fnbind(function(){if(this.$("#@email").val()){this.c(":suggestions").show();this.c(":suggestions.topic.topic_add").setoid(this.$("#@email").val());this.c(":suggestions.question").setObjectID(this.$("#@email").val());return false}}))}});
InlineEditor=W2.Component.extend({onLoad:function(){this.input_obj=this.$("#@"+this.input);this.input_button="inline_editor_submit";this.input_button_obj=this.$("#@"+this.input_button);this.toggle_callback=null;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();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(function(){this.trigger_request(this.ajax_path)}),invalid:this.fnbind(function(){})});return false}));this.focus_onload&&this.focusInput();this.typing_area&&this.c(":editor").setTypingStateCallback(this.fnbind(function(b){W2.rpc("/ajax/ajax_typing_POST").kwargs({area:this.typing_area,
state:b}).send()}))},get_value:function(){return this.is_qtext?this.c(":editor").serialize():this.input_obj.val()},trigger_request:function(){var b=this.get_value();this.typing_area&&this.c(":editor").stopTyping();$.liveMutate(this.ajax_path,{id:this.id,input:b},this.fnbind(function(){this.ajax_callback()}))},ajax_callback:function(){this.toggle_editor()},focusInput:function(){this.is_qtext?$(".qtext_editor_content").focus():this.input_obj.focus()},toggle_editor:function(){this.$("#@inline_editor_content").toggleClass("hidden");
this.$("#@inline_editor_form").toggleClass("hidden");this.input_obj.focus()}});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}))}});
TopicAliases=W2.Component.extend({init:function(b){this.tid=b.tid},onLoad:function(){this.get_value=function(){return this.$("#@topic_alias_input").val()};this.trigger_request=function(b,f){if(!this.tid||!f)return false;$.liveMutate(b,{tid:this.tid,alias:f},this.fnbind(function(){this.$("#@topic_alias_input").val("");this.$("#@topic_alias_input").focus()}))};this.$("#@topic_alias_add").click(this.fnbind(this.addAliasSubmit));this.$("#@topic_alias_add_form").submit(this.fnbind(this.addAliasSubmit))},
addAliasSubmit:function(){var b=this.get_value();this.trigger_request("/topic/ajax_add_topic_alias_POST",b);return false}});
TopicAlias=W2.Component.extend({init:function(b){this.tid=b.tid;this.alias=b.alias},onLoad:function(){this.trigger_request=function(){if(!this.tid||!this.alias)return false;$.liveMutate("/topic/ajax_remove_topic_alias_POST",{tid:this.tid,alias:this.alias})};this.$("#@topic_alias_remove").click(this.fnbind(function(){$(".content").dialog({title:"Topic Alias Deletion",contents:"Are you sure you wish to delete this alias?",buttons:{Ok:this.fnbind(function(){this.trigger_request()}),Cancel:null}});return false}))}});
TopicDialog=W2.Component.extend({onLoad:function(){this.c(":editor").focus();W2.topicDialog=this}});RevertDialog=W2.Component.extend({onLoad:function(){this.c(":editor").focus();W2.revertDialog=this}});
TopicSelectorAdd=W2.Component.extend({init:function(b){this.oid=b.oid;this.type=b.type;this.ajax_path="/topic/ajax_add_topic_POST";this.comment=""},onLoad:function(){this.$("#@add_btn").click(this.fnbind(function(){this.addClick();return false}))},addClick:function(){this.select()},select:function(){this.type=="to_tid"?$(".content").dialog({title:"Topic Merge",url:"/ajax/topic_merge_dialog",buttons:{Ok:this.fnbind(function(){var b=W2.topicDialog.c(":editor");if(!b.isEmpty()){this.comment=b.serialize();
this.request()}}),Cancel:null}}):this.request()},request:function(){var b=this.parent_().qValue;if(!this.type||!this.oid||!b||b==" ")return false;$.liveMutate(this.ajax_path,{id:this.oid,type:this.type,topic_name:b,comment:this.comment},this.fnbind(function(){this.parent_().reset()}))}});
TempTopicSelectorAdd=TopicSelectorAdd.extend({onLoad:function(){this._super.apply(this,arguments);this.rmTempTopic()},select:function(){this.saveTempTopic(this.parent_().qValue)},setoid:function(b){this.oid=b},saveTempTopic:function(b){if(b){this.parent_().addTempTopic($("<li/>").addClass("topic_list_item").append($("<input/>").attr("type","hidden").attr("name","tidsugg_"+this.oid).val(b)).append($("<a/>").addClass("topic_name").html(b)).append($("<a/>").addClass("topic_remove").attr("href","#").html("")));
this.rmTempTopic();this.parent_().setText("");this.parent_().focus()}},rmTempTopic:function(){$(".topic_remove").click(function(){$(this).parent().remove();return false})}});
TopicDelete=W2.Component.extend({init:function(b){this.tid=b.tid},onLoad:function(){this.$("#@delete_topic_link").click(this.fnbind(function(){$(".content").dialog({title:"Delete Topic",url:"/ajax/topic_delete_dialog",buttons:{Ok:this.fnbind(function(){var b=W2.topicDialog.c(":editor");if(!b.isEmpty()){this.comment=b.serialize();$.liveMutate("/topic/ajax_delete_topic_POST",{tid:this.tid,comment:this.comment})}}),Cancel:null}});return false}));this.$("#@undelete_topic_link").click(this.fnbind(function(){$(".content").dialog({title:"Undelete Topic",
url:"/ajax/topic_undelete_dialog",buttons:{Ok:this.fnbind(function(){var b=W2.topicDialog.c(":editor");if(!b.isEmpty()){this.comment=b.serialize();$.liveMutate("/topic/ajax_undelete_topic_POST",{tid:this.tid,comment:this.comment})}}),Cancel:null}});return false}))}});
TopicUnmergeLink=W2.Component.extend({init:function(b){this.tid=b.tid},onLoad:function(){this.$("#@unmerge").click(this.fnbind(function(){this.request();return false}))},request:function(){$.liveMutate("/topic/ajax_unmerge_topic_POST",{tid:this.tid})}});FeedSuggestions=W2.Component.extend({onLoad:function(){this.$("#@view_suggestions_list_link").click(this.fnbind(function(){this.$("#@suggestions_list").toggleClass("hidden");return false}))}});
CommentLink=W2.Component.extend({init:function(b){this.object_id=b.object_id},onLoad:function(){this.$("#@view_comment_link").click(this.fnbind(function(){this.view_comments();return false}))},view_comments:function(){this.c(":comments_list").view_comments()}});QuestionComments=W2.Component.extend({view_comments:function(){if(this.$("#@question_comments").toggleClass("hidden").is(":visible")){if(this.mobile)window.location.hash="#question_comments";this.c(":add_comment").focus&&this.c(":add_comment").c("editor").focus()}}});
AnswerComments=W2.Component.extend({init:function(b){this.object_id=b.object_id},view_comments:function(){this.$("#@answer_comments").toggleClass("hidden").is(":visible")&&this.c(":add_comment").focus&&this.c(":add_comment").c("editor").focus()}});
CommentAdd=W2.Component.extend({init:function(b){this.object_id=b.id;this.ajax_path=b.ajax_path},onLoad:function(){this.$("#@add_comment_link").click(this.fnbind(function(){this.request();return false}))},request:function(){var b=this.c(":editor");if(b.isEmpty())return false;b=b.serialize();$.liveMutate(this.ajax_path,{object_id:this.object_id,comment:b},this.fnbind(function(f){this.ajax_callback(f)}))},ajax_callback:function(){this.c(":editor").clear()}});
Comment=W2.Component.extend({onLoad:function(b){this.$("#@delete_comment_link").click(this.fnbind(function(){$(".content").dialog({title:"Delete Comment",contents:"Are you sure you want to delete this comment?",buttons:{"Delete Comment":this.fnbind(function(){this.request()}),Cancel:null}});return false}));if(b)if(window.location.hash=="#comment_"+this.id){this.c(":comments_list").view_comments();this.$("#@comment").effect("highlight",{},5E3)}},request:function(){$.liveMutate("/question/ajax_delete_comment_POST",
{id:this.id,type:this.type,object_id:this.object_id})}});EndorseUserLink=W2.Component.extend({onLoad:function(){this.$("#@endorse").tooltip({contents:"Endorse "+this.name+" on "+this.topic_name});this.$("#@endorse").click(this.fnbind(function(){this.request();return false}))},request:function(){$.liveMutate("/user/ajax_endorse_user_POST",{to_uid:this.uid,tid:this.tid})}});
UnendorseUserLink=W2.Component.extend({init:function(b){this.enid=b.enid},onLoad:function(){this.$("#@remove_endorse").click(this.fnbind(function(){this.request();return false}))},request:function(){$.liveMutate("/user/ajax_remove_endorse_user_POST",{enid:this.enid})}});UserTopicStatsRow=W2.Component.extend({onLoad:function(){this.$(".@view_more").click(this.fnbind(function(){this.$("#@more").toggleClass("hidden");return false}))}});PhotoTooltip=W2.Component.extend({onLoad:function(){this.$("#@photo_tooltip").tooltip({contents:this.text})}});
QuestionFollowing=W2.Component.extend({onLoad:function(){this.$("#@follow").click(this.fnbind(function(){this.request(1);return false}));this.$("#@unfollow").click(this.fnbind(function(){this.request(0);return false}))},request:function(b){$.liveMutate("/question/ajax_follow_question_POST",{qid:this.qid,follow:b})}});QuestionFollowingLink=QuestionFollowing.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@follow").tooltip({contents:"Follow Question"});this.$("#@unfollow").tooltip({contents:"Unfollow Question"})}});
QuestionRedirectLink=W2.Component.extend({onLoad:function(){this.$("#@remove_redirect").click(this.fnbind(function(){this.remove();return false}))},remove:function(){$.liveMutate("/question/ajax_remove_redirect_question_POST",{qid:this.qid})}});
QuestionAnonLink=W2.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(){$.liveMutate("/question/ajax_set_anon_question_POST",{qid:this.qid})},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(){$.liveMutate("/question/ajax_set_public_question_POST",
{qid:this.qid})}),Cancel:null}})}});QuestionSettingsLink=W2.Component.extend({onLoad:function(){this.$("#@question_settings_link").click(this.fnbind(function(){this.$("#@question_settings_menu").menu(this.$("#@question_settings_link"));return false}))}});
QuestionMain=W2.Component.extend({init:function(b){this.qid=b.qid;this.mobile=b.mobile;this.ajax_path="/question/ajax_edit_question_POST"},onLoad:function(){this.$("#@delete_question_link").click(this.fnbind(function(){$(".content").dialog({mobile:this.mobile,title:"Question Delete",contents:"Are you sure you wish to delete this question?",buttons:{Ok:this.fnbind(function(){this.request("/question/ajax_delete_question_POST")}),Cancel:null}});return false}));this.$("#@undelete_question_link").click(this.fnbind(function(){$(".content").dialog({mobile:this.mobile,
title:"Restore Question",contents:"Are you sure you wish to restore this question?",buttons:{Ok:this.fnbind(function(){this.request("/question/ajax_undelete_question_POST")}),Cancel:null}});return false}))},request:function(b){$.liveMutate(b,{qid:this.qid})}});
AnswerActions=W2.Component.extend({init:function(){this._super.apply(this,arguments);this.ajax_path="/question/ajax_edit_answer_POST"},onLoad:function(b){b&&window.location.hash=="#answer_"+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("/question/ajax_remove_answer_POST")}),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("/question/ajax_unremove_answer_POST")}),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.$("#@view_all_voters").click(this.fnbind(function(){this.$("#@answer_voters span").removeClass("hidden");this.$("#@view_all_voters").addClass("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}))},request:function(b){var f={aid:this.aid};$.liveMutate(b,
f)}});
AnswerVotingButtons=W2.Component.extend({onLoad:function(){this.$("#@answer_vote_up_cancel_link").click(this.fnbind(function(){this.controller("answer_vote_up_cancel").liveMutate().send();return false}));this.$("#@answer_vote_up_link").click(this.fnbind(function(){this.controller("answer_vote_up").liveMutate().send();return false}));this.$("#@answer_vote_down_cancel_link").click(this.fnbind(function(){this.controller("answer_vote_down_cancel").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."})}});
AnswerDeletedButton=W2.Component.extend({init:function(b){this.qid=b.qid},onLoad:function(){this.$("#@view_deleted_answers").click(this.fnbind(function(){$(".deleted_answers").toggleClass("hidden");return false}))}});TopicListItem=W2.Component.extend({onLoad:function(){this.$("#@remove_topic").tooltip({contents:"Remove"}).click(this.fnbind(function(){this.controller("remove_topic").liveMutate().send();return false}))}});
UserFollowLink=W2.Component.extend({init:function(b){this.uid=b.uid},onLoad:function(){this.$("#@follow_user").click(this.fnbind(function(b){this.request(1);b.stopPropagation();return false}));this.$("#@unfollow_user").click(this.fnbind(function(b){this.request(0);b.stopPropagation();return false}))},request:function(b){$.liveMutate("/user/ajax_follow_user_POST",{to_user:this.uid,follow:b})}});
FeedStoryItem=W2.Component.extend({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}))},getURL:function(){return"/q/"+this.q_path},getId:function(){return this.qid},getItem:function(){return this.$("#@item")}});
QuestionTopics=W2.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=W2.Component.extend({init:function(b){this.uid=b.uid;this.object_id=b.object_id;this.type=b.type},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 b={object_id:this.object_id,type:this.type,msg_json:this.c(":editor").serialize()};
$(":input").each(function(){if($(this).attr("checked"))b[$(this).attr("name")]=1});this.controller("share").liveMutate().kwargs(b).send()}});TopicBrowser=ObjectBrowser.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@browser_next").click(this.fnbind(function(){var b=0,f="";$(".dialog .selected .topic_name").each(function(){if(b>0)f+=", ";f+='<a href="#">'+$(this).text()+"</a>";b++});b==1?this.$(".@topic_plural").text(""):this.$(".@topic_plural").text("s");this.$("#@object_names_preview").html(f)}))}});
var pagerParent=null;PagerBase=W2.Component.extend({onLoad:function(b){this.last=parseInt(this.limit)+parseInt(this.offset);if(b&&this.is_hot_keyed&&!pagerParent)pagerParent=this.parent_();if(this.is_hot_keyed&&pagerParent)if(b){pagerParent.registerPager(this);pagerParent.setPager(0)}else{pagerParent.registerPager(this);if(pagerParent.active&&!pagerParent.focusedIndex){pagerParent.setPager(1);pagerParent.setFocusIndex(this.offset)}}},getChild:function(b){return this.c(":"+b)}});
PagerNav=W2.Component.extend({onLoad:function(b){if(b){this.pagers=[];this.cnames=[];this.pager=0;this.focusedIndex=null;this.active=this.locked=false;$(document).keydown(this.fnbind(function(f){return this.docKeydown(f)}))}},setPager:function(b){if(this.pager+b<0)this.pager=0;else if(this.pager+b>this.pagers.length-1)this.pager=this.pagers.length-1;if(b!=0)this.pager+=b},getPager:function(){return this.pagers[this.pager]},registerPager:function(b){this.pagers.push(b);this.registerCnames(b.cnames);
this.locked=false},registerCnames:function(b){$.each(b,this.fnbind(function(f,g){g!="more"&&this.cnames.push(b[f])}));this.last=this.cnames.length-1},getCname:function(b){return this.cnames[b]},isLocked:function(){var b=false;$("input, textarea, .qtext_editor_content").each(function(){if($(this).attr("focused")=="true")b=true});return this.locked||b},docKeydown:function(b){b=b||window.event;if(this.isLocked())return true;if(b.keyCode==74){this.active=true;this.next();return false}else if(b.keyCode==
75){this.active=true;this.prev();return false}else if(b.keyCode!=85)if(b.keyCode==13)if(this.go())return false;return true},next:function(){if(this.focusedIndex==null)this.setFocusIndex(0);else if(this.focusedIndex<this.getPager().last-1&&this.focusedIndex<this.last)this.setFocusIndex(this.focusedIndex+1);else if(this.focusedIndex==this.getPager().last-1)if(this.getPager().c(":more").open){var b=parseInt(this.focusedIndex);this.setFocusIndex(null);this.setPager(1);this.setFocusIndex(b+1)}else{this.setFocusIndex(null);
this.locked=true;this.getPager().c(":more").more()}},prev:function(){if(this.focusedIndex==null)this.setFocusIndex(0);else if(this.getPager().offset==this.focusedIndex&&this.focusedIndex>0){var b=parseInt(this.focusedIndex);this.setFocusIndex(null);this.setPager(-1);this.setFocusIndex(b-1)}else this.getPager().offset<this.focusedIndex&&this.setFocusIndex(this.focusedIndex-1)},getObj:function(b){var f=this.getPager();b=this.getCname(b);return f.getChild(b)},go:function(){if(this.focusedIndex!=null){document.location=
this.getObj(this.focusedIndex).getURL();return true}return false},setFocusIndex:function(b){this.focusedIndex!=null&&this.getObj(this.focusedIndex).getItem().removeClass("item_selected");if(b!=null){var f=this.getObj(b).getItem().offset().top-30;window.scrollTo(0,f);this.getObj(b).getItem().addClass("item_selected")}this.focusedIndex=b}});
SimplePageMore=W2.Component.extend({init:function(b){this.object_id=b.object_id;this.type=b.type;this.offset=b.offset;this.limit=b.limit;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(b,f){this.offset+=this.limit;var g={object_id:this.object_id,type:this.type,offset:this.offset,limit:this.limit};b.setContentFromAJAXComponent(f,g,this.cid,null,this.fnbind(function(){if(!b.text()||b.text()=="")this.$("#@pager_next").addClass("hidden")}))}});
TextareaAutoSize=W2.Component.extend({init:function(){this.t=$("textarea")},onLoad:function(){this.t.each(function(){var b=W2.fnbind(this,function(){var f=$(this).height(),g=parseInt($(this)[0].scrollHeight)-8;if(f<g)$(this).css("height",(g<=8?12:g)+"px")});$(this).bind("keypress",b).bind("focus",b)})}});
UserTopicPromote=W2.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=W2.Component.extend({onLoad:function(){this.$("#@link").click(this.fnbind(function(){this.$("#@link").addClass("hidden");this.$("#@topic_selector").removeClass("hidden");this.c(":selector").focus();return false}))}});
OperationApprove=W2.Component.extend({init:function(b){this.oid=b.oid},onLoad:function(){this.trigger_request=function(b){$.liveMutate(b,{oid:this.oid})};this.$("#@operation_undo_approve").click(this.fnbind(function(){this.trigger_request("/ajax/ajax_approve_revision_remove_POST");return false}));this.$("#@operation_approve").tooltip({contents:"Confirm this change has been reviewed"}).click(this.fnbind(function(){this.trigger_request("/ajax/ajax_approve_revision_POST");return false}))}});
OperationRevert=W2.Component.extend({onLoad:function(){this.trigger_request=function(b){$.liveMutate(b,{oid:this.oid,comment:this.comment})};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 b=W2.revertDialog.c(":editor");if(!b.isEmpty()){this.comment=b.serialize();this.trigger_request("/ajax/ajax_revert_revision_POST")}}),Cancel:null}});return false}))}});
LoginProfile=W2.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.c(":login_box").selected&&this.c(":login_box").$(".@select_user").fadeTo("fast",1)}),this.fnbind(function(){this.$("#@x_person").css("visibility","hidden");this.c(":login_box").selected&&this.c(":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.c(":login_box").select({uid:this.uid})},
passwordlessLoginAs:function(){W2.rpc("/login/login_ajax_POST").kwargs({uid:this.uid}).success(this.fnbind(function(){var b=this.c(":login_box").next||"/";window.location=b})).error(function(){alert("There was a problem logging you in. :(")}).send()}});LiveTestDialog=W2.Component.extend({onLoad:function(){this.$("link").bind("click",function(){$(".content").dialog({title:"LiveDep Dialog",url:"dialog"})})}});TestAC=W2.Component.extend({onLoad:function(){this.$("click_me").click(this.fnbind(function(){this.$("x").setContentFromAJAXComponent("ac_POST")}))}});
PasswordInput=W2.Component.extend({onLoad:function(){this.$("#@next").val(window.location);this.$("#@cancel_button").click(this.fnbind(function(){this.c(":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(b){if(b){this.$("#@password_form").unbind("submit");this.$("#@password_form").submit()}else{this.$("#@incorrect_password").show();this.$("#@password").focus()}})).send();
return false}));this.$("#@password").focus()}});
LoginBox=W2.Component.extend({init:function(b){this._super(b);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(b){this.selected=b;
var f={};if(typeof b.uid=="undefined"){f={email:b.email};if(!b.email)return false}else f={uid:b.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(g,o){switch(o[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: "+o[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=W2.Component.extend({init:function(b){this.epochMicroseconds=b.epoch_us;this.jsDisplay=b.js_disp},onLoad:function(){if(this.jsDisplay){var b=new Date;b.setTime(this.epochMicroseconds/1E3);this.ge("@datespan").innerHTML=""+b}}});SessionRow=W2.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=W2.Component.extend({onLoad:function(){this.$("#@x").click(this.fnbind(function(){this.$("#@container").hide();return false}))}});
PMsgContainer=W2.Component.extend({onLoad:function(){W2.pmsgContainer=this;this.setPosition();this.$("#@pmsg_container").show()},clear:function(){this.$("#@pmsg_container").html("")},setPosition:function(){if(!this.mobile){var b=parseInt($(window).width()/2-220);$(".pmsg").css("left",b+"px")}},setContent:function(b,f){this.$("#@pmsg_container").setContent(b);this.setPosition();f&&setTimeout(this.fnbind(function(){this.clear()}),3E3);return this},set:function(b){this.controller("load").kwargs({window_id:w2.windowId,
parent_cid:null,pmsg_s:b}).success(this.fnbind(function(f){this.setContent(f);this.setPosition()})).send()}});
SWFComponent=W2.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(b){if(b.success)typeof this.success=="function"&&this.success(b);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(b,f){var g=f.target,o=$("[__w2_cid="+b+"]");o.addClass("mouse_tracker_highlight");o.offset();o=W2._components[b];var x="<h3>"+b+"</h3>";if(o)x+=
'<pre id="__w2mousetracker_component_data"> </pre>';if(g=g.getAttribute("id")){if(g.substr(0,5+b.length)=="__wn_"+b)g="@"+g.substr(6+b.length);x+="<br /><span>id="+g+"</span>"}b=f.pageY-80;if(b<0)b=f.pageY+20;g=$("#__w2mousetracker_label");g.html(x).css("top",b).css("left",f.pageX);g.show();if(o)g.get(0).childNodes.item(1).childNodes.item(0).textContent=JSON.stringify(o.__data)},unhighlightCID:function(b){$("[__w2_cid="+b+"]").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(b){var f=b.target.getAttribute("__w2_cid");f&&this.highlightCID(f,b)})).bind("mouseout.component_inspector",this.fnbind(function(b){var f=b.target.getAttribute("__w2_cid");f&&this.unhighlightCID(f,b)}));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(b){this.recordMouseover(b);return true})).click(this.fnbind(function(b){this.recordClick(b);return true}))},recordMouseover:function(){},
recordClick:function(b){console.log("Got a click"+b)},_getClicks:function(){}});
EditPhoto=W2.Component.extend({onLoad:function(){FB.getLoginStatus(this.fnbind(function(b){switch(b.status){case "connected":case "notConnected":this.$("#@use_fb_photo").show();break;default:}}));this.$("#@from_facebook").click(this.fnbind(function(){FB.login(this.fnbind(function(b){if(b.session){b=b.session.uid;FB.api({method:"fql.query",query:"SELECT pic_big FROM user WHERE uid = "+b},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 alert("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=W2.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(b){if(!(b&&b.status=="connected")){this.$("#@dialog").show();FB.login()}}));this.$("#@connect").click(this.fnbind(function(){FB.login();return false}))}});
FacebookFriends=W2.Component.extend({onLoad:function(){this.$("#@follow_all").click(this.fnbind(function(){this.followAll();return false}))},followAll:function(b){$.liveMutate("/user/ajax_follow_all_POST",{uids:this.uids.join(",")},b)}});
FacebookAccountConnectedTo=W2.Component.extend({onLoad:function(){this.$("#@connect").click(this.fnbind(function(){FB.login(this.fnbind(function(b){Quora.FB.updateAuth();b&&b.status=="connected"&&$.liveMutate("/facebook/connect_POST",{})}));return false}));this.$("#@disconnect").click(this.fnbind(function(){$.liveMutate("/facebook/disconnect_POST",{});return false}))}});
FacebookSync=W2.Component.extend({onLoad:function(){$(document).bind("fbupdateauth",this.fnbind(function(){FB.getLoginStatus(this.fnbind(function(b){b.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=W2.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(b){if(b){b=b[0];b.pic&&this.$("#@photo").attr("src",b.pic);b.name?this.$("#@name").text(b.name):this.$("#@name").html("<span style='color: gray;'>Couldn't retrieve info from Facebook; you may not be logged in to Facebook.</span>")}}))}));Q.FB.updateAuth()}});
FacebookFriendsNUX=W2.Component.extend({onLoad:function(){this.$("#@follow_all_and_continue").click(this.fnbind(function(){try{this.c("fbfriends").followAll(this.fnbind(function(){window.location=this.next}))}catch(b){window.location=this.next}}))}});
GrowlNotification=W2.Component.extend({onLoad:function(b){var f=this.age_us/1E3/1E3;if(b)f<1.5&&this.show();else f<15&&this.show();this.$("#@notif").mouseover(this.fnbind(function(){clearTimeout(this._timeout);var g=this.$("#@notif");if(g.is(":animated")){g.stop();g.animate({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)},show:function(){this.$("#@notif").slideDown("fast")},
startFade:function(b){clearTimeout(this._timeout);this._timeout=setTimeout(this.fnbind(function(){this.$("#@notif").fadeOut(1250)}),b)}});EditPhotoChoice=W2.Component.extend({onLoad:function(){this.$(".@img_choice").click(this.fnbind(function(b){b=$(b.target).attr("choice");this.$("#@choice").val(b);this.$("#@formchoice").submit();return false}))}});
TView=W2.Component.extend({onLoad:function(){this.$("#@clickme").click(this.fnbind(function(){this.controller("log_something").args("i can see for miles =P").success(this.fnbind(function(b){console.log("oh yeah: "+b)})).send();console.log("miles and miles and miles");return false}))}});
UndoTopicRemoval=W2.Component.extend({onLoad:function(){this.t=setTimeout(this.fnbind(function(){this.$("#@container").fadeOut(1E3)}),3E3);this.$("#@undo").click(this.fnbind(function(){this.controller("undo").kwargs({poid:this.poid}).liveMutate().success(this.fnbind(function(){clearTimeout(this.t);this.$("#@container").hide()})).send();return false}))}});
OnOffControlPanelSetting=W2.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(b){this.$("#@on").attr("checked",b);this.$("#@off").attr("checked",!b)})).send();
return false}))}});
SignupForm2=W2.Component.extend({onLoad:function(){this.$("#@more_what_happens").click(this.fnbind(function(){$(".content").dialog({title:"Connecting your Facebook Account to Quora",contents:"<p>To get you started, we'll have you follow all your Facebook friends who are already on Quora when you sign up.</p><br /><p>We won't message your Facebook contacts who aren't on the site or post anything to your Facebook 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.",buttons:{Close:null}});
return false}));this.$("#@facebook_connect_button").click(this.fnbind(function(){FB.login(this.fnbind(function(b){if(b.session){this.$("#@step1").hide();FB.api({method:"fql.query",query:"SELECT name, pic_big FROM user WHERE uid = "+b.session.uid},this.fnbind(function(f){this.$("#@step2").show();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.c("name_validator").validate()}else console.log("Error retrieving data from Facebook.")}))}else this.$("#@err_must_connect").show()}))}));
this.$("#@form").submit(this.fnbind(function(){if(!this.c("name_validator").isValid){alert("Check the name that you entered before submitting.");return false}if(!this.c("email_validator").isValid){alert("Check the e-mail that you're using before submitting.");return false}if(!this.c("password_validator").isValid){alert("Check the password that you're using before submitting.");return false}return true}))}});
TopicFollowButton=W2.Component.extend({onLoad:function(){this.$("#@follow").click(this.fnbind(function(){this.controller("follow").liveMutate().send();return false}));this.$("#@unfollow").click(this.fnbind(function(){this.controller("unfollow").liveMutate().send();return false}))}});
TitleNotificationsCount=W2.Component.extend({onLoad:function(){this.setTitle()},setTitle:function(){var b=document.title,f=b,g,o="",x;if(this.notif_count||this.inbox_count){o+="(";if(this.notif_count)o+=this.notif_count;if(this.inbox_count)o+="/"+this.inbox_count;o+=") "}if(g=b.indexOf(" -")){if(b.charAt(g-1)==")")if(x=b.indexOf("("))f=b.substr(0,x)+o+b.substr(g+1);else $.serverLog("Invalid title bar state");else f=b.substr(0,g)+" "+o+b.substr(g+1);if(b!=f)document.title=f}}});
MobileFooter=W2.Component.extend({onLoad:function(){this.$("#@full_site").click(this.fnbind(function(){Quora.cookie("m","0");location.reload(true);return false}))}});UseMobileSite=W2.Component.extend({onLoad:function(){this.$("#@mobile_site").click(this.fnbind(function(){Quora.cookie("m","1");location.reload(true);return false}))}});Dialog=W2.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(f){this.successCallback&&
this.successCallback(f);this.close()})).send()},ok2Submit:function(){return true},getPars:function(){return{}},setSetup:function(b){b.each(this.fnbdin(function(f,g){this.options[f]=g}))},setSuccessCallback:function(b){this.successCallback=b},close:function(){$("#generic_dialog").remove()}});AddCommentDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.c(":editor").focus()},getPars:function(){if(this.comment_required&&this.c(":editor").isEmpty())return false;return{comment:this.c(":editor").serialize()}}});
DialogLink=W2.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,f){this.options[b]=f},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,mobile:this.mobile,buttons_hide_on_close:this.buttons_hide_on_close,buttons:null})},
triggerClick:function(b){$.each(b,this.fnbind(function(f,g){this.addOption(f,g)}));this.click()}});AnswerDownvoteLink=DialogLink.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@link").click(this.fnbind(function(){this.controller("answer_vote_down").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});return false}))}});QuestionRedirectDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false}});
AddPassOnVoteDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.ok2Submit=false},getPars:function(){var b=this.c(":editor").serialize();if(b&&this.object_id)this.ok2Submit=true;return{qid:this.object_id,reason:b}}});
AnswerDownvoteCommentDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.c(":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="This doesn't seem to be a real attempt to make this question page a great resource for anyone who legitimately wants to know about the question.";break;case "other":default:b="[Please explain how this answer could be improved.]";
break}this.c(":editor").setHtml(b);return false}))},getPars:function(){if(this.c(":editor").isEmpty())return false;var b=this.c(":editor").serialize();return{object_id:this.object_id,comment: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.c(":people_selector").inputFocus();this.load()},load:function(){this.object_id&&this.setTo(this.object_id)},getPars:function(){if($("#generic_dialog #compose_message_to_uid").length>0)this.object_id=$("#generic_dialog #compose_message_to_uid").val();if(!this.object_id||this.c(":editor").isEmpty())return false;return{to_uid:this.object_id,
msg:this.c(":editor").serialize()}},change:function(){this.c(":people_selector").reset();this.$("#@pick_people").removeClass("hidden");this.$("#@picked_person").addClass("hidden");this.$("#@to_name").html("")},setTo:function(b){this.c(":people_selector").reset();this.$("#@pick_people").addClass("hidden");this.$("#@picked_person").removeClass("hidden");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.c(":people_selector").inputFocus()},load:function(){return false},getPars:function(){var b=null;if($("#generic_dialog #compose_message_to_uid").length>0)b=$("#generic_dialog #compose_message_to_uid").val();if(!b)return false;this.ok2Submit=true;return{uid:b}},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.c(":editor").setHtml(this.default_text);this.focus();this.submitted=false}));this.c(":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.c(":details_editor").focus();return false}))},clear:function(){this.c(":editor").clear()},focus:function(){this.c(":editor").focus()},getPars:function(){var b=this.c(":editor").html().slice(0,this.default_text.length)==this.default_text,f={};f.question=this.c(":editor").serialize();f.question_details=this.c(":details_editor").serialize();f.rel_qid=this.$("#@rel_qid").val()?this.$("#@rel_qid").val():0;f.tid=this.$("#@tid").val()?this.$("#@tid").val():0;f["private"]=this.$("#@question_privacy").attr("checked")==
true?1:0;if(!f.question||f.question==" "||b||this.c(":editor").isEmpty()){this.$("#@question_text").select();return false}return f}});WantedAnswerDialog=Dialog.extend({onLoad:function(){this._super.apply(this,arguments);this.c("question_selector").focus();this.setSuccessCallback(this.fnbind(function(b){if(b)document.location=b}))},getPars:function(){var b=this.c("question_selector").getQid(),f=this.c("question_selector").qValue;return{qid:b,text:f}}});MobileStandardLayout=W2.Component.extend({onLoad:function(){},hideURLBar:function(){!this.touched&&window.location.hash.substr(0,1)!="#"&&setTimeout(function(){window.scrollTo(0,1)},0)}});MobileHeader=W2.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=W2.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}))}});jQuery.effects||function(b){function f(m,h){var p=m[1]&&m[1].constructor==Object?m[1]:{};if(h)p.mode=h;h=m[1]&&m[1].constructor!=Object?m[1]:p.duration?p.duration:m[2];h=b.fx.off?0:typeof h==="number"?h:b.fx.speeds[h]||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,h,r]}function g(m){var h;if(m&&m.constructor==Array&&m.length==3)return m;if(h=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(m))return[parseInt(h[1],
10),parseInt(h[2],10),parseInt(h[3],10)];if(h=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(m))return[parseFloat(h[1])*2.55,parseFloat(h[2])*2.55,parseFloat(h[3])*2.55];if(h=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(m))return[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)];if(h=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(m))return[parseInt(h[1]+h[1],16),parseInt(h[2]+h[2],16),parseInt(h[3]+h[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(m))return x.transparent;
return x[b.trim(m).toLowerCase()]}function o(m,h){var p;do{p=b.curCSS(m,h);if(p!=""&&p!="transparent"||b.nodeName(m,"body"))break;h="backgroundColor"}while(m=m.parentNode);return g(p)}b.effects={version:"1.7.2",save:function(m,h){for(var p=0;p<h.length;p++)h[p]!==null&&m.data("ec.storage."+h[p],m[0].style[h[p]])},restore:function(m,h){for(var p=0;p<h.length;p++)h[p]!==null&&m.css(h[p],m.data("ec.storage."+h[p]))},setMode:function(m,h){if(h=="toggle")h=m.is(":hidden")?"show":"hide";return h},getBaseline:function(m,
h){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]/h.height}switch(m[1]){case "left":m=0;break;case "center":m=0.5;break;case "right":m=1;break;default:m=m[1]/h.width}return{x:m,y:p}},createWrapper:function(m){if(m.parent().is(".ui-effects-wrapper"))return m.parent();var h={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 s=m.css("left");if(isNaN(parseInt(s,10)))s="auto";p.css({position:m.css("position"),top:r,left:s,zIndex:m.css("z-index")}).show();m.css({position:"relative",top:0,left:0})}p.css(h);return p},removeWrapper:function(m){if(m.parent().is(".ui-effects-wrapper"))return m.parent().replaceWith(m);return m},setTransition:function(m,h,p,r){r=
r||{};b.each(h,function(s,z){unit=m.cssUnit(z);if(unit[0]>0)r[z]=unit[0]*p+unit[1]});return r},animateClass:function(m,h,p,r){var s=typeof p=="function"?p:r?r:null,z=typeof p=="string"?p:null;return this.each(function(){var H={},S=b(this),d=S.attr("style")||"";if(typeof d=="object")d=d.cssText;if(m.toggle)S.hasClass(m.toggle)?(m.remove=m.toggle):(m.add=m.toggle);var I=b.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);m.add&&S.addClass(m.add);m.remove&&
S.removeClass(m.remove);var G=b.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);m.add&&S.removeClass(m.add);m.remove&&S.addClass(m.remove);for(var L in G)if(typeof G[L]!="function"&&G[L]&&L.indexOf("Moz")==-1&&L.indexOf("length")==-1&&G[L]!=I[L]&&(L.match(/color/i)||!L.match(/color/i)&&!isNaN(parseInt(G[L],10)))&&(I.position!="static"||I.position=="static"&&!L.match(/left|top|bottom|right/)))H[L]=G[L];S.animate(H,h,z,function(){if(typeof b(this).attr("style")==
"object"){b(this).attr("style").cssText="";b(this).attr("style").cssText=d}else b(this).attr("style",d);m.add&&b(this).addClass(m.add);m.remove&&b(this).removeClass(m.remove);s&&s.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,h,p,r){return b.effects[m]?b.effects[m].call(this,{method:m,options:h||{},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,f(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,f(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,f(arguments,"toggle"))},addClass:function(m,h,p,r){return h?b.effects.animateClass.apply(this,[{add:m},h,p,r]):this._addClass(m)},removeClass:function(m,h,p,r){return h?b.effects.animateClass.apply(this,[{remove:m},h,p,r]):this._removeClass(m)},toggleClass:function(m,h,p,r){return typeof h!=="boolean"&&h?b.effects.animateClass.apply(this,[{toggle:m},h,p,r]):this._toggleClass(m,h)},morph:function(m,h,p,r,s){return b.effects.animateClass.apply(this,
[{add:h,remove:m},p,r,s])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(m){var h=this.css(m),p=[];b.each(["em","px","%","pt"],function(r,s){if(h.indexOf(s)>0)p=[parseFloat(h),s]});return p}});b.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(m,h){b.fx.step[h]=function(p){if(p.state==0){p.start=o(p.elem,h);p.end=g(p.end)}p.elem.style[h]="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 x={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,h,p,r,s){return b.easing[b.easing.def](m,h,p,r,s)},easeInQuad:function(m,h,p,r,s){return r*(h/=s)*h+p},easeOutQuad:function(m,h,p,r,s){return-r*(h/=s)*(h-2)+p},easeInOutQuad:function(m,h,p,r,s){if((h/=s/2)<1)return r/2*h*h+p;return-r/2*(--h*(h-2)-1)+p},easeInCubic:function(m,h,p,r,s){return r*(h/=s)*h*h+p},easeOutCubic:function(m,
h,p,r,s){return r*((h=h/s-1)*h*h+1)+p},easeInOutCubic:function(m,h,p,r,s){if((h/=s/2)<1)return r/2*h*h*h+p;return r/2*((h-=2)*h*h+2)+p},easeInQuart:function(m,h,p,r,s){return r*(h/=s)*h*h*h+p},easeOutQuart:function(m,h,p,r,s){return-r*((h=h/s-1)*h*h*h-1)+p},easeInOutQuart:function(m,h,p,r,s){if((h/=s/2)<1)return r/2*h*h*h*h+p;return-r/2*((h-=2)*h*h*h-2)+p},easeInQuint:function(m,h,p,r,s){return r*(h/=s)*h*h*h*h+p},easeOutQuint:function(m,h,p,r,s){return r*((h=h/s-1)*h*h*h*h+1)+p},easeInOutQuint:function(m,
h,p,r,s){if((h/=s/2)<1)return r/2*h*h*h*h*h+p;return r/2*((h-=2)*h*h*h*h+2)+p},easeInSine:function(m,h,p,r,s){return-r*Math.cos(h/s*(Math.PI/2))+r+p},easeOutSine:function(m,h,p,r,s){return r*Math.sin(h/s*(Math.PI/2))+p},easeInOutSine:function(m,h,p,r,s){return-r/2*(Math.cos(Math.PI*h/s)-1)+p},easeInExpo:function(m,h,p,r,s){return h==0?p:r*Math.pow(2,10*(h/s-1))+p},easeOutExpo:function(m,h,p,r,s){return h==s?p+r:r*(-Math.pow(2,-10*h/s)+1)+p},easeInOutExpo:function(m,h,p,r,s){if(h==0)return p;if(h==
s)return p+r;if((h/=s/2)<1)return r/2*Math.pow(2,10*(h-1))+p;return r/2*(-Math.pow(2,-10*--h)+2)+p},easeInCirc:function(m,h,p,r,s){return-r*(Math.sqrt(1-(h/=s)*h)-1)+p},easeOutCirc:function(m,h,p,r,s){return r*Math.sqrt(1-(h=h/s-1)*h)+p},easeInOutCirc:function(m,h,p,r,s){if((h/=s/2)<1)return-r/2*(Math.sqrt(1-h*h)-1)+p;return r/2*(Math.sqrt(1-(h-=2)*h)+1)+p},easeInElastic:function(m,h,p,r,s){m=1.70158;var z=0,H=r;if(h==0)return p;if((h/=s)==1)return p+r;z||(z=s*0.3);if(H<Math.abs(r)){H=r;m=z/4}else m=
z/(2*Math.PI)*Math.asin(r/H);return-(H*Math.pow(2,10*(h-=1))*Math.sin((h*s-m)*2*Math.PI/z))+p},easeOutElastic:function(m,h,p,r,s){m=1.70158;var z=0,H=r;if(h==0)return p;if((h/=s)==1)return p+r;z||(z=s*0.3);if(H<Math.abs(r)){H=r;m=z/4}else m=z/(2*Math.PI)*Math.asin(r/H);return H*Math.pow(2,-10*h)*Math.sin((h*s-m)*2*Math.PI/z)+r+p},easeInOutElastic:function(m,h,p,r,s){m=1.70158;var z=0,H=r;if(h==0)return p;if((h/=s/2)==2)return p+r;z||(z=s*0.3*1.5);if(H<Math.abs(r)){H=r;m=z/4}else m=z/(2*Math.PI)*Math.asin(r/
H);if(h<1)return-0.5*H*Math.pow(2,10*(h-=1))*Math.sin((h*s-m)*2*Math.PI/z)+p;return H*Math.pow(2,-10*(h-=1))*Math.sin((h*s-m)*2*Math.PI/z)*0.5+r+p},easeInBack:function(m,h,p,r,s,z){if(z==undefined)z=1.70158;return r*(h/=s)*h*((z+1)*h-z)+p},easeOutBack:function(m,h,p,r,s,z){if(z==undefined)z=1.70158;return r*((h=h/s-1)*h*((z+1)*h+z)+1)+p},easeInOutBack:function(m,h,p,r,s,z){if(z==undefined)z=1.70158;if((h/=s/2)<1)return r/2*h*h*(((z*=1.525)+1)*h-z)+p;return r/2*((h-=2)*h*(((z*=1.525)+1)*h+z)+2)+p},
easeInBounce:function(m,h,p,r,s){return r-b.easing.easeOutBounce(m,s-h,0,r,s)+p},easeOutBounce:function(m,h,p,r,s){return(h/=s)<1/2.75?r*7.5625*h*h+p:h<2/2.75?r*(7.5625*(h-=1.5/2.75)*h+0.75)+p:h<2.5/2.75?r*(7.5625*(h-=2.25/2.75)*h+0.9375)+p:r*(7.5625*(h-=2.625/2.75)*h+0.984375)+p},easeInOutBounce:function(m,h,p,r,s){if(h<s/2)return b.easing.easeInBounce(m,h*2,0,r,s)*0.5+p;return b.easing.easeOutBounce(m,h*2-s,0,r,s)*0.5+r*0.5+p}})}(jQuery);(function(b){b.effects.shake=function(f){return this.queue(function(){var g=b(this),o=["position","top","left"];b.effects.setMode(g,f.options.mode||"effect");var x=f.options.direction||"left",m=f.options.distance||20,h=f.options.times||3,p=f.duration||f.options.duration||140;b.effects.save(g,o);g.show();b.effects.createWrapper(g);var r=x=="up"||x=="down"?"top":"left",s=x=="up"||x=="left"?"pos":"neg";x={};var z={},H={};x[r]=(s=="pos"?"-=":"+=")+m;z[r]=(s=="pos"?"+=":"-=")+m*2;H[r]=(s=="pos"?"-=":"+=")+
m*2;g.animate(x,p,f.options.easing);for(m=1;m<h;m++)g.animate(z,p,f.options.easing).animate(H,p,f.options.easing);g.animate(z,p,f.options.easing).animate(x,p/2,f.options.easing,function(){b.effects.restore(g,o);b.effects.removeWrapper(g);f.callback&&f.callback.apply(this,arguments)});g.queue("fx",function(){g.dequeue()});g.dequeue()})}})(jQuery);(function(b){b.effects.highlight=function(f){return this.queue(function(){var g=b(this),o=["backgroundImage","backgroundColor","opacity"],x=b.effects.setMode(g,f.options.mode||"show"),m=f.options.color||"#ffff99",h=g.css("backgroundColor");b.effects.save(g,o);g.show();g.css({backgroundImage:"none",backgroundColor:m});m={backgroundColor:h};if(x=="hide")m.opacity=0;g.animate(m,{queue:false,duration:f.duration,easing:f.options.easing,complete:function(){x=="hide"&&g.hide();b.effects.restore(g,o);x==
"show"&&b.browser.msie&&this.style.removeAttribute("filter");f.callback&&f.callback.apply(this,arguments);g.dequeue()}})})}})(jQuery);if(!window.console)window.console={};if(!window.console.log)window.console.log=function(){};
(function(b,f){window.LiveNode=function(){function g(I,G,L){H.currentlySyncing=false;L=L||false;if(I=="error"){console.log("LiveNode error");s("error_response2")}else{if(f.interactionMode._state==f.interactionMode._states.BLOCKING){H.interactionDelayedLivedepOperations.push({data:I,textStatus:G});return false}try{b.each(I,function(U,N){var u,A={};b("#"+N.domid+" [w2cid]").each(function(C,F){u=F.getAttribute("w2cid");A[u]=true});b.each(A,function(C){var F=f.interactionMode._changedComponents[C];if(F&&
F!=f.interactionMode._states.OFF)if(L)console.log("forcing override on live update conflict with cid="+C+" on optype = "+N.type);else throw"blocking_interaction_mode";})})}catch(ca){if(typeof ca=="string"&&ca=="blocking_interaction_mode"){f.interactionMode.startBlocking();H.interactionDelayedLivedepOperations.push({data:I,textStatus:G});return false}else throw ca;}b.each(I,function(U,N){switch(N.type){case "set_node":U=b("#"+N.domid);if(!U.length){s("set_node_missing "+N.domid);return}U.setContent(N.content);
switch(N.transition.type){case "none":break;case "highlight":default:U.effect("highlight",{},2E3);break}break;case "insert_node":U=document.getElementById(N.domid);if(!U){s("insert_node_missing "+N.domid);return}var u=document.createElement("DIV");f.setContentHTML(u,N.content);if(u.childNodes.length!=1){console.log("error: append must give a single node");s("append");return}var A=u.childNodes[0];u=A.id;A.style.display="none";U.childNodes.length==N.position?U.appendChild(A):U.insertBefore(A,U.childNodes[N.position]);
f.setContentJS(A,N.content);if(N.transition.type=="none")break;if(N.transition.type=="highlight_only"){b("#"+u).effect("highlight",{},2E3);break}N=b("#"+u).height();A.style.height=0;A.style.overflow="hidden";A.style.clear="both";function C(){A.style.overflow="";A.style.height="";A.style.clear=""}b("#"+u).animate({height:N},200,"linear",C).effect("highlight",{},2E3);break;case "delete_node":U=document.getElementById(N.domid);if(!U){s("delete_node_missing "+N.domid);return}u=U.childNodes[N.position];
if(u.id!=N.child_domid){s("delete_node_wrong_child "+N.child_domid);return}U.removeChild(u);f.removeComponentMetadata(N.child_cid);break;case "error":console.log("livedep error: "+N.error);s("error_response");return;default:console.log("bad op type: "+N.type);s("bad_type")}});S?x():p()}}function o(I,G,L){console.log("on check livedep error: ",I,G,L);if(I.status==500)s("check_livedeps_500");else{H.currentlySyncing=false;z=setTimeout(x,1E3)}}function x(){if(H.currentlySyncing)S=true;else{S=false;if(z){clearTimeout(z);
z=null}H.currentlySyncing=true;(new b.Ajax).url("/check_livedeps/index?window_id="+f.windowId+"&random="+Math.random()).type("GET").dataType("json").success(g).error(o).send()}}function m(){f.interactionMode.resumeUpdates();var I=Math.random(),G={};G._lm_transaction_id=I;G._lm_window_id=f.windowId;d[I]=1;p();return{transactionId:I,data:G}}function h(I){delete d[I];H.currentlySyncing||p()}function p(){var I=0,G;for(G in d)I++;I!=H.pendingMutationCount&&r(I);H.pendingMutationCount=I}function r(I){I>
0?f.Loading.show():f.Loading.hide()}function s(I){console.log("Page requires reload "+I);b.serverLog("reportPageNeedsReload: "+I);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}})}var z=null,H={currentlySyncing:false,interactionDelayedLivedepOperations:[],pendingMutationCount:0},S=false,d={};f._LoadingCls=f.Component.extend({init:function(){this._super.apply(this,
arguments);f.Loading=this;this.t=null},show:function(){var I=this.fnbind(function(){var G=b(".main_content").offset().left;this.$("#@loading").css("left",G+"px").show()});this.t=setTimeout(I,750)},hide:function(){clearTimeout(this.t);this.t=null;this.$("#@loading").hide()}});window.sync_livedeps=function(){console&&console.warn&&console.warn("Still using sync_livedeps (deprecated) ...");x.apply(window,arguments)};window.finished_mutation=function(){console&&console.warn&&console.warn("Still using finished_mutation (deprecated) ...");
h.apply(window,arguments)};b.liveMutate=function(I,G,L,ca){var U=m();(new b.Ajax).url(I).data(b.extend(G,U.data,{formkey:f.RPC.formkey})).dataType(ca||"text").success(function(N,u){L&&typeof L=="function"&&L(N,u)}).error(function(N,u){alert("error: "+u)}).type("POST").send()};return{syncLivedeps:x,startMutation:m,finishedMutation:h,onLivedepOperations:g,reportPageNeedsReload:s,state:H}}()})(jQuery,webnode2);function now_us(){return(new Date).getTime()*1E3}
QTextEditor=W2.Component.extend({onLoad:function(){this.enterCallback=null;if(!this.typingStateCallback)this.typingStateCallback=function(){};this.typingTimeout=null;this.lastTypingReportTime=this.lastInputTime=0;this.lastReportedTypingState="empty";this.typingStopped=false;this.$("#@add_qlink").tooltip({contents:"Link to questions, topics and people."});this.$("#@cmd_blockquote").tooltip({contents:"Blockquote a section of text."});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_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(f){return this.editorKeyDown(f)}));this.$("#@editor").keyup(this.fnbind(function(f){return this.editorKeyUp(f)}));this.$("#@editor").focus(this.fnbind(function(){this.$("#@editor").attr("focused",true)}));this.$("#@editor").blur(this.fnbind(function(){this.$("#@editor").attr("focused",false)}));this.$("#@editor .qlink").click(this.fnbind(function(){var f=this.$("#@editor .qlink").attr("id").substr(6);this.editLink(f);return false}));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}));Q.mobile||this.c("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="",f="abcdefghijklmnopqrstuvwxyz0123456789",g=0;g<10;g++)b+=f[Math.floor(Math.random()*f.length)];return b},syncTypingState:function(){var b=1E7;state=this.isEmpty()||this.typingStopped?"empty":this.lastInputTime<now_us()-b?"paused":"typing";var f=false;if(state!=this.lastReportedTypingState)f=true;if(state!="empty")if(this.lastTypingReportTime<now_us()-55E6)f=true;if(f){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)},editorKeyUp:function(){this.typingStopped=false;this.lastInputTime=now_us();this.syncTypingState()},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 f=
document.selection.createRange();f&&f.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 f=b.parentNode,g=b.previousSibling;if(g==null||g.nodeName!="#text"){g=document.createTextNode("\u00a0");f.insertBefore(g,b)}var o=this.makeKey();g=document.createElement("span");g.id="qlink_"+o;g.contentEditable="false";g.onclick=this.fnbind(function(){this.editLink(o);return false});g.innerHTML=
"...";var x=document.createElement("a");x.contentEditable="false";x.style.textDecoration="none";x.className="qlink";x.href="#";x.appendChild(g);f.insertBefore(x,b);f.removeChild(b);this.qlink_data[o]={target:{},text:""};this.editLink(o)}else alert("Click the textarea before adding a reference.")},editLink:function(b){this.closeEditLink();var f=window.getSelection();this.lastSelectionRange=f.rangeCount?f.getRangeAt(0):null;f=this.qlink_data[b].text;this.$("#@qlink_key").val(b);this.$("#@qlink_text").val(f);
var g=f?"qlink_tab_selector":"";this.editLinkTabs(g);var o=this.$("#@editor_wrapper").offset(),x=this.$("#@editor #qlink_"+b).offset();g=x.left-o.left;o=x.top-o.top;this.$("#@qlink_editor").css("left",g-10);this.$("#@qlink_editor").css("top",o+20);this.$("#@qlink_editor").removeClass("hidden");this.c("link_selector").clear();this.c("link_selector").setText(f);this.c("link_selector").focus();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,
f){this.editLinkTabsReset();this.$("#@"+b).addClass("selected");this.$("#@"+f).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(),f=this.$("#@qlink_text").val();f?this.$("#@editor #qlink_"+b).html(f):this.$("#@editor #qlink_"+b).html("...");var g=this.c("link_selector").result;this.qlink_data[b]={text:f,target:g}},
onLinkSelection:function(){var b=this.c("link_selector").qValue;this.$("#@qlink_text").val(b);this.qlinkSync();this.$("#@editor").focus();b=window.getSelection();b.removeAllRanges();this.lastSelectionRange&&b.addRange(this.lastSelectionRange);this.closeEditLink()},cmd:function(b){this.$("#@editor").focus();this.$("#@cmd_"+b).toggleClass("qtext_editor_button_active");document.execCommand(b,false,false);return false},setEnterCallback:function(b){this.enterCallback=b},setTypingStateCallback:function(b){this.typingStateCallback=
Q.mobile?null:b},serialize:function(){var b=this.html();b=Q.mobile?{html:b,data:{}}:{html:b,data:this.qlink_data};return JSON.stringify(b)},html:function(){if(Q.mobile){var b=this.$("#@editor").val();return b.replace(/\n/g,"<br>")}else return this.$("#@editor").html()},setHtml:function(b){return this.$("#@editor").html(b)},isEmpty:function(){if(Q.mobile)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(Q.mobile)this.$("#@editor").val("");else{this.$("#@editor").html("<br>");this.qlink_data={};this.lastInputTime=now_us();this.syncTypingState()}},stopTyping:function(){if(!Q.mobile){this.typingStopped=true;this.syncTypingState()}},focus:function(){if(Q.mobile){this.$("#@editor").focus();this.$("#@editor").select()}else{this.$("#@editor").focus();this.$("#@editor").attr("focused",true)}},blur:function(){this.$("#@editor").blur();Q.mobile||this.$("#@editor").attr("focused",
false)}});(function(){var b=function(f,g){for(var o=0;o<f.length;o++)if(f[o]==g)return o;return-1};QTextEditor.getCursorPosition=function(){var f;if(window.getSelection){f=window.getSelection();f.getRangeAt(0);return f=b(f.anchorNode.parentNode.childNodes,f.anchorNode)+f.anchorOffset}else if(document.selection){f=document.selection.createRange();f=f.getBookmark();return f=f.charCodeAt(2)-11}}})();
ThreadMessageQTextEditor=QTextEditor.extend({onLoad:function(){this.is_disabled=false;this._super.apply(this,arguments);this.setTypingStateCallback(this.fnbind(function(b){W2.rpc("/ajax/ajax_typing_POST").kwargs({area:"thread-"+this.thread_id,state:b}).send()}));this.setEnterCallback(this.fnbind(function(){this.request()}));this.focus()},request:function(){if(this.is_disabled||this.isEmpty()&&!this.mobile)return false;var b={};b.thread_id=this.thread_id;b.object_id=this.object_id;b.msg=this.isEmpty()&&
this.mobile?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=W2.Component.extend({onLoad:function(){this.$("#@save").click(this.fnbind(function(){var b=this.c(":editor").serialize();$.securepost("/internal/qtexttest/save_POST",{content:b})}))}});function now(){return new Date}
TypeaheadResults=W2.Component.extend({onLoad:function(){function b(o){var x=f.$("#@list_item_"+o);x.mouseover(f.fnbind(function(){f.setFocusIndex(o);return false}));x.mousedown(f.fnbind(function(){f.goResult(o);return false}))}this.hideDropdown();this.focusedIndex=null;for(var f=this,g=0;g<this.results.length;g++)b(g)},hideDropdown:function(){this.$("#@results_frame").hide()},showDropdown:function(){this.$("#@results_frame").show()},hide:function(){this.hideDropdown();this.setFocusIndex(null)},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=W2.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.$("#@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()},requestUpdate:function(){this.requestOutstanding=true;this.requestStartTime=now();var b={q:this.qValue,data:this.data};b.___W2_parentId=this.cid;b.___W2_windowId=W2.windowId;$.ajax({type:"GET",url:this.resultsQueryPath,
dataType:"json",data:b,success:this.fnbind(function(f){this.ajaxCallback(f)}),error:this.fnbind(function(f,g,o){console.log(g,o);this.requestOutstanding=false;this.$("#@results_shell").html("Could not retrieve results: "+g)})})},close:function(){this.closed=true;this.c("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},setValue:function(b,f){this.qValue=b;this.$("#@input").val(this.qValue);this.result=f;this.$("#@input").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 f=now();if(this.requestOutstanding){this.requestOutstanding=false;if(!this.closed){W2.removeComponentMetadata(this.c("results").cid);this.$("#@results_shell").setContent(b);!this.c("results").empty&&this.c("results").query&&this.c("results").showDropdown();b=(now()-this.requestStartTime)/1E3;f=(now()-f)/1E3;console&&console.log("js saw "+b+" ms and "+f+" in callback");this.c("results").query!=this.qValue&&this.requestUpdate()}}},inputKeydown:function(b){b=
b||window.event;var f=this.$("#@input");if(f.val()=="")if(b.keyCode==40||b.keyCode==32){f.blur();return false}if(f.val()==""||f.val()==this.initialValue)if(b.keyCode==34||b.keyCode==18){f.blur();return false}if(b.keyCode==40){this.requestOutstanding=false;this.c("results").down();return false}else if(b.keyCode==38){this.c("results").up();return false}else if(b.keyCode==27){this.c("results").hide();return false}else if(b.keyCode==13)if(this.c("results").go())return false;else if(this.selectionlessCallback&&
this.selectionlessCallback())return false;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.c("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.c("results").showDropdown()}});TopicSelector=Typeahead.extend({onLoad:function(b){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.c(":topic_add").select();this.type!="to_tid"&&this.reset()}));var f=false;$("input, textarea, .qtext_editor_content").each(function(){if($(this).attr("focused")=="true")f=true});!b&&!f&&this.$("#@view_selector").focus()},addTempTopic:function(b){this.$("#@temp_topics_list").append(b)}});
Navigator=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.$("#@add_new_question").click(this.fnbind(function(){this.c(":add_question").triggerClick({q:this.qValue});return false}));this.setSelectionlessCallback(this.fnbind(function(){this.c(":add_question").triggerClick({q:this.qValue})}))}});
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.c(":add_question").triggerClick({q:this.qValue});return false}));this.setSelectionlessCallback(this.fnbind(function(){this.c(":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();$.liveMutate("/question/ajax_add_related_question_POST",{rel_qid:this.rel_qid,qid:this.qid})}));this.setSelectionlessCallback(this.fnbind(function(){this.c(":add_question").triggerClick({q:this.qValue});this.reset()}))}});
RedirectQuestionSelector=Typeahead.extend({onLoad:function(){this._super.apply(this,arguments);this.setCallback(this.fnbind(function(){this.to_qid=this.qValue;this.reset();$.liveMutate("/question/ajax_create_redirect_question_POST",{to_qid:this.to_qid,qid:this.qid},this.fnbind(function(){$("#generic_dialog").remove()}))}))}});
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)}))}});(function(b,f){b.RPC=$.Ajax.extend({__init__:function(g){this._super(b.RPC.defaults);this.options(g);this.__data={args:[],kwargs:{}};this.__success=null;this.error(this.fnbind(this._defaultErrorHandler));this.__exceptionPatterns={};this.__exceptionCatchAll=null;this.__liveMutation=false;this.options(g)},liveMutate:function(){this.__liveMutation=true;return this},send:function(){if(this.__liveMutation)this.__liveMutationInfo=f.startMutation();return this._super()},_defaultErrorHandler:function(){this._throwError("Unhandled error response from server: "+
JSON.stringify(arguments))},success:function(g){this.__success=g;return this},except:function(g,o){switch(arguments.length){case 1:this.__exceptionCatchAll=g;break;case 2:if(typeof g=="string")this.__exceptionPatterns[g]=o;else $.each(g,this.fnbind(function(x,m){this.__exceptionPatterns[m]=o}));break;default:this._throwError("The except method takes either (<pattern>, <callback>) or (<default-callback>) as arguments.")}return this},args:function(){var g=[],o;for(o=0;o<arguments.length;o++)g.push(arguments[o]);
this.__data.args=g;return this},kwargs:function(g){this.__data.kwargs=g;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 g={json:JSON.stringify(this.__data),formkey:b.RPC.formkey,window_id:b.windowId};this.__liveMutation&&$.extend(g,this.__liveMutationInfo.data);return g},success:function(g){this.__success=g;return this},_successWrapper:function(g){if(g.pmsg)if(b.pmsgContainer)b.pmsgContainer.setContent(g.pmsg,true);else console&&console.warn&&console.warn("Received a piggybacking pmsg but there's no pmsgContainer present on this page; dropping the pmsg.");if(g.exception)return this._handleException(g);else if(typeof this.__success==
"function")return this.__success(g.value)},_success:function(){return this.fnbind(this._successWrapper)},_throwError:function(g){console&&console.error&&console.error(g);throw new Error(g);},_handleException:function(g){var o=this.__exceptionPatterns[g.exception.type];if(o)this._invokeExceptionCallback(o,g);else if(this.__exceptionCatchAll)this._invokeExceptionCallback(this.__exceptionCatchAll,g);else{console&&console.error&&console.error("Unhandled ClientError of type '"+g.exception.type+"' sent from server: "+
JSON.stringify(g.exception)+".  Falling back to error handler.");return this._error()(g)}},_invokeExceptionCallback:function(g,o){return g(o.exception,o)}});b.RPC.defaults={type:"POST",dataType:"json"};b.rpc=function(g){return(new b.RPC).url(g)};b.rpc.init=function(g){b.RPC.formkey=g.formkey;b._Controller.viewControllerURL=g.viewControllerURL};b._Controller=b.RPC.extend({__init__:function(g,o){this._super();this.__vcon=g;this.__vcon_method=o;if(b._Controller.viewControllerURL)this.url(b._Controller.viewControllerURL);
else throw new Error("viewControllerURL not set in W2.rpc.init(<opts>);");},_data:function(){var g=this._super();if(this.__vcon){g.__vcon_json=JSON.stringify(this.__vcon);g.__vcon_method=this.__vcon_method}else throw new Error("vcon not set; can't call a view controller.");return g}})})(webnode2,LiveNode);(function(b){b.serverLog=function(f,g,o,x){var m=W2.rpc("/ajax/server_log_POST").kwargs({message:f,level:g,other:o}).error(function(){console.log("Couldn't log error message: '"+f+"' on server.  Meta-failure :(")}).send();if(x!==false){switch(g){case "DEBUG":g=function(h){console.debug(h)};break;case "INFO":g=function(h){console.info(h)};break;case "WARNING":g=function(h){console.warn(h)};break;case "ERROR":case "CRITICAL":g=function(h){console.error(h)};break;default:g=function(h){console.log(h)}}if(typeof g!=
"function"){g=function(h){console.log(h)};if(typeof g!="function")return}g("[$.serverLog] "+f+" "+JSON.stringify(o))}return m};window.Quora=window.Quora||{};(function(f){f.FB=f.FB||{};f.FB.init=function(g){f.FB.api_key=g;FB.init({apiKey:g});FB.Event.subscribe("auth.sessionChange",function(){f.FB.updateAuth()});b(document).ready(function(){setTimeout(function(){FB.getLoginStatus()},1)})};f.FB.updateAuth=function(){FB.getLoginStatus(function(g){if(g&&g.status=="connected"){var o=new Date(g.session.expires*
1E3),x="/facebook/";o={expires:o,path:x};f.cookie("fb_uid",g.session.uid,o);f.cookie("fb_session_key",g.session.session_key,o)}else{o={expires:-1,path:"/facebook/"};f.cookie("fb_uid",null,o);f.cookie("fb_session_key",null,o)}b(document).trigger("fbupdateauth")})};f.FB._disconnect=function(){FB.getLoginStatus(function(g){g.session?FB.api({method:"auth.revokeAuthorization"},function(o){o?console.log("Successfully disconnected"):console.error("Disconnection failed")},console.error):console.warn("Already not connected")})};
f.cookie=function(g,o,x){x=x||{};x=b.extend({expires:999999,path:"/",domain:".quora.com"},x);return b.cookie(f.cookiePrefix+"-"+g,o,x)}})(window.Quora);window.Q=window.Q||window.Quora})(jQuery);(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 f=this.$("#@toggle").click(this.fnbind(function(){this.toggle();return false}));this._showMore=false;this.show_link&&f.show();this.$("#@on_msg").show();this._state=0;document.addEventListener("keydown",
this.fnbind(function(g){switch(this._state){case 0:this._state=1*(g.keyCode==87);break;case 1:this._state=2*(g.keyCode==50);break;case 2:this._state=3*(g.keyCode==87);break;case 3:if(this._state=4*(g.keyCode==50)){this.toggle();this._state=0}break;default:this._state=0}if(this._active)switch(g.keyCode){case 81:case 27:this.off();break;case 84:if(g=this._lastHighlightedCID){window.this_=b._components[g];if(window.this_)console.info("`this_` is now set to the JS Component for cid "+g);else{b._safeGetComponentByCID(g);
console.warn("No JS Component exists for cid "+g+" 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:g=this._lastHighlightedCID;$("["+this._ANNOTATION_ATTR+"="+g+"]").effect("highlight",1E3);break;case 72:alert("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(f,g){var o=g.target,x=$("["+this._ANNOTATION_ATTR+"="+f+"]");x.addClass("__w2inspector_highlight");x.offset();var m=b._components[f];x=g.pageY-80;if(x<0)x=g.pageY+20;var h=function(z){if(z.substr(0,13)=="__w2inspector")return"";if(z.substr(0,5+f.length)=="__w2_"+f)z="@"+
z.substr(6+f.length);return z},p=o.tagName,r;if(r=o.id)p+=" id="+h(r);if(o=o.className)if(o=$.map(o.split(/\s+/),h).join(" ").replace(/^\s+|\s+$/g,""))p+=" class="+o;o=$("<div></div>");h=b._debugInfo[f];r=f;var s=null;if(h){s=h.inst;r=h.live_class?h.py_class+" ("+h.live_class+")":h.py_class;r+=" <span style='color: gray;'>"+f+"</span"}o.append($("<h2>"+r+"</h2>"));s&&o.append($("<pre style='font-size: 0.7em;'></pre>").addClass("__w2inspector_code").text(s));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[f])));r.append($("<h4>All Children</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(b._allChildren[f])));r.append($("<h4>Knows About</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(JSON.stringify(b._knowsAbout[f])));r.append($("<h4>Parent</h4>")).append($("<div></div>").addClass("__w2inspector_small_code").text(b._parents[f]));
this._showMore&&o.append(r);h&&o.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(h.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(h.init_time_ms+"ms").addClass("__w2inspector_code"));m=$("["+this._ANNOTATION_ATTR+
"="+f+"]").length;o.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(o.css("top",-9999).css("left",-9999));m=o.height();m=o.width();h=window.innerWidth;r=g.pageX;p=g.pageY;g=r+20;if(r+40+m>h){m=h-r-40;o.width(m)}m=o.height();p=p-20-m;if(p>=10)x=p;$("#__w2inspector_label").html(o.remove().html()).css("top",x).css("left",g).show();this._lastHighlightedCID=f},unhighlightCID:function(f){$("["+
this._ANNOTATION_ATTR+"="+f+"]").removeClass("__w2inspector_highlight");$("#__w2inspector_label").hide()},on:function(){if(this._active)console.warn("Component Inspector already active.  Not turning on.");else{this._msgFlash("Component Inspector On");$("body").bind("mouseover.w2inspector",this.fnbind(function(f){var g=f.target.getAttribute(this._ANNOTATION_ATTR);g&&this.highlightCID(g,f);this._lastNodeOver=f.target})).bind("mouseout.w2inspector",this.fnbind(function(f){var g=f.target.getAttribute(this._ANNOTATION_ATTR);
g&&this.unhighlightCID(g);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.")},
toggle:function(){return this._active?this.off():this.on()},_msgFlash:function(f){this.$("#@msg").html(f).fadeIn(400,this.fnbind(function(){setTimeout(this.fnbind(function(){this.$("#@msg").fadeOut(400)}),200)}))}})})(webnode2);(function(b,f){b._InteractionModeCls=b.Component.extend({init:function(){this._super.apply(this,arguments);b.interactionMode=this;this._changedComponents={};this._cidToDomId={}},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(g,o){g=o.parents;$.each(g,this.fnbind(function(x){x=(new W2.VirtualComponent(x)).$("%@interaction");
this.bindInteractionMode(x)}))}));this.$("#@resume").click(this.fnbind(function(){this.resumeUpdates();return false}))},updateStateForLastFocusedDOMElement:function(g){if(!g)return false;if(this._state==this._states.PENDING){var o=g.getAttribute("w2cid");if(this._lastVal==this._val(g)){this._changedComponents[o]=this._states.OFF;return false}else{this._changedComponents[o]=this._states.ON;this._cidToDomId[o]=this._getLiveDOMIdForElement(g);return true}}return false},_getLiveDOMIdForElement:function(g){if(g.id)if(g.id.substr(0,
3)=="ld_")return g.id;return g.parentNode?this._getLiveDOMIdForElement(g.parentNode):null},startBlocking:function(){this.showBanner();this._state=this._states.BLOCKING},bindInteractionMode:function(g){g.bind("focus.w2interactionmode",this.fnbind(function(o){var x=o.target.getAttribute("w2cid");this._lastVal=this._val(o.target);this._lastDOMNode=o.target;if(this._state==this._states.OFF&&f.state.pendingMutationCount==0)this._state=this._changedComponents[x]=this._states.PENDING})).bind("blur.w2interactionmode",
this.fnbind(function(o){o.target.getAttribute("w2cid");switch(this._state){case this._states.PENDING:this.updateStateForLastFocusedDOMElement(o.target);this._state=this._lastVal==this._val(o.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(g){g=$(g);return g.is(":input")?g.val():g.html()},_setVal:function(g,o){g=$(g);g.is(":input")?
g.val(o):g.html(o)},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 g=f.state.interactionDelayedLivedepOperations;g.length>0;){var o=g.shift();f.onLivedepOperations(o.data,o.textStatus,true)}}})})(W2,LiveNode);

