/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(Aq,z){function A2(){if(!AI.isReady){try{AA.documentElement.doScroll("left")}catch(A){setTimeout(A2,1);return }AI.ready()}}function x(F,A){A.src?AI.ajax({url:A.src,async:false,dataType:"script"}):AI.globalEval(A.text||A.textContent||A.innerHTML||"");A.parentNode&&A.parentNode.removeChild(A)}function AQ(F,A,O,K,L,G){var J=F.length;if(typeof A==="object"){for(var N in A){AQ(F,N,A[N],K,L,O)}return F}if(O!==z){K=!G&&K&&AI.isFunction(O);for(N=0;N<J;N++){L(F[N],A,K?O.call(F[N],N,L(F[N],A)):O,G)}return F}return J?L(F[0],A):z}function Ah(){return(new Date).getTime()}function AP(){return false}function AN(){return true}function Am(F,A,G){G[0].type=F;return AI.event.handle.apply(A,G)}function AH(R){var Q,P=[],N=[],O=arguments,K,L,F,J,G,A;L=AI.data(this,"events");if(!(R.liveFired===this||!L||!L.live||R.button&&R.type==="click")){R.liveFired=this;var T=L.live.slice(0);for(J=0;J<T.length;J++){L=T[J];L.origType.replace(AZ,"")===R.type?N.push(L.selector):T.splice(J--,1)}K=AI(R.target).closest(N,R.currentTarget);G=0;for(A=K.length;G<A;G++){for(J=0;J<T.length;J++){L=T[J];if(K[G].selector===L.selector){F=K[G].elem;N=null;if(L.preType==="mouseenter"||L.preType==="mouseleave"){N=AI(R.relatedTarget).closest(L.selector)[0]}if(!N||N!==F){P.push({elem:F,handleObj:L})}}}}G=0;for(A=P.length;G<A;G++){K=P[G];R.currentTarget=K.elem;R.data=K.handleObj.data;R.handleObj=K.handleObj;if(K.handleObj.origHandler.apply(K.elem,O)===false){Q=false;break}}return Q}}function q(F,A){return"live."+(F&&F!=="*"?F+".":"")+A.replace(/\./g,"`").replace(/ /g,"&")}function b(A){return !A||!A.parentNode||A.parentNode.nodeType===11}function BJ(F,A){var G=0;A.each(function(){if(this.nodeName===(F[G]&&F[G].nodeName)){var L=AI.data(F[G++]),N=AI.data(this,L);if(L=L&&L.events){delete N.handle;N.events={};for(var J in L){for(var K in L[J]){AI.event.add(this,J,L[J][K],L[J][K].data)}}}}})}function A5(F,A,L){var J,K,G;A=A&&A[0]?A[0].ownerDocument||A[0]:AA;if(F.length===1&&typeof F[0]==="string"&&F[0].length<512&&A===AA&&!Ar.test(F[0])&&(AI.support.checkClone||!AL.test(F[0]))){K=true;if(G=AI.fragments[F[0]]){if(G!==1){J=G}}}if(!J){J=A.createDocumentFragment();AI.clean(F,A,J,L)}if(K){AI.fragments[F[0]]=G?J:1}return{fragment:J,cacheable:K}}function Ae(F,A){var G={};AI.each(v.concat.apply([],v.slice(0,A)),function(){G[this]=F});return G}function f(A){return"scrollTo" in A&&A.document?A:A.nodeType===9?A.defaultView||A.parentWindow:false}var AI=function(F,A){return new AI.fn.init(F,A)},g=Aq.jQuery,D=Aq.$,AA=Aq.document,AT,A9=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Av=/^.[^:#\[\.,]*$/,AO=/\S/,y=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,AX=navigator.userAgent,C=false,AV=[],Ad,A3=Object.prototype.toString,Ax=Object.prototype.hasOwnProperty,AY=Array.prototype.push,AU=Array.prototype.slice,A8=Array.prototype.indexOf;AI.fn=AI.prototype={init:function(F,A){var J,G;if(!F){return this}if(F.nodeType){this.context=this[0]=F;this.length=1;return this}if(F==="body"&&!A){this.context=AA;this[0]=AA.body;this.selector="body";this.length=1;return this}if(typeof F==="string"){if((J=A9.exec(F))&&(J[1]||!A)){if(J[1]){G=A?A.ownerDocument||A:AA;if(F=h.exec(F)){if(AI.isPlainObject(A)){F=[AA.createElement(F[1])];AI.fn.attr.call(F,A,true)}else{F=[G.createElement(F[1])]}}else{F=A5([J[1]],[G]);F=(F.cacheable?F.fragment.cloneNode(true):F.fragment).childNodes}return AI.merge(this,F)}else{if(A=AA.getElementById(J[2])){if(A.id!==J[2]){return AT.find(F)}this.length=1;this[0]=A}this.context=AA;this.selector=F;return this}}else{if(!A&&/^\w+$/.test(F)){this.selector=F;this.context=AA;F=AA.getElementsByTagName(F);return AI.merge(this,F)}else{return !A||A.jquery?(A||AT).find(F):AI(A).find(F)}}}else{if(AI.isFunction(F)){return AT.ready(F)}}if(F.selector!==z){this.selector=F.selector;this.context=F.context}return AI.makeArray(F,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return AU.call(this,0)},get:function(A){return A==null?this.toArray():A<0?this.slice(A)[0]:this[A]},pushStack:function(F,A,J){var G=AI();AI.isArray(F)?AY.apply(G,F):AI.merge(G,F);G.prevObject=this;G.context=this.context;if(A==="find"){G.selector=this.selector+(this.selector?" ":"")+J}else{if(A){G.selector=this.selector+"."+A+"("+J+")"}}return G},each:function(F,A){return AI.each(this,F,A)},ready:function(A){AI.bindReady();if(AI.isReady){A.call(AA,AI)}else{AV&&AV.push(A)}return this},eq:function(A){return A===-1?this.slice(A):this.slice(A,+A+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(AU.apply(this,arguments),"slice",AU.call(arguments).join(","))},map:function(A){return this.pushStack(AI.map(this,function(F,G){return A.call(F,G,F)}))},end:function(){return this.prevObject||AI(null)},push:AY,sort:[].sort,splice:[].splice};AI.fn.init.prototype=AI.fn;AI.extend=AI.fn.extend=function(){var F=arguments[0]||{},A=1,O=arguments.length,K=false,L,G,J,N;if(typeof F==="boolean"){K=F;F=arguments[1]||{};A=2}if(typeof F!=="object"&&!AI.isFunction(F)){F={}}if(O===A){F=this;--A}for(;A<O;A++){if((L=arguments[A])!=null){for(G in L){J=F[G];N=L[G];if(F!==N){if(K&&N&&(AI.isPlainObject(N)||AI.isArray(N))){J=J&&(AI.isPlainObject(J)||AI.isArray(J))?J:AI.isArray(N)?[]:{};F[G]=AI.extend(K,J,N)}else{if(N!==z){F[G]=N}}}}}}return F};AI.extend({noConflict:function(A){Aq.$=D;if(A){Aq.jQuery=g}return AI},isReady:false,ready:function(){if(!AI.isReady){if(!AA.body){return setTimeout(AI.ready,13)}AI.isReady=true;if(AV){for(var F,A=0;F=AV[A++];){F.call(AA,AI)}AV=null}AI.fn.triggerHandler&&AI(AA).triggerHandler("ready")}},bindReady:function(){if(!C){C=true;if(AA.readyState==="complete"){return AI.ready()}if(AA.addEventListener){AA.addEventListener("DOMContentLoaded",Ad,false);Aq.addEventListener("load",AI.ready,false)}else{if(AA.attachEvent){AA.attachEvent("onreadystatechange",Ad);Aq.attachEvent("onload",AI.ready);var F=false;try{F=Aq.frameElement==null}catch(A){}AA.documentElement.doScroll&&F&&A2()}}}},isFunction:function(A){return A3.call(A)==="[object Function]"},isArray:function(A){return A3.call(A)==="[object Array]"},isPlainObject:function(F){if(!F||A3.call(F)!=="[object Object]"||F.nodeType||F.setInterval){return false}if(F.constructor&&!Ax.call(F,"constructor")&&!Ax.call(F.constructor.prototype,"isPrototypeOf")){return false}var A;for(A in F){}return A===z||Ax.call(F,A)},isEmptyObject:function(F){for(var A in F){return false}return true},error:function(A){throw A},parseJSON:function(A){if(typeof A!=="string"||!A){return null}A=AI.trim(A);if(/^[\],:{}\s]*$/.test(A.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return Aq.JSON&&Aq.JSON.parse?Aq.JSON.parse(A):(new Function("return "+A))()}else{AI.error("Invalid JSON: "+A)}},noop:function(){},globalEval:function(F){if(F&&AO.test(F)){var A=AA.getElementsByTagName("head")[0]||AA.documentElement,G=AA.createElement("script");G.type="text/javascript";if(AI.support.scriptEval){G.appendChild(AA.createTextNode(F))}else{G.text=F}A.insertBefore(G,A.firstChild);A.removeChild(G)}},nodeName:function(F,A){return F.nodeName&&F.nodeName.toUpperCase()===A.toUpperCase()},each:function(F,A,N){var K,L=0,G=F.length,J=G===z||AI.isFunction(F);if(N){if(J){for(K in F){if(A.apply(F[K],N)===false){break}}}else{for(;L<G;){if(A.apply(F[L++],N)===false){break}}}}else{if(J){for(K in F){if(A.call(F[K],K,F[K])===false){break}}}else{for(N=F[0];L<G&&A.call(N,L,N)!==false;N=F[++L]){}}}return F},trim:function(A){return(A||"").replace(y,"")},makeArray:function(F,A){A=A||[];if(F!=null){F.length==null||typeof F==="string"||AI.isFunction(F)||typeof F!=="function"&&F.setInterval?AY.call(A,F):AI.merge(A,F)}return A},inArray:function(F,A){if(A.indexOf){return A.indexOf(F)}for(var J=0,G=A.length;J<G;J++){if(A[J]===F){return J}}return -1},merge:function(F,A){var K=F.length,G=0;if(typeof A.length==="number"){for(var J=A.length;G<J;G++){F[K++]=A[G]}}else{for(;A[G]!==z;){F[K++]=A[G++]}}F.length=K;return F},grep:function(F,A,L){for(var J=[],K=0,G=F.length;K<G;K++){!L!==!A(F[K],K)&&J.push(F[K])}return J},map:function(F,A,N){for(var K=[],L,G=0,J=F.length;G<J;G++){L=A(F[G],G,N);if(L!=null){K[K.length]=L}}return K.concat.apply([],K)},guid:1,proxy:function(F,A,G){if(arguments.length===2){if(typeof A==="string"){G=F;F=G[A];A=z}else{if(A&&!AI.isFunction(A)){G=A;A=z}}}if(!A&&F){A=function(){return F.apply(G||this,arguments)}}if(F){A.guid=F.guid=F.guid||A.guid||AI.guid++}return A},uaMatch:function(A){A=A.toLowerCase();A=/(webkit)[ \/]([\w.]+)/.exec(A)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(A)||/(msie) ([\w.]+)/.exec(A)||!/compatible/.test(A)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(A)||[];return{browser:A[1]||"",version:A[2]||"0"}},browser:{}});AX=AI.uaMatch(AX);if(AX.browser){AI.browser[AX.browser]=true;AI.browser.version=AX.version}if(AI.browser.webkit){AI.browser.safari=true}if(A8){AI.inArray=function(F,A){return A8.call(A,F)}}AT=AI(AA);if(AA.addEventListener){Ad=function(){AA.removeEventListener("DOMContentLoaded",Ad,false);AI.ready()}}else{if(AA.attachEvent){Ad=function(){if(AA.readyState==="complete"){AA.detachEvent("onreadystatechange",Ad);AI.ready()}}}}(function(){AI.support={};var P=AA.documentElement,O=AA.createElement("script"),N=AA.createElement("div"),K="script"+Ah();N.style.display="none";N.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var L=N.getElementsByTagName("*"),G=N.getElementsByTagName("a")[0];if(!(!L||!L.length||!G)){AI.support={leadingWhitespace:N.firstChild.nodeType===3,tbody:!N.getElementsByTagName("tbody").length,htmlSerialize:!!N.getElementsByTagName("link").length,style:/red/.test(G.getAttribute("style")),hrefNormalized:G.getAttribute("href")==="/a",opacity:/^0.55$/.test(G.style.opacity),cssFloat:!!G.style.cssFloat,checkOn:N.getElementsByTagName("input")[0].value==="on",optSelected:AA.createElement("select").appendChild(AA.createElement("option")).selected,parentNode:N.removeChild(N.appendChild(AA.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};O.type="text/javascript";try{O.appendChild(AA.createTextNode("window."+K+"=1;"))}catch(J){}P.insertBefore(O,P.firstChild);if(Aq[K]){AI.support.scriptEval=true;delete Aq[K]}try{delete O.test}catch(A){AI.support.deleteExpando=false}P.removeChild(O);if(N.attachEvent&&N.fireEvent){N.attachEvent("onclick",function F(){AI.support.noCloneEvent=false;N.detachEvent("onclick",F)});N.cloneNode(true).fireEvent("onclick")}N=AA.createElement("div");N.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";P=AA.createDocumentFragment();P.appendChild(N.firstChild);AI.support.checkClone=P.cloneNode(true).cloneNode(true).lastChild.checked;AI(function(){var Q=AA.createElement("div");Q.style.width=Q.style.paddingLeft="1px";AA.body.appendChild(Q);AI.boxModel=AI.support.boxModel=Q.offsetWidth===2;AA.body.removeChild(Q).style.display="none"});P=function(Q){var T=AA.createElement("div");Q="on"+Q;var R=Q in T;if(!R){T.setAttribute(Q,"return;");R=typeof T[Q]==="function"}return R};AI.support.submitBubbles=P("submit");AI.support.changeBubbles=P("change");P=O=N=L=G=null}})();AI.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var Aj="jQuery"+Ah(),E=0,Au={};AI.extend({cache:{},expando:Aj,noData:{embed:true,object:true,applet:true},data:function(F,A,K){if(!(F.nodeName&&AI.noData[F.nodeName.toLowerCase()])){F=F==Aq?Au:F;var G=F[Aj],J=AI.cache;if(!G&&typeof A==="string"&&K===z){return null}G||(G=++E);if(typeof A==="object"){F[Aj]=G;J[G]=AI.extend(true,{},A)}else{if(!J[G]){F[Aj]=G;J[G]={}}}F=J[G];if(K!==z){F[A]=K}return typeof A==="string"?F[A]:F}},removeData:function(F,A){if(!(F.nodeName&&AI.noData[F.nodeName.toLowerCase()])){F=F==Aq?Au:F;var K=F[Aj],G=AI.cache,J=G[K];if(A){if(J){delete J[A];AI.isEmptyObject(J)&&AI.removeData(F)}}else{if(AI.support.deleteExpando){delete F[AI.expando]}else{F.removeAttribute&&F.removeAttribute(AI.expando)}delete G[K]}}}});AI.fn.extend({data:function(F,A){if(typeof F==="undefined"&&this.length){return AI.data(this[0])}else{if(typeof F==="object"){return this.each(function(){AI.data(this,F)})}}var J=F.split(".");J[1]=J[1]?"."+J[1]:"";if(A===z){var G=this.triggerHandler("getData"+J[1]+"!",[J[0]]);if(G===z&&this.length){G=AI.data(this[0],F)}return G===z&&J[1]?this.data(J[0]):G}else{return this.trigger("setData"+J[1]+"!",[J[0],A]).each(function(){AI.data(this,F,A)})}},removeData:function(A){return this.each(function(){AI.removeData(this,A)})}});AI.extend({queue:function(F,A,J){if(F){A=(A||"fx")+"queue";var G=AI.data(F,A);if(!J){return G||[]}if(!G||AI.isArray(J)){G=AI.data(F,A,AI.makeArray(J))}else{G.push(J)}return G}},dequeue:function(F,A){A=A||"fx";var J=AI.queue(F,A),G=J.shift();if(G==="inprogress"){G=J.shift()}if(G){A==="fx"&&J.unshift("inprogress");G.call(F,function(){AI.dequeue(F,A)})}}});AI.fn.extend({queue:function(F,A){if(typeof F!=="string"){A=F;F="fx"}if(A===z){return AI.queue(this[0],F)}return this.each(function(){var G=AI.queue(this,F,A);F==="fx"&&G[0]!=="inprogress"&&AI.dequeue(this,F)})},dequeue:function(A){return this.each(function(){AI.dequeue(this,A)})},delay:function(F,A){F=AI.fx?AI.fx.speeds[F]||F:F;A=A||"fx";return this.queue(A,function(){var G=this;setTimeout(function(){AI.dequeue(G,A)},F)})},clearQueue:function(A){return this.queue(A||"fx",[])}});var BE=/[\n\t]/g,AC=/\s+/,BA=/\r/g,Ao=/href|src|style/,Aw=/(button|input)/i,AW=/(button|input|object|select|textarea)/i,AB=/^(a|area)$/i,A0=/radio|checkbox/;AI.fn.extend({attr:function(F,A){return AQ(this,F,A,true,AI.attr)},removeAttr:function(A){return this.each(function(){AI.attr(this,A,"");this.nodeType===1&&this.removeAttribute(A)})},addClass:function(P){if(AI.isFunction(P)){return this.each(function(R){var Q=AI(this);Q.addClass(P.call(this,R,Q.attr("class")))})}if(P&&typeof P==="string"){for(var O=(P||"").split(AC),N=0,K=this.length;N<K;N++){var L=this[N];if(L.nodeType===1){if(L.className){for(var G=" "+L.className+" ",J=L.className,A=0,F=O.length;A<F;A++){if(G.indexOf(" "+O[A]+" ")<0){J+=" "+O[A]}}L.className=AI.trim(J)}else{L.className=P}}}}return this},removeClass:function(F){if(AI.isFunction(F)){return this.each(function(P){var Q=AI(this);Q.removeClass(F.call(this,P,Q.attr("class")))})}if(F&&typeof F==="string"||F===z){for(var A=(F||"").split(AC),O=0,K=this.length;O<K;O++){var L=this[O];if(L.nodeType===1&&L.className){if(F){for(var G=(" "+L.className+" ").replace(BE," "),J=0,N=A.length;J<N;J++){G=G.replace(" "+A[J]+" "," ")}L.className=AI.trim(G)}else{L.className=""}}}}return this},toggleClass:function(F,A){var J=typeof F,G=typeof A==="boolean";if(AI.isFunction(F)){return this.each(function(L){var K=AI(this);K.toggleClass(F.call(this,L,K.attr("class"),A),A)})}return this.each(function(){if(J==="string"){for(var O,L=0,N=AI(this),P=A,K=F.split(AC);O=K[L++];){P=G?P:!N.hasClass(O);N[P?"addClass":"removeClass"](O)}}else{if(J==="undefined"||J==="boolean"){this.className&&AI.data(this,"__className__",this.className);this.className=this.className||F===false?"":AI.data(this,"__className__")||""}}})},hasClass:function(F){F=" "+F+" ";for(var A=0,G=this.length;A<G;A++){if((" "+this[A].className+" ").replace(BE," ").indexOf(F)>-1){return true}}return false},val:function(F){if(F===z){var A=this[0];if(A){if(AI.nodeName(A,"option")){return(A.attributes.value||{}).specified?A.value:A.text}if(AI.nodeName(A,"select")){var O=A.selectedIndex,K=[],L=A.options;A=A.type==="select-one";if(O<0){return null}var G=A?O:0;for(O=A?O+1:L.length;G<O;G++){var J=L[G];if(J.selected){F=AI(J).val();if(A){return F}K.push(F)}}return K}if(A0.test(A.type)&&!AI.support.checkOn){return A.getAttribute("value")===null?"on":A.value}return(A.value||"").replace(BA,"")}return z}var N=AI.isFunction(F);return this.each(function(P){var T=AI(this),R=F;if(this.nodeType===1){if(N){R=F.call(this,P,T.val())}if(typeof R==="number"){R+=""}if(AI.isArray(R)&&A0.test(this.type)){this.checked=AI.inArray(T.val(),R)>=0}else{if(AI.nodeName(this,"select")){var Q=AI.makeArray(R);AI("option",this).each(function(){this.selected=AI.inArray(AI(this).val(),Q)>=0});if(!Q.length){this.selectedIndex=-1}}else{this.value=R}}}})}});AI.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(F,A,L,J){if(!F||F.nodeType===3||F.nodeType===8){return z}if(J&&A in AI.attrFn){return AI(F)[A](L)}J=F.nodeType!==1||!AI.isXMLDoc(F);var K=L!==z;A=J&&AI.props[A]||A;if(F.nodeType===1){var G=Ao.test(A);if(A in F&&J&&!G){if(K){A==="type"&&Aw.test(F.nodeName)&&F.parentNode&&AI.error("type property can't be changed");F[A]=L}if(AI.nodeName(F,"form")&&F.getAttributeNode(A)){return F.getAttributeNode(A).nodeValue}if(A==="tabIndex"){return(A=F.getAttributeNode("tabIndex"))&&A.specified?A.value:AW.test(F.nodeName)||AB.test(F.nodeName)&&F.href?0:z}return F[A]}if(!AI.support.style&&J&&A==="style"){if(K){F.style.cssText=""+L}return F.style.cssText}K&&F.setAttribute(A,""+L);F=!AI.support.hrefNormalized&&J&&G?F.getAttribute(A,2):F.getAttribute(A);return F===null?z:F}return AI.style(F,A,L)}});var AZ=/\.(.*)$/,i=function(A){return A.replace(/[^\w\s\.\|`]/g,function(F){return"\\"+F})};AI.event={add:function(T,R,P,N){if(!(T.nodeType===3||T.nodeType===8)){if(T.setInterval&&T!==Aq&&!T.frameElement){T=Aq}var O,K;if(P.handler){O=P;P=O.handler}if(!P.guid){P.guid=AI.guid++}if(K=AI.data(T)){var L=K.events=K.events||{},F=K.handle;if(!F){K.handle=F=function(){return typeof AI!=="undefined"&&!AI.event.triggered?AI.event.handle.apply(F.elem,arguments):z}}F.elem=T;R=R.split(" ");for(var J,G=0,A;J=R[G++];){K=O?AI.extend({},O):{handler:P,data:N};if(J.indexOf(".")>-1){A=J.split(".");J=A.shift();K.namespace=A.slice(0).sort().join(".")}else{A=[];K.namespace=""}K.type=J;K.guid=P.guid;var V=L[J],Q=AI.event.special[J]||{};if(!V){V=L[J]=[];if(!Q.setup||Q.setup.call(T,N,A,F)===false){if(T.addEventListener){T.addEventListener(J,F,false)}else{T.attachEvent&&T.attachEvent("on"+J,F)}}}if(Q.add){Q.add.call(T,K);if(!K.handler.guid){K.handler.guid=P.guid}}V.push(K);AI.event.global[J]=true}T=null}}},global:{},remove:function(W,V,R,P){if(!(W.nodeType===3||W.nodeType===8)){var Q,N=0,O,J,L,K,A,X,T=AI.data(W),F=T&&T.events;if(T&&F){if(V&&V.type){R=V.handler;V=V.type}if(!V||typeof V==="string"&&V.charAt(0)==="."){V=V||"";for(Q in F){AI.event.remove(W,Q+V)}}else{for(V=V.split(" ");Q=V[N++];){K=Q;O=Q.indexOf(".")<0;J=[];if(!O){J=Q.split(".");Q=J.shift();L=new RegExp("(^|\\.)"+AI.map(J.slice(0).sort(),i).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=F[Q]){if(R){K=AI.event.special[Q]||{};for(G=P||0;G<A.length;G++){X=A[G];if(R.guid===X.guid){if(O||L.test(X.namespace)){P==null&&A.splice(G--,1);K.remove&&K.remove.call(W,X)}if(P!=null){break}}}if(A.length===0||P!=null&&A.length===1){if(!K.teardown||K.teardown.call(W,J)===false){Ai(W,Q,T.handle)}delete F[Q]}}else{for(var G=0;G<A.length;G++){X=A[G];if(O||L.test(X.namespace)){AI.event.remove(W,K,X.handler,G);A.splice(G--,1)}}}}}if(AI.isEmptyObject(F)){if(V=T.handle){V.elem=null}delete T.events;delete T.handle;AI.isEmptyObject(T)&&AI.removeData(W)}}}}},trigger:function(Q,P,O,L){var N=Q.type||Q;if(!L){Q=typeof Q==="object"?Q[Aj]?Q:AI.extend(AI.Event(N),Q):AI.Event(N);if(N.indexOf("!")>=0){Q.type=N=N.slice(0,-1);Q.exclusive=true}if(!O){Q.stopPropagation();AI.event.global[N]&&AI.each(AI.cache,function(){this.events&&this.events[N]&&AI.event.trigger(Q,P,this.handle.elem)})}if(!O||O.nodeType===3||O.nodeType===8){return z}Q.result=z;Q.target=O;P=AI.makeArray(P);P.unshift(Q)}Q.currentTarget=O;(L=AI.data(O,"handle"))&&L.apply(O,P);L=O.parentNode||O.ownerDocument;try{if(!(O&&O.nodeName&&AI.noData[O.nodeName.toLowerCase()])){if(O["on"+N]&&O["on"+N].apply(O,P)===false){Q.result=false}}}catch(J){}if(!Q.isPropagationStopped()&&L){AI.event.trigger(Q,P,L,true)}else{if(!Q.isDefaultPrevented()){L=Q.target;var K,A=AI.nodeName(L,"a")&&N==="click",G=AI.event.special[N]||{};if((!G._default||G._default.call(O,Q)===false)&&!A&&!(L&&L.nodeName&&AI.noData[L.nodeName.toLowerCase()])){try{if(L[N]){if(K=L["on"+N]){L["on"+N]=null}AI.event.triggered=true;L[N]()}}catch(F){}if(K){L["on"+N]=K}AI.event.triggered=false}}}},handle:function(F){var A,N,K,L;F=arguments[0]=AI.event.fix(F||Aq.event);F.currentTarget=this;A=F.type.indexOf(".")<0&&!F.exclusive;if(!A){N=F.type.split(".");F.type=N.shift();K=new RegExp("(^|\\.)"+N.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}L=AI.data(this,"events");N=L[F.type];if(L&&N){N=N.slice(0);L=0;for(var G=N.length;L<G;L++){var J=N[L];if(A||K.test(J.namespace)){F.handler=J.handler;F.data=J.data;F.handleObj=J;J=J.handler.apply(this,arguments);if(J!==z){F.result=J;if(J===false){F.preventDefault();F.stopPropagation()}}if(F.isImmediatePropagationStopped()){break}}}}return F.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(F){if(F[Aj]){return F}var A=F;F=AI.Event(A);for(var J=this.props.length,G;J;){G=this.props[--J];F[G]=A[G]}if(!F.target){F.target=F.srcElement||AA}if(F.target.nodeType===3){F.target=F.target.parentNode}if(!F.relatedTarget&&F.fromElement){F.relatedTarget=F.fromElement===F.target?F.toElement:F.fromElement}if(F.pageX==null&&F.clientX!=null){A=AA.documentElement;J=AA.body;F.pageX=F.clientX+(A&&A.scrollLeft||J&&J.scrollLeft||0)-(A&&A.clientLeft||J&&J.clientLeft||0);F.pageY=F.clientY+(A&&A.scrollTop||J&&J.scrollTop||0)-(A&&A.clientTop||J&&J.clientTop||0)}if(!F.which&&(F.charCode||F.charCode===0?F.charCode:F.keyCode)){F.which=F.charCode||F.keyCode}if(!F.metaKey&&F.ctrlKey){F.metaKey=F.ctrlKey}if(!F.which&&F.button!==z){F.which=F.button&1?1:F.button&2?3:F.button&4?2:0}return F},guid:100000000,proxy:AI.proxy,special:{ready:{setup:AI.bindReady,teardown:AI.noop},live:{add:function(A){AI.event.add(this,A.origType,AI.extend({},A,{handler:AH}))},remove:function(F){var A=true,G=F.origType.replace(AZ,"");AI.each(AI.data(this,"events").live||[],function(){if(G===this.origType.replace(AZ,"")){return A=false}});A&&AI.event.remove(this,F.origType,AH)}},beforeunload:{setup:function(F,A,G){if(this.setInterval){this.onbeforeunload=G}return false},teardown:function(F,A){if(this.onbeforeunload===A){this.onbeforeunload=null}}}}};var Ai=AA.removeEventListener?function(F,A,G){F.removeEventListener(A,G,false)}:function(F,A,G){F.detachEvent("on"+A,G)};AI.Event=function(A){if(!this.preventDefault){return new AI.Event(A)}if(A&&A.type){this.originalEvent=A;this.type=A.type}else{this.type=A}this.timeStamp=Ah();this[Aj]=true};AI.Event.prototype={preventDefault:function(){this.isDefaultPrevented=AN;var A=this.originalEvent;if(A){A.preventDefault&&A.preventDefault();A.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=AN;var A=this.originalEvent;if(A){A.stopPropagation&&A.stopPropagation();A.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=AN;this.stopPropagation()},isDefaultPrevented:AP,isPropagationStopped:AP,isImmediatePropagationStopped:AP};var AF=function(F){var A=F.relatedTarget;try{for(;A&&A!==this;){A=A.parentNode}if(A!==this){F.type=F.data;AI.event.handle.apply(this,arguments)}}catch(G){}},n=function(A){A.type=A.data;AI.event.handle.apply(this,arguments)};AI.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(F,A){AI.event.special[F]={setup:function(G){AI.event.add(this,A,G&&G.selector?n:AF,F)},teardown:function(G){AI.event.remove(this,A,G&&G.selector?n:AF)}}});if(!AI.support.submitBubbles){AI.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){AI.event.add(this,"click.specialSubmit",function(F){var A=F.target,G=A.type;if((G==="submit"||G==="image")&&AI(A).closest("form").length){return Am("submit",this,arguments)}});AI.event.add(this,"keypress.specialSubmit",function(F){var A=F.target,G=A.type;if((G==="text"||G==="password")&&AI(A).closest("form").length&&F.keyCode===13){return Am("submit",this,arguments)}})}else{return false}},teardown:function(){AI.event.remove(this,".specialSubmit")}}}if(!AI.support.changeBubbles){var j=/textarea|input|select/i,I,U=function(F){var A=F.type,G=F.value;if(A==="radio"||A==="checkbox"){G=F.checked}else{if(A==="select-multiple"){G=F.selectedIndex>-1?AI.map(F.options,function(J){return J.selected}).join("-"):""}else{if(F.nodeName.toLowerCase()==="select"){G=F.selectedIndex}}}return G},BD=function(F,A){var K=F.target,G,J;if(!(!j.test(K.nodeName)||K.readOnly)){G=AI.data(K,"_change_data");J=U(K);if(F.type!=="focusout"||K.type!=="radio"){AI.data(K,"_change_data",J)}if(!(G===z||J===G)){if(G!=null||J){F.type="change";return AI.event.trigger(F,A,K)}}}};AI.event.special.change={filters:{focusout:BD,click:function(F){var A=F.target,G=A.type;if(G==="radio"||G==="checkbox"||A.nodeName.toLowerCase()==="select"){return BD.call(this,F)}},keydown:function(F){var A=F.target,G=A.type;if(F.keyCode===13&&A.nodeName.toLowerCase()!=="textarea"||F.keyCode===32&&(G==="checkbox"||G==="radio")||G==="select-multiple"){return BD.call(this,F)}},beforeactivate:function(A){A=A.target;AI.data(A,"_change_data",U(A))}},setup:function(){if(this.type==="file"){return false}for(var A in I){AI.event.add(this,A+".specialChange",I[A])}return j.test(this.nodeName)},teardown:function(){AI.event.remove(this,".specialChange");return j.test(this.nodeName)}};I=AI.event.special.change.filters}AA.addEventListener&&AI.each({focus:"focusin",blur:"focusout"},function(F,A){function G(J){J=AI.event.fix(J);J.type=A;return AI.event.handle.call(this,J)}AI.event.special[A]={setup:function(){this.addEventListener(F,G,true)},teardown:function(){this.removeEventListener(F,G,true)}}});AI.each(["bind","one"],function(F,A){AI.fn[A]=function(O,K,L){if(typeof O==="object"){for(var G in O){this[A](G,K,O[G],L)}return this}if(AI.isFunction(K)){L=K;K=z}var J=A==="one"?AI.proxy(L,function(P){AI(this).unbind(P,J);return L.apply(this,arguments)}):L;if(O==="unload"&&A!=="one"){this.one(O,K,L)}else{G=0;for(var N=this.length;G<N;G++){AI.event.add(this[G],O,J,K)}}return this}});AI.fn.extend({unbind:function(F,A){if(typeof F==="object"&&!F.preventDefault){for(var J in F){this.unbind(J,F[J])}}else{J=0;for(var G=this.length;J<G;J++){AI.event.remove(this[J],F,A)}}return this},delegate:function(F,A,J,G){return this.live(A,J,G,F)},undelegate:function(F,A,G){return arguments.length===0?this.unbind("live"):this.die(A,null,G,F)},trigger:function(F,A){return this.each(function(){AI.event.trigger(F,A,this)})},triggerHandler:function(F,A){if(this[0]){F=AI.Event(F);F.preventDefault();F.stopPropagation();AI.event.trigger(F,A,this[0]);return F.result}},toggle:function(F){for(var A=arguments,G=1;G<A.length;){AI.proxy(F,A[G++])}return this.click(AI.proxy(F,function(J){var K=(AI.data(this,"lastToggle"+F.guid)||0)%G;AI.data(this,"lastToggle"+F.guid,K+1);J.preventDefault();return A[K].apply(this,arguments)||false}))},hover:function(F,A){return this.mouseenter(F).mouseleave(A||F)}});var BH={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};AI.each(["live","die"],function(F,A){AI.fn[A]=function(R,P,Q,N){var O,J=0,L,K,G=N||this.selector,T=N?this:AI(this.context);if(AI.isFunction(P)){Q=P;P=z}for(R=(R||"").split(" ");(O=R[J++])!=null;){N=AZ.exec(O);L="";if(N){L=N[0];O=O.replace(AZ,"")}if(O==="hover"){R.push("mouseenter"+L,"mouseleave"+L)}else{K=O;if(O==="focus"||O==="blur"){R.push(BH[O]+L);O+=L}else{O=(BH[O]||O)+L}A==="live"?T.each(function(){AI.event.add(this,q(O,G),{data:P,selector:G,handler:Q,origType:O,origHandler:Q,preType:K})}):T.unbind(q(O,G),Q)}}return this}});AI.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(F,A){AI.fn[A]=function(G){return G?this.bind(A,G):this.trigger(A)};if(AI.attrFn){AI.attrFn[A]=true}});Aq.attachEvent&&!Aq.addEventListener&&Aq.attachEvent("onunload",function(){for(var F in AI.cache){if(AI.cache[F].handle){try{AI.event.remove(AI.cache[F].handle.elem)}catch(A){}}}});(function(){function Z(Ab){for(var Aa="",w,s=0;Ab[s];s++){w=Ab[s];if(w.nodeType===3||w.nodeType===4){Aa+=w.nodeValue}else{if(w.nodeType!==8){Aa+=Z(w.childNodes)}}}return Aa}function Y(BM,BL,Ab,Aa,s,w){s=0;for(var BO=Aa.length;s<BO;s++){var BP=Aa[s];if(BP){BP=BP[BM];for(var BN=false;BP;){if(BP.sizcache===Ab){BN=Aa[BP.sizset];break}if(BP.nodeType===1&&!w){BP.sizcache=Ab;BP.sizset=s}if(BP.nodeName.toLowerCase()===BL){BN=BP;break}BP=BP[BM]}Aa[s]=BN}}}function X(BM,BL,Ab,Aa,s,w){s=0;for(var BO=Aa.length;s<BO;s++){var BP=Aa[s];if(BP){BP=BP[BM];for(var BN=false;BP;){if(BP.sizcache===Ab){BN=Aa[BP.sizset];break}if(BP.nodeType===1){if(!w){BP.sizcache=Ab;BP.sizset=s}if(typeof BL!=="string"){if(BP===BL){BN=true;break}}else{if(Q.filter(BL,[BP]).length>0){BN=BP;break}}}BP=BP[BM]}Aa[s]=BN}}}var V=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,W=0,R=Object.prototype.toString,T=false,O=true;[0,0].sort(function(){O=false;return 0});var Q=function(BO,BN,BL,Ab){BL=BL||[];var w=BN=BN||AA;if(BN.nodeType!==1&&BN.nodeType!==9){return[]}if(!BO||typeof BO!=="string"){return BL}for(var Aa=[],BT,BU,BQ,BM,BS=true,BP=F(BN),BR=BO;(V.exec(""),BT=V.exec(BR))!==null;){BR=BT[3];Aa.push(BT[1]);if(BT[2]){BM=BT[3];break}}if(Aa.length>1&&L.exec(BO)){if(Aa.length===2&&P.relative[Aa[0]]){BU=c(Aa[0]+Aa[1],BN)}else{for(BU=P.relative[Aa[0]]?[BN]:Q(Aa.shift(),BN);Aa.length;){BO=Aa.shift();if(P.relative[BO]){BO+=Aa.shift()}BU=c(BO,BU)}}}else{if(!Ab&&Aa.length>1&&BN.nodeType===9&&!BP&&P.match.ID.test(Aa[0])&&!P.match.ID.test(Aa[Aa.length-1])){BT=Q.find(Aa.shift(),BN,BP);BN=BT.expr?Q.filter(BT.expr,BT.set)[0]:BT.set[0]}if(BN){BT=Ab?{expr:Aa.pop(),set:A(Ab)}:Q.find(Aa.pop(),Aa.length===1&&(Aa[0]==="~"||Aa[0]==="+")&&BN.parentNode?BN.parentNode:BN,BP);BU=BT.expr?Q.filter(BT.expr,BT.set):BT.set;if(Aa.length>0){BQ=A(BU)}else{BS=false}for(;Aa.length;){var s=Aa.pop();BT=s;if(P.relative[s]){BT=Aa.pop()}else{s=""}if(BT==null){BT=BN}P.relative[s](BQ,BT,BP)}}else{BQ=[]}}BQ||(BQ=BU);BQ||Q.error(s||BO);if(R.call(BQ)==="[object Array]"){if(BS){if(BN&&BN.nodeType===1){for(BO=0;BQ[BO]!=null;BO++){if(BQ[BO]&&(BQ[BO]===true||BQ[BO].nodeType===1&&J(BN,BQ[BO]))){BL.push(BU[BO])}}}else{for(BO=0;BQ[BO]!=null;BO++){BQ[BO]&&BQ[BO].nodeType===1&&BL.push(BU[BO])}}}else{BL.push.apply(BL,BQ)}}else{A(BQ,BL)}if(BM){Q(BM,w,BL,Ab);Q.uniqueSort(BL)}return BL};Q.uniqueSort=function(w){if(N){T=O;w.sort(N);if(T){for(var s=1;s<w.length;s++){w[s]===w[s-1]&&w.splice(s--,1)}}}return w};Q.matches=function(w,s){return Q(w,null,null,s)};Q.find=function(BM,BL,Ab){var Aa,s;if(!BM){return[]}for(var w=0,BO=P.order.length;w<BO;w++){var BP=P.order[w];if(s=P.leftMatch[BP].exec(BM)){var BN=s[1];s.splice(1,1);if(BN.substr(BN.length-1)!=="\\"){s[1]=(s[1]||"").replace(/\\/g,"");Aa=P.find[BP](s,BL,Ab);if(Aa!=null){BM=BM.replace(P.match[BP],"");break}}}}Aa||(Aa=BL.getElementsByTagName("*"));return{set:Aa,expr:BM}};Q.filter=function(BP,BO,BM,Ab){for(var w=BP,Aa=[],BV=BO,BW,BS,BN=BO&&BO[0]&&F(BO[0]);BP&&BO.length;){for(var BU in P.filter){if((BW=P.leftMatch[BU].exec(BP))!=null&&BW[2]){var BQ=P.filter[BU],BT,s;s=BW[1];BS=false;BW.splice(1,1);if(s.substr(s.length-1)!=="\\"){if(BV===Aa){Aa=[]}if(P.preFilter[BU]){if(BW=P.preFilter[BU](BW,BV,BM,Aa,Ab,BN)){if(BW===true){continue}}else{BS=BT=true}}if(BW){for(var BL=0;(s=BV[BL])!=null;BL++){if(s){BT=BQ(s,BW,BL,BV);var BR=Ab^!!BT;if(BM&&BT!=null){if(BR){BS=true}else{BV[BL]=false}}else{if(BR){Aa.push(s);BS=true}}}}}if(BT!==z){BM||(BV=Aa);BP=BP.replace(P.match[BU],"");if(!BS){return[]}break}}}}if(BP===w){if(BS==null){Q.error(BP)}else{break}}w=BP}return BV};Q.error=function(s){throw"Syntax error, unrecognized expression: "+s};var P=Q.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(s){return s.getAttribute("href")}},relative:{"+":function(Ab,Aa){var w=typeof Aa==="string",s=w&&!/\W/.test(Aa);w=w&&!s;if(s){Aa=Aa.toLowerCase()}s=0;for(var BL=Ab.length,BM;s<BL;s++){if(BM=Ab[s]){for(;(BM=BM.previousSibling)&&BM.nodeType!==1;){}Ab[s]=w||BM&&BM.nodeName.toLowerCase()===Aa?BM||false:BM===Aa}}w&&Q.filter(Aa,Ab,true)},">":function(Ab,Aa){var w=typeof Aa==="string";if(w&&!/\W/.test(Aa)){Aa=Aa.toLowerCase();for(var s=0,BL=Ab.length;s<BL;s++){var BM=Ab[s];if(BM){w=BM.parentNode;Ab[s]=w.nodeName.toLowerCase()===Aa?w:false}}}else{s=0;for(BL=Ab.length;s<BL;s++){if(BM=Ab[s]){Ab[s]=w?BM.parentNode:BM.parentNode===Aa}}w&&Q.filter(Aa,Ab,true)}},"":function(Ab,Aa,w){var s=W++,BL=X;if(typeof Aa==="string"&&!/\W/.test(Aa)){var BM=Aa=Aa.toLowerCase();BL=Y}BL("parentNode",Aa,s,Ab,BM,w)},"~":function(Ab,Aa,w){var s=W++,BL=X;if(typeof Aa==="string"&&!/\W/.test(Aa)){var BM=Aa=Aa.toLowerCase();BL=Y}BL("previousSibling",Aa,s,Ab,BM,w)}},find:{ID:function(Aa,w,s){if(typeof w.getElementById!=="undefined"&&!s){return(Aa=w.getElementById(Aa[1]))?[Aa]:[]}},NAME:function(Ab,Aa){if(typeof Aa.getElementsByName!=="undefined"){var w=[];Aa=Aa.getElementsByName(Ab[1]);for(var s=0,BL=Aa.length;s<BL;s++){Aa[s].getAttribute("name")===Ab[1]&&w.push(Aa[s])}return w.length===0?null:w}},TAG:function(w,s){return s.getElementsByTagName(w[1])}},preFilter:{CLASS:function(BL,Ab,w,s,BM,BN){BL=" "+BL[1].replace(/\\/g,"")+" ";if(BN){return BL}BN=0;for(var Aa;(Aa=Ab[BN])!=null;BN++){if(Aa){if(BM^(Aa.className&&(" "+Aa.className+" ").replace(/[\t\n]/g," ").indexOf(BL)>=0)){w||s.push(Aa)}else{if(w){Ab[BN]=false}}}}return false},ID:function(s){return s[1].replace(/\\/g,"")},TAG:function(s){return s[1].toLowerCase()},CHILD:function(w){if(w[1]==="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(w[2]==="even"&&"2n"||w[2]==="odd"&&"2n+1"||!/\D/.test(w[2])&&"0n+"+w[2]||w[2]);w[2]=s[1]+(s[2]||1)-0;w[3]=s[3]-0}w[0]=W++;return w},ATTR:function(Ab,Aa,w,s,BL,BM){Aa=Ab[1].replace(/\\/g,"");if(!BM&&P.attrMap[Aa]){Ab[1]=P.attrMap[Aa]}if(Ab[2]==="~="){Ab[4]=" "+Ab[4]+" "}return Ab},PSEUDO:function(Ab,Aa,w,s,BL){if(Ab[1]==="not"){if((V.exec(Ab[3])||"").length>1||/^\w/.test(Ab[3])){Ab[3]=Q(Ab[3],null,null,Aa)}else{Ab=Q.filter(Ab[3],Aa,w,true^BL);w||s.push.apply(s,Ab);return false}}else{if(P.match.POS.test(Ab[0])||P.match.CHILD.test(Ab[0])){return true}}return Ab},POS:function(s){s.unshift(true);return s}},filters:{enabled:function(s){return s.disabled===false&&s.type!=="hidden"},disabled:function(s){return s.disabled===true},checked:function(s){return s.checked===true},selected:function(s){return s.selected===true},parent:function(s){return !!s.firstChild},empty:function(s){return !s.firstChild},has:function(Aa,w,s){return !!Q(s[3],Aa).length},header:function(s){return/h\d/i.test(s.nodeName)},text:function(s){return"text"===s.type},radio:function(s){return"radio"===s.type},checkbox:function(s){return"checkbox"===s.type},file:function(s){return"file"===s.type},password:function(s){return"password"===s.type},submit:function(s){return"submit"===s.type},image:function(s){return"image"===s.type},reset:function(s){return"reset"===s.type},button:function(s){return"button"===s.type||s.nodeName.toLowerCase()==="button"},input:function(s){return/input|select|textarea|button/i.test(s.nodeName)}},setFilters:{first:function(w,s){return s===0},last:function(Ab,Aa,w,s){return Aa===s.length-1},even:function(w,s){return s%2===0},odd:function(w,s){return s%2===1},lt:function(Aa,w,s){return w<s[3]-0},gt:function(Aa,w,s){return w>s[3]-0},nth:function(Aa,w,s){return s[3]-0===w},eq:function(Aa,w,s){return s[3]-0===w}},filter:{PSEUDO:function(Ab,Aa,w,s){var BL=Aa[1],BM=P.filters[BL];if(BM){return BM(Ab,w,Aa,s)}else{if(BL==="contains"){return(Ab.textContent||Ab.innerText||Z([Ab])||"").indexOf(Aa[3])>=0}else{if(BL==="not"){Aa=Aa[3];w=0;for(s=Aa.length;w<s;w++){if(Aa[w]===Ab){return false}}return true}else{Q.error("Syntax error, unrecognized expression: "+BL)}}}},CHILD:function(BL,Ab){var w=Ab[1],s=BL;switch(w){case"only":case"first":for(;s=s.previousSibling;){if(s.nodeType===1){return false}}if(w==="first"){return true}s=BL;case"last":for(;s=s.nextSibling;){if(s.nodeType===1){return false}}return true;case"nth":w=Ab[2];var BM=Ab[3];if(w===1&&BM===0){return true}Ab=Ab[0];var BN=BL.parentNode;if(BN&&(BN.sizcache!==Ab||!BL.nodeIndex)){var Aa=0;for(s=BN.firstChild;s;s=s.nextSibling){if(s.nodeType===1){s.nodeIndex=++Aa}}BN.sizcache=Ab}BL=BL.nodeIndex-BM;return w===0?BL===0:BL%w===0&&BL/w>=0}},ID:function(w,s){return w.nodeType===1&&w.getAttribute("id")===s},TAG:function(w,s){return s==="*"&&w.nodeType===1||w.nodeName.toLowerCase()===s},CLASS:function(w,s){return(" "+(w.className||w.getAttribute("class"))+" ").indexOf(s)>-1},ATTR:function(Ab,Aa){var w=Aa[1];Ab=P.attrHandle[w]?P.attrHandle[w](Ab):Ab[w]!=null?Ab[w]:Ab.getAttribute(w);w=Ab+"";var s=Aa[2];Aa=Aa[4];return Ab==null?s==="!=":s==="="?w===Aa:s==="*="?w.indexOf(Aa)>=0:s==="~="?(" "+w+" ").indexOf(Aa)>=0:!Aa?w&&Ab!==false:s==="!="?w!==Aa:s==="^="?w.indexOf(Aa)===0:s==="$="?w.substr(w.length-Aa.length)===Aa:s==="|="?w===Aa||w.substr(0,Aa.length+1)===Aa+"-":false},POS:function(Ab,Aa,w,s){var BL=P.setFilters[Aa[2]];if(BL){return BL(Ab,w,Aa,s)}}}},L=P.match.POS;for(var G in P.match){P.match[G]=new RegExp(P.match[G].source+/(?![^\[]*\])(?![^\(]*\))/.source);P.leftMatch[G]=new RegExp(/(^(?:.|\r|\n)*?)/.source+P.match[G].source.replace(/\\(\d+)/g,function(w,s){return"\\"+(s-0+1)}))}var A=function(w,s){w=Array.prototype.slice.call(w,0);if(s){s.push.apply(s,w);return s}return w};try{Array.prototype.slice.call(AA.documentElement.childNodes,0)}catch(K){A=function(Ab,Aa){Aa=Aa||[];if(R.call(Ab)==="[object Array]"){Array.prototype.push.apply(Aa,Ab)}else{if(typeof Ab.length==="number"){for(var w=0,s=Ab.length;w<s;w++){Aa.push(Ab[w])}}else{for(w=0;Ab[w];w++){Aa.push(Ab[w])}}}return Aa}}var N;if(AA.documentElement.compareDocumentPosition){N=function(w,s){if(!w.compareDocumentPosition||!s.compareDocumentPosition){if(w==s){T=true}return w.compareDocumentPosition?-1:1}w=w.compareDocumentPosition(s)&4?-1:w===s?0:1;if(w===0){T=true}return w}}else{if("sourceIndex" in AA.documentElement){N=function(w,s){if(!w.sourceIndex||!s.sourceIndex){if(w==s){T=true}return w.sourceIndex?-1:1}w=w.sourceIndex-s.sourceIndex;if(w===0){T=true}return w}}else{if(AA.createRange){N=function(Ab,Aa){if(!Ab.ownerDocument||!Aa.ownerDocument){if(Ab==Aa){T=true}return Ab.ownerDocument?-1:1}var w=Ab.ownerDocument.createRange(),s=Aa.ownerDocument.createRange();w.setStart(Ab,0);w.setEnd(Ab,0);s.setStart(Aa,0);s.setEnd(Aa,0);Ab=w.compareBoundaryPoints(Range.START_TO_END,s);if(Ab===0){T=true}return Ab}}}}(function(){var Aa=AA.createElement("div"),w="script"+(new Date).getTime();Aa.innerHTML="<a name='"+w+"'/>";var s=AA.documentElement;s.insertBefore(Aa,s.firstChild);if(AA.getElementById(w)){P.find.ID=function(Ab,BL,BM){if(typeof BL.getElementById!=="undefined"&&!BM){return(BL=BL.getElementById(Ab[1]))?BL.id===Ab[1]||typeof BL.getAttributeNode!=="undefined"&&BL.getAttributeNode("id").nodeValue===Ab[1]?[BL]:z:[]}};P.filter.ID=function(Ab,BL){var BM=typeof Ab.getAttributeNode!=="undefined"&&Ab.getAttributeNode("id");return Ab.nodeType===1&&BM&&BM.nodeValue===BL}}s.removeChild(Aa);s=Aa=null})();(function(){var s=AA.createElement("div");s.appendChild(AA.createComment(""));if(s.getElementsByTagName("*").length>0){P.find.TAG=function(Ab,Aa){Aa=Aa.getElementsByTagName(Ab[1]);if(Ab[1]==="*"){Ab=[];for(var w=0;Aa[w];w++){Aa[w].nodeType===1&&Ab.push(Aa[w])}Aa=Ab}return Aa}}s.innerHTML="<a href='#'></a>";if(s.firstChild&&typeof s.firstChild.getAttribute!=="undefined"&&s.firstChild.getAttribute("href")!=="#"){P.attrHandle.href=function(w){return w.getAttribute("href",2)}}s=null})();AA.querySelectorAll&&function(){var Aa=Q,w=AA.createElement("div");w.innerHTML="<p class='TEST'></p>";if(!(w.querySelectorAll&&w.querySelectorAll(".TEST").length===0)){Q=function(Ab,BN,BO,BL){BN=BN||AA;if(!BL&&BN.nodeType===9&&!F(BN)){try{return A(BN.querySelectorAll(Ab),BO)}catch(BM){}}return Aa(Ab,BN,BO,BL)};for(var s in Aa){Q[s]=Aa[s]}w=null}}();(function(){var s=AA.createElement("div");s.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!s.getElementsByClassName||s.getElementsByClassName("e").length===0)){s.lastChild.className="e";if(s.getElementsByClassName("e").length!==1){P.order.splice(1,0,"CLASS");P.find.CLASS=function(Ab,Aa,w){if(typeof Aa.getElementsByClassName!=="undefined"&&!w){return Aa.getElementsByClassName(Ab[1])}};s=null}}})();var J=AA.compareDocumentPosition?function(w,s){return !!(w.compareDocumentPosition(s)&16)}:function(w,s){return w!==s&&(w.contains?w.contains(s):true)},F=function(s){return(s=(s?s.ownerDocument||s:0).documentElement)?s.nodeName!=="HTML":false},c=function(Ab,Aa){var w=[],s="",BL;for(Aa=Aa.nodeType?[Aa]:Aa;BL=P.match.PSEUDO.exec(Ab);){s+=BL[0];Ab=Ab.replace(P.match.PSEUDO,"")}Ab=P.relative[Ab]?Ab+"*":Ab;BL=0;for(var BM=Aa.length;BL<BM;BL++){Q(Ab,Aa[BL],w)}return Q.filter(s,w)};AI.find=Q;AI.expr=Q.selectors;AI.expr[":"]=AI.expr.filters;AI.unique=Q.uniqueSort;AI.text=Z;AI.isXMLDoc=F;AI.contains=J})();var H=/Until$/,BB=/^(?:parents|prevUntil|prevAll)/,Ay=/,/;AU=Array.prototype.slice;var An=function(F,A,J){if(AI.isFunction(A)){return AI.grep(F,function(L,K){return !!A.call(L,K,L)===J})}else{if(A.nodeType){return AI.grep(F,function(K){return K===A===J})}else{if(typeof A==="string"){var G=AI.grep(F,function(K){return K.nodeType===1});if(Av.test(A)){return AI.filter(A,G,!J)}else{A=AI.filter(A,G)}}}}return AI.grep(F,function(K){return AI.inArray(K,A)>=0===J})};AI.fn.extend({find:function(F){for(var A=this.pushStack("","find",F),N=0,K=0,L=this.length;K<L;K++){N=A.length;AI.find(F,this[K],A);if(K>0){for(var G=N;G<A.length;G++){for(var J=0;J<N;J++){if(A[J]===A[G]){A.splice(G--,1);break}}}}}return A},has:function(F){var A=AI(F);return this.filter(function(){for(var J=0,G=A.length;J<G;J++){if(AI.contains(this,A[J])){return true}}})},not:function(A){return this.pushStack(An(this,A,false),"not",A)},filter:function(A){return this.pushStack(An(this,A,true),"filter",A)},is:function(A){return !!A&&AI.filter(A,this).length>0},closest:function(P,O){if(AI.isArray(P)){var N=[],K=this[0],L,G={},J;if(K&&P.length){L=0;for(var A=P.length;L<A;L++){J=P[L];G[J]||(G[J]=AI.expr.match.POS.test(J)?AI(J,O||this.context):J)}for(;K&&K.ownerDocument&&K!==O;){for(J in G){L=G[J];if(L.jquery?L.index(K)>-1:AI(K).is(L)){N.push({selector:J,elem:K});delete G[J]}}K=K.parentNode}}return N}var F=AI.expr.match.POS.test(P)?AI(P,O||this.context):null;return this.map(function(R,Q){for(;Q&&Q.ownerDocument&&Q!==O;){if(F?F.index(Q)>-1:AI(Q).is(P)){return Q}Q=Q.parentNode}return null})},index:function(A){if(!A||typeof A==="string"){return AI.inArray(this[0],A?AI(A):this.parent().children())}return AI.inArray(A.jquery?A[0]:A,this)},add:function(F,A){F=typeof F==="string"?AI(F,A||this.context):AI.makeArray(F);A=AI.merge(this.get(),F);return this.pushStack(b(F[0])||b(A[0])?A:AI.unique(A))},andSelf:function(){return this.add(this.prevObject)}});AI.each({parent:function(A){return(A=A.parentNode)&&A.nodeType!==11?A:null},parents:function(A){return AI.dir(A,"parentNode")},parentsUntil:function(F,A,G){return AI.dir(F,"parentNode",G)},next:function(A){return AI.nth(A,2,"nextSibling")},prev:function(A){return AI.nth(A,2,"previousSibling")},nextAll:function(A){return AI.dir(A,"nextSibling")},prevAll:function(A){return AI.dir(A,"previousSibling")},nextUntil:function(F,A,G){return AI.dir(F,"nextSibling",G)},prevUntil:function(F,A,G){return AI.dir(F,"previousSibling",G)},siblings:function(A){return AI.sibling(A.parentNode.firstChild,A)},children:function(A){return AI.sibling(A.firstChild)},contents:function(A){return AI.nodeName(A,"iframe")?A.contentDocument||A.contentWindow.document:AI.makeArray(A.childNodes)}},function(F,A){AI.fn[F]=function(K,G){var J=AI.map(this,A,K);H.test(F)||(G=K);if(G&&typeof G==="string"){J=AI.filter(G,J)}J=this.length>1?AI.unique(J):J;if((this.length>1||Ay.test(G))&&BB.test(F)){J=J.reverse()}return this.pushStack(J,F,AU.call(arguments).join(","))}});AI.extend({filter:function(F,A,G){if(G){F=":not("+F+")"}return AI.find.matches(F,A)},dir:function(F,A,J){var G=[];for(F=F[A];F&&F.nodeType!==9&&(J===z||F.nodeType!==1||!AI(F).is(J));){F.nodeType===1&&G.push(F);F=F[A]}return G},nth:function(F,A,J){A=A||1;for(var G=0;F;F=F[J]){if(F.nodeType===1&&++G===A){break}}return F},sibling:function(F,A){for(var G=[];F;F=F.nextSibling){F.nodeType===1&&F!==A&&G.push(F)}return G}});var AJ=/ jQuery\d+="(?:\d+|null)"/g,AS=/^\s+/,t=/(<([\w:]+)[^>]*?)\/>/g,Af=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,d=/<([\w:]+)/,AD=/<tbody/i,k=/<|&#?\w+;/,Ar=/<script|<object|<embed|<option|<style/i,AL=/checked\s*(?:[^=]|=\s*.checked.)/i,BK=function(F,A,G){return Af.test(G)?F:A+"></"+G+">"},Al={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Al.optgroup=Al.option;Al.tbody=Al.tfoot=Al.colgroup=Al.caption=Al.thead;Al.th=Al.td;if(!AI.support.htmlSerialize){Al._default=[1,"div<div>","</div>"]}AI.fn.extend({text:function(A){if(AI.isFunction(A)){return this.each(function(F){var G=AI(this);G.text(A.call(this,F,G.text()))})}if(typeof A!=="object"&&A!==z){return this.empty().append((this[0]&&this[0].ownerDocument||AA).createTextNode(A))}return AI.text(this)},wrapAll:function(F){if(AI.isFunction(F)){return this.each(function(G){AI(this).wrapAll(F.call(this,G))})}if(this[0]){var A=AI(F,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&A.insertBefore(this[0]);A.map(function(){for(var G=this;G.firstChild&&G.firstChild.nodeType===1;){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(A){if(AI.isFunction(A)){return this.each(function(F){AI(this).wrapInner(A.call(this,F))})}return this.each(function(){var F=AI(this),G=F.contents();G.length?G.wrapAll(A):F.append(A)})},wrap:function(A){return this.each(function(){AI(this).wrapAll(A)})},unwrap:function(){return this.parent().each(function(){AI.nodeName(this,"body")||AI(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(A){this.nodeType===1&&this.appendChild(A)})},prepend:function(){return this.domManip(arguments,true,function(A){this.nodeType===1&&this.insertBefore(A,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(F){this.parentNode.insertBefore(F,this)})}else{if(arguments.length){var A=AI(arguments[0]);A.push.apply(A,this.toArray());return this.pushStack(A,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(F){this.parentNode.insertBefore(F,this.nextSibling)})}else{if(arguments.length){var A=this.pushStack(this,"after",arguments);A.push.apply(A,AI(arguments[0]).toArray());return A}}},remove:function(F,A){for(var J=0,G;(G=this[J])!=null;J++){if(!F||AI.filter(F,[G]).length){if(!A&&G.nodeType===1){AI.cleanData(G.getElementsByTagName("*"));AI.cleanData([G])}G.parentNode&&G.parentNode.removeChild(G)}}return this},empty:function(){for(var F=0,A;(A=this[F])!=null;F++){for(A.nodeType===1&&AI.cleanData(A.getElementsByTagName("*"));A.firstChild;){A.removeChild(A.firstChild)}}return this},clone:function(F){var A=this.map(function(){if(!AI.support.noCloneEvent&&!AI.isXMLDoc(this)){var J=this.outerHTML,G=this.ownerDocument;if(!J){J=G.createElement("div");J.appendChild(this.cloneNode(true));J=J.innerHTML}return AI.clean([J.replace(AJ,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(AS,"")],G)[0]}else{return this.cloneNode(true)}});if(F===true){BJ(this,A);BJ(this.find("*"),A.find("*"))}return A},html:function(F){if(F===z){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(AJ,""):null}else{if(typeof F==="string"&&!Ar.test(F)&&(AI.support.leadingWhitespace||!AS.test(F))&&!Al[(d.exec(F)||["",""])[1].toLowerCase()]){F=F.replace(t,BK);try{for(var A=0,J=this.length;A<J;A++){if(this[A].nodeType===1){AI.cleanData(this[A].getElementsByTagName("*"));this[A].innerHTML=F}}}catch(G){this.empty().append(F)}}else{AI.isFunction(F)?this.each(function(N){var K=AI(this),L=K.html();K.empty().append(function(){return F.call(this,N,L)})}):this.empty().append(F)}}return this},replaceWith:function(A){if(this[0]&&this[0].parentNode){if(AI.isFunction(A)){return this.each(function(F){var J=AI(this),G=J.html();J.replaceWith(A.call(this,F,G))})}if(typeof A!=="string"){A=AI(A).detach()}return this.each(function(){var F=this.nextSibling,G=this.parentNode;AI(this).remove();F?AI(F).before(A):AI(G).append(A)})}else{return this.pushStack(AI(AI.isFunction(A)?A():A),"replaceWith",A)}},detach:function(A){return this.remove(A,true)},domManip:function(R,Q,P){function N(T){return AI.nodeName(T,"table")?T.getElementsByTagName("tbody")[0]||T.appendChild(T.ownerDocument.createElement("tbody")):T}var O,K,L=R[0],F=[],J;if(!AI.support.checkClone&&arguments.length===3&&typeof L==="string"&&AL.test(L)){return this.each(function(){AI(this).domManip(R,Q,P,true)})}if(AI.isFunction(L)){return this.each(function(T){var V=AI(this);R[0]=L.call(this,T,Q?V.html():z);V.domManip(R,Q,P)})}if(this[0]){O=L&&L.parentNode;O=AI.support.parentNode&&O&&O.nodeType===11&&O.childNodes.length===this.length?{fragment:O}:A5(R,this,F);J=O.fragment;if(K=J.childNodes.length===1?(J=J.firstChild):J.firstChild){Q=Q&&AI.nodeName(K,"tr");for(var G=0,A=this.length;G<A;G++){P.call(Q?N(this[G],K):this[G],G>0||O.cacheable||this.length>1?J.cloneNode(true):J)}}F.length&&AI.each(F,x)}return this}});AI.fragments={};AI.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(F,A){AI.fn[F]=function(N){var K=[];N=AI(N);var L=this.length===1&&this[0].parentNode;if(L&&L.nodeType===11&&L.childNodes.length===1&&N.length===1){N[A](this[0]);return this}else{L=0;for(var G=N.length;L<G;L++){var J=(L>0?this.clone(true):this).get();AI.fn[A].apply(AI(N[L]),J);K=K.concat(J)}return this.pushStack(K,F,N.selector)}}});AI.extend({clean:function(R,Q,P,N){Q=Q||AA;if(typeof Q.createElement==="undefined"){Q=Q.ownerDocument||Q[0]&&Q[0].ownerDocument||AA}for(var O=[],K=0,L;(L=R[K])!=null;K++){if(typeof L==="number"){L+=""}if(L){if(typeof L==="string"&&!k.test(L)){L=Q.createTextNode(L)}else{if(typeof L==="string"){L=L.replace(t,BK);var F=(d.exec(L)||["",""])[1].toLowerCase(),J=Al[F]||Al._default,G=J[0],A=Q.createElement("div");for(A.innerHTML=J[1]+L+J[2];G--;){A=A.lastChild}if(!AI.support.tbody){G=AD.test(L);F=F==="table"&&!G?A.firstChild&&A.firstChild.childNodes:J[1]==="<table>"&&!G?A.childNodes:[];for(J=F.length-1;J>=0;--J){AI.nodeName(F[J],"tbody")&&!F[J].childNodes.length&&F[J].parentNode.removeChild(F[J])}}!AI.support.leadingWhitespace&&AS.test(L)&&A.insertBefore(Q.createTextNode(AS.exec(L)[0]),A.firstChild);L=A.childNodes}}if(L.nodeType){O.push(L)}else{O=AI.merge(O,L)}}}if(P){for(K=0;O[K];K++){if(N&&AI.nodeName(O[K],"script")&&(!O[K].type||O[K].type.toLowerCase()==="text/javascript")){N.push(O[K].parentNode?O[K].parentNode.removeChild(O[K]):O[K])}else{O[K].nodeType===1&&O.splice.apply(O,[K+1,0].concat(AI.makeArray(O[K].getElementsByTagName("script"))));P.appendChild(O[K])}}}return O},cleanData:function(P){for(var O,N,K=AI.cache,L=AI.event.special,G=AI.support.deleteExpando,J=0,A;(A=P[J])!=null;J++){if(N=A[AI.expando]){O=K[N];if(O.events){for(var F in O.events){L[F]?AI.event.remove(A,F):Ai(A,F,O.handle)}}if(G){delete A[AI.expando]}else{A.removeAttribute&&A.removeAttribute(AI.expando)}delete K[N]}}}});var M=/z-?index|font-?weight|opacity|zoom|line-?height/i,A6=/alpha\([^)]*\)/,As=/opacity=([^)]*)/,Ag=/float/i,AE=/-([a-z])/ig,BF=/([A-Z])/g,A1=/^-?\d+(?:px)?$/i,Ak=/^-?\d/,AG={position:"absolute",visibility:"hidden",display:"block"},o=["Left","Right"],a=["Top","Bottom"],BI=AA.defaultView&&AA.defaultView.getComputedStyle,AM=AI.support.cssFloat?"cssFloat":"styleFloat",m=function(F,A){return A.toUpperCase()};AI.fn.css=function(F,A){return AQ(this,F,A,true,function(K,G,J){if(J===z){return AI.curCSS(K,G)}if(typeof J==="number"&&!M.test(G)){J+="px"}AI.style(K,G,J)})};AI.extend({style:function(F,A,K){if(!F||F.nodeType===3||F.nodeType===8){return z}if((A==="width"||A==="height")&&parseFloat(K)<0){K=z}var G=F.style||F,J=K!==z;if(!AI.support.opacity&&A==="opacity"){if(J){G.zoom=1;A=parseInt(K,10)+""==="NaN"?"":"alpha(opacity="+K*100+")";F=G.filter||AI.curCSS(F,"filter")||"";G.filter=A6.test(F)?F.replace(A6,A):A}return G.filter&&G.filter.indexOf("opacity=")>=0?parseFloat(As.exec(G.filter)[1])/100+"":""}if(Ag.test(A)){A=AM}A=A.replace(AE,m);if(J){G[A]=K}return G[A]},css:function(F,A,N,K){if(A==="width"||A==="height"){var L,G=A==="width"?o:a;function J(){L=A==="width"?F.offsetWidth:F.offsetHeight;K!=="border"&&AI.each(G,function(){K||(L-=parseFloat(AI.curCSS(F,"padding"+this,true))||0);if(K==="margin"){L+=parseFloat(AI.curCSS(F,"margin"+this,true))||0}else{L-=parseFloat(AI.curCSS(F,"border"+this+"Width",true))||0}})}F.offsetWidth!==0?J():AI.swap(F,AG,J);return Math.max(0,Math.round(L))}return AI.curCSS(F,A,N)},curCSS:function(F,A,L){var J,K=F.style;if(!AI.support.opacity&&A==="opacity"&&F.currentStyle){J=As.test(F.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return J===""?"1":J}if(Ag.test(A)){A=AM}if(!L&&K&&K[A]){J=K[A]}else{if(BI){if(Ag.test(A)){A="float"}A=A.replace(BF,"-$1").toLowerCase();K=F.ownerDocument.defaultView;if(!K){return null}if(F=K.getComputedStyle(F,null)){J=F.getPropertyValue(A)}if(A==="opacity"&&J===""){J="1"}}else{if(F.currentStyle){L=A.replace(AE,m);J=F.currentStyle[A]||F.currentStyle[L];if(!A1.test(J)&&Ak.test(J)){A=K.left;var G=F.runtimeStyle.left;F.runtimeStyle.left=F.currentStyle.left;K.left=L==="fontSize"?"1em":J||0;J=K.pixelLeft+"px";K.left=A;F.runtimeStyle.left=G}}}}return J},swap:function(F,A,K){var G={};for(var J in A){G[J]=F.style[J];F.style[J]=A[J]}K.call(F);for(J in A){F.style[J]=G[J]}}});if(AI.expr&&AI.expr.filters){AI.expr.filters.hidden=function(F){var A=F.offsetWidth,J=F.offsetHeight,G=F.nodeName.toLowerCase()==="tr";return A===0&&J===0&&!G?true:A>0&&J>0&&!G?false:AI.curCSS(F,"display")==="none"};AI.expr.filters.visible=function(A){return !AI.expr.filters.hidden(A)}}var A4=Ah(),Ap=/<script(.|\s)*?\/script>/gi,AK=/select|textarea/i,u=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,Ac=/=\?(&|$)/,S=/\?/,e=/(\?|&)_=.*?(&|$)/,B=/^(\w+:)?\/\/([^\/?#]+)/,A7=/%20/g,At=AI.fn.load;AI.fn.extend({load:function(F,A,L){if(typeof F!=="string"){return At.call(this,F)}else{if(!this.length){return this}}var J=F.indexOf(" ");if(J>=0){var K=F.slice(J,F.length);F=F.slice(0,J)}J="GET";if(A){if(AI.isFunction(A)){L=A;A=null}else{if(typeof A==="object"){A=AI.param(A,AI.ajaxSettings.traditional);J="POST"}}}var G=this;AI.ajax({url:F,type:J,dataType:"html",data:A,complete:function(N,O){if(O==="success"||O==="notmodified"){G.html(K?AI("<div />").append(N.responseText.replace(Ap,"")).find(K):N.responseText)}L&&G.each(L,[N.responseText,O,N])}});return this},serialize:function(){return AI.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?AI.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||AK.test(this.nodeName)||u.test(this.type))}).map(function(F,A){F=AI(this).val();return F==null?null:AI.isArray(F)?AI.map(F,function(G){return{name:A.name,value:G}}):{name:A.name,value:F}}).get()}});AI.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(F,A){AI.fn[A]=function(G){return this.bind(A,G)}});AI.extend({get:function(F,A,J,G){if(AI.isFunction(A)){G=G||J;J=A;A=null}return AI.ajax({type:"GET",url:F,data:A,success:J,dataType:G})},getScript:function(F,A){return AI.get(F,null,A,"script")},getJSON:function(F,A,G){return AI.get(F,A,G,"json")},post:function(F,A,J,G){if(AI.isFunction(A)){G=G||J;J=A;A={}}return AI.ajax({type:"POST",url:F,data:A,success:J,dataType:G})},ajaxSetup:function(A){AI.extend(AI.ajaxSettings,A)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:Aq.XMLHttpRequest&&(Aq.location.protocol!=="file:"||!Aq.ActiveXObject)?function(){return new Aq.XMLHttpRequest}:function(){try{return new Aq.ActiveXObject("Microsoft.XMLHTTP")}catch(A){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(Aa){function w(){c.success&&c.success.call(T,O,W,F);c.global&&Z("ajaxSuccess",[F,c])}function s(){c.complete&&c.complete.call(T,F,W);c.global&&Z("ajaxComplete",[F,c]);c.global&&!--AI.active&&AI.event.trigger("ajaxStop")}function Z(BL,BM){(c.context?AI(c.context):AI.event).trigger(BL,BM)}var c=AI.extend(true,{},AI.ajaxSettings,Aa),V,W,O,T=Aa&&Aa.context||c,P=c.type.toUpperCase();if(c.data&&c.processData&&typeof c.data!=="string"){c.data=AI.param(c.data,c.traditional)}if(c.dataType==="jsonp"){if(P==="GET"){Ac.test(c.url)||(c.url+=(S.test(c.url)?"&":"?")+(c.jsonp||"callback")+"=?")}else{if(!c.data||!Ac.test(c.data)){c.data=(c.data?c.data+"&":"")+(c.jsonp||"callback")+"=?"}}c.dataType="json"}if(c.dataType==="json"&&(c.data&&Ac.test(c.data)||Ac.test(c.url))){V=c.jsonpCallback||"jsonp"+A4++;if(c.data){c.data=(c.data+"").replace(Ac,"="+V+"$1")}c.url=c.url.replace(Ac,"="+V+"$1");c.dataType="script";Aq[V]=Aq[V]||function(BL){O=BL;w();s();Aq[V]=z;try{delete Aq[V]}catch(BM){}A&&A.removeChild(K)}}if(c.dataType==="script"&&c.cache===null){c.cache=false}if(c.cache===false&&P==="GET"){var L=Ah(),G=c.url.replace(e,"$1_="+L+"$2");c.url=G+(G===c.url?(S.test(c.url)?"&":"?")+"_="+L:"")}if(c.data&&P==="GET"){c.url+=(S.test(c.url)?"&":"?")+c.data}c.global&&!AI.active++&&AI.event.trigger("ajaxStart");L=(L=B.exec(c.url))&&(L[1]&&L[1]!==location.protocol||L[2]!==location.host);if(c.dataType==="script"&&P==="GET"&&L){var A=AA.getElementsByTagName("head")[0]||AA.documentElement,K=AA.createElement("script");K.src=c.url;if(c.scriptCharset){K.charset=c.scriptCharset}if(!V){var N=false;K.onload=K.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){N=true;w();s();K.onload=K.onreadystatechange=null;A&&K.parentNode&&A.removeChild(K)}}}A.insertBefore(K,A.firstChild);return z}var J=false,F=c.xhr();if(F){c.username?F.open(P,c.url,c.async,c.username,c.password):F.open(P,c.url,c.async);try{if(c.data||Aa&&Aa.contentType){F.setRequestHeader("Content-Type",c.contentType)}if(c.ifModified){AI.lastModified[c.url]&&F.setRequestHeader("If-Modified-Since",AI.lastModified[c.url]);AI.etag[c.url]&&F.setRequestHeader("If-None-Match",AI.etag[c.url])}L||F.setRequestHeader("X-Requested-With","XMLHttpRequest");F.setRequestHeader("Accept",c.dataType&&c.accepts[c.dataType]?c.accepts[c.dataType]+", */*":c.accepts._default)}catch(Ab){}if(c.beforeSend&&c.beforeSend.call(T,F,c)===false){c.global&&!--AI.active&&AI.event.trigger("ajaxStop");F.abort();return false}c.global&&Z("ajaxSend",[F,c]);var Y=F.onreadystatechange=function(BM){if(!F||F.readyState===0||BM==="abort"){J||s();J=true;if(F){F.onreadystatechange=AI.noop}}else{if(!J&&F&&(F.readyState===4||BM==="timeout")){J=true;F.onreadystatechange=AI.noop;W=BM==="timeout"?"timeout":!AI.httpSuccess(F)?"error":c.ifModified&&AI.httpNotModified(F,c.url)?"notmodified":"success";var BN;if(W==="success"){try{O=AI.httpData(F,c.dataType,c)}catch(BL){W="parsererror";BN=BL}}if(W==="success"||W==="notmodified"){V||w()}else{AI.handleError(c,F,W,BN)}s();BM==="timeout"&&F.abort();if(c.async){F=null}}}};try{var X=F.abort;F.abort=function(){F&&X.call(F);Y("abort")}}catch(R){}c.async&&c.timeout>0&&setTimeout(function(){F&&!J&&Y("timeout")},c.timeout);try{F.send(P==="POST"||P==="PUT"||P==="DELETE"?c.data:null)}catch(Q){AI.handleError(c,F,null,Q);s()}c.async||Y();return F}},handleError:function(F,A,J,G){if(F.error){F.error.call(F.context||F,A,J,G)}if(F.global){(F.context?AI(F.context):AI.event).trigger("ajaxError",[A,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol==="file:"||F.status>=200&&F.status<300||F.status===304||F.status===1223||F.status===0}catch(A){}return false},httpNotModified:function(F,A){var J=F.getResponseHeader("Last-Modified"),G=F.getResponseHeader("Etag");if(J){AI.lastModified[A]=J}if(G){AI.etag[A]=G}return F.status===304||F.status===0},httpData:function(F,A,K){var G=F.getResponseHeader("content-type")||"",J=A==="xml"||!A&&G.indexOf("xml")>=0;F=J?F.responseXML:F.responseText;J&&F.documentElement.nodeName==="parsererror"&&AI.error("parsererror");if(K&&K.dataFilter){F=K.dataFilter(F,A)}if(typeof F==="string"){if(A==="json"||!A&&G.indexOf("json")>=0){F=AI.parseJSON(F)}else{if(A==="script"||!A&&G.indexOf("javascript")>=0){AI.globalEval(F)}}}return F},param:function(F,A){function L(N,O){if(AI.isArray(O)){AI.each(O,function(P,Q){A||/\[\]$/.test(N)?J(N,Q):L(N+"["+(typeof Q==="object"||AI.isArray(Q)?P:"")+"]",Q)})}else{!A&&O!=null&&typeof O==="object"?AI.each(O,function(P,Q){L(N+"["+P+"]",Q)}):J(N,O)}}function J(N,O){O=AI.isFunction(O)?O():O;K[K.length]=encodeURIComponent(N)+"="+encodeURIComponent(O)}var K=[];if(A===z){A=AI.ajaxSettings.traditional}if(AI.isArray(F)||F.jquery){AI.each(F,function(){J(this.name,this.value)})}else{for(var G in F){L(G,F[G])}}return K.join("&").replace(A7,"+")}});var BG={},BC=/toggle|show|hide/,Az=/^([+-]=)?([\d+-.]+)(.*)$/,AR,v=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];AI.fn.extend({show:function(F,A){if(F||F===0){return this.animate(Ae("show",3),F,A)}else{F=0;for(A=this.length;F<A;F++){var K=AI.data(this[F],"olddisplay");this[F].style.display=K||"";if(AI.css(this[F],"display")==="none"){K=this[F].nodeName;var G;if(BG[K]){G=BG[K]}else{var J=AI("<"+K+" />").appendTo("body");G=J.css("display");if(G==="none"){G="block"}J.remove();BG[K]=G}AI.data(this[F],"olddisplay",G)}}F=0;for(A=this.length;F<A;F++){this[F].style.display=AI.data(this[F],"olddisplay")||""}return this}},hide:function(F,A){if(F||F===0){return this.animate(Ae("hide",3),F,A)}else{F=0;for(A=this.length;F<A;F++){var G=AI.data(this[F],"olddisplay");!G&&G!=="none"&&AI.data(this[F],"olddisplay",AI.css(this[F],"display"))}F=0;for(A=this.length;F<A;F++){this[F].style.display="none"}return this}},_toggle:AI.fn.toggle,toggle:function(F,A){var G=typeof F==="boolean";if(AI.isFunction(F)&&AI.isFunction(A)){this._toggle.apply(this,arguments)}else{F==null||G?this.each(function(){var J=G?F:AI(this).is(":hidden");AI(this)[J?"show":"hide"]()}):this.animate(Ae("toggle",3),F,A)}return this},fadeTo:function(F,A,G){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:A},F,G)},animate:function(F,A,K,G){var J=AI.speed(A,K,G);if(AI.isEmptyObject(F)){return this.each(J.complete)}return this[J.queue===false?"each":"queue"](function(){var N=AI.extend({},J),O,P=this.nodeType===1&&AI(this).is(":hidden"),L=this;for(O in F){var Q=O.replace(AE,m);if(O!==Q){F[Q]=F[O];delete F[O];O=Q}if(F[O]==="hide"&&P||F[O]==="show"&&!P){return N.complete.call(this)}if((O==="height"||O==="width")&&this.style){N.display=AI.css(this,"display");N.overflow=this.style.overflow}if(AI.isArray(F[O])){(N.specialEasing=N.specialEasing||{})[O]=F[O][1];F[O]=F[O][0]}}if(N.overflow!=null){this.style.overflow="hidden"}N.curAnim=AI.extend({},F);AI.each(F,function(T,R){var X=new AI.fx(L,N,T);if(BC.test(R)){X[R==="toggle"?P?"show":"hide":R](F)}else{var W=Az.exec(R),Y=X.cur(true)||0;if(W){R=parseFloat(W[2]);var V=W[3]||"px";if(V!=="px"){L.style[T]=(R||1)+V;Y=(R||1)/X.cur(true)*Y;L.style[T]=Y+V}if(W[1]){R=(W[1]==="-="?-1:1)*R+Y}X.custom(Y,R,V)}else{X.custom(Y,R,"")}}});return true})},stop:function(F,A){var G=AI.timers;F&&this.queue([]);this.each(function(){for(var J=G.length-1;J>=0;J--){if(G[J].elem===this){A&&G[J](true);G.splice(J,1)}}});A||this.dequeue();return this}});AI.each({slideDown:Ae("show",1),slideUp:Ae("hide",1),slideToggle:Ae("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(F,A){AI.fn[F]=function(J,G){return this.animate(A,J,G)}});AI.extend({speed:function(F,A,J){var G=F&&typeof F==="object"?F:{complete:J||!J&&A||AI.isFunction(F)&&F,duration:F,easing:J&&A||A&&!AI.isFunction(A)&&A};G.duration=AI.fx.off?0:typeof G.duration==="number"?G.duration:AI.fx.speeds[G.duration]||AI.fx.speeds._default;G.old=G.complete;G.complete=function(){G.queue!==false&&AI(this).dequeue();AI.isFunction(G.old)&&G.old.call(this)};return G},easing:{linear:function(F,A,J,G){return J+G*F},swing:function(F,A,J,G){return(-Math.cos(F*Math.PI)/2+0.5)*G+J}},timers:[],fx:function(F,A,G){this.options=A;this.elem=F;this.prop=G;if(!A.orig){A.orig={}}}});AI.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(AI.fx.step[this.prop]||AI.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(AI.css(this.elem,this.prop,A)))&&A>-10000?A:parseFloat(AI.curCSS(this.elem,this.prop))||0},custom:function(F,A,K){function G(L){return J.step(L)}this.startTime=Ah();this.start=F;this.end=A;this.unit=K||this.unit||"px";this.now=this.start;this.pos=this.state=0;var J=this;G.elem=this.elem;if(G()&&AI.timers.push(G)&&!AR){AR=setInterval(AI.fx.tick,13)}},show:function(){this.options.orig[this.prop]=AI.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());AI(this.elem).show()},hide:function(){this.options.orig[this.prop]=AI.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(F){var A=Ah(),K=true;if(F||A>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var G in this.options.curAnim){if(this.options.curAnim[G]!==true){K=false}}if(K){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;F=AI.data(this.elem,"olddisplay");this.elem.style.display=F?F:this.options.display;if(AI.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&AI(this.elem).hide();if(this.options.hide||this.options.show){for(var J in this.options.curAnim){AI.style(this.elem,J,this.options.orig[J])}}this.options.complete.call(this.elem)}return false}else{J=A-this.startTime;this.state=J/this.options.duration;F=this.options.easing||(AI.easing.swing?"swing":"linear");this.pos=AI.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||F](this.state,J,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};AI.extend(AI.fx,{tick:function(){for(var F=AI.timers,A=0;A<F.length;A++){F[A]()||F.splice(A--,1)}F.length||AI.fx.stop()},stop:function(){clearInterval(AR);AR=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(A){AI.style(A.elem,"opacity",A.now)},_default:function(A){if(A.elem.style&&A.elem.style[A.prop]!=null){A.elem.style[A.prop]=(A.prop==="width"||A.prop==="height"?Math.max(0,A.now):A.now)+A.unit}else{A.elem[A.prop]=A.now}}}});if(AI.expr&&AI.expr.filters){AI.expr.filters.animated=function(A){return AI.grep(AI.timers,function(F){return A===F.elem}).length}}AI.fn.offset="getBoundingClientRect" in AA.documentElement?function(F){var A=this[0];if(F){return this.each(function(K){AI.offset.setOffset(this,F,K)})}if(!A||!A.ownerDocument){return null}if(A===A.ownerDocument.body){return AI.offset.bodyOffset(A)}var J=A.getBoundingClientRect(),G=A.ownerDocument;A=G.body;G=G.documentElement;return{top:J.top+(self.pageYOffset||AI.support.boxModel&&G.scrollTop||A.scrollTop)-(G.clientTop||A.clientTop||0),left:J.left+(self.pageXOffset||AI.support.boxModel&&G.scrollLeft||A.scrollLeft)-(G.clientLeft||A.clientLeft||0)}}:function(Q){var P=this[0];if(Q){return this.each(function(R){AI.offset.setOffset(this,Q,R)})}if(!P||!P.ownerDocument){return null}if(P===P.ownerDocument.body){return AI.offset.bodyOffset(P)}AI.offset.initialize();var O=P.offsetParent,L=P,N=P.ownerDocument,J,K=N.documentElement,A=N.body;L=(N=N.defaultView)?N.getComputedStyle(P,null):P.currentStyle;for(var G=P.offsetTop,F=P.offsetLeft;(P=P.parentNode)&&P!==A&&P!==K;){if(AI.offset.supportsFixedPosition&&L.position==="fixed"){break}J=N?N.getComputedStyle(P,null):P.currentStyle;G-=P.scrollTop;F-=P.scrollLeft;if(P===O){G+=P.offsetTop;F+=P.offsetLeft;if(AI.offset.doesNotAddBorder&&!(AI.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(P.nodeName))){G+=parseFloat(J.borderTopWidth)||0;F+=parseFloat(J.borderLeftWidth)||0}L=O;O=P.offsetParent}if(AI.offset.subtractsBorderForOverflowNotVisible&&J.overflow!=="visible"){G+=parseFloat(J.borderTopWidth)||0;F+=parseFloat(J.borderLeftWidth)||0}L=J}if(L.position==="relative"||L.position==="static"){G+=A.offsetTop;F+=A.offsetLeft}if(AI.offset.supportsFixedPosition&&L.position==="fixed"){G+=Math.max(K.scrollTop,A.scrollTop);F+=Math.max(K.scrollLeft,A.scrollLeft)}return{top:G,left:F}};AI.offset={initialize:function(){var F=AA.body,A=AA.createElement("div"),L,J,K,G=parseFloat(AI.curCSS(F,"marginTop",true))||0;AI.extend(A.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});A.innerHTML="<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>";F.insertBefore(A,F.firstChild);L=A.firstChild;J=L.firstChild;K=L.nextSibling.firstChild.firstChild;this.doesNotAddBorder=J.offsetTop!==5;this.doesAddBorderForTableAndCells=K.offsetTop===5;J.style.position="fixed";J.style.top="20px";this.supportsFixedPosition=J.offsetTop===20||J.offsetTop===15;J.style.position=J.style.top="";L.style.overflow="hidden";L.style.position="relative";this.subtractsBorderForOverflowNotVisible=J.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=F.offsetTop!==G;F.removeChild(A);AI.offset.initialize=AI.noop},bodyOffset:function(F){var A=F.offsetTop,G=F.offsetLeft;AI.offset.initialize();if(AI.offset.doesNotIncludeMarginInBodyOffset){A+=parseFloat(AI.curCSS(F,"marginTop",true))||0;G+=parseFloat(AI.curCSS(F,"marginLeft",true))||0}return{top:A,left:G}},setOffset:function(F,A,N){if(/static/.test(AI.curCSS(F,"position"))){F.style.position="relative"}var K=AI(F),L=K.offset(),G=parseInt(AI.curCSS(F,"top",true),10)||0,J=parseInt(AI.curCSS(F,"left",true),10)||0;if(AI.isFunction(A)){A=A.call(F,N,L)}N={top:A.top-L.top+G,left:A.left-L.left+J};"using" in A?A.using.call(F,N):K.css(N)}};AI.fn.extend({position:function(){if(!this[0]){return null}var F=this[0],A=this.offsetParent(),J=this.offset(),G=/^body|html$/i.test(A[0].nodeName)?{top:0,left:0}:A.offset();J.top-=parseFloat(AI.curCSS(F,"marginTop",true))||0;J.left-=parseFloat(AI.curCSS(F,"marginLeft",true))||0;G.top+=parseFloat(AI.curCSS(A[0],"borderTopWidth",true))||0;G.left+=parseFloat(AI.curCSS(A[0],"borderLeftWidth",true))||0;return{top:J.top-G.top,left:J.left-G.left}},offsetParent:function(){return this.map(function(){for(var A=this.offsetParent||AA.body;A&&!/^body|html$/i.test(A.nodeName)&&AI.css(A,"position")==="static";){A=A.offsetParent}return A})}});AI.each(["Left","Top"],function(F,A){var G="scroll"+A;AI.fn[G]=function(K){var L=this[0],J;if(!L){return null}if(K!==z){return this.each(function(){if(J=f(this)){J.scrollTo(!F?K:AI(J).scrollLeft(),F?K:AI(J).scrollTop())}else{this[G]=K}})}else{return(J=f(L))?"pageXOffset" in J?J[F?"pageYOffset":"pageXOffset"]:AI.support.boxModel&&J.document.documentElement[G]||J.document.body[G]:L[G]}}});AI.each(["Height","Width"],function(F,A){var G=A.toLowerCase();AI.fn["inner"+A]=function(){return this[0]?AI.css(this[0],G,false,"padding"):null};AI.fn["outer"+A]=function(J){return this[0]?AI.css(this[0],G,false,J?"margin":"border"):null};AI.fn[G]=function(J){var K=this[0];if(!K){return J==null?null:this}if(AI.isFunction(J)){return this.each(function(L){var N=AI(this);N[G](J.call(this,L,N[G]()))})}return"scrollTo" in K&&K.document?K.document.compatMode==="CSS1Compat"&&K.document.documentElement["client"+A]||K.document.body["client"+A]:K.nodeType===9?Math.max(K.documentElement["client"+A],K.body["scroll"+A],K.documentElement["scroll"+A],K.body["offset"+A],K.documentElement["offset"+A]):J===z?AI.css(K,G):this.css(G,typeof J==="string"?J:J+"px")}});Aq.jQuery=Aq.$=AI})(window);var ClkrTop=window.self;var Clicker={evElem:null,_loginEvents:[],bound:false,_getEvElem:function(){if(Clicker.evElem==null){Clicker.evElem=$("#logLinkItem")}return Clicker.evElem},_addPendingEvent:function(B,C,A){if(!this.bound){ClkrTop.l.bind(ClkrTop.l.ev.succeed,function(){Clicker._handlePendingEvents()})}Clicker._loginEvents.push({objClass:B,func:C,f_args:A})},_handlePendingEvents:function(){for(var A;A=Clicker._loginEvents.pop();A!=null){A.func.apply(A.objClass,A.f_args)}},_tokenpost:function(D){var B={AJAX:true,rnd:Math.floor(Math.random()*10001)};ClkrTop.l.getInPageToken();B[ClkrTop.l.csrf_name]=ClkrTop.l.csrf_value;D.params=$.extend(D.params,B);var A=D;A.attempt++;var C=D.timeout;if(C==null){C=10000}$.ajax({url:D.url,data:D.params,cache:false,dataType:"json",type:"POST",timeout:C,success:function(E,G,F){Clicker._processTpResponse(E,A)},error:function(H,I,G){try{if(H.status==401&&H.responseText.indexOf("token")>-1){var E=$.parseJSON(H.responseText);Clicker._processTpResponse(E,A)}}catch(F){}}})},_processTpResponse:function(B,A){if(B==null){return }if(!B.isTrue&&!Util.isEmpty(B.token)&&ClkrTop.l.csrf_value!=B.token&&A.attempt<3){ClkrTop.l.csrf_name=B.token_name;ClkrTop.l.csrf_value=B.token;var C=A;setTimeout(function(){Clicker._tokenpost(C)},10)}else{if(A.callback){A.callback(B)}}},tokenpost:function(B,D,E,A){var C={url:B,params:D,callback:E,attempt:0,timeout:A};Clicker._tokenpost(C)},waitForLogin:function(K,M,B,I,A){if(ClkrTop.l.isLoggedIn){if(ClkrTop.l.tempFBAcct&&!A){var H=B;var F=M;var J=I;var G=K;var L=$(K);var E={msg:"[Placeholder text for action taken]"};if(M){if(M.getActionMsg&&M.getActionMsg(L)!=null){E.msg=M.getActionMsg(L)}if(M.getActionType&&M.getActionType(L)!=null){E.actionType=M.getActionType(L)}}var C=Clicker.Action.getShareIds(L);E=$.extend(E,C);var D=Clicker.Action.getRateTo(L);if(D!=null){E.rating=D}$(G).addClass("noComment");Clicker.completeProfile(E,function(N){H.apply(F,J)})}else{B.apply(M,I)}}else{Clicker._addPendingEvent(M,B,I);ClkrTop.l.start(K);return false}return true},bind:function(B,A){var C=Clicker._getEvElem();C.bind(B,A)},trigger:function(A,B){Clicker._getEvElem().trigger(A,B)},chkNewAwd:function(B){var A={AJAX:true,rnd:Math.floor(Math.random()*10001)};$.extend(A,B);$.post("/user/AJAX/checkAward/",A,function(C){if($.trim(C)!="false"){Util.customMsg(C,5000)}})},delTmpFB:function(B){var A=B;Clicker.tokenpost("/utility/delTmpFbByName/",{},function(C){if(A){A(C.isTrue)}})},delTmpFbById:function(B){var A=B;Clicker.tokenpost("/utility/delTmpFbByFbId/",{},function(C){if(A){A(C.isTrue)}})},getExtraPerms:function(B){var A=B;Clicker.FBGraph.doLoginWithPerms(function(D){var C=D;setTimeout(function(){if(C){Clicker.fbconnect(true,A)}else{if(A!=null){A(false)}}},1)},"publish_stream,offline_access,user_likes,email")},fbconnect:function(C,E,B){var A=E;var D={perm:C};Clicker.tokenpost("/user/AJAX/fbconnect/",D,function(){if(D.perm){ClkrTop.l.fbPost.can=true}ClkrTop.l.fbConnected=true;if(A){A(true)}})},processFBIP:function(A,B){if(ClkrTop.l.tempFBAcct){Clicker.completeProfile(A,B)}else{Clicker.popAddFBToCur(A,B,false)}},completeProfile:function(C,D){var B=C;var A=D;Clicker._completeProfile(B,A)},_completeProfile:function(D,E){var A=E;var B="/popup/fbprofile/";if(D!=null){var C=$.param(D);B=B+"?"+C}Clicker.Dialog.show(B,function(F){if(A!=null){A(F)}})},popAddFBToCur:function(C,E,D){var B=C;var A=E;if(!D){Clicker.Dialog.showspinner(true);Clicker.getExtraPerms(function(F){if(F){Clicker._popAddFBToCur(B,A)}else{Clicker.tokenpost("/user/markFBIPDone/",{},function(){location.href=location.href})}})}else{Clicker._popAddFBToCur(B,A)}},_popAddFBToCur:function(D,E){var A=E;var B="/popup/ipselect/";if(D!=null){var C=$.param(D);B=B+"?"+C}Clicker.Dialog.show(B,function(){if(A!=null){A()}},null,true)},followFriends:function(){Clicker.popAddFBToCur({mode:"ip"},function(){location.href=location.href},false);return false},checkSettings:function(B){var A=B;$.get("/user/AJAX/checkOldPwd",{AJAX:true,rnd:Math.floor(Math.random()*10001)},function(D){var C=D.isTrue;if(C||!l.haveEmail||l.isFbOnlyEmail){Clicker.Dialog.show("/popup/needsettings/",function(){if(A){A()}})}else{if(A){A()}}},"json");return true},fbdisconnectExistingUser:function(){Clicker.checkSettings(function(){var A={};Clicker.tokenpost("/user/AJAX/fbdisconnect/",A,function(B){if(B&&B.isTrue){Clicker.FBGraph.doRevoke(false,function(){ClkrTop.location.href=ClkrTop.location.href})}else{$("#connectError").text(B.msg)}})})},silentConvAcct:function(B){var A=B;ClkrTop.Clicker.tokenpost("/popup/fbToReal/AJAX/?closing=true",{},function(){var C=ClkrTop.l.numFollowers+ClkrTop.l.numPendFollowers;if(C>0){Util.message('You have <a href="/profile/'+ClkrTop.l.lastUsername+'/followers/">'+C+" followers</a> on Clicker.")}if(A){A()}},45000)},reloadProfile:function(){var A=$("#profileBarFrame");if(A.length==0){Clicker.loadProfile()}else{A[0].contentWindow.location.reload(true)}},loadProfile:function(){var B=$("#profileBar");if(B.length>0){var A="/utility/profileBar/";if(B.hasClass("useCss2")){A+="?useCss2=1"}B.html('<iframe id="profileBarFrame" name="profileBarFrame" class="" src="'+A+'" style="height: 55px; width:100%; overflow:hidden;"></iframe>')}},inviteEmail:function(A){Clicker.Dialog.show("/popup/inviteEmail/?email="+A)},inviteFBFriends:function(F,C,B){var A=$(C);var D=$('[name="inviteFBID"]',A).val();var G=$('[name="inviteFBName"]',A).val();Clicker.Dialog.show("/popup/inviteFBFriend/?fbid="+D+"&fbname="+G);if(!B){var E=A.closest("tr");setTimeout(function(){E.fadeOut()},1000)}},modUi:function(A,C){var B={};B[A]=C;Clicker.tokenpost("/user/AJAX/modUI/",B)},lazyLoggedIn:function(){$.get("/utility/lazyLoggedIn/",{},function(C){if(C!=null){var B=$(C);var A=$("#replace_menuBox_queue",B);if(A.length>0){$("#wrapper_menuBox_queue").html(A.html())}B.remove()}})},filterClips:function(C,A){$("#clipGuide_Filters .optionNarrow").removeClass("curOption");var B="#clipGuide_";if(C!=null){B+=C}$(B).addClass("curOption spinner");var D={showid:A};Clicker._getClips(D,function(E){Clicker._updateClips(B,E)})},filterClipSeasons:function(C,A){$("#clipGuide_Seasons .optionNarrow").removeClass("curOption");var B="#clipSeason_";if(C!=null){B+=Util.escColon(C)}$(B).addClass("curOption spinner");var D={showid:A};Clicker._getClips(D,function(E){Clicker._updateClips(B,E)})},_updateClips:function(A,B){$(A).removeClass("spinner");$("#tabContent_clipguide_data").html(B);if($("#tabContent_clipguide_data .nodata").length>0){$("#tabContent_clipguide_data").html('<div class="padMost px15">No clips match your current filters</div>')}},moreClips:function(B,A){var D=$(B);$(".moreMsg",D).addClass("spinner");var C=D.attr("id").split("_");if(C.length>0){var E={episodeid:C[1]};Clicker._getClips(E,function(F){var G=D.parent();D.remove();G.append(F)})}},_getClips:function(F,E){var A=E;var B=$("#clipGuide_Filters .curOption").attr("id");if(B){var D=B.split("_");if(D.length>0&&!Util.isEmpty(D[1])){F.episode_type=D[1]}}var C=$("#clipGuide_Seasons .curOption").attr("id");if(C){var D=C.split("_");if(D.length>0&&!Util.isEmpty(D[1])){F.o_filter=D[1]}}$.post("/clips/AJAX/",F,function(G){if(A){A(G)}})}};var Util={b2i:function(A){return A?1:0},insertAJAX:function(A){var C=A.lastIndexOf("/");if(C<=0){C=A.indexOf("?");if(C<=0){C=A.indexOf("&")}}var B=A.substring(0,C+1)+"AJAX/"+A.substring(C+1);return B},ajaxReplace:function(E,B,A,F){var C=E.href!=null?E.href:E;var D=this.insertAJAX(C);A=A==null?true:A;$.get(D,"&AJAX="+A+"&rnd="+Math.floor(Math.random()*10001),function(G){$("#"+B).html(G);if(F){F()}});return false},message:function(B,A){var B='<div class="popDiv popMessageBottomRight" style="bottom: 20px; display: none;"><div id="top" class="top"></div><div id="main" class="center"><div class="messagetext" id="messageText">'+B+'</div></div><div id="bottom" class="bottom"></div></div>';Util.customMsg(B,A)},customMsg:function(C,A){A=A!=null?A:3000;var C=$(C);var B=setTimeout(function(){C.fadeOut(500)},A);C.bind("mouseenter",function(){clearTimeout(B)});C.bind("mouseleave",function(){B=setTimeout(function(){C.fadeOut(500)},1000)});$("body").append(C);C.slideToggle("slow")},more:function(A){var B=$("#"+A);var D=$("#link_"+A);if(B.is(":hidden")){B.show();D.removeClass("more_link").addClass("less_link");var C=D.html();D.html(C.replace("MORE","LESS"))}else{B.hide();D.removeClass("less_link").addClass("more_link");var C=D.html();D.html(C.replace("LESS","MORE"));Util.scrollTo(D)}return false},isDevice:function(){var A=false;var B="";if(true||navigator.userAgent.indexOf("iPad")!=-1){A=true}return[A,B]},redecorate:function(C){var A;detect=this.isDevice();if(detect[0]){if(detect[1]=="ipad"){this.displayIpadMsg()}if(C){A=document.getElementById("logoBox").getElementsByTagName("a")[0]}else{A=document.getElementById("homePageLogoLink")}if(A){A.innerHTML="";A.className=detect[1];document.getElementsByTagName("body")[0].className=detect[1]}}else{var B="";if(document.cookie.length>0){c_start=document.cookie.indexOf("college_partner=");if(c_start!=-1){c_start=c_start+"college_partner".length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}if(unescape(document.cookie.substring(c_start,c_end))==="ucla"){if(C){A=document.getElementById("logoBox").getElementsByTagName("a")[0]}else{A=document.getElementById("homePageLogoLink")}A.innerHTML="";A.className="ucla";document.getElementsByTagName("body")[0].className="ucla"}}}}},scrollTo:function(C,D){if(C.length>0){var E=$(window).scrollTop();var B=$(window).height();var A=C.offset().top-30;if(D||A<E||A>(E+B)){$("html,body").animate({scrollTop:A},500)}}},logToServer:function(B){var A="/images/log.gif?"+B+"&rnd="+Math.floor(Math.random()*10001);Util.hiddenImgRequest(A)},watchedOver:function(E,C,B,A,D){if($(D).data("watched")==null){$(D).data("watched",true);setTimeout(function(){Util.watched(E,C,B,A)},1000)}},watched:function(G,D,C,B){var A="";var E="";if(D==null||D.length==0){A=B=="1"?"X":"W";E="|s:"+G}else{A=B=="1"?"x":"w";E="|s:"+G+"|"+D}var F={ajax:"true",feedID:C,rnd:Math.floor(Math.random()*10001),caller:document.URL,showID:G,la:"playlist",pl:A+E};if(D!=null&&D.length>0){F.episodeID=D}$.get("/watch.html",F);return false},setEditorial:function(A){var C=this.b2i(A);var B=new Cookie("ed");B.bake(C,315360000000,"/");location.reload()},hideTagline:function(){$("#taglineBox,#fullBot").css("display","none");$("#shortBot").css("display","")},setTagCookie:function(A){var B=this.b2i(A);var C=new Cookie("tl");C.bake(B,315360000000,"/")},hiddenImgRequest:function(B){var A=document.createElement("img");A.height=1;A.width=1;A.style.display="none";A.src=B;document.body.appendChild(A)},isEmpty:function(A){if(A==null){return true}return $.trim(A)==""},displayIpadMsg:function(){if(!(new Cookie("ipad").exists())){$("#ipadPageOverlay").css({opacity:0.5,display:""});$("#ipadMsgBg").css("display","");this.setIpadCookie()}},closeIpadMsg:function(){$("#ipadPageOverlay").css({display:"none"});$("#ipadMsgBg").css("display","none")},setIpadCookie:function(A){var C=this.b2i(A);var B=new Cookie("ipad");B.bake(C,315360000000,"/")},parseHref:function(A){var B={pathname:null,params:{}};if(A==null){return B}var D=A.split("?",2);B.pathname=D[0];if(D.length>1){D=D[1].split("&");for(var C=0;C<D.length;C++){if(D[C].length>0){var E=D[C].split("=",2);B.params[E[0]]="";if(E.length>1){B.params[E[0]]=E[1]}}}}return B},log:function(A){if(window.console&&window.console.log){console.log(A)}},htmlEncode:function(A){return $("<div/>").text(A).html()},escColon:function(A){return A.replace(/(:|\.)/g,"\\$1")},uiCount:function(A){if(A>1000){return"1000+"}return A},clean:function(A){return A.replace(/\<.*?\>/g,"")},trunc:function(B,A){return(B==null||B.length<=A)?B:B.substring(0,A-3)+"..."},checkMax:function(A,B){var C=false;var D=$(A);var E=D.val();if(E.length>=B){D.addClass("toobig");C=true;if(E.length>B){D.val(E.substring(0,B))}}else{D.removeClass("toobig")}return C},serializeParams:function(A){var C=$(A).serializeArray();var B={};$.each(C,function(E,F){if(B[F.name]!=null){B[F.name]=[].concat(B[F.name],F.value)}else{var D={};D[F.name]=F.value;$.extend(B,D)}});return B},random:function(){return Math.floor(Math.random()*100001)},logGAHit:function(A){A=A||location.href;try{_gaq.push(["_trackPageview",A])}catch(B){}},removeTags:function(A){if(A!=null){return A.replace(/\<.*?\>/,"")}return""},prepShareTxt:function(A){A=A.replace(/\[.*?\]/g,"%s");return A},imgLoaded:function(B,C){var A=C;B.load(A);if(B.length>0&&B[0].complete||B[0].readyState===4){A()}},validateEmails:function(C){var B=true;var D=C.split(",");for(var A=D.length;A--;A>=0){B=Util.validateEmail(D[A]);if(!B){break}}return B},validateEmail:function(A){var D=A.split(",");if(D.length==1){D=A.split(";")}var C=true;for(var B=0;B<D.length;B++){C=Util._validateEmail($.trim(D[B]))}return C},_validateEmail:function(B){var Q=1;var T=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;var P=/^(.+)@(.+)$/;var N='\\(\\)><@,;:\\\\\\"\\.\\[\\]';var I="[^\\s"+N+"]";var D='("[^"]*")';var O=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var A=I+"+";var M="("+A+"|"+D+")";var J=new RegExp("^"+M+"(\\."+M+")*$");var F=new RegExp("^"+A+"(\\."+A+")*$");var C=B.match(P);if(C==null){return false}var R=C[1];var S=C[2];for(K=0;K<R.length;K++){if(R.charCodeAt(K)>127){return false}}for(K=0;K<S.length;K++){if(S.charCodeAt(K)>127){return false}}if(R.match(J)==null){return false}var H=S.match(O);if(H!=null){for(var K=1;K<=4;K++){if(H[K]>255){return false}}return true}var G=new RegExp("^"+A+"$");var E=S.split(".");var L=E.length;for(K=0;K<L;K++){if(E[K].search(G)==-1){return false}}if(Q&&E[E.length-1].length!=2&&E[E.length-1].search(T)==-1){return false}if(L<2){return false}return true}};Util.isiDevice=(navigator.userAgent.indexOf("iPad")!=-1||navigator.userAgent.indexOf("iPhone")!=-1||navigator.userAgent.indexOf("iPod")!=-1);Util.isMobile=(Util.isiDevice||navigator.userAgent.indexOf("Android")!=-1);function Cookie(A){this.name=A||"cookie"}Cookie.prototype={bake:function(C,A,D){if(!D){D="/"}var B=new Date();if(A){B.setTime(B.getTime()+A);document.cookie=this.name+"="+C+"; expires="+B.toGMTString()+"; path="+D}else{document.cookie=this.name+"="+C+"; path="+D}},eat:function(){document.cookie=this.name+"=; expires=Jan 01 1970 00:00:00 UTC; path=/"},get:function(){var D=this.name+"=";var B=document.cookie;var C=B.split(";");for(var A=0;A<C.length;A++){var B=C[A];while(B.charAt(0)==" "){B=B.substring(1,B.length)}if(B.indexOf(D)==0){return B.substring(D.length,B.length)}}return null},exists:function(){var A=document.cookie;if(A.indexOf(this.name+"=")!=-1){return true}return false}};var UUID=function(){var D=new Date(1582,10,15,0,0,0,0);var G=new Date();var I=G.getTime()-D.getTime();var B="-";var J=this.getIntegerBits(I,0,31);var H=this.getIntegerBits(I,32,47);var F=this.getIntegerBits(I,48,59)+"1";var C=this.getIntegerBits(this.rand(4095),0,7);var E=this.getIntegerBits(this.rand(4095),0,7);var A=this.getIntegerBits(this.rand(8191),0,7)+this.getIntegerBits(this.rand(8191),8,15)+this.getIntegerBits(this.rand(8191),0,7)+this.getIntegerBits(this.rand(8191),8,15)+this.getIntegerBits(this.rand(8191),0,15);this.value=J+B+H+B+F+B+C+E+B+A};UUID.prototype={returnVal:function(){return this.value},valueOf:function(){return this.id},toString:function(){return this.id},getIntegerBits:function(F,G,B){var A=this.returnBase(F,16);var D=new Array();var E="";var C=0;for(C=0;C<A.length;C++){D.push(A.substring(C,C+1))}for(C=Math.floor(G/4);C<=Math.floor(B/4);C++){if(!D[C]||D[C]==""){E+="0"}else{E+=D[C]}}return E},returnBase:function(A,B){return(A).toString(B).toUpperCase()},rand:function(A){return Math.floor(Math.random()*(A+1))}};var AutoCompleter=function(A,E,H,I){I=I!=null?I:{};this.fld=document.getElementById(A);var F=$(this.fld);if(!this.fld){return false}this.coverTarget=null;if(I.coverElement!=null&&I.coverElement!=""){var C=$("#"+I.coverElement);if(C){this.coverTarget=C}}this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.maxTitleLen=I.maxTitleLen||45;this.maxResults=I.maxResults||5;this.AC_Ping=I.AC_Ping||false;this.userText="";this.extraWidth=I.extraWidth||0;this.offsetX=I.offsetX||0;this.SEARCH_QUERY=6;this.deviceParam=navigator.userAgent.indexOf("iPad")!=-1?"&canIPad=1":"";this.submitting=false;this.position();this.types={tv:1,web:2,music:3,movie:4,source:5};this.DEFAULT_TEXT="Find any show or movie online";this.options=E?E:{};this.isEditorial=false;this.isRec=false;this.isPlaylist=false;this.isHomepagePlaylist=false;this.picked=null;var B=this;var G,D={valueSep:null,minchars:1,meth:"get",varname:"query",className:"autocomplete roundBottom border shadowBottom2 whiteBg",timeout:30000,delay:100,offsety:-5,shownoresults:false,noresults:"No results were found.",maxheight:250,cache:false,maxentries:25,onAjaxError:null,setWidth:false,minWidth:100,maxWidth:330,useNotifier:true,instanceName:H,json:true,clearAdd:null,callback:function(L){var N=B.removeBold(L.value);if(B.isEditorial||B.isRec){B.fld.value=N;B.picked=L;if(B.isRec){$("#acRecGood").show()}}else{if(B.isPlaylist){if(Playlist){B.fld.value="";B.og_text="";B.picked=L;var O="show";var K=L.show_id;if(L.type=="movie"){}var M={la:"playlist",pl:"A|s:"+K};if(B.isHomepagePlaylist){Playlist.clearUnwatchedCount();$("#queueLoading").show();Clicker.tokenpost("/user/AJAX/queue/",M,function(P){var Q=P.msg;setTimeout(function(){var R="/index/AJAX/queue/?rnd="+Math.floor(Math.random()*10001);$.get(R,function(S){$("#queueBox").html(S);$("#queueLoading").hide()})},100)})}else{var J=document.getElementById("addMsg");J.style.visibility="visible";J.innerHTML="Adding...";Playlist.clearUnwatchedCount();Clicker.tokenpost("/user/AJAX/queue/",M,function(P){var Q=P.msg;clearTimeout(B.clearAdd);setTimeout(function(){var R="/profile/"+Playlist.curUserName+"/queue/?AJAX=true&rnd="+Math.floor(Math.random()*10001);$.get(Playlist.insertAJAX(R),function(S){Playlist.updateHtml(S);J.innerHTML=Q;B.clearAdd=setTimeout(function(){J.style.visibility="hidden"},5000)})},100)})}}}else{B.setLocation(L)}}},script:""};this.options=D;this.options.script=E+"fmt=2&max_len="+this.maxTitleLen+this.deviceParam+"&";this.acID=A+"-ac_div";this.surroundID="surround_div";if(this.options.useNotifier){F.addClass("ac_field")}F.bind("keypress",function(J){return B.onKeyPress(J)});F.bind("keyup",function(J){return B.onKeyUp(J)});this.fld.setAttribute("AutoComplete","off");F.bind("focus",function(J){return B.clickFunc(J)});F.bind("blur",function(J){return B.blurFunc(J)});$(window).bind("resize",function(){})};AutoCompleter.prototype={position:function(){var A;if(this.coverTarget!=null){A=this.coverTarget;offsetHeight=0}else{A=this.fld;offsetHeight=A.offsetHeight}var B=$(A).offset();this.popTop=B.top+(offsetHeight+7)+"px";this.popWidth=A.offsetWidth+this.extraWidth+"px";this.popLeft=B.left+this.offsetX+"px"},setLocation:function(F){if(this.AC_Ping){var B=this.options.script.substring(0,this.options.script.lastIndexOf("/"))+"/t2?";var C=B+"result="+F.id+"&showid="+encodeURIComponent(F.show_id)+"&value="+encodeURIComponent(F.value);C+="&url="+encodeURIComponent(F.url)+"&type="+encodeURIComponent(F.type)+"&imageURL="+encodeURIComponent(F.imageURL);C+="&match_type="+encodeURIComponent(F.match_type)+"&autoCompeted="+encodeURIComponent(this.lastsInp);C+="&referrer="+encodeURIComponent(location.href);var A=document.getElementById("autocompletedriver");if(A!=null){try{document.getElementById("pageHead").removeChild(A)}catch(E){A.parentNode.removeChild(A)}}var G=document.createElement("script");G.id="autocompletedriver";G.src=C;document.getElementsByTagName("head")[0].appendChild(G)}var D="";if(F.match_type=="episode"&&F.episode_url){D=F.episode_url}else{if(F.url==""){D="/search.html?query="+encodeURIComponent(this.removeBold(F.value))}else{D=F.url}}Util.logToServer("source=ac&usertext="+encodeURIComponent(this.userText)+"&match="+encodeURIComponent(F.value)+"&url="+encodeURIComponent(D));if(top.location!=self.location){top.location.href=D}else{location.href=D}},usingKeys:false,removeBold:function(A){return A.replace(/<\/?b>/g,"")},onKeyPress:function(B){var A=B.keyCode;$(this.fld).removeClass("ltGray");switch(A){case 13:if(this.usingKeys){if(this.iHigh>0){if(!this.isRec&&!this.isEditorial&&!this.isPlaylist&&this.iHigh==this.SEARCH_QUERY){location.href="/find/?query="+encodeURIComponent(this.fld.value)}else{this.setHighlightedValue()}B.preventDefault()}else{if(this.fld.value.length<=0){B.preventDefault()}}}break;case 9:this.setHighlightedValue();B.preventDefault();break;case 27:this.clearSuggestions();this.iHigh=0;break}return true},submit:function(){if(this.fld.value.length<=0){return false}else{if(this.fld.value==this.DEFAULT_TEXT){return false}else{if(this.isPlaylist||this.isRec){return false}else{this.submitting=true;this.cleanup();return true}}}},onKeyUp:function(B){this.userText=this.fld.value;var A=B.keyCode;if(A==38||A==40){this.changeHighlight(A);B.preventDefault();this.usingKeys=true}else{this.getSuggestions(this.userText)}return true},clickFunc:function(A){if(this.og_text==""&&this.fld.value!=""){this.og_text=this.fld.value}if(this.fld.value==this.DEFAULT_TEXT){this.fld.value="";$(this.fld).removeClass("ltGray")}return true},blurFunc:function(B){var A=this;if(this.fld.value==""&&this.og_text!=""){if(this.og_text&&this.og_text!=""){this.fld.value=this.og_text}else{this.fld.value=this.DEFAULT_TEXT;$(this.fld).addClass("ltGray")}}A.resetTimeout();this.clearSuggestions();return true},getSuggestions:function(F){F=this.removeBold(F);if(F==this.sInp){return false}this.lastsInp=this.sInp;this.sInp=F;if(F.length<this.options.minchars){this.aSug=[];this.nInpC=F.length;$(this.fld).removeClass("ac_field_busy").addClass("ac_field");if($("#"+this.acID)){$("#"+this.acID).remove()}return false}var C=this.nInpC;this.nInpC=F.length?F.length:0;var B=this.aSug.length;if(this.options.cache&&(this.nInpC>C)&&B&&(B<this.options.maxentries)){var A=new Array();for(var D=0;D<B;D++){if(this.aSug[D].value.toLowerCase().indexOf(F.toLowerCase())!=-1){A.push(this.aSug[D])}}this.aSug=A;this.createList(this.aSug)}else{var E=this;clearTimeout(this.ajID);this.ajID=setTimeout(function(){E.doAjaxRequest(E.sInp)},this.options.delay)}document.helper=this;return false},getLastInput:function(C){var B=C;if(undefined!=this.options.valueSep){var A=B.lastIndexOf(this.options.valueSep);B=A==-1?B:B.substring(A+1,B.length)}return B},doAjaxRequest:function(C){if(C!=this.fld.value){return false}this.sInp=this.getLastInput(this.sInp);if(typeof this.options.script=="function"){var D=this.options.script(encodeURIComponent(this.sInp))}else{var D=this.options.script+this.options.varname+"="+encodeURIComponent(this.sInp)}if(!D){return false}var F=this;if(this.options.useNotifier){$(this.fld).removeClass("ac_field").addClass("ac_field_busy")}var B=document.getElementById("autocompletedriver");if(B!=null){try{document.getElementById("pageHead").removeChild(B)}catch(E){B.parentNode.removeChild(B)}}var G=document.createElement("script");G.id="autocompletedriver";var A=this.options.script;if(this.isEditorial||this.isPlaylist||this.isRec){A+="filter=s*all&group=show&"}G.src=A+"cb="+this.options.instanceName+".createList&q="+encodeURIComponent(this.sInp);document.getElementsByTagName("head")[0].appendChild(G)},ce:function(F,B,A,E){var G=document.createElement(F);if(!G){return 0}for(var C in B){G[C]=B[C]}var D=typeof (A);if(D=="string"&&!E){G.appendChild(document.createTextNode(A))}else{if(D=="string"&&E){G.innerHTML=A}else{if(D=="object"){G.appendChild(A)}}}return G},cleanup:function(){$(this.fld).removeClass("ac_field_busy").addClass("ac_field");if($("#"+this.acID)){$("#"+this.acID).remove()}this.killTimeout()},createList:function(K){if(this.submitting){return false}var d=this;if(K.results==""){this.cleanup();return false}this.aSug=K.results;if($("#"+this.acID)){$("#"+this.acID).remove()}if($("#"+this.surroundID)){$("#"+this.surroundID).remove()}this.killTimeout();this.position();if(K.results.length==0&&!this.options.shownoresults){return false}var H=this.ce("div",{id:this.surroundID,className:"surroundDiv"});H.onclick=function(){d.clearSuggestions();return false};document.getElementsByTagName("body")[0].appendChild(H);var k=this.ce("div",{id:this.acID,className:this.options.className});var X=this.ce("ul",{id:"ac_ul"});if(K.results.length==0){if(this.options.shownoresults){var V=this.ce("li",{className:"ac_warning"},this.options.noresults);X.appendChild(V)}else{if(this.options.useNotifier){this.fld.removeClass("ac_field_busy");this.fld.addClass("ac_field")}}}else{var T=0;var h=K.results.length;if(this.maxResults<K.results.length){h=this.maxResults}for(var j=0;j<h;j++){var L=K.results[j];var O=L.value;var N="";var o="";var c=this.types[L.type];var e=L.match_type;var V;if(T==0){V=this.ce("li",{className:"first"});T++}else{V=this.ce("li",{})}V.name=j+1;var D;var U=this.removeBold(O);if(e=="category"){D=this.ce("div",{className:"categoryImage",alt:U,title:U},true)}else{if(e=="person"){D=this.ce("div",{className:"personImage",alt:U,title:U},true)}else{if(e=="topic"){D=this.ce("img",{src:L.imageURL,alt:"img",height:40,width:72},true)}else{if(L.imageURL!=""){D=this.ce("img",{src:L.imageURL,alt:"img",height:40,width:72},true)}else{D=this.ce("div",{className:"acOther",alt:U,title:U},true)}}}}var F;var n;if(this.isEditorial){n=this.ce("span",{className:"title"},O,true);F=this.ce("span",{className:"image"},"",true)}else{n=this.ce("a",{href:"#",className:"title"},O,true);F=this.ce("a",{href:"#",className:"image"},D,true)}V.appendChild(F);V.appendChild(n);V.appendChild(this.ce("b",{},"<br/>",true));var f=" Show";if(e!="source"&&e!="category"&&e!="person"&&e!="topic"){switch(L.type){case"tv":f=" Episode";break;case"web":f=" Video";break;case"music":f=" Song";break;case"movie":f=" Movie";break}}var Y=L.episodes;var R=Y>0;var I=Y>1?"s":"";var Q=f+I;var b="Unavailable Online";if(Y&&Y!=""){N=this.ce("p",{},"&nbsp;",true)}switch(e){case"source":N=R?Y+Q:b;N=this.wrapNum(N);break;case"category":N=R?Y+Q:b;N=this.wrapNum(N);break;case"person":N=R?Y+Q:b;N=this.wrapNum(N);break;case"topic":N=R?Y+Q:b;N=this.wrapNum(N);break;case"episode":if(!(this.isEditorial||this.isPlaylist)){if(this.maxTitleLen>=45){var M=L.episode_title;N=this.wrapNum(f)+": "+M;var E=Y-1;if(E>0){I=E>1?"s":"";Q=f+I;N+="<br>"+this.wrapNum("...and "+E+" more matching"+Q)}}else{if(this.maxTitleLen>=25){N=Y+" matching "+Q;N=this.wrapNum(N)}else{N=Y+(Y>1?" matches":" match");N=this.wrapNum(N)}}break}default:if(L.type=="movie"){N=R?f:b}else{N=R?Y+Q:b}N=this.wrapNum(N);break}var B;var G;var J=this.ce("div",{className:"media-icon"+c});if(this.isEditorial){B=this.ce("span",{className:"left"},N,true);G=this.ce("span",{className:"right"},"")}else{B=this.ce("a",{href:"#",className:"left"},N,true);G=this.ce("a",{href:"#",className:"right"},J)}V.appendChild(B);V.onclick=function(a){d.setHighlightedValue(false);return false};V.onmouseover=function(){d.setHighlight(this.name)};X.appendChild(V)}X.appendChild(V)}if(!this.isEditorial&&!this.isPlaylist&&!this.isRec){var m=this.fld.value;var C=$('<li class="ac_search" style="height:15px;text-align:right;margin:5px" name='+(j+1)+'>See all search results for <b>"'+m+'" &raquo;</b></li>');C.click(function(a){location.href="/find/?query="+encodeURIComponent(m)});C[0].onmouseover=function(a){d.setHighlight($(this).attr("name"))};X.appendChild(C[0])}k.appendChild(X);k.style.left=this.popLeft;var Z=K.results.length;var S=this.isPlaylist||this.isEditorial||this.isRec?300:342;var g=Z>=5?S:S/5*Z;g+=16;var W=26;var A=parseFloat(this.popTop)+S;var P=A>$(document).height();if(this.coverTarget!=null){P=false;k.style.width=this.popWidth}else{k.style.width=(parseFloat(this.popWidth)-10)+"px"}k.style.top=P?(parseFloat(this.popTop)-g-W)+"px":this.popTop;k.onmouseover=function(){d.killTimeout()};k.onmouseout=function(){d.resetTimeout();d.clearHighlight()};document.getElementsByTagName("body")[0].appendChild(k);if(this.options.useNotifier){$(this.fld).removeClass("ac_field_busy").addClass("ac_field")}this.iHigh=0;this.toID=setTimeout(function(){d.clearSuggestions()},this.options.timeout)},wrapNum:function(A){return'<span class="leftNum">'+A+"</span>"},changeHighlight:function(A){var B=$("#ac_ul")[0];if(!B){return false}var C;C=(A==40||A==9)?this.iHigh+1:this.iHigh-1;C=(C>B.childNodes.length)?B.childNodes.length:((C<1)?1:C);this.setHighlight(C)},setHighlight:function(E){var B=$("#ac_ul")[0];if(!B){return false}if(this.iHigh>0){this.clearHighlight()}this.iHigh=Number(E);try{var D=document.getElementById("ac_ul");var A=D.getElementsByTagName("li");A[E-1].className="ac_highlight"}catch(C){}this.killTimeout()},clearHighlight:function(){var C=$("#ac_ul")[0];if(!C){return false}if(this.iHigh>0){try{var E=document.getElementById("ac_ul");var A=E.getElementsByTagName("li");for(var B=0;B<A.length;B++){if(B==5){A[B].className="ac_search"}else{A[B].className=""}}}catch(D){}this.iHigh=0}},setHighlightedValue:function(B){B=B==null?true:B;if(this.iHigh){if(!this.aSug[this.iHigh-1]){return }if(undefined!=this.options.valueSep){var C=this.getLastInput(this.fld.value);var A=this.fld.value.lastIndexOf(C);C=this.aSug[this.iHigh-1].value+this.options.valueSep;this.sInp=A==-1?C:this.fld.value.substring(0,A)+C}else{var C=this.getLastInput(this.fld.value);var A=this.fld.value.lastIndexOf(C);C=this.aSug[this.iHigh-1].value;this.sInp=A==-1?C:this.fld.value.substring(0,A)+C}this.fld.value=this.sInp=this.removeBold(this.sInp);this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInp.length,this.sInp.length)}if(B){this.clearSuggestions()}if(typeof this.options.callback=="function"){this.options.callback(this.aSug[this.iHigh-1])}}},killTimeout:function(){clearTimeout(this.toID)},resetTimeout:function(){this.killTimeout();var A=this;this.toID=setTimeout(function(){A.clearSuggestions()},A.options.timeout)},clearSuggestions:function(){this.killTimeout();if($("#"+this.acID)){$("#"+this.acID).fadeOut(200)}if($("#"+this.surroundID)){$("#"+this.surroundID).remove()}}};var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(C){var A="";var J,H,F,I,G,E,D;var B=0;C=Base64._utf8_encode(C);while(B<C.length){J=C.charCodeAt(B++);H=C.charCodeAt(B++);F=C.charCodeAt(B++);I=J>>2;G=((J&3)<<4)|(H>>4);E=((H&15)<<2)|(F>>6);D=F&63;if(isNaN(H)){E=D=64}else{if(isNaN(F)){D=64}}A=A+this._keyStr.charAt(I)+this._keyStr.charAt(G)+this._keyStr.charAt(E)+this._keyStr.charAt(D)}return A},decode:function(C){var A="";var J,H,F;var I,G,E,D;var B=0;C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(B<C.length){I=this._keyStr.indexOf(C.charAt(B++));G=this._keyStr.indexOf(C.charAt(B++));E=this._keyStr.indexOf(C.charAt(B++));D=this._keyStr.indexOf(C.charAt(B++));J=(I<<2)|(G>>4);H=((G&15)<<4)|(E>>2);F=((E&3)<<6)|D;A=A+String.fromCharCode(J);if(E!=64){A=A+String.fromCharCode(H)}if(D!=64){A=A+String.fromCharCode(F)}}A=Base64._utf8_decode(A);return A},_utf8_encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A},_utf8_decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3}}}return B}};var LogIn=function(C,B,A){this.ev={check:"check.login",succeed:"succeed.login",fail:"fail.login"};this.evElem=$("#logLinkItem");this.siID="signin";this.loginUrl="/j_acegi_security_check";this.resetUrl="/login.html";this.lastUsername="";this.displayableFirstName="";this.isLoggedIn=false;this.reloadOnGoodLogin=false;this.isHomePage=A!=null?A:false;this.fbid=null;this.haveup=false;this.csrf_name="csrf_token";this.csrf_value="";this.fbConnected=false;this.tempFBAcct=false;this.displayFbip=false;this.userSetFbShare=false;this.haveEmail=true;this.isFbOnlyEmail=false;this.globalNotify=0;this.numFollowers=0;this.numPendFollowers=0;this.tweet={can:false,checkin:false,love:false,dislike:false,playlist:false,award:false,review:false};this.fbPost={can:false,checkin:false,love:false,dislike:false,playlist:false,award:false,review:false};this.ui={hideWelcome:false,dispedGetEmail:false,hideConnNetflix:false};if(B==true){this.reloadOnGoodLogin=true}if(C){this.checkLogin()}};LogIn.prototype={createDOMElement:function(F,B,A,E){var G=document.createElement(F);if(!G){return 0}for(var C in B){G[C]=B[C]}var D=typeof (A);if(D=="string"&&!E){G.appendChild(document.createTextNode(A))}else{if(D=="string"&&E){G.innerHTML=A}else{if(D=="object"){G.appendChild(A)}}}return G},checkLogin:function(){var A=new Cookie("C_NM").get();if(A){this.userName=A;this.isLoggedIn=true;this.lastUsername=this.userName;this.setLoggedIn(true);this.changeLogin("");this.evElem.trigger(this.ev.check)}return false},bind:function(B,A){this.evElem.bind(B,A)},getInPageToken:function(){if(Util.isEmpty(this.csrf_value)){var A=document.getElementById(this.csrf_name);if(A){this.csrf_value=A.getAttribute("value")}}},getToken:function(){var A=this;this.getInPageToken();if(Util.isEmpty(this.csrf_value)){$.post("/utility/Token/",{AJAX:true,rnd:Math.floor(Math.random()*10001)},function(B){A.csrf_name=B.tokenName;A.csrf_value=B.tokenValue},"json")}},loggedInReturn:function(data){var userInfo=eval("("+data+")");if(!userInfo.isLoggedIn){this.isLoggedIn=false}else{this.userName=userInfo.userName;this.isLoggedIn=true;this.lastUsername=this.userName;this.fbid=userInfo.fbid;this.setLoggedIn(true);this.changeLogin("")}return false},buildForm:function(K,T,L,R){var O=this;var U=this.createDOMElement("p",{className:"title b"},L);var C=this.createDOMElement("form",{id:"loginForm",action:this.loginUrl});K.appendChild(C);var H=this.createDOMElement("div",{id:"wrapper",className:"wrapper"});H.appendChild(U);var G=this.createDOMElement("div",{className:"form"});var S=this.createDOMElement("div",{id:"ftitle"});var N=this.createDOMElement("div",{className:"titleF px12"},"Or use your existing Clicker account:");S.appendChild(N);G.appendChild(S);var E=this.createDOMElement("input",{id:"popusername",className:"textbox",name:"j_username",type:"text",size:"20",maxlength:"20",value:T});G.appendChild(E);var D=$.browser.msie?"password":"text";var B=this.createDOMElement("input",{id:"poppassword",className:"textbox",name:"j_password",type:D,size:"20",maxlength:"64"});G.appendChild(B);var M=this.createDOMElement("input",{id:"submitBtn",className:"popupSubmitBtn",name:"login",value:"",type:"submit"});M.onclick=function(){O.submit();return false};G.appendChild(M);var Q=this.createDOMElement("a",{href:"#",className:"forgotLink"},"Forgot your password?");Q.onclick=function(){O.forgot();return false};G.appendChild(Q);var J=this.createDOMElement("div",{className:"padTopMost"});G.appendChild(J);var A=this.createDOMElement("a",{href:"/create-an-account.html",className:"smaller"},"Create a new Clicker account");J.appendChild(A);var P=this.createDOMElement("div",{className:"clear"});G.appendChild(P);if(!R){var I=document.createElement("div");I.id="fbMsg";var F='<div style="margin:4px 0;height:28px"><fb:login-button length="long" size="large" onlogin="l.fbLoginCB();"></fb:login-button></div>';F+='<div class="smallish">Nothing you do on Clicker will be published to Facebook unless you tell us to.</div>';I.innerHTML=F;H.appendChild(I)}H.appendChild(G);C.appendChild(H);setTimeout(function(){FB.XFBML.parse();$("#popusername").focus(function(){$("#popusername").val("")});$("#poppassword").focus(function(){if(!$.browser.msie){document.getElementById("poppassword").setAttribute("type","password")}$("#poppassword").val("")});$("#popusername").val("Username or Email").addClass("gray");if(!$.browser.msie){$("#poppassword").val("Password").addClass("gray")}},0)},silentFb:function(C){if(Clicker.FBGraph.getUid()!=null){var A=C;var B=this;$.post("/login/AJAX/",{fblogin:"true",AJAX:true,rnd:Math.floor(Math.random()*10001)},function(D){if(D){if(D.isTrue){if(D.extras&&D.extras.firstName){B.displayableFirstName=D.extras.firstName}B.checkLogin();B.processResponse("true")}if(A!=null){A(D.isTrue)}}},"json")}},fbLoginCB:function(B){var A=B;setTimeout(function(){ClkrTop.l.silentFb(function(C){if(C){if(A){A()}}else{ClkrTop.l.close();ClkrTop.Clicker.reloadProfile()}})},1)},start:function(J,K,E){var C=this;var F=document.getElementById(this.siID);if(F){this.close()}var H=J;this.getToken();var A=this.createDOMElement("div",{id:this.siID,className:"signin"});var D=this.createDOMElement("a",{href:"#",className:"close"});D.onclick=function(){C.close();return false};A.appendChild(D);var G=this.createDOMElement("div",{id:"spacing",className:"signin-spacer"});if(K){this.build_forgot(G)}else{this.buildForm(G,"","Log in",E)}A.appendChild(G);var I="popArrowLogin";var B=this.createDOMElement("div",{id:I,className:"popArr"});A.appendChild(B);A.style.position="absolute";document.getElementsByTagName("body")[0].appendChild(A);if(E){$("#"+this.siID).css("width",270)}this.setPosition($(H),$("#"+this.siID),I);return false},setPosition:function(N,G,B){var H=$(window);var O=$(document);var I=H.width()+O.scrollLeft();var Q=H.height()+O.scrollTop();arrow=$("#"+B);var M=N.offset();var L=N.width();var F=N.height();var D=L/2;var J=G.width();var E=G.height();E+=2;var C=((M.left+J)>I)?M.left-J:M.left;var A;if(C<M.left){A=16;arrow.css("left",J-16)}else{A=-10;arrow.css("left",D)}var K=M.top+E>Q?M.top-E-8:M.top+F+8;var P=0;if(K<M.top){arrow.removeClass("popArrowTop").addClass("popArrowBottom")}else{arrow.removeClass("popArrowBottom").addClass("popArrowTop")}G.css({top:(K)+"px",left:(C+A)+"px"});G.css({width:510+"px",height:210+"px"})},forgot_box:function(A){this.start(A,true);return false},forgot:function(A,D){var C=this;var B=document.getElementById("spacing");return this.build_forgot(B,A,D)},build_forgot:function(G,E,C){var A=this;G.innerHTML='<p class="title">Retrieve Password</p>';var I;if(E==null){I=this.createDOMElement("p",{className:"retrieve"},"We'll send instructions to reset your password to the email address associated with your account.")}else{I=this.createDOMElement("p",{className:"retrieve"}," We don't have an account for that email address. Please make sure you entered the right one and try again. If you need help, email help@clicker.com.")}G.appendChild(I);var B=this.createDOMElement("p",{className:"retrieve"},"Please enter your email addess:");G.appendChild(B);var D;if(C==null){D=this.createDOMElement("input",{id:"resetEmail",className:"textbox",name:"email",type:"text",size:"20",maxlength:"20"})}else{D=this.createDOMElement("input",{id:"resetEmail",className:"textbox",name:"email",type:"text",size:"20",maxlength:"20",value:C})}G.appendChild(D);var H=this.createDOMElement("nbsp",{className:"space"});G.appendChild(H);var F=this.createDOMElement("input",{id:"submit",className:"submitBtn",name:"login",value:"Sign in",type:"submit"});F.onclick=function(){A.submit_forgot();return false};G.appendChild(F);return false},submit_forgot:function(){var D=this;var C="AJAX=true&submit=passwordReset&reset=submit&";C+="&"+this.csrf_name+"="+this.csrf_value+"&";var A=document.getElementById("resetEmail");if(A.value==""){this.forgot(true,this.last_email)}C+=A.name+"="+encodeURIComponent(A.value)+"&extra="+Math.floor(Math.random()*10001);this.last_email=A.value;var B=document.getElementById("spacing");B.innerHTML='<p class="title">Retrieve Password</p>';B.innerHTML+="Generating password reset...<br/>";$.ajax({type:"POST",url:this.resetUrl,data:C,complete:function(G,H,E){if(G.status==200){D.forgotResponse(G.responseText)}else{if(G.status==401){var F=G.responseText.trim();if(F.length==32){D.csrf_value=F;D.forgotResponse("false")}}}}});return false},forgotResponse:function(B){var C=this;if(B.indexOf("true")!=-1){var A=document.getElementById("spacing");A.innerHTML='<p class="title">Retrieve Password</p>';A.innerHTML+='<p class="padVert">Success! A password reset link was sent to you. <strong>Please check your email for further instructions.</strong></p></a>'}else{this.forgot(true,this.last_email)}},close:function(){$("#"+this.siID).remove();return false},submit:function(){var D=this;var C="ajaxlogin=true&";var A=document.getElementById("popusername");C+=A.name+"="+A.value+"&";D.lastUsername=A.value;D.userName=A.value;A=document.getElementById("poppassword");C+=A.name+"="+A.value;C+="&"+this.csrf_name+"="+this.csrf_value;var B=document.getElementById("spacing");B.innerHTML="Signing in...<br/>";$.ajax({type:"POST",url:this.loginUrl,data:C,complete:function(G,H,E){if(G.status==200){D.processResponse(G.responseText)}else{if(G.status==401){var F=G.responseText.trim();if(F.length==32){D.csrf_value=F;D.processResponse("false")}}}}});return false},processResponse:function(B){var C=this;if(B.indexOf("false")!=-1){var A=document.getElementById("spacing");if(A){A.innerHTML=""}form=this.buildForm(A,this.lastUsername,"Log in failed.");current.appendChild(form);C.evElem.trigger(C.ev.fail)}else{this.changeLogin("");this.isLoggedIn=true;C.evElem.trigger(C.ev.succeed);if(this.reloadOnGoodLogin){C.close();window.location.reload()}else{C.close();ClkrTop.Clicker.reloadProfile()}}},changeLogin:function(B){var D=this;var C=$("#menuUserName"+B);var A=this.displayableFirstName!=null&&this.displayableFirstName.length>0?this.displayableFirstName:this.lastUsername;A=(A.length>10)?A.substring(0,7)+"...":A;C.text(A);C=$("#menuLink_user"+B);C.attr("href","/profile/");C=$("#logLinkItem"+B);C.attr("href","#");C.text("Log Out");$("#noClickerNoFB").hide();C.click(function(){D.signout();return false})},setLoggedIn:function(A){this.isLoggedIn=A},failed_login:function(B){var A=document.getElementById("spacing");this.buildForm(A,this.lastUsername)},authed:function(A){if(this.isLoggedIn){return true}else{return this.start(A)}},signout:function(B,A){if(Clicker.FBGraph.getUid()!=null){Clicker.FBGraph.doLogout(function(){setTimeout(function(){l.clkrSignout()},1)})}else{this.clkrSignout()}return false},clkrSignout:function(B,D){Clicker.FBGraph.resetLip();var A=D;Playlist.clearUnwatchedCount();var C=new Cookie("sf");if(C.exists()){C.eat()}if(B){$.get("/j_acegi_logout",function(){l.checkLogin();if(A!=null){A()}})}else{ClkrTop.location.href="/j_acegi_logout"}},reqFBConnectId:function(callback){var p=this;$.post("/utility/getFBConnect/",{rnd:Math.floor(Math.random()*10001)},function(data){var fbInfo=eval("("+data+")");p.fbid=fbInfo.fbid;if(callback){callback(fbInfo.fbid)}})},submitDisconnect:function(A){if($("#badfbPassword")[0].innerHTML.indexOf("Valid Password")!=-1&&$("#badfbEmail")[0].innerHTML.indexOf("Valid Email")!=-1){return true}else{return false}},displaySignoutBox:function(){var B=this;var A=this.createDOMElement("div",{id:"signoutBox",className:"signoutBox"});document.getElementsByTagName("body")[0].appendChild(A)},removeSignoutBox:function(){$("#signoutBox").remove()},displaySignoutPrompt:function(){this.displaySignoutBox();var H=this.createDOMElement("div",{id:"signoutMsg",className:"signoutMsg prompt"});var A=this.createDOMElement("div",{className:"bigger red padVert"},"Signing Out");var C=this.createDOMElement("div",{className:"h2div"},"");H.appendChild(A);H.appendChild(C);var E=this.createDOMElement("div",{className:"account-create"});var J=this.createDOMElement("div",{className:"message"},"Would you like to sign out of both Facebook and Clicker, or just Clicker?");E.appendChild(J);var B=this;var G=this.createDOMElement("button",{className:"button"},"Clicker and Facebook");G.onclick=function(){B.signout(this,{facebook:true,clicker:true})};E.appendChild(G);var F=this.createDOMElement("button",{className:"button"},"Clicker Only");F.onclick=function(){B.signout(this,{clicker:true})};E.appendChild(F);var D=this.createDOMElement("button",{className:"button"},"Stay Logged In");D.onclick=function(){B.closeSignoutPrompt()};E.appendChild(D);H.appendChild(E);var I=this.createDOMElement("div",{className:"closeBtn"});I.onclick=function(){B.closeSignoutPrompt()};H.appendChild(I);H.appendChild(E);document.getElementsByTagName("body")[0].appendChild(H)},removeSignoutPrompt:function(){$("#signoutMsg").remove()},closeSignoutPrompt:function(){this.removeSignoutBox();this.removeSignoutPrompt()},displayDisconnectPrompt:function(){$("#disconnectBox").height($(document).height());$("#disconnectBox").css({opacity:0.5,display:""});$("#disconnectMsg").css("display","");Util.scrollTo($("#disconnectMsg"))},closeDisconnectPrompt:function(){$("#disconnectBox").css("display","none");$("#disconnectMsg").css("display","none")}};var Search={tmr:null,getid:0,container:null,serviceUrl:"/utility/search/?",user:null,showMoreEpisodes:function(E,F,B){var A=document.getElementById("moreEps"+F);if(A){var D=A.style.display=="none";var C=D?"less":"more";var B=D?B.replace(/SEE NEXT/,"HIDE LAST"):B.replace(/HIDE LAST/,"SEE NEXT");A.style.display=D?"block":"none";E.className=C;E.innerHTML=B}},searchInInit:function(){this.container=$("#episodesBox");var B=this.container;if(B.length>0){var A=B.height()+"px";B.css("minHeight",A);$("#searchInBtn").bind("click",this.searchIn);$("#searchInClear").bind("click",this.searchIn);$("#searchInInput").bind("keyup",this.searchIn)}},searchIn:function(){clearTimeout(Search.tmr);Search.getid++;var B=Search.getid;var A=this.id.indexOf("Clear")!=-1;Search.tmr=setTimeout(function(){Search._searchIn(B,A)},300)},_searchIn:function(getid,clear){if(getid!=Search.getid){return }var el=$("#searchInInput");var val=encodeURIComponent(el.attr("value"));var searchInUrl=$("#searchInUrl").attr("value");if(!clear){searchInUrl+="&query="+val}if(clear){el.attr("value","");val="";searchInUrl=searchInUrl.replace(/&available=2/,"")}var c=Search.container;el.addClass("ac_field_busy");searchInUrl+="&rnd="+Math.floor(Math.random()*10001);$.get(searchInUrl,null,function(html){c.html(html);$("#searchInInput").removeClass("ac_field_busy");$("#episodeCountMsg").html($("#queryMsg").html());var newCode=$("#episodeTableCallback");if(newCode.length>0&&newCode.html().length>0){eval(newCode.html())}if(val.length==0){$("#searchInBoxContainer").removeClass("activeQuery").addClass("inactiveQuery")}else{$("#searchInBoxContainer").removeClass("inactiveQuery").addClass("activeQuery")}$("#searchInClear").css("display",val.length==0?"none":"")})},searchPopInit:function(){$(".popInput").each(function(A){$(this).bind("focus",Search.popFocus);$(this).bind("blur",Search.popBlur);$(this).bind("keyup",Search.popKeyUp)})},popKeyUp:function(A){if(A.keyCode==13){this.blur()}},popFocus:function(){this.style.color="#333"},popBlur:function(){var A=this.id.split("_")[1];var B=parseInt(this.value);if(isNaN(B)||B<0||B>150){this.style.color="#ff0000";return false}if(l&&l.userName){var C=Search.serviceUrl+"editShowID="+A+"&editShowPopularity="+B+"&rnd="+Math.floor(Math.random()*10001);Util.hiddenImgRequest(C)}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}this.style.color="#bbb"}};var Related={level:0,showids:"",ac:null,lastEdit:"",injectParam:"",init:function(){var A=$("#racbtn");if(A.length>0){A.bind("click",this.addShowClick)}$(".rateStar").each(function(B){var C=$(this);C.data("on",this.src.indexOf("star-on")!=-1);C.bind("mouseenter",function(K){var E=this.id;var G=E.split("_");var J=G[2];for(var H=1;H<=5;H++){var D="rat_"+G[1]+"_"+H;var M=document.getElementById(D);var I=M.src;var F=I.replace(/\.gif/,"Hover.gif");var L=I.replace(/Hover.gif/,".gif");if(H<=J){if(I.indexOf("Hover")==-1){M.src=F}}else{M.src=L}}});C.bind("click",function(H){var I=this.id;var G=I.split("_");var E=G[2];for(var F=1;F<=5;F++){var D="rat_"+G[1]+"_"+F;document.getElementById(D).src="/images/buttons/star-"+(F<=E?"on":"off")+".gif";$("#"+D).data("on",F<=E)}})});$(".rateStarBox").bind("mouseleave",function(C){var D=this.getElementsByTagName("img");for(var B=0;B<D.length;B++){D[B].src=$(D[B]).data("on")?"/images/buttons/star-on.gif":"/images/buttons/star-off.gif"}})},remove:function(E){if(l&&l.userName){var D=E.name;var C="#"+E.id.replace(/rrem/,"ritem");var A=$(C).css("opacity")<1;var B=Search.serviceUrl+"la=related&"+D+"&rnd="+Math.floor(Math.random()*10001);$(C).fadeTo("fast",A?1:0.3);if(A){E.name=E.name.replace(/0.0/,"remove");E.title="remove"}else{E.name=E.name.replace(/remove/,"0.0");E.title="un-remove"}Util.hiddenImgRequest(B)}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}return false},inject:function(B,A){if(A!=this.injectParam){this.injectParam=A;document.getElementById(B).appendChild(document.getElementById("racbox"));document.getElementById("racbox").style.display="";if(this.ac){this.ac.position()}}else{document.getElementById("racbox").style.display="none";this.injectParam=""}},addShowClick:function(E){if(Related.ac&&Related.ac.picked&&Related.injectParam.length>0){var F=Related.ac.picked.show_id+Related.injectParam;var D=Search.serviceUrl;var B=Related.injectParam.split("|");var A="la=related&rel="+F;D+=A;var C="&relRat="+Related.ac.picked.show_id+"|"+B[1]+"|4";D+=C;$("#racbox .loading").show();$.get(D,function(G){$("#racbox .loading").hide();$("#racbox .result").show().delay(1000).fadeOut("slow");$("#racbox .ac_field").val("");window.location.reload(true)});return false}},rate:function(A,B,D){if(l&&l.userName){var E=B+"|"+A+"|"+D;var C=Search.serviceUrl+"la=related&relRat="+E+"&rnd="+Math.floor(Math.random()*10001);Util.hiddenImgRequest(C)}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}},addToCategoryClick:function(C,A){if(l&&l.userName){var D=$("#addCatBox");if(D.data("loaded")){D.slideToggle("fast")}else{D.data("loaded",true);$("#addCatBox").css("display","block");var B=$("#catIdList").html();D.html($('<div class="spinner" style="height:20px;width:20px;"></div>'));Util.ajaxReplace("/categoryTree/?catIdList="+B+"&showid="+A,"addCatBox","",function(){})}}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}return false},addShowToCategoryClick:function(A){if(l&&l.userName){var B=Search.serviceUrl;B+=A.name;B+=A.checked?"add":"remove";B+="&rnd="+Math.floor(Math.random()*10001);Util.hiddenImgRequest(B);Util.message("Show "+(A.checked?"added to ":"removed from")+" category.");return true}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}return false},addEditParam:function(B){if(l&&l.userName){var A=B.href;location.href=A}else{Util.message('<span class="red">Request rejected</span>. You must be logged in.')}return false}};var Filter={init:function(){$("#homeFilterBtn").click(function(A){$("#filterOptions").slideToggle("fast")})},searchOptionClick:function(A){if(A.tagName=="DIV"){if(A.className.indexOf("spinner")==-1){A.className=A.className+" spinner"}var B=A.getElementsByTagName("a");if(B.length>0){location.href=B[0].href}}},linkClick:function(B){var A=B.href;if(B.href.indexOf("#filter")!=-1&&B.name){A="/searchwithin/?"+stripLeadingAmp(B.name)}return this.inlineReplace(A)},optionClick:function(C){var B=null;if(C.tagName=="DIV"){var D=C.getElementsByTagName("a");if(D.length>0){B=D[0];if(C.className.indexOf("spinner")==-1){C.className=C.className+" spinner"}}}else{if(C.tagName=="A"){B=C}}var A=B.href;if(B.href.indexOf("#filter")!=-1&&B.name){A="/searchwithin/?"+this.stripLeadingAmp(B.name)}else{if(B.href.indexOf("/category/")!=-1&&B.name){A="/searchwithin/?"+this.stripLeadingAmp(B.name)}}return this.inlineReplace(A)},stripLeadingAmp:function(A){if(A.substring(0,1)=="&"){return A.substring(1)}else{return A}},inlineReplace:function(reqUrl){reqUrl+="&rnd="+Math.floor(Math.random()*10001);$.get(reqUrl,null,function(html){var c=Search.container;c.html(html);$("#episodeCountMsg").html($("#queryMsg").html());var scrollToElement=$("#episodeListAnchor");if(scrollToElement.length>0){Util.scrollTo(scrollToElement)}var newCode=$("#episodeTableCallback");if(newCode.length>0&&newCode.html().length>0){eval(newCode.html())}});return false},freeButtonClick:function(A,B){Util.scrollTo($("#episodeListAnchor"),true);$("#hideTypeSubOptions input").attr("checked",false);this.handlePaidOptions($(A),false)},freeOptionClick:function(C,D,E,B){var A=$(C);$("#hideTypeSubOptions input").attr("checked",false);if(!B){A.addClass("spinner");this.handlePaidOptions(A,E)}this.save()},clearHomeFilterClick:function(A){this.clearFilter();location.reload();return false},clearFilterClick:function(C){$("#hideTypeSubOptions input").attr("checked",true);var D=$(C);var B=D.attr("href");var A=D.attr("name");if(B.indexOf("#filter")!=-1&&A!=""&&A!=null){B="/searchwithin/?"+this.stripLeadingAmp(A)}this.save();this.inlineReplace(B);return false},paidButtonClick:function(C,D){Util.scrollTo($("#episodeListAnchor"),true);$("#hideTypeSubOptions input").attr("checked",true);var E=$("a",$(C));var B=E.attr("href");var A=E.attr("name");if(B.indexOf("#filter")!=-1&&A!=""&&A!=null){B="/searchwithin/?"+this.stripLeadingAmp(A)}B+="&paid=-1";return this.inlineReplace(B)},paidOptionClick:function(E,F,G,D){var A=$(E);var B=(F.target||F.srcElement);if(B.tagName!="INPUT"){var C=$("input",A);C.attr("checked",C.is(":checked")?"":"checked")}if(!D){A.addClass("spinner");this.handlePaidOptions(A,G)}this.save()},handlePaidOptions:function(C,H){var D="";var E=$("#hideTypeSubOptions input:checked");if(E.length==0){D="&paid=0"}else{var F=$("#hideTypeSubOptions input:not(:checked)");D="&hide_type=";F.each(function(I,J){if(I>0){D+="|"}var L=$(J).attr("id");var K=L.split("_")[0];D+=K})}var G=$("a",C);var B=G.attr("href");var A=G.attr("name");if(B.indexOf("#filter")!=-1&&A!=""&&A!=null){B="/searchwithin/?"+this.stripLeadingAmp(A)}B+=D;if(H){location.href=B}else{return this.inlineReplace(B)}},showMsg:function(){var A=$("#updated");if(A.length>0){A.css("visibility","visible");setTimeout(function(){A.css("visibility","hidden")},2000)}},save:function(){var J=$(".paidOption input");var F="";var E=true;var H=true;for(var G=0;G<J.length;G++){var I=$(J[G]);var B=I.attr("id");if(B!=null&&B.length>0&&B.indexOf("watched")==-1){var A=B.split("_")[0];var D=I.attr("checked");if(D){H=false}else{E=false;if(F.length>0){F+="|"}F+=A}}}if(E){}else{if(H){F+="|paid"}else{}}if(F.length>0){$(".filterBtn").attr("title","Filtered. Click to change.")}else{$(".filterBtn").attr("title","Showing all sources. Click to filter out one or more paid sources.")}var C=new Cookie("sf");C.bake(F,315360000000,"/");this.setFilterSetting(F);Playlist.clearUnwatchedCount()},clearFilter:function(){var B="";var A=new Cookie("sf");A.bake(B,315360000000,"/");this.setFilterSetting(B);Playlist.clearUnwatchedCount()},setFilterSetting:function(B){var A={filter:encodeURIComponent(B)};Clicker.tokenpost("/user/AJAX/modSourceFilter.html",A,function(C){if(C.isTrue){}})}};var Editorial={enabled:false};$(document).ready(function(){if(Editorial.enabled){Related.init();Search.searchPopInit()}Search.searchInInit();Filter.init()});var Media={closeTmr:"",openTmr:"",init:function(){this.menuOffsetL=15;this.menuOffsetR=16;this.menuOffsetT=0;this.hoverId="epInfoBox";this.contentId="epInfoContent";$(".epInfoHover").live("mouseenter",this.onWatchButtonOver).live("mouseleave",this.close);$("#"+this.hoverId).live("mouseleave",function(){Media.close()}).bind("mouseenter",function(){clearTimeout(Media.closeTmr)});$("a.playLink").click(function(B){var A=this.id.split("_");Util.watched(A[0],A[1],A[2],A[3])})},onWatchButtonOver:function(C){var D=this.id.split("_")[1];var A=$("#"+Media.hoverId);var E=$("#"+Media.contentId);me=this;clearTimeout(Media.openTmr);clearTimeout(Media.closeTmr);$("#"+Media.hoverId).hide();Media.positionWin("#"+me.id,"#"+Media.hoverId);var B=$("#wbov_"+D).html();if(B){E.html(B);Media.openTmr=setTimeout(function(){Media.fadeInOverride(A)},250)}},close:function(){var A=$("#"+Media.hoverId);clearTimeout(Media.openTmr);clearTimeout(Media.closeTmr);Media.closeTmr=setTimeout(Media.closeNow,250)},closeNow:function(){Media.fadeOutOverride($("#"+Media.hoverId))},fadeInOverride:function(A){$.browser.msie&&$.browser.version<8?A.show():A.fadeIn("fast")},fadeOutOverride:function(A){$.browser.msie&&$.browser.version<8?A.hide():A.fadeOut("fast")},positionWin:function(B,H){var I=this;var E=$(B).width();var G=$(B).offset();var C=$(window);var K=$(document);var D=C.width()+K.scrollLeft();var M=C.height()+K.scrollTop();var L=$(H).width();var J=$(H+" .popArrow");var A=G.left+E+I.menuOffsetR;J.removeClass("popArrowRight").addClass("popArrowLeft");if(G.left+L+E>D){A=G.left-L-I.menuOffsetL;J.removeClass("popArrowLeft").addClass("popArrowRight")}var F=G.top+I.menuOffsetT;$(H).css({top:(F)+"px",left:(A)+"px"})}};var LargeMedia={lastOverlayId:"",lastBaseClass:"",lastBtnId:"",init:function(){var A=$("#playerPop");if(A.length>0){if($("#playbutton_1").hasClass("watchnowActive")){LargeMedia.lastOverlayId="#freeSources";LargeMedia.lastBaseClass="watchnow";LargeMedia.lastBtnId="#playbutton_1"}else{if($("#download_1").hasClass("downloadActive")){LargeMedia.lastOverlayId="downloadSources";LargeMedia.lastBaseClass="download";LargeMedia.lastBtnId="#download_1"}else{if($("#onDemand_1").hasClass("ondemandActive")){LargeMedia.lastOverlayId="paidSources";LargeMedia.lastBaseClass="ondemand";LargeMedia.lastBtnId="#onDemand_1"}}}$("#playerClose").click(function(){$(LargeMedia.lastOverlayId).css("display","none");$(LargeMedia.lastBtnId).removeClass(LargeMedia.lastBaseClass+"Active").addClass(LargeMedia.lastBaseClass);$("#playerPop").css("display","none");LargeMedia.lastOverlayId="";LargeMedia.lastBaseClass="";LargeMedia.lastBtnId=""});$("#playbutton_1, #download_1, #onDemand_1").click(function(H){var E=$(this);var G=this.className;var D="watchnow";var C="#freeSources";if(G.indexOf("sources")!=-1){D="sources"}else{if(G.indexOf("download")!=-1){D="download";C="#downloadSources"}else{if(G.indexOf("ondemand")!=-1){D="ondemand";C="#paidSources"}}}var B=false;if(E.hasClass(D)){E.removeClass(D).addClass(D+"Active");B=true}else{E.removeClass(D+"Active").addClass(D)}if(LargeMedia.lastOverlayId.length>0&&LargeMedia.lastOverlayId!=C){$(LargeMedia.lastOverlayId).css("display","none");$(LargeMedia.lastBtnId).removeClass(LargeMedia.lastBaseClass+"Active").addClass(LargeMedia.lastBaseClass)}LargeMedia.lastOverlayId=C;LargeMedia.lastBtnId="#"+this.id;LargeMedia.lastBaseClass=D;$(C).css("display",B?"":"none");var F=($("#embedWrapper").height()-45)+"px";if(B){$("#playerPop, #imageBackgroundID").height(F).fadeIn("fast")}else{$("#playerPop, #imageBackgroundID").height(F).fadeOut("fast")}})}}};var ShowHover=function(A){this.init(A)};ShowHover.prototype={init:function(A){this.box=$("#showInfoBox");this.content=$("#showInfoContent");this.arrow=$("#popArrow");this.openTmr=null;this.closeTmr=null;this.infoBoxId=null;this.prefix="show";this.offsetRt=0;this.offsetLt=0;this.offsetTop=5;this.useOldCalcs=false;var B=this;this.box.bind("mouseleave",function(){B.close()}).bind("mouseenter",function(){clearTimeout(B.closeTmr)});if(typeof (A)!="undefined"){if(A.prefix!=null){this.prefix=A.prefix}if(A.offsetLt!=null){this.offsetLt=parseInt(A.offsetLt)}if(A.offsetRt!=null){this.offsetRt=parseInt(A.offsetRt)}if(A.offsetTop!=null){this.offsetTop=parseInt(A.offsetTop)}if(A.useOldCalcs!=null){this.useOldCalcs=A.useOldCalcs}}this.classNm="."+this.prefix+"Hover";this.hoverId="#"+this.prefix+"Info_";this.rebind()},close:function(){$("#showInfoBox").fadeOut("fast");p.saveToParent()},saveToParent:function(){var B=this;var A=B.content.html()},rebind:function(){var A=this;if(this.box.length>0){$(this.classNm).live("mouseenter",function(B){clearTimeout(A.openTmr);clearTimeout(A.closeTmr);var C=this;A.openTmr=setTimeout(function(){var J=A.box;J.css("display","none");var H=C.id;var I=H.split("_")[1];var P=$(C).offset();var F=$(A.hoverId+I);A.infoBoxId=A.hoverId+I;if(F.length>0){var D=F.html();A.content.html(D);var L=$(window);var Q=$(document);var K=L.width()+Q.scrollLeft();var S=L.height()+Q.scrollTop();var G=H.indexOf("rshow")!=-1;var R=$("#showInfoBox").width();var N=$(C).width();var E=G||(P.left+R+N)>K?P.left-R-A.offsetLt:P.left+N+A.offsetRt;if(A.useOldCalcs){E=G||P.left+425>K?P.left-274:P.left+155}if(E>P.left){A.arrow.removeClass("popArrowRight").addClass("popArrowLeft")}else{A.arrow.removeClass("popArrowLeft").addClass("popArrowRight")}var M=P.top+200>S;var O=M?P.top-75:P.top+A.offsetTop;if(M){A.arrow.css("top","80px")}else{A.arrow.css("top","8px")}J.css({top:(O)+"px",left:(E)+"px"});J.fadeIn("fast")}},250)}).live("mouseleave",function(B){clearTimeout(A.openTmr);A.saveToParent();A.closeTmr=setTimeout(function(){$("#showInfoBox").fadeOut("fast")},250)})}}};var HBrowse=function(A){HBrowse.instances[A]=this.init(A)};HBrowse.instances={};HBrowse.get=function(A){return HBrowse.instances[A]};HBrowse.prototype={init:function(A){this.id=A;this.box=$("#"+A);this.frame=1;this.highestFrame=1;this.framesPerAjaxCall=1;this.moveTmr=null;this.colNum=3;this.totalResults=0;this.moreLikeData=[];this.browseParam="browsecat";this.pageParam="page";this.defaultKeyHandler=false;this.isOver=false;this.extraBrowseParams="";this.colsPerPage=4;this.colWidth=170;this.isEpCarousel=false;this.widgetsPerPage=this.colNum*this.colsPerPage;var B=this;this.box.mouseenter(function(){B.isOver=true}).mouseleave(function(){B.isOver=false});$(document).keydown(function(F){if(F.target.tagName=="INPUT"){var G=F.target.value;if(G.length>0){return }}var E=B.isOver;if(!E&&B.defaultKeyHandler){E=true;for(var H in HBrowse.instances){var D=HBrowse.instances[H];if(H!=B.bid&&D.isOver){E=false;break}}}if(E){var C=F.keyCode;if(C==37){F.preventDefault();B.move(false)}else{if(C==39){F.preventDefault();B.move(true)}}}});return this},move:function(J,A){var M=1;var C=true;if(arguments.length>1){pages=A.pages?A.pages:1;C=A.animate?A.animate:true}this.frame=J?this.frame+1:this.frame-1;this.frame=Math.max(this.frame,1);var E=(this.frame-1)*this.colsPerPage;var O=-(E*this.colWidth);var N=$("#viewContent",this.box);if(this.frame>this.highestFrame){var G=this;N.animate({left:O,duration:500},function(){G.fillWhenReady(0)});var K="";if(this.moreLikeData.length>0){var B="";var L=this.moreLikeData.length;var H=3;for(var I=L-1;I>=0;I--){if(H>0){B+=this.moreLikeData[I].id+"|"}H--}B=B.substring(0,B.length-1);K=$("#browseLikeUrl").attr("value");K+="&shows="+B}else{K=$("#searchInUrl").attr("value");var D=$("#searchInInput");var F=encodeURIComponent(D.attr("value"));if(F!=""){K+="&query="+F}}if(this.isEpCarousel){K+="&isEpCarousel=1&doSourceFilter=-1&"+this.pageParam+"="+Math.ceil(this.frame/this.framesPerAjaxCall)}else{K+="&"+this.browseParam+"=1&colnum="+this.colNum+"&"+this.pageParam+"="+this.frame}if(this.extraBrowseParams.length>0){K+="&"+this.extraBrowseParams}K+="&rnd="+Math.floor(Math.random()*10001);$("#working",this.box).css("visibility","visible");$.get(K,null,function(P){G.html=P});this.highestFrame+=this.framesPerAjaxCall}else{N.animate({left:O,duration:500})}var G=this;if(J){$("#rightArrow",this.box).removeClass("rightArrow").addClass("rightArrowOn");setTimeout(function(){$("#rightArrow",G.box).removeClass("rightArrowOn").addClass("rightArrow")},500)}else{$("#leftArrow",this.box).removeClass("leftArrow").addClass("leftArrowOn");setTimeout(function(){$("#leftArrow",G.box).removeClass("leftArrowOn").addClass("leftArrow")},500)}this.highestFrame=Math.max(this.frame,this.highestFrame);if(this.frame==1){$("#leftArrow",this.box).css("visibility","hidden")}else{$("#leftArrow",this.box).css("visibility","visible")}if((this.frame)*this.widgetsPerPage>=this.totalResults){$("#rightArrow",this.box).css("visibility","hidden")}else{$("#rightArrow",this.box).css("visibility","visible")}},fillWhenReady:function(wait){clearTimeout(this.moveTmr);if(this.html!=null){var c=$("#viewContent",this.box);var newHtml=$(this.html);c.append(newHtml);$("#working",this.box).css("visibility","hidden");var newCode=$("#browseShowCallBack",this.box);if(newCode.length>0&&newCode.html().length>0){eval(newCode.html())}this.html=null}else{var thisObj=this;this.moveTmr=setTimeout(function(){thisObj.fillWhenReady(wait+1)},100)}},moreLikeThis:function(C,E,G,K){var F=this.moreLikeData.length;var B=3;for(var D=F-1;D>=0;D--){if(B>0){if(C==this.moreLikeData[D].id){Util.message("Already browsing shows like "+K);return false}}B--}var I='<div class="fl padLeftMore"><a title="'+K.replace(/'/g,"")+'" href="'+G+'"><img height="25" width="45" src="'+E+'"></a></div>';this.moreLikeData.push({id:C,html:I});var J=$("#viewContent",this.box);J.html("");this.frame=0;this.highestFrame=0;this.move(true);var A="";B=3;F=this.moreLikeData.length;for(var D=F-1;D>=0;D--){if(B>0){A+=this.moreLikeData[D].html}B--}var H=$("#moreLikeThis");H.html(A);$("#clearLikeThis").css("display","block");$("#browseTitle",this.box).html('Browsing shows like <a href="'+G+'">'+K+"</a>");$("#leftArrow,#rightArrow",this.box).css("visibility","hidden")},clearMore:function(){this.moreLikeData=[];var A=$("#viewContent",this.box);A.html("");this.frame=0;this.highestFrame=0;this.move(true);$("#clearLikeThis").css("display","none");$("#moreLikeThis",this.box).html("");$("#browseTitle",this.box).html("")}};$(document).ready(function(A){Media.init();LargeMedia.init()});var Playlist={curUserName:"",isCurUser:false,btnTitles:{playlistWatched:"You have watched this. Click to mark as unwatched",playlistUnwatched:"You have not watched this yet. Click to mark as watched."},curShowId:null,pageEps:{},pageItems:1,watchedState:{watched:false,unwatched:true},init:function(){if(this.isCurUser){$(".notifyFreqBtn").live("click",this.changeNotifyClick);$(".plItem").live("mouseenter",function(){var A=$(this);A.addClass("plItemOver");$(".plItemRem",A).show()}).live("mouseleave",function(){var A=$(this);A.removeClass("plItemOver");$(".plItemRem",A).hide()});$(".moreEpsBtn").live("click",function(){var A=this.id.split("_")[1];var C=$(this);var E=$("#playlistEpsBox_"+A);var D=E.data("opened");if($(this).hasClass("arrowRightGray")){$(this).removeClass("arrowRightGray").addClass("arrowDownGray")}else{$(this).removeClass("arrowDownGray").addClass("arrowRightGray")}if(D){E.slideUp("fast");E.data("opened",false);return }else{E.empty().show();E.data("opened",true);Playlist.pageEps[A]=1}var B="/profile/"+Playlist.curUserName+"/AJAX/queue/";$("#loading_"+A).show();$.get(B,{shows:A,num_eps_res:16,page_eps:Playlist.pageEps[A],pl_watched:Playlist.getWatchedParam(),AJAX:true,rnd:Util.random()},function(G){var F=$(G).hide();if(A!=Playlist.curShowId){Playlist.curShowId=A}else{}E.append(F);F.slideDown();$("#loading_"+A).hide()})});$(".moreBtn").live("click",function(){var A=this.id.split("_")[1];var C=$(this);var D=$("#playlistEpsBox_"+A);Playlist.curShowId=A;Playlist.pageEps[A]++;var B="/profile/"+Playlist.curUserName+"/AJAX/queue/";$(".moreMsg",C).addClass("spinner");$.get(B,{shows:A,num_eps_res:16,page_eps:Playlist.pageEps[A],pl_watched:Playlist.getWatchedParam(),AJAX:true,rnd:Util.random()},function(F){var E=$(F).hide();D.append(E);E.slideDown();C.hide();$(".moreMsg",C).removeClass("spinner")})});$(".actPlayRemove").live("click",function(){var F=this.id.split("_");var B=F[1];$("#plItem_"+B).fadeOut();var D=null;var C=false;do{B++;D=$("#plItemIndex_"+B);if(D.length>0){var A=parseInt(D.text());D.text(--A);C=true}else{C=false}}while(C);var E="D|s:"+F[2];if(F.length==4){E="d|s:"+F[2]+"|"+F[3]}Playlist.clearUnwatchedCount();var H=function(I){setTimeout(function(){Util.message("Item removed from Queue");Playlist.setUnwatchedCount()},1000)};var G={la:"playlist",pl:E};Clicker.tokenpost("/user/AJAX/queue/",G,H)})}$(".moreItemsBtn").live("click",function(){var C=$(this);var D=$("#playlistItemsBox");var A=this.id.split("_")[1];Playlist.pageItems++;var B="/profile/"+Playlist.curUserName+"/AJAX/queue/";$(".moreMsg",C).addClass("spinner");$.get(B,{num_res:50,page:Playlist.pageItems,page_index:A,AJAX:true,pl_watched:Playlist.getWatchedParam(),rnd:Util.random()},function(F){var E=$(F).hide();D.append(E);E.slideDown();C.hide();$(".moreMsg",C).removeClass("spinner")})});$("#playlistFilter #hideTypeSubOptions,#freeSourceOption,#watchOptions").click(function(B){var A="/profile/"+Playlist.curUserName+"/AJAX/queue/";var C={AJAX:true,rnd:Util.random()};C.pl_watched=Playlist.getWatchedParam();$("#loading").show();$.get(A,C,function(D){Playlist.updateHtml(D);$("#loading").hide()})})},getWatchedParam:function(){var A=Playlist.watchedState;var B=-2;if(A.watched&&A.unwatched){}else{if(A.watched){B=1}else{if(A.unwatched){B=0}else{}}}return B},watchedOptionClick:function(C,D){var A=$(C);var B=(D.target||D.srcElement);if(B.tagName!="INPUT"){inp=$("input",A);inp.attr("checked",inp.is(":checked")?"":"checked")}var E=C.id.split("_")[0];Playlist.watchedState[E]=document.getElementById(E+"_input").checked},setUnwatchedCount:function(){if(l&&l.isLoggedIn&&l.userName!=null){var C=new Cookie("uw");if(C.exists()){var B=C.get();if((!isNaN(B)&&B>0)||B=="1000+"){$("#uwCountNum").html(B);$("#uwCount").show()}}else{var A="/user/playlistcount/AJAX/?AJAX=true&pl_watched=0&rnd="+Math.floor(Math.random()*10001);$.get(A,function(E){if(!isNaN(E)){E=parseInt(E);E=isNaN(E)?0:E;var D=E<=1000?E:"1000+";C.bake(D,315360000000,"/");if(E>0){$("#uwCountNum").html(D);$("#uwCount").fadeIn()}}})}}},clearUnwatchedCount:function(){var A=new Cookie("uw");if(A.exists()){A.eat()}$("#uwCount").hide()},updateHtml:function(A){$("#profileBox").html(A);Util.scrollTo($("#profileBox"))},insertAJAX:function(A){var C=A.lastIndexOf("/");if(C<=0){C=A.indexOf("?");if(C<=0){C=A.indexOf("&")}}var B=A.substring(0,C+1)+"AJAX/"+A.substring(C+1);return B},modShowNotify:function(A,C,B){var D={show:A,freq:C};Clicker.tokenpost("/user/AJAX/modNotify.html",D,function(E){if(E.isTrue){if(B){setTimeout(function(){if(C!=0){Util.message("You will receive an email when new episodes are available.")}else{Util.message("No email notifications will be sent for this show.")}},500)}}})},addTo:function(A,B){if(l.isLoggedIn){Playlist.clearUnwatchedCount();var C={rnd:Math.floor(Math.random()*10001)};Clicker.tokenpost(Playlist.insertAJAX(A),C,function(D){if($(B).hasClass("addBtn")){$(B).removeClass("addBtn").addClass("checkBtn").attr("title","Show added to your Queue.")}Util.message(D.msg+'<br/><a id="goToPlayList" href="/user/queue/">Go To My Queue</a>');Playlist.setUnwatchedCount()})}else{if(B[0]){B=B[0]}Clicker.waitForLogin(B,Playlist,Playlist.addTo,[A,B]);return false}return true},addLinkClick:function(A){Playlist.addTo(this.href,this);return false},changeNotifyClick:function(D){var C=$(this);var A=this.id.split("_")[1];var G=C.hasClass("nfsel");var B=G?0:3;var F="";if(G){C.removeClass("nfsel").html("Notifications OFF");F="Notifications turned OFF for this show"}else{C.addClass("nfsel").html("Notifications ON");F="Notifications turned ON for this show"}var E={show:A,freq:B};Clicker.tokenpost("/user/AJAX/modNotify.html",E,function(H){Util.message(F)})},addBtnClick:function(C,E){if($(C).hasClass("checkBtn")){return false}Playlist.clearUnwatchedCount();var D=C.id.split("_");var A=D[1];if(C.id.indexOf("Episode")!=-1){var B="/user/queue/?la=playlist&pl=a|s:"+A+"|"+D[2];if(Playlist.addTo(B,C)){$(C).removeClass("addBtn").addClass("checkBtn").attr("title","Show added to your Queue.")}}else{if(C.id.indexOf("Movie")!=-1){var B="/user/queue/?la=playlist&pl=A|s:"+A;if(Playlist.addTo(B,C)){$(C).removeClass("addBtn").addClass("checkBtn").attr("title","Movie added to your Queue.")}}else{var B="/user/queue/?la=playlist&pl=A|s:"+A;if(Playlist.addTo(B,C)){$(C).removeClass("addBtn").addClass("checkBtn").attr("title","Show added to your Queue.")}}}return false},addShowBtnClick:function(D,F){Playlist.clearUnwatchedCount();var E=D.id.split("_");var A=E[1];var C=C||{action:"A",eltype:"s",ids:A};var B="/user/queue/?la=playlist&pl="+C.action+"|"+C.eltype+":"+C.ids;Playlist.addTo(B,D);return false},addEpisodeBtnClick:function(C,A,D){var B="/user/queue/?la=playlist&pl=a|s:"+A+"|"+D;Playlist.addTo(B,C);return false},profVisClick:function(B){var A=$(this);var C=A.hasClass("public")?1:0;ProfileVisBox.load(this,C,function(E){var D={vis:E};Clicker.tokenpost("/user/AJAX/modVis.html",D,function(F){if(F.isTrue){E=(+E);Util.message(F.msg,4000);if(E==1){A.addClass("public");A.html("<span>Profile is public</span>")}else{A.removeClass("public");A.html("<span>Profile is private</span>")}}else{Util.message("Error setting profile visibility.")}})})},watchButtonClick:function(F,J,E,B,D){var I=$(F);J=I.hasClass("playlistUnwatched")||I.hasClass("checkin");var C,G,L;if(B!=null){C=D=="1"?(J?"x":"v"):(J?"w":"u");G=E+"|"+B;L="episode"}else{C=J?"W":"U";G=E;L="show";var K=$("#moreEpsBox_"+E);if(K.length>0&&K.html().indexOf("unwatched")!=-1){if(J){$("span",K).html("0")}else{$("span",K).html("New")}}}var A=$(F);if(A.hasClass("afilter")){A.fadeOut("fast")}else{if(A.hasClass("checkin")||A.hasClass("checkined")){if(J){setTimeout(function(){A.removeClass("checkin").addClass("checkined");A.attr("title","You watched this. Click to mark as unwatched in your queue.")},500)}else{setTimeout(function(){A.removeClass("checkined").addClass("checkin");A.attr("title","Mark as watched in your queue")},500)}}else{if(J){A.removeClass("playlistUnwatched").addClass("playlistWatched");A.html("Watched");A.attr("title","You have watched this. Click to mark as unwatched")}else{A.removeClass("playlistWatched").addClass("playlistUnwatched");A.html("Unwatched");A.attr("title","You have not watched this. Click to mark as watched")}}}if(B==null){var E=F.id.split("_")[1];var H=$("#playlistEpsBox_"+E);H.empty().hide();var K=$("#moreEpsBox_"+E);K.removeClass("arrowDownGray").addClass("arrowRightGray")}this.doPlaylistAction({action:C,eltype:"s",ids:G},function(){if(J){}else{Util.message("Marked "+L+" as unwatched.")}Playlist.setUnwatchedCount()})},doPlaylistAction:function(B,D){Playlist.clearUnwatchedCount();B=B||{action:"A",eltype:"s",ids:-1};var A="/user/AJAX/queue/?AJAX=true";A+="&la=playlist&pl="+B.action+"|"+B.eltype+":"+B.ids;var C={};Clicker.tokenpost(A,C,D)}};var ProfileVisBox={freqText:["private","public","followers only"],closeTmr:null,box:null,arrow:null,init:function(){this.box=$("#profVisBox");this.arrow=$("#profVisPopArrow");this.box.bind("mouseleave",function(A){ProfileVisBox.closeTmr=setTimeout(function(){ProfileVisBox.cancel()},500)});this.box.bind("mouseenter",function(A){clearTimeout(ProfileVisBox.closeTmr)});$("#profVisBox .grayCancelBtn").click(function(){ProfileVisBox.cancel()})},load:function(L,J,N){if(J!=null){$("[name=profileVisibility][value="+J+"]").attr("checked","checked")}var G=$(window);var R=$(document);var H=G.width()+R.scrollLeft();var C=G.height()+R.scrollTop();L=$(L);var I=L.offset();var A=L.width();var M=L.height();var O=A/2;var K=this.box.width();var Q=this.box.height();Q+=26;var D=((I.left+K)>H)?I.left-K:I.left;var B;if(D<I.left){B=16;ProfileVisBox.arrow.css("left",K-16)}else{B=-10;ProfileVisBox.arrow.css("left",O)}var P=I.top+Q>C?I.top-Q-8:I.top+M+8;var F=0;if(P<I.top){ProfileVisBox.arrow.removeClass("popArrowTop").addClass("popArrowBottom")}else{ProfileVisBox.arrow.removeClass("popArrowBottom").addClass("popArrowTop")}this.box.css({top:(P)+"px",left:(D+B)+"px"});var E=N;$("#profVisBox .blueSubBtn").unbind("click.ProfileVisBoxSubmit").bind("click.ProfileVisBoxSubmit",function(){E($("[name=profileVisibility]:checked").val());ProfileVisBox.box.fadeOut("fast")});L.bind("mouseleave.ProfileVisBox",function(){ProfileVisBox.closeTmr=setTimeout(function(){ProfileVisBox.cancel()},500);$(this).unbind("mouseleave.ProfileVisBox")});this.box.fadeIn("fast")},cancel:function(){this.box.fadeOut("fast")}};var PlaylistTabs={curTab:null,init:function(A){A=A||{};this.hookupEvents()},hookupEvents:function(){this.curTab=$(".filter.fsel")[0];$(".jsTab").click(function(){if(PlaylistTabs.curTab!=null){$(PlaylistTabs.curTab).removeClass("fsel");PlaylistTabs.getBox(PlaylistTabs.curTab).hide()}PlaylistTabs.curTab=this;var A=$(this);A.addClass("fsel");var B=PlaylistTabs.getBox(this);B.show();if(this.id=="tab_recs_to"){$("#activityList").fadeTo("fast",0.7);var C={as_filter:"social_call_to"};$.get("/tabs/AJAX/userrecs/",C,function(D){$("#activityList").html(D);Clicker.Activity.as_options.as_filter="social_call_to";$("#activityList").fadeTo("fast",1)});A.data("clicked",true)}else{if(this.id=="tab_recs_from"){$("#activityList").fadeTo("fast",0.7);var C={as_filter:"social_call_from"};$.get("/tabs/AJAX/userrecs/",C,function(D){$("#activityList").html(D);Clicker.Activity.as_options.as_filter="social_call_from";$("#activityList").fadeTo("fast",1)});A.data("clicked",true)}else{Clicker.Activity.as_options.as_filter=""}}})},getBox:function(C){var D=C.id;var B="#tabContent_"+D.split("_")[1];var A=$(B);return A}};$(document).ready(function(A){ProfileVisBox.init()});var report=function(A,D,C){var B="/edit.html";this.episodeId=A;this.episodeTitle=D;this.episodeUrl=C};report.prototype={createDOMElement:function(F,B,A,E){var G=document.createElement(F);if(!G){return 0}for(var C in B){G[C]=B[C]}var D=typeof (A);if(D=="string"&&!E){G.appendChild(document.createTextNode(A))}else{if(D=="string"&&E){G.innerHTML=A}else{if(D=="object"){G.appendChild(A)}}}return G},reportProb:function(U,O,C){var R=$("#reportaproblem");var F=R.offset();pTop=(F.top-10)+"px";pleft=(F.left-208)+"px";var S=this.createDOMElement("div",{id:"holdIt",className:"holdIt zPopUpLow"},"");S.style.position="absolute";S.style.top=pTop;S.style.left=pleft;var N=this.createDOMElement("a",{href:"#",className:"close"});N.onclick=function(){r.close();return false};S.appendChild(N);var M=this.createDOMElement("div",{id:"holdIt_holder",className:"holder"});var Y=this.createDOMElement("h3",{className:"title"},"Problems with this video? Let us know!");M.appendChild(Y);var A=this.createDOMElement("form",{id:"form",className:"form"},"");var Q=this.createDOMElement("input",{type:"radio",id:"check1",className:"check1",name:"check",value:"Video no longer available"});A.appendChild(Q);var E=this.createDOMElement("label",{},"Video no longer available.");A.appendChild(E);var X=this.createDOMElement("br",{className:"clear"});A.appendChild(X);var K=this.createDOMElement("input",{type:"radio",id:"check2",className:"check2",name:"check",value:"Video not playing correctly"});A.appendChild(K);var P=this.createDOMElement("label",{},"Video not playing correctly.");A.appendChild(P);var W=this.createDOMElement("br");A.appendChild(W);var V=this.createDOMElement("br");A.appendChild(V);var H=this.createDOMElement("label",{id:"commenttitle"},"What Happened?");A.appendChild(H);V=this.createDOMElement("br");A.appendChild(V);var G=this.createDOMElement("textarea",{id:"reportComments",className:"problemArea",name:"comments",rows:3});A.appendChild(G);var T=this.createDOMElement("br");A.appendChild(T);var I=this.createDOMElement("input",{id:"submit",className:"submitBtn",name:"SUBMIT",value:"Submit",type:"button"});A.appendChild(I);I.onclick=function(){r.submit();return false};var D=this.createDOMElement("input",{id:"cancel",className:"submitBtn",name:"Cancel",value:"Cancel",type:"button"});A.appendChild(D);D.onclick=function(){r.close();return false};var J=this.createDOMElement("input",{id:"episodeId",className:"episodeId",name:"episodeId",type:"hidden",value:U});A.appendChild(J);var L=this.createDOMElement("input",{id:"episodeTitle",className:"episodeTitle",name:"episodeTitle",type:"hidden",value:O});A.appendChild(L);var B=this.createDOMElement("input",{id:"episodeUrl",className:"episodeUrl",name:"episodeUrl",type:"hidden",value:C});A.appendChild(B);M.appendChild(A);S.appendChild(M);document.getElementsByTagName("body")[0].appendChild(S)},onResize:function(){var A=$("#reportaproblem");if(A){var C=A.offset();pTop=(C.top-10)+"px";pleft=(C.left-208)+"px";var B=document.getElementById("holdIt");if(B){B.style.top=pTop;B.style.left=pleft}}},submit:function(){var F={reportproblem:true};var D=document.getElementById("reportComments");F[D.name]=D.value;var C=document.getElementById("check1");if(C.checked==true){F.check1="checked"}var A=document.getElementById("check2");if(A.checked==true){F.check2="checked"}var G=document.getElementById("episodeId");F[G.name]=G.value;var E=document.getElementById("episodeTitle");F[E.name]=E.value;var B=document.getElementById("episodeUrl");F[B.name]=escape(B.value);Clicker.tokenpost("/edit.html",F,function(H){});this.thanks();return false},thanks:function(){var B=document.getElementById("holdIt_holder");B.innerHTML="";var E=this.createDOMElement("h3",{className:"title"},"Thank You!");B.appendChild(E);var A=this.createDOMElement("p",{className:"messageBody"},"Your comments have been submitted. Thank you for reporting the issue.");B.appendChild(A);var D=this.createDOMElement("form",{id:"form",className:"form"},"");var C=this.createDOMElement("input",{id:"close",className:"submitBtn",name:"Close",value:"Close",type:"button"});D.appendChild(C);C.onclick=function(){r.close();return false};B.appendChild(D);return false},close:function(){$("#holdIt").remove();return false}};var r=null;function reportHere(A,C,B){if(r!=null){return r.reportProb(A,C,B)}else{r=new report();return r.reportProb(A,C,B)}}var Share={shortener:null,msg:"",linkUrl:location.href,isEpisode:false,mediaType:"",diggUrl:"",stumbleUrl:"",popWinName:"shareWin",popWinArgs:"scrollbars=1,toolbar=0,status=0,resizable=1,width=740,height=480",liveHandle:"@ClickerLive",mailTo:"",closeTmr:null,box:null,init:function(){this.shortener=new shortener();this.box=$("#shareBox");this.box.unbind("mouseenter").bind("mouseenter",function(){clearTimeout(Share.closeTmr)}).unbind("mouseleave").bind("mouseleave",function(){Share.closeTmr=setTimeout(function(){Share.box.fadeOut("fast")},750)})},setMsg:function(B,A){this.linkUrl=A?A:location.href;this.msg=B;this.diggUrl="http://digg.com/submit?url="+encodeURIComponent(this.linkUrl)+"&title="+encodeURIComponent(this.msg);this.stumbleUrl="http://www.stumbleupon.com/submit?url="+encodeURIComponent(this.linkUrl)+"&title="+encodeURIComponent(this.msg);$(".shareOnFacebook, .shareFB").attr("href","javascript:var%20d=document,f='http://www.facebook.com/share',loc=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1255638955&u='+e('"+this.linkUrl+"')+'&t='+e('"+this.msg.replace(/'/,"\\'")+"');1;try{if%20(!/^(.*.)?facebook.[^.]*$/.test(loc.host))throw(0);share_internal_bookmarklet(p)}catch(z)%20{a=function()%20{if%20(!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if%20(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)");this.mailTo="mailto:?subject="+B+"&body="+B+": "+A},shareBtnClick:function(C,K,D,B){K=$.Event(K);this.setMsg(D,B);var H=C.id.split("_")[1];var I=this.box;I.css("display","none");var M=I.outerHeight();var G=$(C);var A=G.position();var E=$(".hvrcmmt_below",I);E.css("top",M-3);var F=$(".hvrcmmt_above",I);F.css("left",0);var L=G.offset();var J={top:L.top,left:L.left};J.top=L.top+G.outerHeight()+5;J.left=L.left-8;F.css("visibility","visible");E.css("visibility","hidden");if(Util.isiDevice){J.top-=window.pageYOffset;J.left-=window.pageXOffset}I.css("top",J.top);I.css("left",J.left);I.fadeIn("fast");$(C).unbind("mouseleave").bind("mouseleave",function(N){Share.closeTmr=setTimeout(function(){Share.box.fadeOut("fast")},1000)});return false},tweetUs:function(K){var I;if(K==undefined){I=Share.msg}else{I=K}var H=this.newWin();if(l.isLoggedIn){var B=$(".suggestFriend")[0];var G,C="";var F=B.id.split("_");var J="_";if(F.length>1){G=F[1];J+=G;if(F.length>2){C=F[2];J+="_"+C}}var E={showId:G,episodeId:C,action_target:$("#sugTarget"+J).html(),action_target_url:$("#sugTargetUrl"+J).html(),comment:"",device:"web",src_title:"Clicker",src:"Clicker"};Clicker.tokenpost("/user/AJAX/modRec.html",E,function(L){if(L.isTrue==true){var O="http://"+location.host+L.extras.recUrl;var M="http://twitter.com/?status="+encodeURIComponent(I);try{Share.shortener.afterResponse=function(){var P=Share.shortener.shortUrl;var Q="http://twitter.com/?status=";Share.shareWin(Q+encodeURIComponent(I+": ")+P)};Share.shortener.shorten(O)}catch(N){Share.shareWin(M);Util.message("Error processing request.")}}else{Util.message("Error processing request.")}})}else{var A="http://twitter.com/?status="+encodeURIComponent(I);try{Share.shortener.afterResponse=function(){var L=Share.shortener.shortUrl;var M="http://twitter.com/?status=";Share.shareWin(M+encodeURIComponent(I+": ")+L)};Share.shortener.shorten(Share.linkUrl)}catch(D){Share.shareWin(A);alert(D)}}return false},tweetLive:function(){var A="http://twitter.com/home?status="+encodeURIComponent("Hey: "+this.liveHandle+" "+$("#liveTweetMessage").val());this.shareWin(A);return false},shareWin:function(A){window.open(A,this.popWinName,this.popWinArgs);return false},newWin:function(){var A=window.open("",this.popWinName,this.popWinArgs);A.document.writeln('<html><head></head><body style="text-align:center;"><div style="margin:100px 0 0 0;"><img src="/images/general/loading.gif"></div></body></html>');A.document.close();return A},mailThis:function(E,D,A){E=E||Share.msg;var A=A||E;D=D||Share.linkUrl;var C="mailto:?subject="+E+"&body="+A+": "+D;var B=window.open(C,"shareEmail");if(B&&B.open){B.close()}return false}};var shortener=function(A){this.onLoad=this.bitlyShorten;instance=this};shortener.prototype={bitly_src:"http://bit.ly/javascript-api.js?version=latest&login=clicker&apiKey=R_fcacf9ec8c9e82017abc10477fc11b4a",libLoaded:false,longUrl:"",shortUrl:"",instance:false,loadLibrary:function(){var A=$("head")[0];if(A){var B=document.createElement("script");B.id="bitly";B.src=this.bitly_src;document.getElementsByTagName("head")[0].appendChild(B);A.appendChild(B);this.watchForSymbol({symbol:"BitlyApiClient",timeout:10,onSuccess:function(C){this.libLoaded=true;instance.onLoad()},onTimeout:function(C){throw (C+" didn't load before timeout!")}})}},watchForSymbol:function(C){var B;var A=typeof C.onSuccess;if(!C||!C.symbol||!(A=="function")){throw"Missing required options"}C.onTimeout=C.onTimeout||Prototype.K;C.timeout=C.timeout||10;B=(new Date()).getTime()+(C.timeout*1000);var D=setInterval(function(){if(typeof window[C.symbol]!="undefined"){C.onSuccess(C.symbol);clearInterval(D)}else{if((new Date()).getTime()>B){C.onTimeout(C.symbol);clearInterval(D)}}},250)},onLoad:function(){alert("original onload")},bitlyShorten:function(){BitlyCB.alertResponse=this.onResponse;BitlyClient.call("shorten",{longUrl:this.longUrl},"BitlyCB.alertResponse")},onResponse:function(C){var A="";var D;for(var B in C.results){D=C.results[B];break}A="http://cli.cr/"+D.userHash;instance.shortUrl=A;instance.afterResponse()},shorten:function(A){this.longUrl=A;if(!this.libLoaded){this.onLoad=this.bitlyShorten;this.loadLibrary()}else{this.bitlyShorten()}}};$(document).ready(function(){Share.init()});var Follow={ev:{success:"success.follow",fail:"fail.follow"},evElem:null,followingCnt:0,followersCnt:0,followingPendCnt:0,followersPendCnt:0,statusToText:["","Following","Pending"],fromToClass:{request:"cancel",cancel:"request",follow:"unfollow",approve:"none",block:"approve",unblock:"block",ignore:"approve",unfollow:"follow"},fromToTable:{userFollowingPage_pendingTableFollowing_cancel:null,userFollowingPage_pendingTableFollowers_approve:null,userFollowingPage_followingTable_unfollow:null,userPendingPage_pendingTableFollowers_approve:null,userPendingPage_pendingTableFollowers_block:null,userPendingPage_pendingTableFollowing_cancel:null,userFollowersPage_followersTable_block:null,userBlockedPage_blockedTable_unblock:null},init:function(){$(".followBtn").live("click",this.followBtnClick)},getActionClass:function(C){var B=C.attr("class").split(/\s+/);var A=null;$.each(B,function(D,E){if(E in Follow.fromToClass){A=E;return false}});return A},importFriends:function(B){var A=$(".x_fbid",B).text();if(A==null){A=""}var C={fbid:A};Clicker.tokenpost("/user/AJAX/importFriends.html",C,function(D){if(D.isTrue){if(D.msg!=""){Util.message(D.msg)}Clicker.trigger(Follow.ev.success,[B,"follow",D.msg])}else{Util.message("Error processing request.");Clicker.trigger(Follow.ev.fail,[B,"follow",null])}})},doAction:function(E){var D=$(".x_profilename",E).text();if(D==null){D=""}var A=Follow.getActionClass(E);var B=E.parents(".profileRow");var C=E.parents(".profilesTable").attr("id");var G=E.parents(".followPage").attr("id");var F={profilename:D,action:A};Clicker.tokenpost("/user/AJAX/modFollow.html",F,function(I){if(I.isTrue){if(I.msg!=""){Util.message(I.msg)}Clicker.trigger(Follow.ev.success,[E,A,I.msg]);var K=G+"_"+C+"_"+A;if(K in Follow.fromToTable){var H=Follow.fromToTable[K];if(H){H=$(H+" tbody");if(H==null||H.length==0){H=$(Follow.fromToTable[K])}var J=B.clone();H.append(J);B.fadeOut()}else{B.fadeOut()}}E.removeClass(A);E.addClass(Follow.fromToClass[A])}else{Util.message("Error processing request. Try again later.");Clicker.trigger(Follow.ev.fail,[E,A,null])}})},followBtnClick:function(B){var A=$(this);if(A.hasClass("following")){return false}Clicker.waitForLogin(A[0],Follow,Follow.doAction,[A]);return false},changeFollowingCount:function(A){this.followingCnt=A;$("#profFollowingCnt").text(Util.uiCount(A))},changeFollowersCount:function(A){this.followersCnt=A;$("#profFollowersCnt").text(Util.uiCount(A))},changeFollowingPendingCount:function(A){this.followingPendCnt=A;$("#followCnt .pendingCnt div").text(Util.uiCount(A));if(A==0){$("#followCnt .pendingCnt").hide()}},changeFollowersPendingCount:function(A){this.followersPendCnt=A;$("#followerCnt .pendingCnt div").text(Util.uiCount(A));if(A==0){$("#followerCnt .pendingCnt").hide()}},incFollowersCount:function(A){this.followersCnt+=A;Follow.changeFollowersCount(this.followersCnt);return this.followersCnt},incFollowingCount:function(A){this.followingCnt+=A;Follow.changeFollowingCount(this.followingCnt);return this.followingCnt},incFollowersPendingCount:function(A){this.followersPendCnt+=A;Follow.changeFollowersPendingCount(this.followersPendCnt);return this.followersPendCnt},incFollowingPendingCount:function(A){this.followingPendCnt+=A;Follow.changeFollowingPendingCount(this.followingPendCnt);return this.followingPendCnt},dispPage:function(C,B){var G=Util.parseHref(C);var F=(G.pathname.indexOf("following")!=-1);var A=G.params.page;if(A!=null){var E=(A-1)*20;if(F){G.params.nf_base=E;G.params.nf=20}else{G.params.nl_base=E;G.params.nl=20}}G.params.AJAX=true;G.params.rnd=Math.floor(Math.random()*10001);var D=$("#"+B);$.get(G.pathname,G.params,function(H){if($.trim(H)!="false"){if(D.length>0){D.html(H);Util.scrollTo(D)}}});return false},gotoFollowing:function(A){if(!Util.isEmpty(A)){location.href="/profile/"+A+"/following/"}else{location.href="/user/following/"}},gotoFollowers:function(A){if(!Util.isEmpty(A)){location.href="/profile/"+A+"/followers/"}else{location.href="/user/followers/"}},gotoFanOf:function(A){if(!Util.isEmpty(A)){location.href="/profile/"+A+"/fan/"}else{location.href="/user/fan/"}}};$(document).ready(function(A){Follow.init()});if(window.Clicker==null){window.Clicker={}}Clicker.Fanning={getActionType:function(A){return"fanning"},getActionMsg:function(A){var B='You just became a <span class="actionText">fan</span>';if($(A).hasClass("removeFan")){B="You stopped being a fan"}return B},getActIcon:function(A){var B="actLiked";if($(A).hasClass("removeFan")){B="actDisliked"}return B},ev:{success:"success.fanning",fail:"fail.fanning"},init:function(){$(".fanBtn").live("click",this.fanBtnClick);$(".removeFan").live("click",this.removeFanClick)},doAction:function(F){var H=F.attr("id");var E=H.split("_");var B;var D;var C;if(E.length>1){C=E[1];if(E[0]=="fanperson"){D=C}else{B=C}}var A=0;if($(F).hasClass("removeFan")){A=1}var G={showId:B,personTid:D,remove:A};Clicker.tokenpost("/user/AJAX/modFan.html",G,function(J){if(J.isTrue){var I;if(A==1){I=Clicker.Fanning.decreaseFanCount();var K=$("#fanItem_"+C);K.hide()}else{I=Clicker.Fanning.increaseFanCount();F.addClass("fan")}Clicker.trigger(Clicker.Fanning.ev.success,[F,I,A])}else{Util.message("Error processing request.");Clicker.trigger(Clicker.Fanning.ev.fail,[F,null,A])}})},fanBtnClick:function(B){var A=$(this);if(A.hasClass("fan")){return false}Clicker.waitForLogin(A[0],Clicker.Fanning,Clicker.Fanning.doAction,[A]);return false},removeFanClick:function(B){var A=$(this);Clicker.waitForLogin(A[0],Clicker.Fanning,Clicker.Fanning.doAction,[A]);return false},dispPage:function(C,B){var F=Util.parseHref(C);var A=F.params.page;if(A!=null){var E=(A-1)*20;delete F.params.page;F.params.like_base=E}F.params.AJAX=true;F.params.rnd=Math.floor(Math.random()*10001);var D=$("#"+B);$.get(F.pathname,F.params,function(G){if($.trim(G)!="false"){if(D.length>0){D.html(G);Util.scrollTo(D)}}});return false},increaseFanCount:function(){var A=this.getFanCount();A++;Clicker.Fanning.changeFanCount(A);return A},decreaseFanCount:function(){var A=this.getFanCount();A--;Clicker.Fanning.changeFanCount(A);return A},changeFanCount:function(A){$("#fanCnt .cntText").text(A)},getFanCount:function(){return $("#fanCnt .cntText").text()}};Clicker.Action={curActionObj:null,formMode:"checkin",init:function(){},setTweetTxt:function(B){$(B).hide();var C=this.curActionObj;var A=this.getRating(C);var F=Clicker.HoverCmmt.getComment()||"";var E=this.getShareIds(C);var D={showId:E.showId,episodeId:E.episodeId,comment:F,AJAX:true,rnd:Math.floor(Math.random()*10001)};if(A!=null){D.rating=A}$("#twText").val("Loading...");$("#twTextBox").fadeIn();$.post("/user/AJAX/getTweetTxt.html",D,function(G){G=$.trim(G);$("#twText").val(G)})},setTweetTxtPage:function(A){var B=$(A);$(B).hide();var E=Clicker.InPageCmmt.getComment()||"";var D=this.getShareIds(B);var C={showId:D.showId,episodeId:D.episodeId,comment:E,AJAX:true,rnd:Math.floor(Math.random()*10001)};C.action=Clicker.Action.formMode;$("#twTextPage").val("Loading...");$("#twTextBoxPage").fadeIn();$.post("/user/AJAX/getTweetTxt.html",C,function(F){F=$.trim(F);$("#twTextPage").val(F)})},setTweetTxtPageTop:function(B){var C=this.curActionObj;var A=this.getRating(C);var F=Clicker.InPageTopCmmt.getComment()||"";var E=this.getShareIds(C);var D={showId:E.showId,episodeId:E.episodeId,comment:F,AJAX:true,rnd:Math.floor(Math.random()*10001)};if(A!=null){D.rating=A}$("#twTextPageTop").val("Loading...");$("#twTextBoxPageTop").fadeIn();$.post("/user/AJAX/getTweetTxt.html",D,function(G){G=$.trim(G);$("#twTextPageTop").val(G)})},setPostTxt:function(B){$(B).hide();var C=this.curActionObj;var A=this.getRating(C);var F=Clicker.HoverCmmt.getComment()||"";var E=this.getShareIds(C);var D={showId:E.showId,episodeId:E.episodeId,comment:F,AJAX:true,rnd:Math.floor(Math.random()*10001)};if(A!=null){D.rating=A}this._setPostTxt($("#fbTextBox"),$("#fbText"),D)},setPostTxtPage:function(A){var B=$(A);var E=Clicker.InPageCmmt.getComment()||"";var D=this.getShareIds(B);var C={showId:D.showId,episodeId:D.episodeId,comment:E,AJAX:true,rnd:Math.floor(Math.random()*10001)};C.action=this.formMode;this._setPostTxt($("#fbTextBoxPage"),$("#fbTextPage"),C)},setPostTxtPageTop:function(B){var C=this.curActionObj;var A=this.getRating(C);var F=Clicker.InPageTopCmmt.getComment()||"";var E=this.getShareIds(C);var D={showId:E.showId,episodeId:E.episodeId,comment:F,AJAX:true,rnd:Math.floor(Math.random()*10001)};if(A!=null){D.rating=A}this._setPostTxt($("#fbTextBoxPageTop"),$("#fbTextPageTop"),D)},_setPostTxt:function(B,A,D){var C=A;C.val("Loading...");B.fadeIn();$.post("/user/AJAX/getPostTxt.html",D,function(E){E=$.trim(E);C.val(E)})},getRating:function(B){var A=null;if(B.hasClass("btnLikes2")){A=5}else{if(B.hasClass("btnDislikes2")){A=1}}return A},getRateTo:function(B){var A=null;if(B.hasClass("btnLike2")){A=5}else{if(B.hasClass("btnDislike2")){A=1}}return A},getShareIds:function(D){var E=D.attr("id");var C=E.split("_");var A="";var B="";if(C.length>1){A=C[1]}if(C.length>2){B=C[2]}return{showId:A,episodeId:B}},onSocialTabClick:function(F){var A=$(F);$(".socialTab").each(function(K){$(this).removeClass("socialTabOn").addClass("socialTabOff")});A.removeClass("socialTabOff").addClass("socialTabOn");Clicker.InPageCmmt.resetShareArea();var D="";var C="";var J,I="";var G="";var E,H=false;if(F.id=="activityTab"){if(Clicker.Action.formMode!="checkin"){D=Clicker.CheckIn.DEFAULT_COMMENT;Clicker.Action.formMode="checkin";J="btnReviewB";I="btnComment";G="Check in to";C="";E=(l.fbPost.checkin||!l.userSetFbShare);H=l.tweet.checkin}}else{if(F.id=="reviewsTab"){if(Clicker.Action.formMode!="review"){D=Clicker.CheckIn.DEFAULT_REVIEW;Clicker.Action.formMode="review";J="btnComment";I="btnReviewB";G="Review";C="review";E=(l.fbPost.review||!l.userSetFbShare);H=l.tweet.review}}}if(D.length>0){var B=$("#checkinarea");B.val(D);G+=" this show";$(".cfBtn").removeClass(J).addClass(I).attr("title",G);$("#cmmtShareFbPage").attr("checked",E);$("#cmmtShareTweetPage").attr("checked",H);Clicker.Activity.refresh("history/AJAX/","activityList",{as_filter:C},function(){FB.XFBML.parse(document.getElementById("activityList"))})}},confirmPerm:function(D,E){var A=E;var B=D;var C={perm:1};C[D]=1;if(!l.fbPost.can){Clicker.getExtraPerms(function(F){Clicker.tokenpost("/user/modShareVal/",{},function(){ClkrTop.l.userSetFbShare=true;if(F){if(A){A(true)}}else{if(A){A(false)}}})})}else{if(!l.userSetFbShare){Clicker.tokenpost("/user/modShareVal/",{},function(){ClkrTop.l.userSetFbShare=true;if(A){A(true)}})}else{if(A){A(true)}}}},fbPostFailMsg:function(){ClkrTop.l.fbPost.can=false;Util.message('Unable to post to your Facebook wall.<br/><a href="/user/connect/">Go To Share Settings</a>',5000)}};Clicker.Rating={getActionType:function(A){if(A.hasClass("btnRateSm")){return""}return"rating"},getActionMsg:function(A){var B='You <span class="actionText">love it</span>';if(this.getRating(A)==1){B='You <span class="actionText">dislike</span> it'}return B},getActIcon:function(A){var B="actLiked";if(this.getRating(A)==1){B="actDisliked"}return B},ev:{success:"success.rating",fail:"fail.rating"},init:function(){$(".btnLike2").live("click",this.btnLikeClick);$(".btnDislike2").live("click",this.btnLikeClick);$(".btnLove, .btnLoveWhite").live("click",this.btnLikeClick);$(".btnDislike, .btnDislikeWhite, .noloveBox").live("click",this.btnLikeClick)},btnLikeClick:function(){var A=$(this);Clicker.Action.curActionObj=A;if(A.hasClass("btnLoveWhite")){A.removeClass("btnLoveWhite").addClass("btnLoveWhiteOn");$(".btnDislikeWhiteOn",$(A.parent())).removeClass("btnDislikeWhiteOn").addClass("btnDislikeWhite")}if(A.hasClass("btnLove")){A.removeClass("btnLove").addClass("btnLoveOn");$(".btnDislikeOn",$(A.parent())).removeClass("btnDislikeOn").addClass("btnDislike")}if(A.hasClass("btnDislike")){A.removeClass("btnDislike").addClass("btnDislikeOn");$(".btnLoveOn",$(A.parent())).removeClass("btnLoveOn").addClass("btnLove")}if(A.hasClass("btnDislikeWhite")){A.removeClass("btnDislikeWhite").addClass("btnDislikeWhiteOn");$(".btnLoveWhiteOn",$(A.parent())).removeClass("btnLoveWhiteOn").addClass("btnLoveWhite")}Clicker.waitForLogin(A[0],Clicker.Rating,Clicker.Rating.doAction,[A]);return true},getRating:function(A){return(rating=A.hasClass("btnLike2")||A.hasClass("btnLoveOn")||A.hasClass("btnLoveWhiteOn")?5:1)},doAction:function(H,I){Clicker.Buttons.closeHover(H);var D=Clicker.Rating.getRating(H);var J=H.hasClass("btnLikes2");var F=H.hasClass("btnDislikes2");if(J||F){D=3}var A=H.attr("id");var E=A.split("_");var G="";var C="";if(E.length>1){G=E[1]}if(E.length>2){C=E[2]}var B=G;if(C!=""){B=B+"_"+C}if(H.hasClass("btnLike2")){H.removeClass("btnLikes2");$("#dislike_"+B).removeClass("btnDislikes2")}else{H.removeClass("btnDislikes2");$("#like_"+B).removeClass("btnLikes2")}if(D==5){$("#like_"+B).addClass("btnLikes2");Clicker.Rating.increaseLikeCount()}else{if(D==1){$("#dislike_"+B).addClass("btnDislikes2");if(J){Clicker.Rating.decreaseLikeCount()}}else{if(D==3&&J){Clicker.Rating.decreaseLikeCount()}}}this.promptComment(H)},sendRating:function(K,L,B,N,G,A){var H=3;if(K.hasClass("btnLike2")||K.hasClass("btnLikes2")||K.hasClass("loved")){H=5}else{if(K.hasClass("btnDislike2")||K.hasClass("btnDislikes2")||K.hasClass("noloved")){H=1}}L=L==null?"":$.trim(L);var C=K.attr("id");var J=C.split("_");var I="";var E="";if(J.length>1){I=J[1]}if(J.length>2){E=J[2]}var F={showId:I,episodeId:E,rating:H,comment:L};if(B!=null){F.fbPost=B}if(N!=null){F.tweet=N}if(G!=null){F.twtxt=G}if(A!=null){F.fbtxt=A}var D=K.hasClass("noComment");var M=K.hasClass("noGrowl");Clicker.tokenpost("/user/AJAX/modLike.html",F,function(O){if(O&&O.isTrue){if(O.extras!=null&&O.extras.fbPostFailed){ClkrTop.l.fbPost.can=false;Clicker.getExtraPerms(function(Q){if(Q){Clicker.Rating.sendRating(K,L,B,N,G,A)}})}if(!M){var P="You loved this!";if(H<3){P="You disliked this."}Util.message(P)}Clicker.trigger(Clicker.Rating.ev.success,[K])}else{Util.message("Error processing request.");Clicker.trigger(Clicker.Rating.ev.fail,[K])}})},promptComment:function(B){var A={callback:Clicker.Rating.commentCallback,checkShareFb:B.hasClass("btnLikes2")||B.hasClass("loved")?l.fbPost.love:l.fbPost.dislike,checkShareTweet:B.hasClass("btnLikes2")||B.hasClass("noloved")?l.tweet.love:l.tweet.dislike};A.title=B.hasClass("btnLikes2")||B.hasClass("loved")?'<span class="green b">You loved this!</span>':"You disliked this.";if(B.hasClass("inPageTop")){A.callback=Clicker.Rating.inPageTopCallback;Clicker.InPageTopCmmt.show(B,A);Clicker.Rating.sendRating(B,null,false,false)}else{Clicker.Rating.commentCallback(null,B,true,false)}},commentCallback:function(H,I,D,F){var K=Clicker.HoverCmmt.getComment();var G=Clicker.HoverCmmt.getTwTxt();var A=Clicker.HoverCmmt.getFbTxt();if(F){Clicker.Rating.sendRating(I,K,Clicker.HoverCmmt.isShareFb(),Clicker.HoverCmmt.isShareTweet(),G,A)}else{var B=I.hasClass("noComment");var E=B?false:(l.fbPost.can&&(I.hasClass("loved")?l.fbPost.love:l.fbPost.dislike));Clicker.Rating.sendRating(I,K,E,false)}if(F){var J=Clicker.HoverCmmt.doShare;var C=K!=null;if(J||C){if(J&&!C){msg="Rating shared."}else{if(!J&&C){msg="Comment added to rating."}else{if(J&&C){msg="Comment added and rating shared."}}}Util.message(msg)}}},inPageTopCallback:function(C,A){if(Clicker.InPageTopCmmt.isShareFb()&&A){var B=Clicker.Action.getRating(C)==5?"fbPostLove":"fbPostDislike";Clicker.Action.confirmPerm(B,function(D){Clicker.Rating._inPageTopCallback(C,A)})}else{Clicker.Rating._inPageTopCallback(C,A)}},_inPageTopCallback:function(H,A){var G="";var E=Clicker.InPageTopCmmt.getComment();var C=Clicker.InPageTopCmmt.getTwTxt();var D=Clicker.InPageTopCmmt.getFbTxt();var B=E!=null;var F=(A&&(Clicker.InPageTopCmmt.isShareFb()||Clicker.InPageTopCmmt.isShareTweet()));Clicker.Rating.sendRating(H,E,(A&&Clicker.InPageTopCmmt.isShareFb()),(A&&Clicker.InPageTopCmmt.isShareTweet()),C,D);if(F&&!B){G="Rating shared."}else{if(!F&&B){G="Comment added to rating."}else{if(F&&B){G="Comment added and rating shared."}}}if(G.length>0){Util.message(G)}},increaseLikeCount:function(){var A=Clicker.Rating.getLikeCount();A++;Clicker.Rating.changeLikeCount(A);return A},decreaseLikeCount:function(){var A=Clicker.Rating.getLikeCount();A--;Clicker.Rating.changeLikeCount(A);return A},changeLikeCount:function(A){$("#likeCnt .cntText").text(A)},getLikeCount:function(){return $("#likeCnt .cntText").text()},gotoLikes:function(A){if(!Util.isEmpty(A)){location.href="/profile/"+A+"/history/"}else{location.href="/user/history/"}},dispPage:function(B,D){var E=Util.parseHref(B);var A=1;var C=D.split("_");if(C.length>0){var G="page"+C[0];A=E.params[G];var J=(A-1)*9;var F=C[0]+"_"+C[1]+"_base";var I=C[0]+"_"+C[1]+"_nr";E.params[F]=J;E.params[I]=9}E.params.AJAX=true;E.params.rnd=Math.floor(Math.random()*10001);var H=$("#"+D);$.get(E.pathname,E.params,function(K){if($.trim(K)!="false"){if(H.length>0){H.html(K);Util.scrollTo(H)}}});return false}};Clicker.Playlist={getActionType:function(A){return"playlist"},getActionMsg:function(A){var B='You modified your <span class="actionText">Queue</span>';return B},getActIcon:function(A){return"actPlaylist"},ev:{success:"success.playlist",fail:"fail.playlist"},queueSelect:null,init:function(){$(".btnAdd, .btnAddWhite, .btnAddOn, .btnAddWhiteOn").live("click",this.btnAddPlayClick);this.queueSelect=$("#queueSelect")},getProxied:function(D){if(D==null){return null}var E=D.attr("id");if(Util.isEmpty(E)){return null}var C=E.split("_");var A="addShow";if(D.hasClass("epProxy")){A="addEpisode"}if(C.length>1){A=A+"_"+C[1]}if(D.hasClass("epProxy")){if(C.length>2){A=A+"_"+C[2]}}var B=$("#"+A);if(B.length==0){return null}return B},btnAddPlayClick:function(){Playlist.clearUnwatchedCount();var G=$(this);if(G.hasClass("animate")&&this.className.indexOf("On")==-1){var F=this.id.split("_");var B=F[1];if(F.length>2){B+="_"+F[2]}var A=$("#newItemBox");var D=A.offset();var E=$("#recImg_"+B);var C=E.clone();var H=E.offset();if(A.length>0&&(D.top+100>$(document.body).scrollTop())){C.css({position:"absolute",top:H.top+"px",left:H.left+"px",opacity:0.1});C.addClass("smImgBox");$(document.body).append(C);A.animate({height:"60px"});C.animate({top:(D.top+5)+"px",left:(D.left+5)+"px",opacity:0.5,width:"72px",height:"40px"},{duration:500,complete:function(){A.append(C)}})}}Clicker.waitForLogin(G[0],Clicker.Playlist,Clicker.Playlist.doAction,[G]);return true},btnAddPlayDropClick:function(){var A=$(this);Clicker.waitForLogin(A[0],Clicker.Playlist,Clicker.Playlist.doActionDrop,[A])},doActionDrop:function(A){if(Clicker.Playlist.queueSelect.is(":visible")){Clicker.Playlist.closeQueueBox(A)}else{Clicker.Playlist.showQueueSelect(A)}},queueSelectClick:function(A){Clicker.Playlist.doAction($(A));Clicker.Playlist.closeQueueBox()},showQueueSelect:function(E){var H=E;var D=Clicker.Playlist.getProxied(E);if(D!=null){E=D}var A=this.queueSelect;var C=A.outerHeight();var G=E.offset();var B=E.outerHeight();var F={top:G.top+B-5,left:G.left};if(Util.isiDevice){F.top-=window.pageYOffset;F.left-=window.pageXOffset}A.css("top",F.top);A.css("left",F.left);$(document).bind("mousedown.queueSelect",function(I){if(!$.contains(Clicker.Playlist.queueSelect[0],I.target)&&H[0]!=I.target){Clicker.Playlist.closeQueueBox()}});A.show()},closeQueueBox:function(){this.queueSelect.hide()},doAction:function(C,E){Clicker.Buttons.closeHover(C);this.addPlaylist(C);if(C[0].className.indexOf("On")==-1){var D=C[0].id;if(D.indexOf("addShow")==0&&!C.hasClass("epProxy")){var B=D.split("_");var A="";if(B.length>1){A=B[1]}}}},addPlaylist:function(H,I){var A=H[0].id;var F=A.split("_");var G="";var C="";if(F.length>1){G=F[1]}if(F.length>2){C=F[2]}if(H.hasClass("epProxy")&&A.indexOf("addShow")==0){C=""}I=I==null?"":$.trim(I);var J=H.hasClass("noComment");var E=C!=""?"a":"A";if(H[0].className.indexOf("On")!=-1){E=C!=""?"d":"D"}if(H[0].className.indexOf("On")!=-1){var B="This show is not in my Queue.";var A=H.attr("id");if(A.indexOf("addEpisode")==0){B="This episode is not in my Queue."}else{if(A.indexOf("addMovie")==0){B="This movie is not in my Queue."}}H.attr("title",B);if(H.hasClass("btnAddOn")){H.removeClass("btnAddOn").addClass("btnAdd")}else{if(H.hasClass("btnAddWhiteOn")){H.removeClass("btnAddWhiteOn").addClass("btnAddWhite")}}}else{var B="This show is in my Queue.";var A=H.attr("id");if(A.indexOf("addEpisode")==0){B="This episode is in my Queue."}else{if(A.indexOf("addMovie")==0){B="This movie is in my Queue."}}H.attr("title",B);if(H.hasClass("btnAdd")){H.removeClass("btnAdd").addClass("btnAddOn")}else{if(H.hasClass("btnAddWhite")){H.removeClass("btnAddWhite").addClass("btnAddWhiteOn")}}}var K=E+"|s:"+G;if(C!=""){K+="|"+C}var D={la:"playlist",pl:K,showId:G,episodeId:C,comment:I};if(J){D.silent=true}Clicker.tokenpost("/user/AJAX/queue/",D,function(L){if(L&&L.isTrue){Clicker.trigger(Clicker.Playlist.ev.success,[H]);Util.message(L.msg+'<br/><a id="goToPlayList" href="/user/queue/">Go To My Queue</a>');if($("#queueBox").length!=0){$("#queueLoading").show();setTimeout(function(){var M="/index/AJAX/queue/?rnd="+Math.floor(Math.random()*10001);$.get(M,function(N){$("#queueBox").html(N);$("#queueLoading").hide()})},500)}Playlist.setUnwatchedCount()}else{Util.message("Error processing request.");Clicker.trigger(Clicker.Playlist.ev.fail,[H])}})},promptComment:function(B){var A={callback:Clicker.Playlist.commentCallback,title:"Add to your Queue:",showNotify:true};Clicker.HoverCmmt.showCommentBox(B,A)},commentCallback:function(E,G){var B=Clicker.HoverCmmt.getComment();Clicker.Playlist.addPlaylist(G,B);var F=G.attr("id");var D=F.split("_");var A="";if(D.length>1){A=D[1]}if(A!=""){var C=$("#cmmtnotify").is(":checked");C=C?"1":"0";Playlist.modShowNotify(A,C,false)}}};Clicker.Activity={getActionType:function(A){return"activity"},getActionMsg:function(A){var B='You modified your <span class="actionText">activities</span>';return B},numPerPage:20,curBase:0,curActElem:null,as_options:{as_view:"",as_filter:""},ev:{successRemove:"successRemove.activity",failRemove:"failRemove.activity",successEdit:"successEdit.activity",failEdit:"failEdit.activity"},init:function(){var A=Clicker.Activity;$(".activityItem").live("mouseenter",function(){if(A.curActElem==null){$(".actControls",$(this)).css("visibility","visible")}});$(".activityItem").live("mouseleave",function(){if(A.curActElem==null||!$.contains(this,A.curActElem)){$(".actControls",$(this)).css("visibility","hidden")}});$(".actRemove").live("click",function(){var B=$(this);A.curActElem=this;Clicker.Activity.promptRemove(B,{callback:A.confirmRemove,msg:"Are you sure you want to remove this action?"})});$(".userComment, .linkComment").live("click",function(){var B=$(this);Clicker.Activity.showComment(B)});$(".showAllLink").live("click",function(){var B=$(this);Clicker.Activity.showAllComments(B)});$(".commentBtn").live("click",function(){var B=$(this);Clicker.Activity.submitComment(B)});$(".commentCancelBtn").live("click",function(){var B=$(this);Clicker.Activity.cancelComment(B)});$(".hiddenAction").live("mouseenter",function(){if(!l.isLoggedIn){return }var I=this.id;var G=$(this);var C=G.hasClass("hasActions");var F=Clicker.Activity.getParts(G);var E=F.key;if(F.commentKey.length>0){E=F.commentKey}G.attr("title","");G.data("over",true);if(C){var B="/user/AJAX/hiddenaction/";var D="";if(I.indexOf("Like")!=-1){D="awesome"}else{if(I.indexOf("Dislike")!=-1){D="really"}else{if(I.indexOf("Spoiler")!=-1){D="meh"}else{if(I.indexOf("Visit")!=-1){D="visit"}}}}var H={action_key:E,action_type:D};$.get(B,H,function(J){if(G.data("over")){G.data("clicker_title",J);G.attr("title","");Clicker.Buttons.showHover(G,J)}})}}).live("mouseleave",function(){var B=$(this);B.data("over",false);Clicker.Buttons.closeHover(B)})},promptRemove:function(C,A){A=A==null?{}:A;var B=A.callback;A.callback=function(E,D){if(E){Clicker.Activity.removeAction(D)}if(B!=null){B(E,D)}};Clicker.ConfirmBox.showBox(C,A)},removeAction:function(D){var F=D.attr("id");var C=F.split("_");var A="";if(C.length>0){A=C[1]}var E={key:A};var B=$(".fbPostId",D);B=B.text();if(B!=null&&B!=""){E.fb_post_id=B}Clicker.tokenpost("/user/AJAX/modRemAction.html",E,function(G){if(G.isTrue==true){Clicker.trigger(Clicker.Activity.ev.successRemove,[D,G])}else{Util.message("Error processing request.");Clicker.trigger(Clicker.Activity.ev.failRemove,[D,G])}})},confirmRemove:function(B,A){A.hide();Clicker.Activity.curActElem=null;if(B){A.closest(".activityBox").hide()}},getParts:function(E){var F=E.attr("id");var D=F.split("_");var B,C="",A="";if(D.length>0){B=D[0]}if(D.length>1){C=D[1]}if(D.length>2){A=D[2]}return{name:B,key:C,commentKey:A}},showComment:function(G){if(!l.isLoggedIn){l.start(G);return }var F=this.getParts(G);var C=F.key;if(F.commentKey.length>0){C+="_"+F.commentKey}var H=F.name;var D=G.closest("#streamBox");var E=$("#cmText_"+Util.escColon(C),D);if(H=="cmLink"){var B=$("#cmText_"+Util.escColon(C),D);setTimeout(function(){B.focus()},300)}else{if(H!="cmText"){this.submitActionComment(G);return }}var A=$("#cmBox_"+Util.escColon(C),D);A.show();if(E&&!E.data("expanded")){E.css("color","#000");if($.browser.webkit){E.css("height","80px")}else{E.animate({height:"80px"},"fast")}E.val("");$("#cmImgBox_"+Util.escColon(C),D).css("visibility","visible");$("#cmBtnBox_"+Util.escColon(C),D).show();E.data("expanded",true)}},submitActionComment:function(E,A){A=A!=null?A:false;if(!E.data("clicked")){E.data("clicked",true);var C=this.getParts(E);var H=C.key;var I=C.name;var F="";var G="";if(I.indexOf("cmLikeLink")!=-1){F="";G="like"}else{if(I.indexOf("cmDislikeLink")!=-1){F="";G="dislike"}else{if(I.indexOf("cmSpoilerLink")!=-1){F="";G="spoiler"}else{if(I.indexOf("cmVisitLink")!=-1){F="";G="visit"}}}}var B={};B.key=H;B.action_key=C.key;if(C.commentKey.length>0){B.key=C.commentKey;B.comment_key=C.commentKey;H+="_"+C.commentKey}B.comment=F;B.comment_type=G;if(G!="visit"){var D=E.closest("#streamBox");this.incrementCount(G,H,D)}url="/user/AJAX/modAddCmmt.html";if(A){url="/profile/AJAX/modAddCmmt.html"}Clicker.tokenpost(url,B,function(J){if(J.isTrue==true){}else{Util.message("Error processing request.")}})}},incrementCount:function(E,C,D){var B=$("#"+E+"Count_"+Util.escColon(C),D);if(!B.data("clicked")){var F=B.attr("innerHTML");var A=F;if(F.length==0){A=" (1)"}else{A=F.replace(/\s*.*?\((\d+)\)/,"$1");A=" ("+(parseInt(A)+1)+")"}B.data("clicked",true);B.attr("innerHTML",A)}},submitComment:function(F){var B=F.attr("id");var D=this.getParts(F);var L=D.key;var H=F.closest("#streamBox");var G=$("#cmText_"+Util.escColon(L),H);var I=G.val();if(I.length>0){if(G.hasClass("compact")){G.css({color:"#000"})}else{G.css({color:"#000",backgroundColor:"#efefef",border:"0"})}$("#cmBtnBox_"+Util.escColon(L),H).hide();var J=$("#commentTemplate").html();I=Util.clean(I);var E=l.userName?l.userName:"";var K="";J=J.replace(/@profileImageTag@/,$("#userImgHtml").html());J=J.replace(/@userNameAndCommentTag@/,$("#userNameHtml").html()+" "+I+"</div>");var M=$("#cmTable_"+Util.escColon(L),H);M.append($(J));var A=$("#prevCommentUser_"+Util.escColon(L),H);A=A.attr("innerHTML");var C={};C.key=L;C.action_key=D.key;C.comment=I;C.comment_type="comment";C.prev_comment_user=A;Clicker.tokenpost("/user/AJAX/modAddCmmt.html",C,function(N){if(N.isTrue==true){}else{Util.message("Error processing request.")}})}G.css({color:"#bbb",backgroundColor:"#ffffff"});G.val("Write a comment...");G.animate({height:"20px"},"fast");$("#cmBtnBox_"+Util.escColon(L),H).hide();$("#cmImgBox_"+Util.escColon(L),H).css("visibility","hidden");G.data("expanded",false)},cancelComment:function(E){var D=this.getParts(E);var A=D.key;var B=E.closest("#streamBox");var C=$("#cmText_"+Util.escColon(A),B);C.val("");C.css({color:"#bbb",backgroundColor:"#ffffff"});C.val("Write a comment...");C.animate({height:"20px"},"fast");$("#cmBtnBox_"+Util.escColon(A),B).hide();$("#cmImgBox_"+Util.escColon(A),B).css("visibility","hidden");C.data("expanded",false)},showAllComments:function(F){var E=this.getParts(F);var A=E.key;var C=F.closest("#streamBox");var D=$("#cmHide_"+Util.escColon(A),C);var B=F[0];if(F.data("visible")){B.innerHTML=B.innerHTML.replace(/Hide/,"Show");D.slideUp("fast");F.data("visible",false)}else{B.innerHTML=B.innerHTML.replace(/Show/,"Hide");D.slideDown("fast");F.data("visible",true)}},newComment:function(A,B){this.editComment(A,B,true)},editComment:function(D,H,A){var G=D.attr("id");var C=G.split("_");var B="";if(C.length>0){B=C[1]}var F=D;var E={key:B,comment:H,isNew:A==true?1:0};Clicker.tokenpost("/user/AJAX/modEditCmmt.html",E,function(I){if(I.isTrue==true){Util.message("Updated comment");Clicker.trigger(Clicker.Activity.ev.successEdit,[F,I])}else{Util.message("Error processing request.");Clicker.trigger(Clicker.Activity.ev.failEdit,[F,I])}})},optionClick:function(D,B,A,C){$("#activityOptions .option").removeClass("curOption spinner");var E=$(D);E.addClass("curOption spinner");Clicker.Activity.refresh(B,A,{as_filter:C},function(){E.removeClass("spinner")});return false},refresh:function(D,C,B,F){if(B){$.extend(this.as_options,B)}this.curBase=0;var E=$("#"+C);var A=F;$.get(D,{AJAX:true,as_base:0,as_view:this.as_options.as_view,as_filter:this.as_options.as_filter,as_num_res:this.numPerPage,container:C,rnd:Math.floor(Math.random()*10001)},function(H){$("#loading").hide();if(H!="false"){var I=$(":first-child",E);var G=$("<div style='display:none;'></div>");G.append(H);E.prepend(G);G.fadeIn();I.remove();$("#actTotalLiked").text($("#newNumLiked").val());$("#actTotalDisliked").text($("#newNumDisliked").val());$("#actTotalCheckin").text($("#newNumCheckin").val())}FB.XFBML.parse(document.getElementById("activityList"));if(A){A()}});return false},dispMore:function(H,C,A,E){var D=$(H);$(".moreMsg",D).addClass("spinner");var B=$("#"+A);var F=$(H).parents(".pageLinks");F.addClass("spinner");this.curBase+=this.numPerPage;var G={AJAX:true,as_base:this.curBase,as_num_res:this.numPerPage,as_hash_key:E,as_view:this.as_options.as_view,as_filter:this.as_options.as_filter,container:A,rnd:Math.floor(Math.random()*10001)};$.get(C,G,function(J){if($.trim(J)!="false"){F.hide();if(B.length>0){var I=$("<div style='display:none;'></div>");I.append(J);B.append(I);I.fadeIn();$(".moreMsg",D).removeClass("spinner")}}FB.XFBML.parse(document.getElementById("activityList"))});return false},dispPage:function(D,C){var F=Util.parseHref(D);var B=F.params.page;if(B!=null){var A=(B-1)*20;F.params.as_base=A;F.params.as_num_res=20}F.params.AJAX=true;F.params.rnd=Math.floor(Math.random()*10001);var E=$("#"+C);$.get(F.pathname,F.params,function(G){if($.trim(G)!="false"){if(E.length>0){E.html(G);Util.scrollTo(E)}}});return false}};Clicker.CheckIn={getActionType:function(A){return"checkin"},getActionMsg:function(A){var B='You <span class="actionText">checked in</span>';return B},getActIcon:function(A){return"actCheckIn"},DEFAULT_COMMENT:"Write your comment here",DEFAULT_REVIEW:"Write your review here",ev:{success:"success.checkin",fail:"fail.checkin"},maxComment:511,init:function(){$(".btnCheckIn").live("click",this.btnCheckInClick);$(".checkin, .btnWatching, .btnWatchWhite, .checkinBtn").live("click",this.btnCheckInClick);$(".cfBtn").live("click",this.btnCheckInBClick);$(".socialTab").click(function(){Clicker.Action.onSocialTabClick(this)});Clicker.InPageCmmt.init(this.DEFAULT_COMMENT)},btnCheckInClick:function(){var D=$(this);var F=D.attr("id");var C=F.split("_");var A="";var B="";if(C.length>1){A=C[1]}if(C.length>2){B=C[2]}var E=A;if(B!=""){E=E+"_"+B}Clicker.Action.curActionObj=D;if(D.hasClass("btnCheckedIn")){return false}if(D.hasClass("checkin")){D.removeClass("checkin").addClass("checkined")}if(D.hasClass("btnWatching")){D.removeClass("btnWatching").addClass("btnWatchingOn")}if(D.hasClass("btnWatchWhite")){D.removeClass("btnWatchWhite").addClass("btnWatchWhiteOn")}$(".checkin_"+E).removeClass("checkin").addClass("checkined");Clicker.waitForLogin(D[0],Clicker.CheckIn,Clicker.CheckIn.doAction,[D]);return true},btnNotFound:function(A,B){Clicker.waitForLogin(A,Clicker.CheckIn,Clicker.CheckIn.doActionNF,[$(A),B]);return false},btnCheckInBClick:function(){var A=$(this);Clicker.waitForLogin(A[0],Clicker.CheckIn,Clicker.CheckIn.doActionB,[A]);return false},doAction:function(A,C){var B=$("#showName").text().replace(/:/g,"");if($("#episodeName").length>0){B+=" ("+$("#episodeName").text()+")"}Clicker.Buttons.closeHover(A);A.addClass("btnCheckedIn");if($(A).hasClass("noComment")){this.commentCallback(null,A,false,false)}else{this.promptComment(A)}},doActionB:function(B,D){var A=Clicker.InPageCmmt.getComment();var C=Clicker.Action.formMode;if(C=="review"&&A.length==0){return }if(Clicker.InPageCmmt.isShareFb()){Clicker.Action.confirmPerm("fbPostCheckin",function(E){Clicker.CheckIn._doActionB(B,D,E)})}else{Clicker.CheckIn._doActionB(B,D,Clicker.InPageCmmt.isShareFb())}},_doActionB:function(D,E,G){var H=Clicker.InPageCmmt.getComment();var F=Clicker.Action.formMode;var C=Clicker.InPageCmmt.getTwTxt();var A=Clicker.InPageCmmt.getFbTxt();if(F=="checkin"){this.sendCheckIn(D,H,"",G,Clicker.InPageCmmt.isShareTweet(),C,A);Clicker.InPageCmmt.resetCmmt(Clicker.CheckIn.DEFAULT_COMMENT)}else{if(F=="review"){Clicker.CheckIn.sendReview(D,H,"",G,Clicker.InPageCmmt.isShareTweet(),C,A);Clicker.InPageCmmt.resetCmmt(Clicker.CheckIn.DEFAULT_REVIEW)}}Clicker.InPageCmmt.resetShareArea();setTimeout(function(){Clicker.Activity.refresh("history/AJAX/","activityList")},1000);Util.message((F=="checkin"?"Getting the latest comments...":"Posting your review!"));var I=$("#actTotalCheckin");if(I!=null&&I.length>0){var B=I.text();B=Number(B)+1;I.text(B)}},doActionNF:function(A,B){Clicker.CheckIn.promptComment(A,B)},sendCheckIn:function(J,K,M,C,N,G,A){M=M==null?"":$.trim(M);isNullComment=K==null||K.length==0;var L=J.hasClass("noGrowl");K=K==null||K==this.DEFAULT_COMMENT?"":$.trim(K);var B=J.attr("id");var I=B.split("_");var H="";var E="";if(I.length>1){H=I[1]}if(I.length>2){E=I[2]}var F={showId:H,episodeId:E,comment:K,device:"web",title:M,src_title:"Clicker",src:"Clicker"};if(E!=null&&E.length>0){Util.watched(H,E,"",false)}var D=J.hasClass("noComment");if(D){F.fbPost=false;F.tweet=false}else{if(C!=null){F.fbPost=C}if(N!=null){F.tweet=N}if(G!=null){F.twtxt=G}if(A!=null){F.fbtxt=A}}Clicker.tokenpost("/user/AJAX/modCheckin.html",F,function(O){if(O.isTrue==true){if(!L){Util.message("You watched this!")}if(O.extras!=null&&O.extras.fbPostFailed){ClkrTop.l.fbPost.can=false;Clicker.getExtraPerms(function(P){if(P){Clicker.CheckIn.sendCheckIn(J,K,M,C,N,G,A)}})}Clicker.trigger(Clicker.CheckIn.ev.success,[J,O]);setTimeout(function(){Clicker.chkNewAwd({showId:H,episodeId:E})},2000)}else{Util.message("Error processing request.");Clicker.trigger(Clicker.CheckIn.ev.fail,[J,O])}})},sendReview:function(I,J,K,B,L,F,A){K=K==null?"":$.trim(K);J=J==null||J==this.DEFAULT_REVIEW?"":$.trim(J);var C=I.attr("id");var H=C.split("_");var G="";var D="";if(H.length>1){G=H[1]}if(H.length>2){D=H[2]}var E={showId:G,episodeId:D,comment:J,device:"web",title:K,src_title:"Clicker",src:"Clicker"};if(B!=null){E.fbPost=B}if(L!=null){E.tweet=L}if(F!=null){E.twtxt=F}if(A!=null){E.fbtxt=A}Clicker.tokenpost("/user/AJAX/modReview.html",E,function(M){if(M.isTrue==true){Clicker.trigger(Clicker.CheckIn.ev.success,[I,M]);setTimeout(function(){Clicker.chkNewAwd({showId:G,episodeId:D})},2000)}else{Util.message("Error processing request.");Clicker.trigger(Clicker.CheckIn.ev.fail,[I,M])}})},promptComment:function(B,C){var A={callback:Clicker.CheckIn.commentCallback,title:"Marked as watched.",checkShareFb:l.fbPost.checkin,checkShareTweet:l.tweet.checkin};if(B.hasClass("inPageTop")){A.callback=Clicker.CheckIn.inPageTopCallback;Clicker.InPageTopCmmt.show(B,A);Clicker.CheckIn.sendCheckIn(B,null,null,false,false)}else{if(C!=null){A.cmmtsrc=C}Clicker.HoverCmmt.showCommentBox(B,A)}},commentCallback:function(H,I,E,F){var D="You're watching this!";var K=Clicker.HoverCmmt.getComment();var B=Clicker.HoverCmmt.getSrcTitle();if(Clicker.HoverCmmt.srcTitleVis()&&(B==null||E)){return }var G=Clicker.HoverCmmt.getTwTxt();var A=Clicker.HoverCmmt.getFbTxt();if(F){Clicker.CheckIn.sendCheckIn(I,K,B,Clicker.HoverCmmt.isShareFb(),Clicker.HoverCmmt.isShareTweet(),G,A)}else{Clicker.CheckIn.sendCheckIn(I,"",B,(l.fbPost.can&&l.fbPost.checkin),false)}if(F){var J=Clicker.HoverCmmt.doShare;var C=K!=null;if(C){if(J){D="Comment added and shared."}else{D="Comment added."}Util.message(D)}}},inPageTopCallback:function(B,A){if(A&&Clicker.InPageTopCmmt.isShareFb()){Clicker.Action.confirmPerm("fbPostCheckin",function(C){Clicker.CheckIn._inPageTopCallback(B,A)})}else{Clicker.CheckIn._inPageTopCallback(B,A)}},_inPageTopCallback:function(H,A){var G="You're watching this!";var E=Clicker.InPageTopCmmt.getComment();var C=Clicker.InPageTopCmmt.getTwTxt();var D=Clicker.InPageTopCmmt.getFbTxt();var B=E!=null;var F=(A&&(Clicker.InPageTopCmmt.isShareFb()||Clicker.InPageTopCmmt.isShareTweet()));Clicker.CheckIn.sendCheckIn(H,E,null,(A&&Clicker.InPageTopCmmt.isShareFb()),(A&&Clicker.InPageTopCmmt.isShareTweet()),C,D);if(B){if(F){G="Comment added and shared."}else{G="Comment added."}Util.message(G)}},checkMaxAreaTxt:function(){Util.checkMax("#checkinarea",Clicker.CheckIn.maxComment)},setShareSetting:function(A){if(A!=null){var B={share:A.checked?"1":"0"};Clicker.tokenpost("/user/AJAX/modTwitterShare.html",B,function(C){if(C&&C.isTrue){Util.message("Setting saved.")}else{Util.message("Error processing request.")}})}}};Clicker.Awards={dispPage:function(C,B){var E=Util.parseHref(C);var A=E.params.page;if(A!=null){E.params.badge_base=(A-1)*20;E.params.badge_num_res=20}E.params.AJAX=true;E.params.rnd=Math.floor(Math.random()*10001);var D=$("#"+B);$.get(E.pathname,E.params,function(F){if($.trim(F)!="false"){if(D.length>0){D.html(F);Util.scrollTo(D)}}});return false}};Clicker.ConfirmBox={confirmObj:null,closeTmr:null,forObj:null,init:function(){this.confirmObj=$("#confirmbox");if(Util.isMobile!=true){this.confirmObj.bind("mouseleave.ConfirmBox",Clicker.ConfirmBox.startCountdown);this.confirmObj.bind("mouseenter.ConfirmBox",Clicker.ConfirmBox.stopCountdown)}$(".confirmyes",this.confirmObj).click(function(){Clicker.ConfirmBox.closeBox({confirmYes:true})});$(".confirmno",this.confirmObj).click(function(){Clicker.ConfirmBox.closeBox()})},showBox:function(E,I){Clicker.Buttons.closeHover(E);I=I==null?{}:I;this.closeBox({immediate:true});this.forObj=E;this.forOptions=I;var B=$(".confirmmsg",this.confirmObj);if(I.msg){B.html(I.msg)}var H=this.confirmObj.outerHeight();var A=E.position();var C=$(".hvrcmmt_below",this.confirmObj);C.css("top",H-2);var D=$(".hvrcmmt_above",this.confirmObj);var G=E.offset();var F={top:G.top,left:G.left-14};F.top=G.top-H-6;if(F.top>$(document).scrollTop()+50){C.css("visibility","visible");D.css("visibility","hidden")}else{F.top=G.top+E.outerHeight()+6;D.css("visibility","visible");C.css("visibility","hidden")}if(Util.isiDevice){F.top-=window.pageYOffset;F.left-=window.pageXOffset}this.confirmObj.css("top",F.top);this.confirmObj.css("left",F.left);if(Util.isMobile!=true){E.bind("mouseleave.ConfirmBox",Clicker.ConfirmBox.startCountdown);E.bind("mouseenter.ConfirmBox",Clicker.ConfirmBox.stopCountdown)}Clicker.ConfirmBox.confirmObj.show();$(document).bind("mousedown.ConfirmBox",function(J){if(!$.contains(Clicker.ConfirmBox.confirmObj[0],J.target)&&Clicker.ConfirmBox.forObj[0]!=J.target){Clicker.ConfirmBox.closeBox({immediate:true})}})},startCountdown:function(){if(Clicker.ConfirmBox.confirmObj.is(":visible")){Clicker.ConfirmBox.closeTmr=setTimeout(function(){Clicker.ConfirmBox.closeBox()},1000)}},stopCountdown:function(A){if(Clicker.ConfirmBox.closeTmr!=null){clearTimeout(Clicker.ConfirmBox.closeTmr)}Clicker.ConfirmBox.closeTmr=null},closeBox:function(A){A=A==null?{}:A;this.stopCountdown();$(document).unbind("mousedown.ConfirmBox");if(this.forObj){this.forObj.unbind("mouseleave.ConfirmBox");this.forObj.unbind("mouseenter.ConfirmBox")}if(this.confirmObj.is(":visible")){if(this.forOptions&&this.forOptions.callback){this.forOptions.callback((A.confirmYes==true),this.forObj)}}this.forObj=null;this.forOptions=null;if(A.immediate){this.confirmObj.hide()}else{this.confirmObj.fadeOut("fast")}}};Clicker.CmmtFuncs={isShareChecked:function(B,A){if(!B.is(":visible")){return null}return A.is(":checked")},getComment:function(C,A){var B=C.val();if(B!=null){B=$.trim(B);if(B!=""&&B!=A){return Util.htmlEncode(Util.clean(B))}}return null}};Clicker.InPageTopCmmt={forObj:null,forOptions:null,textArea:null,maxComment:511,curDefault:null,DEFAULT_COMMENT:"",init:function(){this.textArea=$("#commentTextAreaTop");this.textArea.focus(function(){var A=$(this);if(A.val().length==0||A.val()==Clicker.InPageTopCmmt.curDefault){Clicker.InPageTopCmmt.clearCmmt()}});this.textArea.blur(function(){var A=$(this);if(A.val().length==0){Clicker.InPageTopCmmt.resetCmmt()}});this.textArea.keyup(function(){Util.checkMax("#commentTextAreaTop",Clicker.InPageTopCmmt.maxComment)});$("#fbTextPageTop, #twTextPageTop").click(function(){$(this).removeClass("disabled")});$(".commentBtnTop").click(this.btnCommentClick);this.resetCmmt()},show:function(C,A){this.reset();this.forObj=C;this.forOptions=A?A:{};if(this.forOptions.defaultComment){this.resetCmmt(this.forOptions.defaultComment)}if(this.forOptions.title){$("#commentAreaActionText").html(this.forOptions.title)}var B=false;if(l.fbConnected&&!l.tempFBAcct){if(!l.userSetFbShare){B=true}else{B=this.forOptions.checkShareFb}}$("#cmmtShareFbPageTop").attr("checked",B);if(l.tweet.can){if(this.forOptions.checkShareTweet){$("#cmmtShareTweetPageTop").attr("checked",true)}}$("#commentAreaTop").slideDown()},hide:function(){$("#commentAreaTop").slideUp()},close:function(){if(this.forOptions&&this.forOptions.callback){this.forOptions.callback(this.forObj,false)}this.hide()},btnCommentClick:function(){if(Clicker.InPageTopCmmt.forOptions&&Clicker.InPageTopCmmt.forOptions.callback){Clicker.InPageTopCmmt.forOptions.callback(Clicker.InPageTopCmmt.forObj,true)}Clicker.InPageTopCmmt.hide()},reset:function(){this.resetCmmt();this.resetShareArea()},resetCmmt:function(A){if(A!=null){this.curDefault=A}else{this.curDefault=this.DEFAULT_COMMENT}this.textArea.val(this.curDefault).addClass("gray")},clearCmmt:function(){this.textArea.val("").removeClass("gray")},resetShareArea:function(){$("#twTextPageTop,#fbTextPageTop").val("");$("#twTextPageTop,#fbTextPageTop").addClass("disabled");$("#twTextBoxPageTop,#fbTextBoxPageTop").hide();$("#cmmtShareFbPageTop, #cmmtShareTweetPageTop").attr("checked",false)},isShareFb:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareFbBoxPageTop"),$("#cmmtShareFbPageTop"))},isShareTweet:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareTweetBoxPageTop"),$("#cmmtShareTweetPageTop"))},getTwTxt:function(){return Clicker.CmmtFuncs.getComment($("#twTextPageTop"))},getFbTxt:function(){return Clicker.CmmtFuncs.getComment($("#fbTextPageTop"))},getComment:function(){return Clicker.CmmtFuncs.getComment(this.textArea,Clicker.InPageTopCmmt.curDefault)}};Clicker.InPageCmmt={maxComment:511,DEFAULT_COMMENT:"Write an optional comment here",init:function(A){var B=$("#checkinarea");B.focus(function(){var C=$(this);if(C.val().length==0||C.val()==Clicker.InPageCmmt.DEFAULT_COMMENT||C.val()==Clicker.CheckIn.DEFAULT_REVIEW){Clicker.InPageCmmt.clearCmmt()}});B.blur(function(){var C=$(this);if(C.val().length==0){Clicker.InPageCmmt.resetCmmt()}});B.keyup(function(){Util.checkMax("#checkinarea",Clicker.CheckIn.maxComment)});$("#fbTextPage, #twTextPage").click(function(){$(this).removeClass("disabled")});this.resetCmmt(A)},resetCmmt:function(A){if(A!=null){this.DEFAULT_COMMENT=A}$("#checkinarea").val(this.DEFAULT_COMMENT).addClass("gray")},clearCmmt:function(){$("#checkinarea").val("").removeClass("gray")},resetShareArea:function(){$("#twTextPage,#fbTextPage").val("");$("#twTextPage,#fbTextPage").addClass("disabled");$("#twTextBoxPage,#fbTextBoxPage").hide()},isShareFb:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareFbBoxPage"),$("#cmmtShareFbPage"))},isShareTweet:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareFbBoxPage"),$("#cmmtShareFbPage"))},getTwTxt:function(){return Clicker.CmmtFuncs.getComment($("#twTextPage"))},getFbTxt:function(){return Clicker.CmmtFuncs.getComment($("#fbTextPage"))},getComment:function(){return Clicker.CmmtFuncs.getComment($("#checkinarea"),Clicker.InPageCmmt.DEFAULT_COMMENT)}};Clicker.HoverCmmt={maxComment:144,hoverObj:null,closeTmr:null,forObj:null,forOptions:null,noTimeout:false,doShare:false,closeSecs:1,closeCountTmr:null,DEFAULT_COMMENT:"Write an optional comment here",init:function(){this.hoverObj=$("#hvrcmmt");if(Util.isMobile!=true){this.hoverObj.bind("mouseleave.HoverCmmt",Clicker.HoverCmmt.startCountdown);this.hoverObj.bind("mouseenter.HoverCmmt",Clicker.HoverCmmt.stopCountdown)}$(".cmmtclose",this.hoverObj).click(function(){Clicker.HoverCmmt.closeCommentBox({closeBtn:true})});$(".cmmtbtn",this.hoverObj).click(function(){Clicker.HoverCmmt.closeCommentBox({submitBtn:true})});$("#commentTxt",this.hoverObj).focus(function(){$(this).removeClass("disabled");if(Clicker.HoverCmmt.getComment()==null){$(this).val("")}}).blur(function(){if(Clicker.HoverCmmt.getComment()==null){$(this).val(Clicker.HoverCmmt.DEFAULT_COMMENT);$(this).addClass("disabled")}}).keyup(function(){Clicker.HoverCmmt.checkMaxComment();if(Clicker.HoverCmmt.getComment()){var A="Comment";$(this).removeClass("disabled");if(Clicker.HoverCmmt.doShare){A="Comment and Share"}$("#submitComment").text(A);$("#submitCommentBox").show()}else{$(this).addClass("disabled");if(!Clicker.HoverCmmt.doShare){$("#submitCommentBox").hide()}else{$("#submitComment").text("Share");$("#submitCommentBox").show()}}});$(".cmmttext").keyup(function(){Clicker.HoverCmmt.noTimeout=true;Clicker.HoverCmmt.stopCountdown()})},onShareCbClick:function(F){var B=$(F);var C=document.getElementById("cmmtShareTweet");var E=document.getElementById("cmmtShareFb");if(C!=null&&E!=null){this.doShare=C.checked||E.checked}var A="";var D=false;if(this.getComment()){A="Comment";D=true}if(this.doShare){var A=D?"Comment and Share":"Share";$("#submitComment").text(A);$("#submitCommentBox").show()}else{if(D){$("#submitComment").text(A);$("#submitCommentBox").show()}else{$("#submitCommentBox").hide()}}},showCommentBox:function(D,J){this.closeCommentBox({immediate:true});this.resetCommentBox();this.forObj=D;this.forOptions=J?J:{};var F=$(".cmmttitle",this.hoverObj);if(this.forOptions.title){F.html(this.forOptions.title)}if(this.forOptions.showNotify){$(".cmmtshow",this.hoverObj).show()}if(this.forOptions.cmmtsrc){$("#cmmtsrc",this.hoverObj).val(this.forOptions.cmmtsrc);$(".cmmtsrcarea",this.hoverObj).show()}if(l.haveup){var H=false;$(".cmmtShare").show();if(l.fbPost.can){$(".cmmtShareFbBox").show();if(this.forOptions.checkShareFb){$("#cmmtShareFb").attr("checked",true);H=true}}else{$(".cmmtShareFbLink").show()}if(l.tweet.can){$(".cmmtShareTweetBox").show();if(this.forOptions.checkShareTweet){$("#cmmtShareTweet").attr("checked",true);H=true}}else{$(".cmmtShareTweetLink").show()}if(H){$("#submitCommentBox").show()}Clicker.HoverCmmt.doShare=H}var I=this.hoverObj.outerHeight();var A=D.position();var B=$(".hvrcmmt_below",this.hoverObj);B.css("top",I-3);var C=$(".hvrcmmt_above",this.hoverObj);var G=D.offset();var E={top:G.top,left:G.left};E.top=G.top+D.outerHeight()+6;if(E.top+I>$(window).height()&&G.top-I-6>$(document).scrollTop()){E.top=G.top-I-6;B.css("visibility","visible");C.css("visibility","hidden")}else{C.css("visibility","visible");B.css("visibility","hidden")}if(Util.isiDevice){E.top-=window.pageYOffset;E.left-=window.pageXOffset}this.hoverObj.css("top",E.top);this.hoverObj.css("left",E.left);if(Util.isMobile!=true){D.bind("mouseleave.HoverCmmt",Clicker.HoverCmmt.startCountdown);D.bind("mouseenter.HoverCmmt",Clicker.HoverCmmt.stopCountdown)}Clicker.HoverCmmt.hoverObj.show();$(document).bind("mousedown.HoverCmmt",function(K){if(!$.contains(Clicker.HoverCmmt.hoverObj[0],K.target)&&Clicker.HoverCmmt.forObj[0]!=K.target){Clicker.HoverCmmt.closeCommentBox({immediate:true})}})},startCountdown:function(){if(Clicker.HoverCmmt.noTimeout==false&&Clicker.HoverCmmt.hoverObj.is(":visible")){Clicker.HoverCmmt.closeSecs=1;$("#closeMsg").css("visibility","visible");Clicker.HoverCmmt.closeCountTmr=setInterval(function(){var A=Clicker.HoverCmmt.closeSecs;if(A>=0){A--}Clicker.HoverCmmt.closeSecs=A},1000);Clicker.HoverCmmt.closeTmr=setTimeout(function(){Clicker.HoverCmmt.closeCommentBox({})},1000)}},stopCountdown:function(A){if(Clicker.HoverCmmt.closeTmr!=null){clearTimeout(Clicker.HoverCmmt.closeTmr)}Clicker.HoverCmmt.closeTmr=null;Clicker.HoverCmmt.closeSecs=1;if(Clicker.HoverCmmt.closeCountTmr!=null){clearInterval(Clicker.HoverCmmt.closeCountTmr)}},resetCommentBox:function(A){Clicker.HoverCmmt.noTimeout=false;var B=$(".cmmttitle",this.hoverObj);B.html("");$("#commentTxt",this.hoverObj).val(this.DEFAULT_COMMENT);$("#fbText",this.hoverObj).val("");$("#twText",this.hoverObj).val("");$(".cmmttext",this.hoverObj).addClass("disabled").data("clicked",false);$("#submitCommentBox").hide();this.doShare=false;$(".shareTxtBox",this.hoverObj).hide();$(".cmmtbtn span",this.hoverObj).text("Share");$(".cmmtshow",this.hoverObj).hide();$(".cmmtepi",this.hoverObj).hide();$(".cmmtsrcarea",this.hoverObj).hide();$("#cmmtsrc",this.hoverObj).val("");$(".cmmtShare").hide();$(".cmmtShareFbBox").hide();$(".cmmtShareFbLink").hide();$("#cmmtShareFb").attr("checked",false);$(".cmmtShareTweetBox").hide();$(".cmmtShareTweetLink").hide();$("#cmmtShareTweet").attr("checked",false);$("#showPost,#showTweet",this.hoverObj).show()},checkMaxComment:function(){if(Util.checkMax(".hvrcmmt .cmmttext",Clicker.HoverCmmt.maxComment)){$(".cmmttitle",this.hoverObj).html('<span class="red">Maximum '+Clicker.HoverCmmt.maxComment+" characters.</span>")}},closeCommentBox:function(A){A=A==null?{}:A;this.stopCountdown();$(document).unbind("mousedown.HoverCmmt");if(this.forObj){this.forObj.unbind("mouseleave.HoverCmmt");this.forObj.unbind("mouseenter.HoverCmmt")}if(this.hoverObj.is(":visible")){if(this.forOptions&&this.forOptions.callback){this.forOptions.callback(this.hoverObj,this.forObj,A.closeBtn==true,A.submitBtn==true)}}this.forObj=null;this.forOptions=null;if(A.immediate){this.hoverObj.hide()}else{this.hoverObj.fadeOut("fast")}},onShareTxtClick:function(B){var A=$(B);A.removeClass("disabled");A.data("clicked",true)},getComment:function(){return Clicker.CmmtFuncs.getComment($("#commentTxt",this.hoverObj),Clicker.HoverCmmt.DEFAULT_COMMENT)},getTwTxt:function(){return Clicker.CmmtFuncs.getComment($("#twText"))},getFbTxt:function(){return Clicker.CmmtFuncs.getComment($("#fbText"))},isShareFb:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareFbBox"),$("#cmmtShareFb"))},isShareTweet:function(){return Clicker.CmmtFuncs.isShareChecked($(".cmmtShareTweetBox"),$("#cmmtShareTweet"))},getSrcTitle:function(){var A=$("#cmmtsrc",this.hoverObj).val();if(A!=null&&$.trim(A)!=""){return Util.htmlEncode(A)}return null},srcTitleVis:function(){return $(".cmmtsrcarea",this.hoverObj).is(":visible")},fbconnect:function(){this.closeCommentBox({immediate:true});setTimeout(function(){location.href="/user/connect/?autofbconnect=true"},100)},twconnect:function(){this.closeCommentBox({immediate:true});setTimeout(function(){location.href="/user/settings/twauth/"},100)}};Clicker.SocialActivity={afterMenuClick:function(A){},init:function(){this.hoverID="socialActivityBoxHover";this.classNm="socialActivityTrigger";this.hoverClass="socialActivityBox";this.backgroundSelector="a img";this.menuTriggerClass="optsBtn";this.menuClass="optsMenu";this.menuOffsetL=-34;this.menuOffsetR=-184;this.menuOffsetT=15;this.menuBind();openTmr=null;closeTmr=null;menuCloseTmr=null},fadeInOverride:function(A){$.browser.msie&&$.browser.version<8?A.show():A.fadeIn("fast")},fadeOutOverride:function(A){$.browser.msie&&$.browser.version<8?A.hide():A.fadeOut("fast")},menuBind:function(){var A=this;$("."+A.menuTriggerClass).live("mousedown",function(D){var C=this;if($("#"+A.hoverID).css("display")=="none"){var B=$("."+A.menuClass,C).html();$("#"+A.hoverID).html(B);A.positionMenu(C,"#"+A.hoverID);$("#"+A.hoverID).show();if(typeof A.afterMenuClick=="function"){A.afterMenuClick(C)}}else{A.closeMenu()}});$("#"+A.hoverID).live("mouseleave",function(C){var B=this;clearTimeout(A.menuCloseTmr);A.menuCloseTmr=setTimeout(function(){A.closeMenu();Media.closeTmr=setTimeout(Media.closeNow,250)},250)}).live("mouseenter",function(C){clearTimeout(A.menuCloseTmr);clearTimeout(A.closeTmr);var B=$("#"+Media.hoverId);clearTimeout(Media.openTmr);clearTimeout(Media.closeTmr)})},closeHover:function(A){sa=this;sa.fadeOutOverride($("."+sa.hoverClass))},closeMenu:function(){sa=this;sa.fadeOutOverride($("#"+sa.hoverID))},positionMenu:function(B,H){var I=this;var E=$(B).width();var G=$(B).offset();var C=$(window);var J=$(document);var D=C.width()+J.scrollLeft();var L=C.height()+J.scrollTop();var K=$(H).width();var A=(G.left+K+E)>D?G.left-K-I.menuOffsetL:G.left+E+I.menuOffsetR;if(A>G.left){$(H).removeClass("menuBotRt").addClass("menuBotLt")}else{$(H).removeClass("menuBotLt").addClass("menuBotRt")}var F=G.top+I.menuOffsetT;$(H).css({top:(F)+"px",left:(A)+"px"})},passFbFriends:function(D,C,B){var A="/user/AJAX/passFbFriends/";var E={uid:C,fbids:B};$("#fbFollowBox_"+D.id.split("_")[1]).fadeOut("fast");$.get(A,E,function(F){})}};$(document).ready(function(A){$("#inviteEmailInput").focus(function(){var B=$(this);if(B.hasClass("ltGray")){B.val("");B.removeClass("ltGray")}}).blur(function(){var B=$(this);if(Util.isEmpty(B.val())){B.addClass("ltGray");B.val("enter emaill address")}}).keydown(function(D){var B=D.which;if(B==13){Clicker.inviteEmail($(this).val())}else{if(B==27){var C=$(this);C.val("");C.blur()}}});Clicker.ConfirmBox.init();Clicker.CheckIn.init();Clicker.Fanning.init();Clicker.Rating.init();Clicker.Playlist.init();Clicker.HoverCmmt.init();Clicker.Activity.init();Clicker.Action.init();Clicker.SocialActivity.init()});if(window.Clicker==null){window.Clicker={}}Clicker.FBGraph={evElem:null,ev:{loginPerms:"loginPerms.fbgraph",loginPermsFail:"loginPermsFail.fbgraph",login:"login.fbgraph",loginFail:"loginFail.fbgraph",logout:"logout.fbgraph",logoutFail:"logoutFail.fbgraph",connected:"connected.fbgraph",notconnected:"notconnected.fbgraph",rendered:"rendered.fbgraph",init:"init.fbgraph"},afterInit:false,start_pic:'<fb:profile-pic  size="square" facebook-logo="true" linked="false" uid="',start_icon_pic:'<fb:profile-pic  width="20" height="20" facebook-logo="false" linked="false" uid="',end_pic:'"></fb:profile-pic>',start_name:'<fb:name linked="false" useyou="false" uid="',end_name:'"></fb:name>',init:function(A,B){window.fbAsyncInit=function(){FB.Event.subscribe("auth.statusChange",Clicker.FBGraph.statusChanged);FB.Event.subscribe("xfbml.render",Clicker.FBGraph.xfbmlRendered);FB.init({appId:A,status:true,cookie:true,xfbml:true,channelUrl:location.protocol+"//"+location.host+"/fb_channel.htm"});afterInit=true;var D=Clicker.FBGraph.getUid();if(D==null){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.notconnected,[])}Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.init,[D])};if(B){var C=document.createElement("script");C.async=true;C.src=document.location.protocol+"//connect.facebook.net/en_US/all.js";document.getElementById(B).appendChild(C)}else{afterInit=true;FB.Event.subscribe("auth.statusChange",Clicker.FBGraph.statusChanged);FB.Event.subscribe("xfbml.render",Clicker.FBGraph.xfbmlRendered)}},getEvElem:function(){if(Clicker.FBGraph.evElem==null){Clicker.FBGraph.evElem=$("#fb-root")}return Clicker.FBGraph.evElem},bind:function(B,A){var C=Clicker.FBGraph.getEvElem();C.bind(B,A)},xfbmlRendered:function(A){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.rendered,[A])},statusChanged:function(B){var C=null;var A=false;if(B==null){ClkrTop.Util.log("statusChanged no response")}else{if(B.error){ClkrTop.Util.log("statusChanged error: "+B.error)}else{if(B.status){if(B.status=="connected"){A=true;Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.connected,[Clicker.FBGraph.getUid()])}else{C=B.status}}else{ClkrTop.Util.log("statusChanged has no status")}}}if(!A){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.notconnected,[C])}},getUid:function(){var A=null;if(window.FB&&window.FB.getSession){A=FB.getSession()}if(A!=null){return A.uid}return null},confirmLoggedIn:function(B){var A=B;FB.getLoginStatus(function(C){if(C.session){if(A){A(C.session.uid)}}else{if(A){A(null)}}})},getInfo:function(A){if(this.getUid()==null){if(A!=null){setTimeout(function(){A(null)},0)}return false}FB.api("/me",{fields:"id,name,first_name,last_name,link,gender,email,location"},function(B){if(A!=null){A(B)}});return true},getInterests:function(A){if(this.getUid()==null){if(A!=null){setTimeout(function(){A(null)},0)}return false}FB.api("/me",{fields:"television,movies,music"},function(B){if(A!=null){A(B)}});return true},getConnections:function(A){if(this.getUid()==null){if(A!=null){setTimeout(function(){A(null)},0)}return false}FB.api("/me",{metadata:1},function(B){if(A!=null){A(B)}});return true},doRevoke:function(A,C){Clicker.FBGraph.resetLip();if(this.getUid()==null){if(C!=null){setTimeout(function(){C(null)},0)}return false}var B={method:"auth.revokeAuthorization"};if(A){B.block=1}FB.api(B,function(E){var D=C;setTimeout(function(){if(D){D(E)}},1)});return true},getAppUsers:function(A){if(this.getUid()==null){if(A!=null){setTimeout(function(){A(null)},0)}return false}FB.api({method:"friends.getAppUsers"},function(B){if(A){A(B)}});return true},doLogin:function(A){FB.login(function(C){if(C&&C.session){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.login,[]);if(A!=null){var B=A;setTimeout(function(){B(C)},1)}}else{Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.loginFail,[])}})},doLogout:function(A){FB.logout(function(B){Clicker.FBGraph.resetLip();if(A!=null){A(B)}if(B&&B.session==null){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.logout,[])}else{Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.logoutFail,[])}})},getEmail:function(B){var A=B;FB.login(function(C){if(C.session){if(C.perms){if(C.perms.indexOf("email")>-1){Clicker.FBGraph.getInfo(function(D){if(D!=null&&D.email!=null){if(A!=null){A(D.email)}}else{if(A!=null){A()}}})}}else{if(A!=null){A()}}}else{if(A!=null){A()}}},{perms:"publish_stream,offline_access,user_likes,email"})},doLoginWithPerms:function(D,B){B=B?B:"publish_stream,offline_access,user_likes,email";var C=B.split(",");var A=D;FB.login(function(E){if(E.session){if(E.perms){var H=true;for(var F=0;F<C.length;F++){var G=C[F];if(E.perms.indexOf(G)<0){H=false}}if(H){Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.loginPerms,[]);if(A!=null){A(true)}return true}}}Clicker.FBGraph.getEvElem().trigger(Clicker.FBGraph.ev.loginPermsFail,[]);if(A!=null){A(false)}},{perms:B})},getPicHtml:function(A){if(A==null){A=this.getUid()}return this.start_pic+A+this.end_pic},getIconHtml:function(A){if(A==null){A=this.getUid()}return this.start_icon_pic+A+this.end_pic},getNameHtml:function(A){if(A==null){A=this.getUid()}return this.start_name+A+this.end_name},sameAsLast:function(){var A=false;var B=this._getLipX().i;if(this.getUid()==B){A=true}this.setLip();return A},resetLip:function(){var A=this._getEmptyLip();this._saveLipX(A)},setLip:function(){var B=this._getLipX();var A=this.getUid();if(B.i!=A){if(A!=null){B.i=A}else{B.i=-1}B.h=0;B.s=0;B.p=0}this._saveLipX(B)},getHomeIpCnt:function(){return this._getLipX().h},getShowsIpCnt:function(){return this._getLipX().s},getProfileIpCnt:function(){return this._getLipX().p},incShowIpCnt:function(){var A=this._getLipX();if(A.s<10){A.s++;this._saveLipX(A)}},incHomeIpCnt:function(){var A=this._getLipX();if(A.h<10){A.h++;this._saveLipX(A)}},incProfileIpCnt:function(){var A=this._getLipX();if(A.p<10){A.p++;this._saveLipX(A)}},_getEmptyLip:function(){return{i:-1,h:0,s:0,p:0}},_getLipX:function(){var A=this._getEmptyLip();var B=new ClkrTop.Cookie("lip").get();if(B!=null){var C=B.split("_");if(C.length>2){A.i=C[0];A.h=C[1];A.s=C[2];if(C.length>3){A.p=C[3]}}}return A},_saveLipX:function(A){new ClkrTop.Cookie("lip").bake(A.i+"_"+A.h+"_"+A.s+"_"+A.p)},initIP:function(){},getFriendsHtml:function(C,A){C=C?C:"";A=A?A:"";var B="";B+=('<fb:request-form action="'+C+'/user/connect/" method="POST" invite="true" type="Clicker" content="<fb:name uid=\''+this.getUid()+"' /> is a member of Clicker and would like to share that experience with you. To register, simply click on the Register button below.<fb:req-choice url='http://clicker.com/create-an-account.html' label='Register'/>\">");B+='<fb:multi-friend-selector exclude_ids="'+A+'" cols="4" rows="3" showborder="true" actiontext="Invite your Facebook Friends to use Clicker" email_invite="true" import_external_friends="true" bypass="cancel" />';B+="</fb:request-form>";return B}};if(window.Clicker==null){window.Clicker={}}Clicker.Buttons={hoverObj:null,curTimer:null,init:function(){this.hoverObj=$("#btnstandard_btnhover");if(Util.isMobile!=true){$("button.btnstandard").live("mouseenter",this.overBtn);$("button.btnstandard").live("mouseleave",this.leaveBtn)}if(Util.isMobile!=true){$(".useHover2").live("mouseenter",this.overBtn);$(".useHover2").live("mouseleave",this.leaveBtn)}if($.browser.msie==true){$("button.btnstandard").css("overflow","visible")}},overBtn:function(B){var C=$(this);var A=C.attr("title");if(A!=null&&$.trim(A)!=""){C.data("clicker_title",A);C.attr("title","");Clicker.Buttons.showHover(C,A)}if(C.hasClass("stripTitle")){$("img",C).attr("title","")}},leaveBtn:function(A){var B=$(this);Clicker.Buttons.closeHover(B)},setText:function(B,A){$("span",B).text(A)},showHover:function(H,A){$(".btnhover_text",this.hoverObj).html(A);var B=this.hoverObj.outerHeight();var C=H.position();var E=$(".btnhover_below",this.hoverObj);E.css("top",B-2);var D=$(".btnhover_above",this.hoverObj);var G=H.offset();var F={top:G.top,left:G.left};F.top=G.top-B-6;if(H.width()<20){F.left=F.left-10}if(F.top>$(document).scrollTop()){E.css("visibility","visible");D.css("visibility","hidden")}else{F.top=G.top+H.outerHeight()+6;D.css("visibility","visible");E.css("visibility","hidden")}this.hoverObj.css("top",F.top);this.hoverObj.css("left",F.left);Clicker.Buttons.curTimer=setTimeout(function(){Clicker.Buttons.hoverObj.show()},300)},closeHover:function(B){var A=B.data("clicker_title");if(A!=null&&A!=""){B.attr("title",A);if(Clicker.Buttons.curTimer!=null){clearTimeout(Clicker.Buttons.curTimer)}Clicker.Buttons.hoverObj.hide()}}};$(document).ready(function(A){Clicker.Buttons.init()});if(window.Clicker==null){window.Clicker={}}Clicker.Dialog={loadinImageUrl:"http://im2n.clicker.com/m/ext/loading.gif",popWinName:"clickeDialog",popWinArgs:{scrollbars:1,toolbar:0,status:0,resizable:1,width:700,height:400},modalGray:null,iframe:null,spinner:null,bigspinner:null,curspinner:null,modalClose:null,lastCallback:null,lastCloseFunc:null,noCloseBtn:false,show:function(C,G,A,D,B){this.noCloseBtn=B!=null?B:false;var F=$(document);var E=$(window);if(this.iframe!=null){Clicker.Dialog.close()}this.lastCallback=G;this.lastCloseFunc=A?A:"popupDialog_Closing";if(this.modalClose==null){this.modalClose=$('<div class="modalClose clickable" style="display:none;"></div>');$("body",F).append(this.modalClose)}this.modalClose.unbind("click.modalClose");this.modalClose.bind("click.modalClose",function(){Clicker.Dialog.close()});this.showspinner(D);if(C){this.iframe=$('<iframe id="modalFrame" style="visibility: hidden;" name="modalFrame" class="rounded5"></iframe>');this.iframe.load(function(){var L=$(this);var M=$("#testPattern",L.contents());if(M!=null&&M.length>0){Clicker.Dialog.hide();alert("This feature is currently not available.  Please try again later.");return }var I=L.contents().width();var K=L.contents().height();var J=(E.height()/2)+F.scrollTop()-(K/2);if(J<=10){J=10}var H=(E.width()/2)+F.scrollLeft()-(I/2);if(H<0){H=0}L.css("top",J);L.css("left",H);L.width(I);L.height(K);L.css("visibility","visible");Clicker.Dialog.modalClose.css("top",J-10);Clicker.Dialog.modalClose.css("left",H+I-28);if(!Clicker.Dialog.noCloseBtn){Clicker.Dialog.modalClose.show()}Clicker.Dialog.modalGray.height($(document).height());ClkrTop.Clicker.Dialog.curspinner.hide()});this.iframe.attr("src",C);$("body",F).append(this.iframe)}},adjustSize:function(){var C=this.iframe;var B=C.contents().height();var A=C.contents().width();C.height(B);C.width(A);this.modalGray.height($(document).height())},showspinner:function(A){var C=$(document);var B=$(window);if(this.modalGray==null){this.modalGray=$('<div style="z-index: 20000; position:absolute; top:0;left:0;background-color:#000;"></div>');this.modalGray.css("opacity",0.5);$("body",C).append(this.modalGray);this.spinner=$('<div class="spinnerTrans rounded10 shadowAll40" style="z-index:20001; position:absolute; display:none; background-color: #333333;"></div>');$("body",C).append(this.spinner);this.bigspinner=$("#main_connecting_big")}this.curspinner=A?this.bigspinner:this.spinner;this.curspinner.css("top",((B.height()/2)+C.scrollTop())-(this.curspinner.height()/2));this.curspinner.css("left",((B.width()/2)+C.scrollLeft())-(this.curspinner.width()/2));this.modalGray.width(C.width());this.modalGray.height(C.height());this.modalGray.show();this.curspinner.show()},hidespinner:function(){if(this.modalGray!=null){this.modalGray.hide()}if(this.curspinner!=null){this.curspinner.hide()}},hide:function(){if(this.iframe!=null){this.iframe.hide();this.iframe.remove();this.iframe=null}this.hidespinner();this.hideCloseBtn()},close:function(D){if(this.lastCloseFunc!=null&&this.iframe!=null){var C=this.iframe[0];C=C.contentWindow;if(C!=null){var A=C[this.lastCloseFunc];if(A!=null){var E=A(D);if(E==false){return }}}}if(this.lastCallback!=null){this.lastCallback(D)}if(D!=null){var B=D;setTimeout(function(){ClkrTop.location.href=B},500)}else{Clicker.Dialog.hide()}},hideCloseBtn:function(){if(this.modalClose!=null){this.modalClose.hide()}},makeOpts:function(C){var A="";var D=true;for(var B in C){if(D){D=false}else{A+=","}A+=(B+"="+C[B])}return A},newWin:function(A,B){if(this.winRef!=null){this.winRef.close()}var C=$.extend({},this.popWinArgs,B);this.winRef=window.open("",this.popWinName,this.makeOpts(C));this.winRef.document.writeln('<html><head></head><body style="text-align:center;"><div style="margin:100px 0 0 0;"><img height="175" width="175" style="display:none" onload="this.style.display=\'\';" src="'+this.loadinImageUrl+'"></div></body></html>');this.winRef.document.close();var D=this;setTimeout(function(){D.winRef.location=A},50)}};var Recs={ratePage:1,rateNum:1,curRecTab:null,doload:false,recsPage:1,lastHideId:null,curPopTab:"topEps",curRecTabId:"onAll",curRateTab:"rateTv",reasonBox:null,reasonTmr:null,reasonCloseTmr:null,doReasonHover:false,isHomePage:false,recTmr:null,recCloseTmr:null,recType:"",recSort:"",viewStyle:"L",viewItems:null,recMediaId:null,fe_key:null,showFlags:null,oFilter:null,objTypes:null,numRes:null,bypassCatLevel0:false,bypassMediaLevel0:false,refreshCallback:null,baseUrl:"/index/AJAX/recs/",allFilterIDs:"#recFilter, #trendFilter, #titleFilter, #dateFilter, #popFilter",viewStyleIDs:"#onViewGrid, #onViewList",init:function(B){B=B||{curRecTabId:"onAll",isHomePage:false};this.curRecTabId=B.curRecTabId;this.isHomepage=B.isHomePage;this.curRecTab=$("#"+this.curRecTabId);this.recMediaId=B.recMediaId;var A=["recSort","baseUrl","bypassCatLevel0","bypassMediaLevel0","oFilter"];this.setOptions(A,B);this.startLoadCheck();this.viewItems=B.viewItems;this.hookupEvents()},startLoadCheck:function(){var A=setInterval(function(){if(Recs.doload){Recs.doload=false;Recs.refresh()}},1000)},refresh:function(){Recs.hideReasonBox();if(Recs.rateNum!=Recs.curRecTab.data("rateNum")){Recs.curRecTab.data("rateNum",Recs.rateNum);if(!$.browser.msie){Recs.curRecTab.fadeTo("fast",0.7)}var A=Recs.baseUrl;var B={};if(Recs.curRecTabId=="onRecShows"){B={mediaid:"1|2"}}else{if(Recs.curRecTabId=="onRecTv"){B={mediaid:"1"}}else{if(Recs.curRecTabId=="onRecMovies"){B={mediaid:"4"}}else{if(Recs.curRecTabId=="onRecWeb"){B={mediaid:"2"}}else{if(Recs.curRecTabId=="onRecMusic"){B={mediaid:"3"}}else{if(Recs.curRecTabId=="onRec"){B={rec_type:"R"}}else{if(Recs.curRecTabId=="onPopular"){B={rec_type:"G"}}else{if(Recs.curRecTabId=="onQueue"){B={rec_type:"E"}}else{if(Recs.curRecTabId=="onNew"){A="/index/AJAX/latest"}}}}}}}}}B.hp=Recs.isHomepage?1:0;B.rec_type=Recs.recType;B.rnd=Util.random();B=Recs.stickyParams(B);$.get(A,B,function(C){var D=$("#"+Recs.curRecTabId+"Content");if(Recs.rateNum==Recs.curRecTab.data("rateNum")){Recs.recsPage=1;if(C.indexOf("No results were found")!=-1){$(".moreBtn",Recs.curRecTab).hide()}else{$(".moreBtn",Recs.curRecTab).show()}D.html(C);FB.XFBML.parse(D[0]);if(!$.browser.msie){Recs.curRecTab.fadeTo("fast",1)}else{Recs.curRecTab.show()}Recs.curRecTab.data("rateNum",null)}else{}if(Recs.refreshCallback){Recs.refreshCallback(C)}})}},stickyParams:function(A){if(Recs.recSort&&Recs.recSort!=""){A.sort=Recs.recSort}if(Recs.viewItems&&Recs.viewItems!=""){A.view=Recs.viewItems}if(Recs.recMediaId&&Recs.recMediaId!=""){A.mediaid=Recs.recMediaId}if(Recs.viewStyle&&Recs.viewStyle!=""){A.recview=Recs.viewStyle}if(Recs.oFilter&&Recs.oFilter!=""){A.o_filter=Recs.oFilter}if(Recs.objTypes&&Recs.objTypes!=""){A.obj_types=Recs.objTypes}if(Recs.numRes&&Recs.numRes!=""){A.rec_num_res=Recs.numRes}if(Recs.showFlags&&Recs.showFlags!=""){A.show_flags=Recs.showFlags}return A},hookupEvents:function(){$("#refresh").click(function(){Recs.refresh()});$(Recs.allFilterIDs).live("click",function(){var A=$(this);if(!A.hasClass("selected")){$(Recs.allFilterIDs).removeClass("selected");if(this.id=="recFilter"){if(l&&l.isLoggedIn){Recs.recType="R";Recs.recSort="rec";Recs.objTypes=null;Recs.showFlags=null;A.addClass("selected")}else{ClkrTop.l.start(A);return false}}else{if(this.id=="trendFilter"){Recs.recType="";Recs.recSort="trend";A.addClass("selected");Recs.objTypes=null;Recs.showFlags=null}else{if(this.id=="titleFilter"){Recs.recType="";Recs.recSort="alpha";Recs.objTypes="s";A.addClass("selected");Recs.viewItems="items"}else{if(this.id=="dateFilter"){Recs.recType="";Recs.showFlags=null;Recs.recSort="air_date";Recs.objTypes="e";A.addClass("selected");Recs.viewItems="items"}else{if(this.id=="popFilter"){Recs.showFlags="10000000|200000|100000|1000|2000|200|400|80|20|8";Recs.recType="";Recs.recSort="popular";Recs.objTypes="s";A.addClass("selected")}}}}}Recs.refresh()}});$(Recs.viewStyleIDs).live("click",function(){var A=$(this);if(!A.hasClass("selected")){$(Recs.viewStyleIDs).removeClass("selected");if(this.id=="onViewGrid"){Recs.viewStyle="G";Recs.numRes="15"}else{if(this.id=="onViewList"){Recs.viewStyle="L";Recs.numRes="15"}}A.addClass("selected");Recs.refresh()}});$(".jsCatFilter").live("click",function(){var B=$(this);Recs.refreshCallback=Recs.catCallback;if(!B.hasClass("curOption")){if(B.hasClass("level0")&&Recs.bypassCatLevel0){window.location=$("a",this).attr("href");return false}$(".jsCatFilter").removeClass("curOption");var A=$(this).attr("class").match(/jsCat-(\d+)/);if(A&&A.length>0){if(A[1]==0){Recs.oFilter=""}else{Recs.oFilter="c:"+A[1]}}Recs.refresh();if($("#catTree").length&&$("#catTreeHtml").length){$("#catTree").html($("#catTreeHtml").html())}}});$(".reasonHover, .recHover").live("mouseenter",function(A){var B=this;clearTimeout(Recs.reasonCloseTmr);if(Recs.reasonBox==null){Recs.reasonBox=$('<div id="reasonBox" class="shadow2 round"><div id="reasonBoxContent" style="min-height:100px;background-color:#f9f9f9"></div><div id="pointer"></div><div id="pointerRight" style="display:none"></div></div>');$(document.body).append(Recs.reasonBox);Recs.reasonBox.mouseenter(function(){clearTimeout(Recs.reasonCloseTmr)}).mouseleave(function(){Recs.reasonCloseTmr=setTimeout(function(){Recs.reasonBox.hide()},300)})}Recs.reasonBox.hide();Recs.doReasonHover=true;Recs.reasonTmr=setTimeout(function(){var K=Recs.reasonBox;var I=B.id;var C=$(B).hasClass("reasonHover");if(C){var D="/index/AJAX/reasons/";var H=I.split("_");var M=H[1];var J=H[2];var G={};G.fe_key=M;G.reason=J;G.hp=Recs.isHomepage?1:0;G.rnd=Util.random();G.title=B.title;$.get(D,G,function(N){if(Recs.doReasonHover){var O=$(N);$("#reasonBoxContent",K).html(O);Recs.reasonPosition(B)}})}else{var L=I.split("_")[1];var F=$("#recInfo_"+L);if(F.length>0){var E=F.html();$("#reasonBoxContent",K).html(E);Recs.reasonPosition(B)}}},200)}).live("mouseleave",function(){clearTimeout(Recs.reasonTmr);Recs.doReasonHover=false;var A=Recs.reasonBox;Recs.reasonCloseTmr=setTimeout(function(){if(A!=null){A.hide()}},200)}).live("click",function(){clearTimeout(Recs.reasonTmr)});$(".recBox").live("click",function(A){}).live("mouseenter",function(A){var B=this;var C=B.id.split("_")[1];if(Recs.lastHideId==C){clearTimeout(Recs.recCloseTmr);return }$(".recReveal",$(B)).show()}).live("mouseleave",function(A){var B=this;$(".recReveal",$(B)).hide()});$(".rateBox").live("click",function(F){if(F&&F.target!=null){var E=$(F.target);if(E.is("a")||E.parent().is("a")){return }if(!(l&&l.isLoggedIn)){ClkrTop.l.start(E);return false}if(F.target.className.toLowerCase().indexOf("like")!=-1||E.hasClass("btnPass2")){if(!E.hasClass("btnPass2")&&$(this).hasClass("doRefresh")){Recs.doload=true}var G={rate_this_num_res:3,page:Recs.ratePage};var H=Recs.curRateTab;if(H.indexOf("rateTv")!=-1){G.mediaid="1"}else{if(H.indexOf("rateMovies")!=-1){G.mediaid="4"}else{if(H.indexOf("rateWeb")!=-1){G.mediaid="2"}else{if(H.indexOf("rateMusic")!=-1){G.mediaid="3"}}}}G.hp=Recs.isHomepage?1:0;var D=Recs.rateNum%3==0;if(D){var B=$(".rateBox",$("#"+Recs.curRateTab));var A=B.length;var C="";B.each(function(I){C+=this.id.split("_")[1]+(I<(A-1)?",":"")});G.rate_this_items=C;setTimeout(function(){if(D){$.get("/index/AJAX/ratings/",G,function(I){var J=$(I);$("#"+Recs.curRateTab).append(J);Recs.ratePage++})}},50)}Recs.rateNum++;$(this).remove()}}}).live("mouseenter",function(){}).live("mouseleave",function(){});$(".recRemove, .btnPass2").live("click",function(){if(!(l&&l.isLoggedIn)){ClkrTop.l.start(this);return false}var H=this.id.split("_")[1];var D=null;var G=-2;var B=$("#recBox_"+H,Recs.curRecTab);var F=B.hasClass("topRec");var A=$(this).hasClass("recRemove");if(A){D=$("#recData_"+H,Recs.curRecTab).html().split("_");B.fadeTo("fast",0.3)}else{G=-3;var C=this.id.split("_");D=[C[1],C[2]]}Recs.lastHideId=null;var E={showId:D[0],episodeId:D[1],rating:G};Clicker.tokenpost("/user/AJAX/modLike.html",E,function(J){if(J.isTrue){if(A){Recs.hideReasonBox();$("#refresh").removeClass("refreshStatic").addClass("refresh");var I="/index/AJAX/recs/";var K={};if(Recs.curRecTabId=="onRecShows"){K={mediaid:"1|2"}}else{if(Recs.curRecTabId=="onRecTv"){K={mediaid:"1"}}else{if(Recs.curRecTabId=="onRecMovies"){K={mediaid:"4"}}else{if(Recs.curRecTabId=="onRecWeb"){K={mediaid:"2"}}else{if(Recs.curRecTabId=="onRecMusic"){K={mediaid:"3"}}else{if(Recs.curRecTabId=="onRec"){K={rec_type:"R"}}else{if(Recs.curRecTabId=="onPopular"){K={rec_type:"G"}}else{if(Recs.curRecTabId=="onQueue"){K={rec_type:"E"}}}}}}}}}K.rec_type=Recs.recType;K.recid=H;K.toprec=F;K.showId=D[0];K.episodeId=D[1];K.hp=Recs.isHomepage?1:0;K.rnd=Util.random();$.get(I,K,function(L){B.html(L);FB.XFBML.parse(B[0]);if(!$.browser.msie){B.fadeTo("fast",1)}else{B.show()}$("#refresh").removeClass("refresh").addClass("refreshStatic");Recs.lastHideId=null})}}else{Util.message("Error processing request.")}})});$(".moreBtn").click(function(){var E=this.id;var B=$(this);$(".moreMsg",B).addClass("spinner");Recs.recsPage++;if(E=="moreRatings"){location.href="/ratings/"}else{var C="onAllContent";var D={page:Recs.recsPage,personal_homepage_base:Recs.recsPage};if(E=="moreRecs"){if(!Recs.isHomepage){D={page:Recs.recsPage,base:Recs.recsPage}}}else{if(E=="moreRecMovies"){D={mediaid:"4",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecMoviesContent"}else{if(E=="moreRecShows"){D={mediaid:"1|2",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecShowsContent"}else{if(E=="moreRecTv"){D={mediaid:"1",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecTvContent"}else{if(E=="moreRecWeb"){D={mediaid:"2",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecWebContent"}else{if(E=="moreRecMusic"){D={mediaid:"3",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecMusicContent"}else{if(E=="moreRec"){D={rec_type:"R",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onRecContent"}else{if(E=="morePopular"){D={rec_type:"G",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onPopularContent"}else{if(E=="moreQueue"){D={rec_type:"E",page:Recs.recsPage,personal_homepage_base:Recs.recsPage};C="onQueueContent"}else{if(E=="moreNew"){D={page:Recs.recsPage};C="onNewContent"}}}}}}}}}}D.hp=Recs.isHomepage?1:0;D.rec_type=Recs.recType;D.fromMoreBtn="1";D=Recs.stickyParams(D);var A=Recs.baseUrl;if(E=="moreNew"){A="/index/AJAX/latest/"}Util.logGAHit(A);D.smallFirst="1";D.hp=Recs.isHomepage?1:0;D.rnd=Util.random();$.get(A,D,function(G){var H=$(G);$("#"+C).append(H);FB.XFBML.parse(document.getElementById(C));$(".moreMsg",B).removeClass("spinner");var F=E=="moreRecs"?10:4;if(Recs.recsPage>F){B.hide()}})}});$("#homeFilter #hideTypeSubOptions,#freeSourceOption").click(function(A){Recs.doload=true})},catCallback:function(A){if($("#catTree").length&&$("#catTreeHtml").length){$("#catTree").html($("#catTreeHtml").html())}Recs.refreshCallback=null},reasonPosition:function(A){if(A==null||A.length==0){return }var D=Recs.reasonBox;var K=$(A).offset();var E=$(window);var L=$(document);var F=E.width()+L.scrollLeft();var O=E.height()+L.scrollTop();var M=300;var I=$(A).width()+20;var C=$(A).height();var N=((K.left+M+I)>F)||$(A).hasClass("recFlipLeft");var B=N?K.left-M-20:K.left+I;var H=D.height();var G=K.top+H>O;var J=G?K.top-H+(C/2)+35:K.top-70+(C/2);D.css({top:(J)+"px",left:(B)+"px"});if(N){$("#pointer",D).hide();$("#pointerRight",D).show().css("top",G?H-50:50)}else{$("#pointerRight",D).hide();$("#pointer",D).show().css("top",G?H-50:50)}D.fadeIn("fast")},setOptions:function(A,B){$.each(A,function(C,D){if(B[D]){Recs[D]=B[D]}})},hideReasonBox:function(){if(Recs.reasonBox!=null&&Recs.reasonBox.length>0){Recs.reasonBox.hide()}},rateTabSelect:function(B){var D=B.id.replace(/Tab/,"");if(D!=Recs.curRateTab){$("#"+Recs.curRateTab+"Tab").removeClass("fsel");$(B).addClass("fsel");var C={};$("#rateLoading").show();Recs.ratePage=1;Recs.rateNum=1;var A="/index/AJAX/ratings/";if(D.indexOf("rateTv")!=-1){C={mediaid:"1"}}else{if(D.indexOf("rateMovies")!=-1){C={mediaid:"4"}}else{if(D.indexOf("rateWeb")!=-1){C={mediaid:"2"}}else{if(D.indexOf("rateMusic")!=-1){C={mediaid:"3"}}}}}C.hp=Recs.isHomepage?1:0;C.rnd=Util.random();C.rate_this_num_res=5;if(!$.browser.msie){$("#"+Recs.curRateTab).fadeTo("fast",0.7)}$.get(A,C,function(E){$("#"+Recs.curRateTab).hide();Recs.curRateTab=D.replace(/Tab/,"");var F=$("#"+Recs.curRateTab);F.html(E);if(!$.browser.msie){F.css("opacity",1)}F.fadeIn("fast");$("#rateLoading").hide()})}},recTabSelect:function(F,J){F=F||document.getElementById(Recs.curRecTabId+"Tab");var C=F.id;var K=C.replace(/Tab/,"");if($(F).hasClass("jsSameTab")){K=Recs.curRecTabId}params={};allowedParams=["mediaid","order","sort"];$.each(allowedParams,function(P,Q){if(J&&J[Q]){params[Q]=J[Q]}});Recs.recsPage=1;Recs.hideReasonBox();var G=$("#"+Recs.curRecTabId+"Tab");var N=$("#"+Recs.curRecTabId);var E=$("#"+Recs.curRecTabId+"Content");var D=$(F);var I=$("#"+K);var O=$("#"+K+"Content");if(Recs.recSort){params.sort=Recs.recSort}var A="";var M=true;if(C.indexOf("onFriends")!=-1){try{var H=l&&l.isLoggedIn?l.userName:"";A="/profile/"+H+"/history/AJAX/";if(l&&l.isLoggedIn){G.removeClass("fsel");if(!$.browser.msie){N.fadeTo("fast",0.7)}D.addClass("fsel");$("#refresh").removeClass("refreshStatic").addClass("refresh");Util.logGAHit(A);Recs.curRecTabId=K;Recs.curRecTab=$("#"+K)}Clicker.waitForLogin(F,Clicker.Activity,Clicker.Activity.refresh,[A,"onFriends",{as_view:"network"},function(){N.hide();if(!$.browser.msie){I.css("opacity",1).show()}else{I.show()}$("#refresh").removeClass("refresh").addClass("refreshStatic");FB.XFBML.parse(I[0])}],true);M=false}catch(L){return false}}else{if(C.indexOf("onRecShows")!=-1){params={mediaid:"1|2"}}else{if(C.indexOf("onRecMovies")!=-1){params={mediaid:"4"}}else{if(C.indexOf("onRecTv")!=-1){params={mediaid:"1"}}else{if(C.indexOf("onRecWeb")!=-1){params={mediaid:"2"}}else{if(C.indexOf("onRecMusic")!=-1){params={mediaid:"3"}}else{if(C.indexOf("onRec")!=-1){if(l&&l.isLoggedIn){params={rec_type:"R"}}else{ClkrTop.l.start(F);return false}}else{if(C.indexOf("onPopular")!=-1){params={rec_type:"G"}}else{if(C.indexOf("onQueue")!=-1){params={rec_type:"E"}}}}}}}}}}if(M){G.removeClass("fsel");if(!$.browser.msie){N.fadeTo("fast",0.7)}D.addClass("fsel");$("#refresh").removeClass("refreshStatic").addClass("refresh");if(C.indexOf("onNew")!=-1){A="/index/AJAX/latest/"}else{A="/index/AJAX/recs/"}params.hp=Recs.isHomepage?1:0;params.rnd=Util.random();params.rec_type=Recs.recType;var B=K==Recs.curRecTabId;$.get(A,params,function(P){O.html(P);FB.XFBML.parse(O[0]);N.hide();if(!B){E.empty()}if(!$.browser.msie){I.css("opacity",0.7);I.fadeTo("fast",1)}else{I.show()}var Q=$(".moreBtn",I);Q.show();$("#refresh").removeClass("refresh").addClass("refreshStatic")});Util.logGAHit(A);Recs.curRecTabId=K;Recs.curRecTab=$("#"+K)}}};var Suggest={sugBox:null,sugTmr:null,sugSearchId:0,showId:"",episodeId:"",sugIcon:null,suggested:false,lastSugItem:null,toList:{},DEFAULT_SEARCH:"Search for them by name",DEFAULT_COMMENT:"Optional comment",DEFAULT_EMAIL:"Enter their email addresses, separated by commas",init:function(){$(".suggestFriend").live("click",function(){if(!(l&&l.isLoggedIn)){ClkrTop.l.start($(this));return false}var E=$(this);Suggest.sugIcon=E;Suggest.suggested=false;var C=this.id.split("_");var D="";if(C.length>1){Suggest.showId=C[1];D+="?showid="+Suggest.showId;if(C.length>2){Suggest.episodeId=C[2];D+="&episodeid="+Suggest.episodeId}}var B="/popup/share/"+D;var A=function(F){};Clicker.Dialog.show(B,function(F){if(A!=null){A(F)}})})},buildUI:function(){this.hookupEvents()},hookupEvents:function(){Suggest.sugBox=$("#sugBox");$("#sugClose, #sugCancel",Suggest.sugBox).click(function(){Clicker.Dialog.close()});$("#sugEmail").keydown(function(){var A=$(this);if(A.hasClass("red")){if(Util.validateEmail(A.val())){A.removeClass("red").css("border","1px solid #ccc")}else{A.addClass("red").css("border","1px solid red")}}});$("#sugSearch").live("keyup",function(){clearTimeout(Suggest.sugTmr);var B=$(this).val();var A=Suggest.sugSearchId+1;Suggest.sugSearchId=A;Suggest.sugTmr=setTimeout(function(){if(A==Suggest.sugSearchId){$.get("/find_users/AJAX/",{uq:B},function(C){if(A==Suggest.sugSearchId){$("#sugSearchList").html(C);FB.XFBML.parse(document.getElementById("sugSearchList"))}})}},200)}).focus(function(){var A=$(this);if(A.val()==Suggest.DEFAULT_SEARCH){A.val("").removeClass("gray")}}).blur(function(){var A=$(this);if(A.val()==""){A.val(Suggest.DEFAULT_SEARCH).addClass("gray")}});$("#sugComment").focus(function(){var A=$(this);if(A.val()==Suggest.DEFAULT_COMMENT){A.val("").removeClass("gray")}}).blur(function(){var A=$(this);if(A.val()==""){A.val(Suggest.DEFAULT_COMMENT).addClass("gray")}});$("#sugEmail").focus(function(){var A=$(this);if(A.val()==Suggest.DEFAULT_EMAIL){A.val("").removeClass("gray")}}).blur(function(){var A=$(this);if(A.val()==""){A.val(Suggest.DEFAULT_EMAIL).addClass("gray")}});$(".sugItem").live("click",function(G){G.preventDefault();var H=this.id;var B=H.split("_")[1];var E=H.split("_")[2];var C=B+"_"+E;var A=Suggest.toList[C]!=null;var D=$(this);if(A){D.removeClass("dkBlueBg").removeClass("white").addClass("medGray");delete Suggest.toList[C]}else{D.addClass("dkBlueBg").removeClass("medGray").addClass("white");Suggest.lastSugItem=D;var F=$.parseJSON($(".sugUserData",$(this)).html());Suggest.toList[C]=F}Suggest.updateToList()});$(".toListItem").live("click",function(){var D=this.id;var A=D.split("_")[1];var C=D.split("_")[2];var B=A+"_"+C;delete Suggest.toList[B];Suggest.updateToList();$("#sugItem_"+B).removeClass("dkBlueBg").removeClass("white").addClass("medGray")});$(".sugSubmit",$("#sugBox")).click(function(){var N=this.id.split("_");var X="";if(N.length>1){Suggest.showId=N[1];if(N.length>2){Suggest.episodeId=N[2]}}var P="";var Z="";var H="";var G="";var S="";var Q=true;var A=false;var J=false;var F=$("#fbShare");if(F.length>0){J=F.attr("checked");if(J){Q=true}}var D=false;var B=$("#twShare");if(B.length>0){D=B.attr("checked");if(D){Q=true}}var T=null;var E=0;var M=$("#sugEmail");var I=M.val()==Suggest.DEFAULT_EMAIL?"":M.val();var R=false;if(I.length>0){R=true;if(Util.validateEmail(M.val())){M.removeClass("red").css("border","1px solid #ccc");Q=true;G=I;var O=G.split(",");if(O.length==1){O=G.split(";")}T=O[0];E=O.length}else{M.addClass("red").css("border","1px solid red")}}if(Suggest.lastSugItem!=null){var L=Suggest.toList;for(var V in L){var Y=L[V];if(Y.name.length>0){if(Z.length>0){Z+=","}Z+='"'+Y.name+'"';if(T==null){T=Y.displayName}}else{if(Y.fbid.length>0){if(H.length>0){H+=","}H+='"'+Y.fbid+'"'}}E++}Q=true;A=true}var C=$("#sugComment",Suggest.sugBox).val();C=C==Suggest.DEFAULT_COMMENT?"":C;if(Q){var K=Suggest.showId;if(Suggest.episodeId.length>0){K+="_"+Suggest.episodeId}var X={showId:Suggest.showId,episodeId:Suggest.episodeId,action_target:$("#sugTarget_"+K).html(),action_target_url:$("#sugTargetUrl_"+K).html(),fbShare:J,twShare:D,comment:C,device:"web",src_title:"Clicker",src:"Clicker",use_service:Z.length>0||H.length>0};if(R){X.to_user_email=G}if(A){X.to_user=Z;X.to_fb_user=H}if(E>0){var W="";var U="";if(T!=null){W=T;if(E>1){W+=" and "+(E-1)+" other friend"+(E>2?"s":"");U="We've emailed your tip to your friends, and for every friend that"}else{U="We've emailed the tip and if "+T}}else{if(E>1){W=" a friend";U="We've emailed your tip to your friends, and for every friend that"}else{W=(E-1)+" friends";U="We've emailed your tip to your friend, and if your friend"}}$("#sugToMsg1").html(W);$("#sugToMsg2").html(U)}$("#sugLoading",Suggest.sugBox).show();Clicker.tokenpost("/user/AJAX/modRec.html",X,function(a){$("#sugLoading",Suggest.sugBox).hide();if(a.isTrue==true){$("#sugBox").hide();var c="http://"+location.host+a.extras.recUrl;try{Share.shortener.afterResponse=function(){var d=Share.shortener.shortUrl;$("#sugUrlInput").val(d)};Share.shortener.shorten(c)}catch(b){$("#sugUrlInput").val(c)}$("#sugUrl").attr("href",c).click(function(){Clicker.Dialog.close(c);return false});$("#sugUrlBox").show();Suggest.suggested=true}else{Util.message("Error processing request.")}})}})},updateToList:function(){var B=this.toList;var C=$("#sugToList");C.empty();for(var D in B){var E=B[D];C.append($('<div id="toListItem_'+E.name+"_"+E.fbid+'" class="toListItem fl">'+E.displayName+'<span class="x">x</span></div>'))}var A=$('<input id="sugSearch" class="toListInput">');C.append(A);A.focus()}};if(window.Clicker==null){window.Clicker={}}Clicker.EpCar=function(C,E,B,D,F,A){Clicker.EpCar.instances[C]=this.init(C,E,B,D,F,A)};Clicker.EpCar.instances={};Clicker.EpCar.get=function(A){return Clicker.EpCar.instances[A]};Clicker.EpCar.prototype={init:function(C,F,B,D,G,A){this.colWidth=193;this.colsPerPage=3;this.reqMore=6;this.fe_pre="e";this.clip_level=0;this.curItemId=-1;this.episode_type=null;this.fillerHtml='<div class="fl"><div class="spinner" style="background-position: center center;height:148px;width:193px"></div></div>';this.pendingCalls=[];var E=this;this.id=C;this.box=$("#"+C);this.isOver=false;this.reset(F,B,D,G,A);this.box.mouseenter(function(){E.isOver=true}).mouseleave(function(){E.isOver=false});$(document).keydown(function(J){var I=E.isOver;if(I){var H=J.which;if(H==37){J.preventDefault();E.move(false)}else{if(H==39){J.preventDefault();E.move(true)}}}});return this},pushCall:function(B,A,C){var D=this.getEpId(C);if(D){this.getMore(B,A,this.fe_pre+":"+D)}else{this.pendingCalls.push({forward:B,colNumToSet:A,colNumToGet:C})}},checkOutstanding:function(){if(this.pendingCalls.length>0){var A=this.pendingCalls.shift();var B=this.getEpId(A.colNumToGet);if(B){this.getMore(A.forward,A.colNumToSet,this.fe_pre+":"+B)}else{this.pendingCalls.push(A)}}},reset:function(D,B,C,E,A){D=(+D);B=(+B);C=(+C);E=(+E);A=(+A);this.numAvail=D;this.nextAvail=B;this.prevAvail=C;this.curEpNum=D-C;this.curLeftEp=this.curEpNum-1;if(this.prevAvail<1){this.curLeftEp--}if(this.curLeftEp<1){this.curLeftEp=1}this.curMaxNext=this.curEpNum-E;this.curMaxPrev=this.curEpNum+A;this.resetArrows()},resetArrows:function(){if(this.curLeftEp<=1){this.curLeftEp=1;$("#leftArrow",this.box).css("visibility","hidden")}else{$("#leftArrow",this.box).css("visibility","visible")}if(this.curLeftEp>=this.numAvail-this.colsPerPage+1){this.curLeftEp=this.numAvail-this.colsPerPage+1;$("#rightArrow",this.box).css("visibility","hidden")}else{$("#rightArrow",this.box).css("visibility","visible")}},move:function(A){var H=$("#viewContent",this.box);this.curLeftEp+=(A?this.colsPerPage:-this.colsPerPage);this.resetArrows();if(this.curLeftEp<this.curMaxNext){var C=this.curMaxNext;for(var B=1;B<=this.reqMore;B++){if(this.curMaxNext-B>0){C--;var E=$(this.fillerHtml);E.attr("id","epBox_"+C);H.prepend(E)}}this.pushCall(A,C,this.curMaxNext);this.curMaxNext=C}else{if(this.curLeftEp+this.colsPerPage-1>this.curMaxPrev){var D=this.curMaxPrev;for(var B=1;B<this.reqMore;B++){if(this.curMaxPrev+B<=this.numAvail){D++;var E=$(this.fillerHtml);E.attr("id","epBox_"+D);H.append(E)}}this.pushCall(A,this.curMaxPrev+1,this.curMaxPrev);this.curMaxPrev=D}}var G=-(this.colWidth*(this.curLeftEp-this.curMaxNext));var F=this;H.animate({left:G,duration:500})},getEpId:function(B){var E=$("#epBox_"+B);var C=$(".showHover",E);var A=C.attr("id");if(A){var D=A.split("_");if(D.length>1){A=D[1]}}return A},getType:function(B,A){var C=$("#"+this.id+"Types");$(".clipTypeTab",C).removeClass("selected");$("#"+this.id+"Type_"+(B==null?"":B)).addClass("selected");this.episode_type=B;this.getMore(true,0,A,true)},getMore:function(B,D,A,C){var E=this;var G={dir:B?"n":"p",colnum:D,num_res:this.reqMore,fe_key:A,clip_level:this.clip_level};if(this.episode_type!=null){G.episode_type=this.episode_type}if(this.curItemId!=null){G.curItemId=this.curItemId}var F=C?C:false;if(F){G.refresh=true}$.post("/epCar/",G,function(H){if(H!=null){var I=$(H);if(F){var J=$("#viewContent",this.box);J.html(H);J.animate({left:0,duration:200});E.reset(I.find(".epsTotalAvail").text(),I.find(".epsBeforeAvail").text(),I.find(".epsAfterAvail").text(),I.find(".epsBeforeCurrent").text(),I.find(".epsAfterCurrent").text())}else{I.each(function(){var K=$(this).attr("id");if(!Util.isEmpty(K)){var L=$("#"+K);L.html($(this).html())}})}}E.checkOutstanding()})}};var Menu={hideTmr:null,curBox:null,init:function(A){A=A||{};if($("#menuBox_cat_html")){$("#menuBox_cat").html($("#menuBox_cat_html").html())}this.hookupEvents()},hookupEvents:function(){$(".menuLink, .menuButton").live("mouseenter",function(){clearTimeout(Menu.hideTmr);if(Menu.curBox!=null){$(Menu.curBox).hide()}var A=Menu.getBox(this);if($(this).hasClass("fill")){if(A.data("filled")==null){A.html(Menu.fillBox(this))}}if($(this).hasClass("animate")){A.animate({width:"show"},150)}else{A.show()}Menu.curBox=A}).live("mouseleave",function(){var A=Menu.getBox(this);Menu.hideBox(A)});$(".menuBox").live("mouseenter",function(){clearTimeout(Menu.hideTmr)}).live("mouseleave",function(){if($(this).hasClass("menuHide")){Menu.hideBox(this)}}).live("click",function(A){if(A.target.tagName!="A"){var B=$($("a",$(this))[0])}$(this).fadeOut()});$(".epPlayBtn, .epPlayBtnSmall").live("click",function(E){var D=$(E.target).hasClass("epPlayBtn")||$(E.target).hasClass("epPlayBtnSmall");if(D){var C=this;var A=C.id;var B=A.split("_");var H=B[1];var G=$("#sourceList_"+H);var I=$(".sourceItem",G);var F=$(I[0]).attr("href");location.href=F}})},getBox:function(D){var E=D.id;var C=E.split("_");var B="#menuBox_"+C[1];if(C.length>2){B+="_"+C[2]}var A=$(B);return A},fillBox:function(C){var A=C.id;var B=A.split("_");var I=B[1];var J="#menuBox_"+I;if(B.length>2){I=B[2];J+="_"+I}var D=$(J);var G=$("#sourceList_"+I);var K=$(".sourceItem",G);var F=$(K[0]).clone();var L=$("<table></table>");var H=$("<tr></tr>");L.append(H);var E=$('<td class=""></td>');K.each(function(O){var Q=$(this).attr("imgsrc");var N=$(this).attr("href");var R=$(this).attr("feedtxt");var M=$('<div class="feedMenuBtnItem" onclick="location.href=\''+N+"';\"></div>");M.append($('<img class="fl" style="padding:5px 5px 5px 10px" width="72" height="40" src="'+Q+'">'));var P=$('<div class="fl" style="width:100px;padding:10px 0 5px 10px"></div>');P.append($('<div class="padBottom">'+R+"</div>"));P.append($('<div class="px10 gray">'+$(this).attr("feedmsg")+"</div>"));M.append(P);M.append($('<div class="clear"></div>'));E.append(M)});H.append(E);D.append(L);D.data("filled",true)},hideBox:function(A){this.hideTmr=setTimeout(function(){$(A).hide()},100)}};var Tabs={curTab:null,init:function(A){A=A||{};this.hookupEvents()},hookupEvents:function(){this.curTab=$(".showTab.activeTab")[0];$(".showTab").click(function(){Tabs.setTab(this)})},setTab:function(C){if(Tabs.curTab!=null){$(Tabs.curTab).removeClass("activeTab");Tabs.getBox(Tabs.curTab).hide()}Tabs.curTab=C;var A=$(C);A.addClass("activeTab");var B=Tabs.getBox(C);B.show();if(C.id=="tab_recs"){Tabs.loadRecsTab();A.data("clicked",true)}else{if(C.id=="tab_clipguide"){if(A.data("clicked")!=true){Tabs.loadClipsTab()}A.data("clicked",true)}else{Clicker.Activity.as_options.as_filter=""}}},loadRecsTab:function(){var D=$("#itemId").html().split("_");if(D.length>0){var F={as_filter:"social_call"};var E="";var A=D[0];F.showid=A;E=A;if(D.length>1){var B=D[1];F.episodeid=B;E=E+"_"+B}var C=$("#sugTarget_"+E).html();F.rec_item_name=C;$.get("/tabs/AJAX/recs/",F,function(G){$("#tabContent_recs").html(G);Clicker.Activity.as_options.as_filter="social_call"})}},loadClipsTab:function(){var C=$("#itemId").html().split("_");if(C.length>0){var D={};var A=C[0];D.showid=A;if(C.length>1){var B=C[1];D.episodeid=B}$.post("/tabs/AJAX/clips/",D,function(E){$("#tabContent_clipguide_data").html(E)})}},getBox:function(C){var D=C.id;var B="#tabContent_"+D.split("_")[1];var A=$(B);return A}};
