(function(g,p){function q(){if(!c.isReady){try{U.documentElement.doScroll("left")}catch(b){setTimeout(q,1);return}c.ready()}}function z(b,f){f.src?c.ajax({url:f.src,async:false,dataType:"script"}):c.globalEval(f.text||f.textContent||f.innerHTML||"");f.parentNode&&f.parentNode.removeChild(f)}function y(b,f,i,m,k,G){var F=b.length;if(typeof f==="object"){for(var T in f)y(b,T,f[T],m,k,i);return b}if(i!==p){m=!G&&m&&c.isFunction(i);for(T=0;T<F;T++)k(b[T],f,m?i.call(b[T],T,k(b[T],f)):i,G);return b}return F?
k(b[0],f):p}function A(){return(new Date).getTime()}function B(){return false}function E(){return true}function ca(b,f,i){i[0].type=b;return c.event.handle.apply(f,i)}function ga(b){var f,i=[],m=[],k=arguments,G,F,T,K,S,ea;F=c.data(this,"events");if(!(b.liveFired===this||!F||!F.live||b.button&&b.type==="click")){b.liveFired=this;var pa=F.live.slice(0);for(K=0;K<pa.length;K++){F=pa[K];F.origType.replace(da,"")===b.type?m.push(F.selector):pa.splice(K--,1)}G=c(b.target).closest(m,b.currentTarget);S=
0;for(ea=G.length;S<ea;S++)for(K=0;K<pa.length;K++){F=pa[K];if(G[S].selector===F.selector){T=G[S].elem;m=null;if(F.preType==="mouseenter"||F.preType==="mouseleave")m=c(b.relatedTarget).closest(F.selector)[0];if(!m||m!==T)i.push({elem:T,handleObj:F})}}S=0;for(ea=i.length;S<ea;S++){G=i[S];b.currentTarget=G.elem;b.data=G.handleObj.data;b.handleObj=G.handleObj;if(G.handleObj.origHandler.apply(G.elem,k)===false){f=false;break}}return f}}function ta(b,f){return"live."+(b&&b!=="*"?b+".":"")+f.replace(/\./g,
"`").replace(/ /g,"&")}function ba(b){return!b||!b.parentNode||b.parentNode.nodeType===11}function oa(b,f){var i=0;f.each(function(){if(this.nodeName===(b[i]&&b[i].nodeName)){var m=c.data(b[i++]),k=c.data(this,m);if(m=m&&m.events){delete k.handle;k.events={};for(var G in m)for(var F in m[G])c.event.add(this,G,m[G][F],m[G][F].data)}}})}function W(b,f,i){var m,k,G;f=f&&f[0]?f[0].ownerDocument||f[0]:U;if(b.length===1&&typeof b[0]==="string"&&b[0].length<512&&f===U&&!gb.test(b[0])&&(c.support.checkClone||
!hb.test(b[0]))){k=true;if(G=c.fragments[b[0]])if(G!==1)m=G}if(!m){m=f.createDocumentFragment();c.clean(b,f,m,i)}if(k)c.fragments[b[0]]=G?m:1;return{fragment:m,cacheable:k}}function fa(b,f){var i={};c.each(ib.concat.apply([],ib.slice(0,f)),function(){i[this]=b});return i}function H(b){return"scrollTo"in b&&b.document?b:b.nodeType===9?b.defaultView||b.parentWindow:false}var c=function(b,f){return new c.fn.init(b,f)},X=g.jQuery,la=g.$,U=g.document,va,O=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,V=/^.[^:#\[\.,]*$/,
M=/\S/,ia=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,sa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,ja=navigator.userAgent,N=false,Aa=[],h,j=Object.prototype.toString,w=Object.prototype.hasOwnProperty,n=Array.prototype.push,C=Array.prototype.slice,I=Array.prototype.indexOf;c.fn=c.prototype={init:function(b,f){var i,m;if(!b)return this;if(b.nodeType){this.context=this[0]=b;this.length=1;return this}if(b==="body"&&!f){this.context=U;this[0]=U.body;this.selector="body";this.length=1;return this}if(typeof b==="string")if((i=O.exec(b))&&
(i[1]||!f))if(i[1]){m=f?f.ownerDocument||f:U;if(b=sa.exec(b))if(c.isPlainObject(f)){b=[U.createElement(b[1])];c.fn.attr.call(b,f,true)}else b=[m.createElement(b[1])];else{b=W([i[1]],[m]);b=(b.cacheable?b.fragment.cloneNode(true):b.fragment).childNodes}return c.merge(this,b)}else{if(f=U.getElementById(i[2])){if(f.id!==i[2])return va.find(b);this.length=1;this[0]=f}this.context=U;this.selector=b;return this}else if(!f&&/^\w+$/.test(b)){this.selector=b;this.context=U;b=U.getElementsByTagName(b);return c.merge(this,
b)}else return!f||f.jquery?(f||va).find(b):c(f).find(b);else if(c.isFunction(b))return va.ready(b);if(b.selector!==p){this.selector=b.selector;this.context=b.context}return c.makeArray(b,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(b){return b==null?this.toArray():b<0?this.slice(b)[0]:this[b]},pushStack:function(b,f,i){var m=c();c.isArray(b)?n.apply(m,b):c.merge(m,b);m.prevObject=this;m.context=this.context;if(f===
"find")m.selector=this.selector+(this.selector?" ":"")+i;else if(f)m.selector=this.selector+"."+f+"("+i+")";return m},each:function(b,f){return c.each(this,b,f)},ready:function(b){c.bindReady();if(c.isReady)b.call(U,c);else Aa&&Aa.push(b);return this},eq:function(b){return b===-1?this.slice(b):this.slice(b,+b+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(b){return this.pushStack(c.map(this,
function(f,i){return b.call(f,i,f)}))},end:function(){return this.prevObject||c(null)},push:n,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var b=arguments[0]||{},f=1,i=arguments.length,m=false,k,G,F,T;if(typeof b==="boolean"){m=b;b=arguments[1]||{};f=2}if(typeof b!=="object"&&!c.isFunction(b))b={};if(i===f){b=this;--f}for(;f<i;f++)if((k=arguments[f])!=null)for(G in k){F=b[G];T=k[G];if(b!==T)if(m&&T&&(c.isPlainObject(T)||c.isArray(T))){F=F&&(c.isPlainObject(F)||
c.isArray(F))?F:c.isArray(T)?[]:{};b[G]=c.extend(m,F,T)}else if(T!==p)b[G]=T}return b};c.extend({noConflict:function(b){g.$=la;if(b)g.jQuery=X;return c},isReady:false,ready:function(){if(!c.isReady){if(!U.body)return setTimeout(c.ready,13);c.isReady=true;if(Aa){for(var b,f=0;b=Aa[f++];)b.call(U,c);Aa=null}c.fn.triggerHandler&&c(U).triggerHandler("ready")}},bindReady:function(){if(!N){N=true;if(U.readyState==="complete")return c.ready();if(U.addEventListener){U.addEventListener("DOMContentLoaded",
h,false);g.addEventListener("load",c.ready,false)}else if(U.attachEvent){U.attachEvent("onreadystatechange",h);g.attachEvent("onload",c.ready);var b=false;try{b=g.frameElement==null}catch(f){}U.documentElement.doScroll&&b&&q()}}},isFunction:function(b){return j.call(b)==="[object Function]"},isArray:function(b){return j.call(b)==="[object Array]"},isPlainObject:function(b){if(!b||j.call(b)!=="[object Object]"||b.nodeType||b.setInterval)return false;if(b.constructor&&!w.call(b,"constructor")&&!w.call(b.constructor.prototype,
"isPrototypeOf"))return false;var f;for(f in b);return f===p||w.call(b,f)},isEmptyObject:function(b){for(var f in b)return false;return true},error:function(b){throw b;},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=c.trim(b);if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return g.JSON&&g.JSON.parse?g.JSON.parse(b):(new Function("return "+
b))();else c.error("Invalid JSON: "+b)},noop:function(){},globalEval:function(b){if(b&&M.test(b)){var f=U.getElementsByTagName("head")[0]||U.documentElement,i=U.createElement("script");i.type="text/javascript";if(c.support.scriptEval)i.appendChild(U.createTextNode(b));else i.text=b;f.insertBefore(i,f.firstChild);f.removeChild(i)}},nodeName:function(b,f){return b.nodeName&&b.nodeName.toUpperCase()===f.toUpperCase()},each:function(b,f,i){var m,k=0,G=b.length,F=G===p||c.isFunction(b);if(i)if(F)for(m in b){if(f.apply(b[m],
i)===false)break}else for(;k<G;){if(f.apply(b[k++],i)===false)break}else if(F)for(m in b){if(f.call(b[m],m,b[m])===false)break}else for(i=b[0];k<G&&f.call(i,k,i)!==false;i=b[++k]);return b},trim:function(b){return(b||"").replace(ia,"")},makeArray:function(b,f){f=f||[];if(b!=null)b.length==null||typeof b==="string"||c.isFunction(b)||typeof b!=="function"&&b.setInterval?n.call(f,b):c.merge(f,b);return f},inArray:function(b,f){if(f.indexOf)return f.indexOf(b);for(var i=0,m=f.length;i<m;i++)if(f[i]===
b)return i;return-1},merge:function(b,f){var i=b.length,m=0;if(typeof f.length==="number")for(var k=f.length;m<k;m++)b[i++]=f[m];else for(;f[m]!==p;)b[i++]=f[m++];b.length=i;return b},grep:function(b,f,i){for(var m=[],k=0,G=b.length;k<G;k++)!i!==!f(b[k],k)&&m.push(b[k]);return m},map:function(b,f,i){for(var m=[],k,G=0,F=b.length;G<F;G++){k=f(b[G],G,i);if(k!=null)m[m.length]=k}return m.concat.apply([],m)},guid:1,proxy:function(b,f,i){if(arguments.length===2)if(typeof f==="string"){i=b;b=i[f];f=p}else if(f&&
!c.isFunction(f)){i=f;f=p}if(!f&&b)f=function(){return b.apply(i||this,arguments)};if(b)f.guid=b.guid=b.guid||f.guid||c.guid++;return f},uaMatch:function(b){b=b.toLowerCase();b=/(webkit)[ \/]([\w.]+)/.exec(b)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(b)||/(msie) ([\w.]+)/.exec(b)||!/compatible/.test(b)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(b)||[];return{browser:b[1]||"",version:b[2]||"0"}},browser:{}});ja=c.uaMatch(ja);if(ja.browser){c.browser[ja.browser]=true;c.browser.version=ja.version}if(c.browser.webkit)c.browser.safari=
true;if(I)c.inArray=function(b,f){return I.call(f,b)};va=c(U);if(U.addEventListener)h=function(){U.removeEventListener("DOMContentLoaded",h,false);c.ready()};else if(U.attachEvent)h=function(){if(U.readyState==="complete"){U.detachEvent("onreadystatechange",h);c.ready()}};(function(){c.support={};var b=U.documentElement,f=U.createElement("script"),i=U.createElement("div"),m="script"+A();i.style.display="none";i.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var k=i.getElementsByTagName("*"),G=i.getElementsByTagName("a")[0];if(!(!k||!k.length||!G)){c.support={leadingWhitespace:i.firstChild.nodeType===3,tbody:!i.getElementsByTagName("tbody").length,htmlSerialize:!!i.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:i.getElementsByTagName("input")[0].value==="on",optSelected:U.createElement("select").appendChild(U.createElement("option")).selected,
parentNode:i.removeChild(i.appendChild(U.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};f.type="text/javascript";try{f.appendChild(U.createTextNode("window."+m+"=1;"))}catch(F){}b.insertBefore(f,b.firstChild);if(g[m]){c.support.scriptEval=true;delete g[m]}try{delete f.test}catch(T){c.support.deleteExpando=false}b.removeChild(f);if(i.attachEvent&&i.fireEvent){i.attachEvent("onclick",function K(){c.support.noCloneEvent=
false;i.detachEvent("onclick",K)});i.cloneNode(true).fireEvent("onclick")}i=U.createElement("div");i.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";b=U.createDocumentFragment();b.appendChild(i.firstChild);c.support.checkClone=b.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var K=U.createElement("div");K.style.width=K.style.paddingLeft="1px";U.body.appendChild(K);c.boxModel=c.support.boxModel=K.offsetWidth===2;U.body.removeChild(K).style.display="none"});b=function(K){var S=
U.createElement("div");K="on"+K;var ea=K in S;if(!ea){S.setAttribute(K,"return;");ea=typeof S[K]==="function"}return ea};c.support.submitBubbles=b("submit");c.support.changeBubbles=b("change");b=f=i=k=G=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var Q="jQuery"+A(),Z=0,ra={};c.extend({cache:{},expando:Q,noData:{embed:true,
object:true,applet:true},data:function(b,f,i){if(!(b.nodeName&&c.noData[b.nodeName.toLowerCase()])){b=b==g?ra:b;var m=b[Q],k=c.cache;if(!m&&typeof f==="string"&&i===p)return null;m||(m=++Z);if(typeof f==="object"){b[Q]=m;k[m]=c.extend(true,{},f)}else if(!k[m]){b[Q]=m;k[m]={}}b=k[m];if(i!==p)b[f]=i;return typeof f==="string"?b[f]:b}},removeData:function(b,f){if(!(b.nodeName&&c.noData[b.nodeName.toLowerCase()])){b=b==g?ra:b;var i=b[Q],m=c.cache,k=m[i];if(f){if(k){delete k[f];c.isEmptyObject(k)&&c.removeData(b)}}else{if(c.support.deleteExpando)delete b[c.expando];
else b.removeAttribute&&b.removeAttribute(c.expando);delete m[i]}}}});c.fn.extend({data:function(b,f){if(typeof b==="undefined"&&this.length)return c.data(this[0]);else if(typeof b==="object")return this.each(function(){c.data(this,b)});var i=b.split(".");i[1]=i[1]?"."+i[1]:"";if(f===p){var m=this.triggerHandler("getData"+i[1]+"!",[i[0]]);if(m===p&&this.length)m=c.data(this[0],b);return m===p&&i[1]?this.data(i[0]):m}else return this.trigger("setData"+i[1]+"!",[i[0],f]).each(function(){c.data(this,
b,f)})},removeData:function(b){return this.each(function(){c.removeData(this,b)})}});c.extend({queue:function(b,f,i){if(b){f=(f||"fx")+"queue";var m=c.data(b,f);if(!i)return m||[];if(!m||c.isArray(i))m=c.data(b,f,c.makeArray(i));else m.push(i);return m}},dequeue:function(b,f){f=f||"fx";var i=c.queue(b,f),m=i.shift();if(m==="inprogress")m=i.shift();if(m){f==="fx"&&i.unshift("inprogress");m.call(b,function(){c.dequeue(b,f)})}}});c.fn.extend({queue:function(b,f){if(typeof b!=="string"){f=b;b="fx"}if(f===
p)return c.queue(this[0],b);return this.each(function(){var i=c.queue(this,b,f);b==="fx"&&i[0]!=="inprogress"&&c.dequeue(this,b)})},dequeue:function(b){return this.each(function(){c.dequeue(this,b)})},delay:function(b,f){b=c.fx?c.fx.speeds[b]||b:b;f=f||"fx";return this.queue(f,function(){var i=this;setTimeout(function(){c.dequeue(i,f)},b)})},clearQueue:function(b){return this.queue(b||"fx",[])}});var Ha=/[\n\t]/g,Ba=/\s+/,Ia=/\r/g,Ga=/href|src|style/,Oa=/(button|input)/i,ma=/(button|input|object|select|textarea)/i,
J=/^(a|area)$/i,P=/radio|checkbox/;c.fn.extend({attr:function(b,f){return y(this,b,f,true,c.attr)},removeAttr:function(b){return this.each(function(){c.attr(this,b,"");this.nodeType===1&&this.removeAttribute(b)})},addClass:function(b){if(c.isFunction(b))return this.each(function(S){var ea=c(this);ea.addClass(b.call(this,S,ea.attr("class")))});if(b&&typeof b==="string")for(var f=(b||"").split(Ba),i=0,m=this.length;i<m;i++){var k=this[i];if(k.nodeType===1)if(k.className){for(var G=" "+k.className+" ",
F=k.className,T=0,K=f.length;T<K;T++)if(G.indexOf(" "+f[T]+" ")<0)F+=" "+f[T];k.className=c.trim(F)}else k.className=b}return this},removeClass:function(b){if(c.isFunction(b))return this.each(function(K){var S=c(this);S.removeClass(b.call(this,K,S.attr("class")))});if(b&&typeof b==="string"||b===p)for(var f=(b||"").split(Ba),i=0,m=this.length;i<m;i++){var k=this[i];if(k.nodeType===1&&k.className)if(b){for(var G=(" "+k.className+" ").replace(Ha," "),F=0,T=f.length;F<T;F++)G=G.replace(" "+f[F]+" ",
" ");k.className=c.trim(G)}else k.className=""}return this},toggleClass:function(b,f){var i=typeof b,m=typeof f==="boolean";if(c.isFunction(b))return this.each(function(k){var G=c(this);G.toggleClass(b.call(this,k,G.attr("class"),f),f)});return this.each(function(){if(i==="string")for(var k,G=0,F=c(this),T=f,K=b.split(Ba);k=K[G++];){T=m?T:!F.hasClass(k);F[T?"addClass":"removeClass"](k)}else if(i==="undefined"||i==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||b===false?"":c.data(this,"__className__")||""}})},hasClass:function(b){b=" "+b+" ";for(var f=0,i=this.length;f<i;f++)if((" "+this[f].className+" ").replace(Ha," ").indexOf(b)>-1)return true;return false},val:function(b){if(b===p){var f=this[0];if(f){if(c.nodeName(f,"option"))return(f.attributes.value||{}).specified?f.value:f.text;if(c.nodeName(f,"select")){var i=f.selectedIndex,m=[],k=f.options;f=f.type==="select-one";if(i<0)return null;var G=f?i:0;for(i=f?i+1:k.length;G<i;G++){var F=
k[G];if(F.selected){b=c(F).val();if(f)return b;m.push(b)}}return m}if(P.test(f.type)&&!c.support.checkOn)return f.getAttribute("value")===null?"on":f.value;return(f.value||"").replace(Ia,"")}return p}var T=c.isFunction(b);return this.each(function(K){var S=c(this),ea=b;if(this.nodeType===1){if(T)ea=b.call(this,K,S.val());if(typeof ea==="number")ea+="";if(c.isArray(ea)&&P.test(this.type))this.checked=c.inArray(S.val(),ea)>=0;else if(c.nodeName(this,"select")){var pa=c.makeArray(ea);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),pa)>=0});if(!pa.length)this.selectedIndex=-1}else this.value=ea}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(b,f,i,m){if(!b||b.nodeType===3||b.nodeType===8)return p;if(m&&f in c.attrFn)return c(b)[f](i);m=b.nodeType!==1||!c.isXMLDoc(b);var k=i!==p;f=m&&c.props[f]||f;if(b.nodeType===1){var G=Ga.test(f);if(f in b&&m&&!G){if(k){f==="type"&&Oa.test(b.nodeName)&&b.parentNode&&c.error("type property can't be changed");
b[f]=i}if(c.nodeName(b,"form")&&b.getAttributeNode(f))return b.getAttributeNode(f).nodeValue;if(f==="tabIndex")return(f=b.getAttributeNode("tabIndex"))&&f.specified?f.value:ma.test(b.nodeName)||J.test(b.nodeName)&&b.href?0:p;return b[f]}if(!c.support.style&&m&&f==="style"){if(k)b.style.cssText=""+i;return b.style.cssText}k&&b.setAttribute(f,""+i);b=!c.support.hrefNormalized&&m&&G?b.getAttribute(f,2):b.getAttribute(f);return b===null?p:b}return c.style(b,f,i)}});var da=/\.(.*)$/,ha=function(b){return b.replace(/[^\w\s\.\|`]/g,
function(f){return"\\"+f})};c.event={add:function(b,f,i,m){if(!(b.nodeType===3||b.nodeType===8)){if(b.setInterval&&b!==g&&!b.frameElement)b=g;var k,G;if(i.handler){k=i;i=k.handler}if(!i.guid)i.guid=c.guid++;if(G=c.data(b)){var F=G.events=G.events||{},T=G.handle;if(!T)G.handle=T=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(T.elem,arguments):p};T.elem=b;f=f.split(" ");for(var K,S=0,ea;K=f[S++];){G=k?c.extend({},k):{handler:i,data:m};if(K.indexOf(".")>-1){ea=K.split(".");
K=ea.shift();G.namespace=ea.slice(0).sort().join(".")}else{ea=[];G.namespace=""}G.type=K;G.guid=i.guid;var pa=F[K],za=c.event.special[K]||{};if(!pa){pa=F[K]=[];if(!za.setup||za.setup.call(b,m,ea,T)===false)if(b.addEventListener)b.addEventListener(K,T,false);else b.attachEvent&&b.attachEvent("on"+K,T)}if(za.add){za.add.call(b,G);if(!G.handler.guid)G.handler.guid=i.guid}pa.push(G);c.event.global[K]=true}b=null}}},global:{},remove:function(b,f,i,m){if(!(b.nodeType===3||b.nodeType===8)){var k,G=0,F,T,
K,S,ea,pa,za=c.data(b),Ea=za&&za.events;if(za&&Ea){if(f&&f.type){i=f.handler;f=f.type}if(!f||typeof f==="string"&&f.charAt(0)==="."){f=f||"";for(k in Ea)c.event.remove(b,k+f)}else{for(f=f.split(" ");k=f[G++];){S=k;F=k.indexOf(".")<0;T=[];if(!F){T=k.split(".");k=T.shift();K=new RegExp("(^|\\.)"+c.map(T.slice(0).sort(),ha).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(ea=Ea[k])if(i){S=c.event.special[k]||{};for(Ca=m||0;Ca<ea.length;Ca++){pa=ea[Ca];if(i.guid===pa.guid){if(F||K.test(pa.namespace)){m==null&&ea.splice(Ca--,
1);S.remove&&S.remove.call(b,pa)}if(m!=null)break}}if(ea.length===0||m!=null&&ea.length===1){if(!S.teardown||S.teardown.call(b,T)===false)ka(b,k,za.handle);delete Ea[k]}}else for(var Ca=0;Ca<ea.length;Ca++){pa=ea[Ca];if(F||K.test(pa.namespace)){c.event.remove(b,S,pa.handler,Ca);ea.splice(Ca--,1)}}}if(c.isEmptyObject(Ea)){if(f=za.handle)f.elem=null;delete za.events;delete za.handle;c.isEmptyObject(za)&&c.removeData(b)}}}}},trigger:function(b,f,i,m){var k=b.type||b;if(!m){b=typeof b==="object"?b[Q]?
b:c.extend(c.Event(k),b):c.Event(k);if(k.indexOf("!")>=0){b.type=k=k.slice(0,-1);b.exclusive=true}if(!i){b.stopPropagation();c.event.global[k]&&c.each(c.cache,function(){this.events&&this.events[k]&&c.event.trigger(b,f,this.handle.elem)})}if(!i||i.nodeType===3||i.nodeType===8)return p;b.result=p;b.target=i;f=c.makeArray(f);f.unshift(b)}b.currentTarget=i;(m=c.data(i,"handle"))&&m.apply(i,f);m=i.parentNode||i.ownerDocument;try{if(!(i&&i.nodeName&&c.noData[i.nodeName.toLowerCase()]))if(i["on"+k]&&i["on"+
k].apply(i,f)===false)b.result=false}catch(G){}if(!b.isPropagationStopped()&&m)c.event.trigger(b,f,m,true);else if(!b.isDefaultPrevented()){m=b.target;var F,T=c.nodeName(m,"a")&&k==="click",K=c.event.special[k]||{};if((!K._default||K._default.call(i,b)===false)&&!T&&!(m&&m.nodeName&&c.noData[m.nodeName.toLowerCase()])){try{if(m[k]){if(F=m["on"+k])m["on"+k]=null;c.event.triggered=true;m[k]()}}catch(S){}if(F)m["on"+k]=F;c.event.triggered=false}}},handle:function(b){var f,i,m,k;b=arguments[0]=c.event.fix(b||
g.event);b.currentTarget=this;f=b.type.indexOf(".")<0&&!b.exclusive;if(!f){i=b.type.split(".");b.type=i.shift();m=new RegExp("(^|\\.)"+i.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}k=c.data(this,"events");i=k[b.type];if(k&&i){i=i.slice(0);k=0;for(var G=i.length;k<G;k++){var F=i[k];if(f||m.test(F.namespace)){b.handler=F.handler;b.data=F.data;b.handleObj=F;F=F.handler.apply(this,arguments);if(F!==p){b.result=F;if(F===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped())break}}}return b.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(b){if(b[Q])return b;var f=b;b=c.Event(f);for(var i=this.props.length,m;i;){m=this.props[--i];b[m]=f[m]}if(!b.target)b.target=b.srcElement||
U;if(b.target.nodeType===3)b.target=b.target.parentNode;if(!b.relatedTarget&&b.fromElement)b.relatedTarget=b.fromElement===b.target?b.toElement:b.fromElement;if(b.pageX==null&&b.clientX!=null){f=U.documentElement;i=U.body;b.pageX=b.clientX+(f&&f.scrollLeft||i&&i.scrollLeft||0)-(f&&f.clientLeft||i&&i.clientLeft||0);b.pageY=b.clientY+(f&&f.scrollTop||i&&i.scrollTop||0)-(f&&f.clientTop||i&&i.clientTop||0)}if(!b.which&&(b.charCode||b.charCode===0?b.charCode:b.keyCode))b.which=b.charCode||b.keyCode;if(!b.metaKey&&
b.ctrlKey)b.metaKey=b.ctrlKey;if(!b.which&&b.button!==p)b.which=b.button&1?1:b.button&2?3:b.button&4?2:0;return b},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(b){c.event.add(this,b.origType,c.extend({},b,{handler:ga}))},remove:function(b){var f=true,i=b.origType.replace(da,"");c.each(c.data(this,"events").live||[],function(){if(i===this.origType.replace(da,""))return f=false});f&&c.event.remove(this,b.origType,ga)}},beforeunload:{setup:function(b,f,
i){if(this.setInterval)this.onbeforeunload=i;return false},teardown:function(b,f){if(this.onbeforeunload===f)this.onbeforeunload=null}}}};var ka=U.removeEventListener?function(b,f,i){b.removeEventListener(f,i,false)}:function(b,f,i){b.detachEvent("on"+f,i)};c.Event=function(b){if(!this.preventDefault)return new c.Event(b);if(b&&b.type){this.originalEvent=b;this.type=b.type}else this.type=b;this.timeStamp=A();this[Q]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var b=
this.originalEvent;if(b){b.preventDefault&&b.preventDefault();b.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=E;var b=this.originalEvent;if(b){b.stopPropagation&&b.stopPropagation();b.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E;this.stopPropagation()},isDefaultPrevented:B,isPropagationStopped:B,isImmediatePropagationStopped:B};var wa=function(b){var f=b.relatedTarget;try{for(;f&&f!==this;)f=f.parentNode;if(f!==this){b.type=
b.data;c.event.handle.apply(this,arguments)}}catch(i){}},xa=function(b){b.type=b.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(b,f){c.event.special[b]={setup:function(i){c.event.add(this,f,i&&i.selector?xa:wa,b)},teardown:function(i){c.event.remove(this,f,i&&i.selector?xa:wa)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(b){var f=
b.target,i=f.type;if((i==="submit"||i==="image")&&c(f).closest("form").length)return ca("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(b){var f=b.target,i=f.type;if((i==="text"||i==="password")&&c(f).closest("form").length&&b.keyCode===13)return ca("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var Da=/textarea|input|select/i,Fa,Pa=function(b){var f=b.type,i=b.value;if(f==="radio"||
f==="checkbox")i=b.checked;else if(f==="select-multiple")i=b.selectedIndex>-1?c.map(b.options,function(m){return m.selected}).join("-"):"";else if(b.nodeName.toLowerCase()==="select")i=b.selectedIndex;return i},Qa=function(b,f){var i=b.target,m,k;if(!(!Da.test(i.nodeName)||i.readOnly)){m=c.data(i,"_change_data");k=Pa(i);if(b.type!=="focusout"||i.type!=="radio")c.data(i,"_change_data",k);if(!(m===p||k===m))if(m!=null||k){b.type="change";return c.event.trigger(b,f,i)}}};c.event.special.change={filters:{focusout:Qa,
click:function(b){var f=b.target,i=f.type;if(i==="radio"||i==="checkbox"||f.nodeName.toLowerCase()==="select")return Qa.call(this,b)},keydown:function(b){var f=b.target,i=f.type;if(b.keyCode===13&&f.nodeName.toLowerCase()!=="textarea"||b.keyCode===32&&(i==="checkbox"||i==="radio")||i==="select-multiple")return Qa.call(this,b)},beforeactivate:function(b){b=b.target;c.data(b,"_change_data",Pa(b))}},setup:function(){if(this.type==="file")return false;for(var b in Fa)c.event.add(this,b+".specialChange",
Fa[b]);return Da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return Da.test(this.nodeName)}};Fa=c.event.special.change.filters}U.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(b,f){function i(m){m=c.event.fix(m);m.type=f;return c.event.handle.call(this,m)}c.event.special[f]={setup:function(){this.addEventListener(b,i,true)},teardown:function(){this.removeEventListener(b,i,true)}}});c.each(["bind","one"],function(b,f){c.fn[f]=function(i,m,k){if(typeof i===
"object"){for(var G in i)this[f](G,m,i[G],k);return this}if(c.isFunction(m)){k=m;m=p}var F=f==="one"?c.proxy(k,function(K){c(this).unbind(K,F);return k.apply(this,arguments)}):k;if(i==="unload"&&f!=="one")this.one(i,m,k);else{G=0;for(var T=this.length;G<T;G++)c.event.add(this[G],i,F,m)}return this}});c.fn.extend({unbind:function(b,f){if(typeof b==="object"&&!b.preventDefault)for(var i in b)this.unbind(i,b[i]);else{i=0;for(var m=this.length;i<m;i++)c.event.remove(this[i],b,f)}return this},delegate:function(b,
f,i,m){return this.live(f,i,m,b)},undelegate:function(b,f,i){return arguments.length===0?this.unbind("live"):this.die(f,null,i,b)},trigger:function(b,f){return this.each(function(){c.event.trigger(b,f,this)})},triggerHandler:function(b,f){if(this[0]){b=c.Event(b);b.preventDefault();b.stopPropagation();c.event.trigger(b,f,this[0]);return b.result}},toggle:function(b){for(var f=arguments,i=1;i<f.length;)c.proxy(b,f[i++]);return this.click(c.proxy(b,function(m){var k=(c.data(this,"lastToggle"+b.guid)||
0)%i;c.data(this,"lastToggle"+b.guid,k+1);m.preventDefault();return f[k].apply(this,arguments)||false}))},hover:function(b,f){return this.mouseenter(b).mouseleave(f||b)}});var Ma={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(b,f){c.fn[f]=function(i,m,k,G){var F,T=0,K,S,ea=G||this.selector,pa=G?this:c(this.context);if(c.isFunction(m)){k=m;m=p}for(i=(i||"").split(" ");(F=i[T++])!=null;){G=da.exec(F);K="";if(G){K=G[0];F=F.replace(da,"")}if(F===
"hover")i.push("mouseenter"+K,"mouseleave"+K);else{S=F;if(F==="focus"||F==="blur"){i.push(Ma[F]+K);F+=K}else F=(Ma[F]||F)+K;f==="live"?pa.each(function(){c.event.add(this,ta(F,ea),{data:m,selector:ea,handler:k,origType:F,origHandler:k,preType:S})}):pa.unbind(ta(F,ea),k)}}return this}});c.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(b,
f){c.fn[f]=function(i){return i?this.bind(f,i):this.trigger(f)};if(c.attrFn)c.attrFn[f]=true});g.attachEvent&&!g.addEventListener&&g.attachEvent("onunload",function(){for(var b in c.cache)if(c.cache[b].handle)try{c.event.remove(c.cache[b].handle.elem)}catch(f){}});(function(){function b(u){for(var D="",L,R=0;u[R];R++){L=u[R];if(L.nodeType===3||L.nodeType===4)D+=L.nodeValue;else if(L.nodeType!==8)D+=b(L.childNodes)}return D}function f(u,D,L,R,aa,Y){aa=0;for(var qa=R.length;aa<qa;aa++){var na=R[aa];
if(na){na=na[u];for(var ya=false;na;){if(na.sizcache===L){ya=R[na.sizset];break}if(na.nodeType===1&&!Y){na.sizcache=L;na.sizset=aa}if(na.nodeName.toLowerCase()===D){ya=na;break}na=na[u]}R[aa]=ya}}}function i(u,D,L,R,aa,Y){aa=0;for(var qa=R.length;aa<qa;aa++){var na=R[aa];if(na){na=na[u];for(var ya=false;na;){if(na.sizcache===L){ya=R[na.sizset];break}if(na.nodeType===1){if(!Y){na.sizcache=L;na.sizset=aa}if(typeof D!=="string"){if(na===D){ya=true;break}}else if(K.filter(D,[na]).length>0){ya=na;break}}na=
na[u]}R[aa]=ya}}}var m=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,k=0,G=Object.prototype.toString,F=false,T=true;[0,0].sort(function(){T=false;return 0});var K=function(u,D,L,R){L=L||[];var aa=D=D||U;if(D.nodeType!==1&&D.nodeType!==9)return[];if(!u||typeof u!=="string")return L;for(var Y=[],qa,na,ya,Xa,Ra=true,Ta=ua(D),Sa=u;(m.exec(""),qa=m.exec(Sa))!==null;){Sa=qa[3];Y.push(qa[1]);if(qa[2]){Xa=qa[3];break}}if(Y.length>
1&&ea.exec(u))if(Y.length===2&&S.relative[Y[0]])na=ab(Y[0]+Y[1],D);else for(na=S.relative[Y[0]]?[D]:K(Y.shift(),D);Y.length;){u=Y.shift();if(S.relative[u])u+=Y.shift();na=ab(u,na)}else{if(!R&&Y.length>1&&D.nodeType===9&&!Ta&&S.match.ID.test(Y[0])&&!S.match.ID.test(Y[Y.length-1])){qa=K.find(Y.shift(),D,Ta);D=qa.expr?K.filter(qa.expr,qa.set)[0]:qa.set[0]}if(D){qa=R?{expr:Y.pop(),set:za(R)}:K.find(Y.pop(),Y.length===1&&(Y[0]==="~"||Y[0]==="+")&&D.parentNode?D.parentNode:D,Ta);na=qa.expr?K.filter(qa.expr,
qa.set):qa.set;if(Y.length>0)ya=za(na);else Ra=false;for(;Y.length;){var Ja=Y.pop();qa=Ja;if(S.relative[Ja])qa=Y.pop();else Ja="";if(qa==null)qa=D;S.relative[Ja](ya,qa,Ta)}}else ya=[]}ya||(ya=na);ya||K.error(Ja||u);if(G.call(ya)==="[object Array]")if(Ra)if(D&&D.nodeType===1)for(u=0;ya[u]!=null;u++){if(ya[u]&&(ya[u]===true||ya[u].nodeType===1&&Ka(D,ya[u])))L.push(na[u])}else for(u=0;ya[u]!=null;u++)ya[u]&&ya[u].nodeType===1&&L.push(na[u]);else L.push.apply(L,ya);else za(ya,L);if(Xa){K(Xa,aa,L,R);K.uniqueSort(L)}return L};
K.uniqueSort=function(u){if(Ca){F=T;u.sort(Ca);if(F)for(var D=1;D<u.length;D++)u[D]===u[D-1]&&u.splice(D--,1)}return u};K.matches=function(u,D){return K(u,null,null,D)};K.find=function(u,D,L){var R,aa;if(!u)return[];for(var Y=0,qa=S.order.length;Y<qa;Y++){var na=S.order[Y];if(aa=S.leftMatch[na].exec(u)){var ya=aa[1];aa.splice(1,1);if(ya.substr(ya.length-1)!=="\\"){aa[1]=(aa[1]||"").replace(/\\/g,"");R=S.find[na](aa,D,L);if(R!=null){u=u.replace(S.match[na],"");break}}}}R||(R=D.getElementsByTagName("*"));
return{set:R,expr:u}};K.filter=function(u,D,L,R){for(var aa=u,Y=[],qa=D,na,ya,Xa=D&&D[0]&&ua(D[0]);u&&D.length;){for(var Ra in S.filter)if((na=S.leftMatch[Ra].exec(u))!=null&&na[2]){var Ta=S.filter[Ra],Sa,Ja;Ja=na[1];ya=false;na.splice(1,1);if(Ja.substr(Ja.length-1)!=="\\"){if(qa===Y)Y=[];if(S.preFilter[Ra])if(na=S.preFilter[Ra](na,qa,L,Y,R,Xa)){if(na===true)continue}else ya=Sa=true;if(na)for(var Ya=0;(Ja=qa[Ya])!=null;Ya++)if(Ja){Sa=Ta(Ja,na,Ya,qa);var jb=R^!!Sa;if(L&&Sa!=null)if(jb)ya=true;else qa[Ya]=
false;else if(jb){Y.push(Ja);ya=true}}if(Sa!==p){L||(qa=Y);u=u.replace(S.match[Ra],"");if(!ya)return[];break}}}if(u===aa)if(ya==null)K.error(u);else break;aa=u}return qa};K.error=function(u){throw"Syntax error, unrecognized expression: "+u;};var S=K.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(u){return u.getAttribute("href")}},relative:{"+":function(u,D){var L=typeof D==="string",R=L&&!/\W/.test(D);L=L&&!R;if(R)D=D.toLowerCase();R=0;for(var aa=u.length,
Y;R<aa;R++)if(Y=u[R]){for(;(Y=Y.previousSibling)&&Y.nodeType!==1;);u[R]=L||Y&&Y.nodeName.toLowerCase()===D?Y||false:Y===D}L&&K.filter(D,u,true)},">":function(u,D){var L=typeof D==="string";if(L&&!/\W/.test(D)){D=D.toLowerCase();for(var R=0,aa=u.length;R<aa;R++){var Y=u[R];if(Y){L=Y.parentNode;u[R]=L.nodeName.toLowerCase()===D?L:false}}}else{R=0;for(aa=u.length;R<aa;R++)if(Y=u[R])u[R]=L?Y.parentNode:Y.parentNode===D;L&&K.filter(D,u,true)}},"":function(u,D,L){var R=k++,aa=i;if(typeof D==="string"&&
!/\W/.test(D)){var Y=D=D.toLowerCase();aa=f}aa("parentNode",D,R,u,Y,L)},"~":function(u,D,L){var R=k++,aa=i;if(typeof D==="string"&&!/\W/.test(D)){var Y=D=D.toLowerCase();aa=f}aa("previousSibling",D,R,u,Y,L)}},find:{ID:function(u,D,L){if(typeof D.getElementById!=="undefined"&&!L)return(u=D.getElementById(u[1]))?[u]:[]},NAME:function(u,D){if(typeof D.getElementsByName!=="undefined"){var L=[];D=D.getElementsByName(u[1]);for(var R=0,aa=D.length;R<aa;R++)D[R].getAttribute("name")===u[1]&&L.push(D[R]);
return L.length===0?null:L}},TAG:function(u,D){return D.getElementsByTagName(u[1])}},preFilter:{CLASS:function(u,D,L,R,aa,Y){u=" "+u[1].replace(/\\/g,"")+" ";if(Y)return u;Y=0;for(var qa;(qa=D[Y])!=null;Y++)if(qa)if(aa^(qa.className&&(" "+qa.className+" ").replace(/[\t\n]/g," ").indexOf(u)>=0))L||R.push(qa);else if(L)D[Y]=false;return false},ID:function(u){return u[1].replace(/\\/g,"")},TAG:function(u){return u[1].toLowerCase()},CHILD:function(u){if(u[1]==="nth"){var D=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(u[2]===
"even"&&"2n"||u[2]==="odd"&&"2n+1"||!/\D/.test(u[2])&&"0n+"+u[2]||u[2]);u[2]=D[1]+(D[2]||1)-0;u[3]=D[3]-0}u[0]=k++;return u},ATTR:function(u,D,L,R,aa,Y){D=u[1].replace(/\\/g,"");if(!Y&&S.attrMap[D])u[1]=S.attrMap[D];if(u[2]==="~=")u[4]=" "+u[4]+" ";return u},PSEUDO:function(u,D,L,R,aa){if(u[1]==="not")if((m.exec(u[3])||"").length>1||/^\w/.test(u[3]))u[3]=K(u[3],null,null,D);else{u=K.filter(u[3],D,L,true^aa);L||R.push.apply(R,u);return false}else if(S.match.POS.test(u[0])||S.match.CHILD.test(u[0]))return true;
return u},POS:function(u){u.unshift(true);return u}},filters:{enabled:function(u){return u.disabled===false&&u.type!=="hidden"},disabled:function(u){return u.disabled===true},checked:function(u){return u.checked===true},selected:function(u){return u.selected===true},parent:function(u){return!!u.firstChild},empty:function(u){return!u.firstChild},has:function(u,D,L){return!!K(L[3],u).length},header:function(u){return/h\d/i.test(u.nodeName)},text:function(u){return"text"===u.type},radio:function(u){return"radio"===
u.type},checkbox:function(u){return"checkbox"===u.type},file:function(u){return"file"===u.type},password:function(u){return"password"===u.type},submit:function(u){return"submit"===u.type},image:function(u){return"image"===u.type},reset:function(u){return"reset"===u.type},button:function(u){return"button"===u.type||u.nodeName.toLowerCase()==="button"},input:function(u){return/input|select|textarea|button/i.test(u.nodeName)}},setFilters:{first:function(u,D){return D===0},last:function(u,D,L,R){return D===
R.length-1},even:function(u,D){return D%2===0},odd:function(u,D){return D%2===1},lt:function(u,D,L){return D<L[3]-0},gt:function(u,D,L){return D>L[3]-0},nth:function(u,D,L){return L[3]-0===D},eq:function(u,D,L){return L[3]-0===D}},filter:{PSEUDO:function(u,D,L,R){var aa=D[1],Y=S.filters[aa];if(Y)return Y(u,L,D,R);else if(aa==="contains")return(u.textContent||u.innerText||b([u])||"").indexOf(D[3])>=0;else if(aa==="not"){D=D[3];L=0;for(R=D.length;L<R;L++)if(D[L]===u)return false;return true}else K.error("Syntax error, unrecognized expression: "+
aa)},CHILD:function(u,D){var L=D[1],R=u;switch(L){case "only":case "first":for(;R=R.previousSibling;)if(R.nodeType===1)return false;if(L==="first")return true;R=u;case "last":for(;R=R.nextSibling;)if(R.nodeType===1)return false;return true;case "nth":L=D[2];var aa=D[3];if(L===1&&aa===0)return true;D=D[0];var Y=u.parentNode;if(Y&&(Y.sizcache!==D||!u.nodeIndex)){var qa=0;for(R=Y.firstChild;R;R=R.nextSibling)if(R.nodeType===1)R.nodeIndex=++qa;Y.sizcache=D}u=u.nodeIndex-aa;return L===0?u===0:u%L===0&&
u/L>=0}},ID:function(u,D){return u.nodeType===1&&u.getAttribute("id")===D},TAG:function(u,D){return D==="*"&&u.nodeType===1||u.nodeName.toLowerCase()===D},CLASS:function(u,D){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(D)>-1},ATTR:function(u,D){var L=D[1];u=S.attrHandle[L]?S.attrHandle[L](u):u[L]!=null?u[L]:u.getAttribute(L);L=u+"";var R=D[2];D=D[4];return u==null?R==="!=":R==="="?L===D:R==="*="?L.indexOf(D)>=0:R==="~="?(" "+L+" ").indexOf(D)>=0:!D?L&&u!==false:R==="!="?L!==D:R===
"^="?L.indexOf(D)===0:R==="$="?L.substr(L.length-D.length)===D:R==="|="?L===D||L.substr(0,D.length+1)===D+"-":false},POS:function(u,D,L,R){var aa=S.setFilters[D[2]];if(aa)return aa(u,L,D,R)}}},ea=S.match.POS;for(var pa in S.match){S.match[pa]=new RegExp(S.match[pa].source+/(?![^\[]*\])(?![^\(]*\))/.source);S.leftMatch[pa]=new RegExp(/(^(?:.|\r|\n)*?)/.source+S.match[pa].source.replace(/\\(\d+)/g,function(u,D){return"\\"+(D-0+1)}))}var za=function(u,D){u=Array.prototype.slice.call(u,0);if(D){D.push.apply(D,
u);return D}return u};try{Array.prototype.slice.call(U.documentElement.childNodes,0)}catch(Ea){za=function(u,D){D=D||[];if(G.call(u)==="[object Array]")Array.prototype.push.apply(D,u);else if(typeof u.length==="number")for(var L=0,R=u.length;L<R;L++)D.push(u[L]);else for(L=0;u[L];L++)D.push(u[L]);return D}}var Ca;if(U.documentElement.compareDocumentPosition)Ca=function(u,D){if(!u.compareDocumentPosition||!D.compareDocumentPosition){if(u==D)F=true;return u.compareDocumentPosition?-1:1}u=u.compareDocumentPosition(D)&
4?-1:u===D?0:1;if(u===0)F=true;return u};else if("sourceIndex"in U.documentElement)Ca=function(u,D){if(!u.sourceIndex||!D.sourceIndex){if(u==D)F=true;return u.sourceIndex?-1:1}u=u.sourceIndex-D.sourceIndex;if(u===0)F=true;return u};else if(U.createRange)Ca=function(u,D){if(!u.ownerDocument||!D.ownerDocument){if(u==D)F=true;return u.ownerDocument?-1:1}var L=u.ownerDocument.createRange(),R=D.ownerDocument.createRange();L.setStart(u,0);L.setEnd(u,0);R.setStart(D,0);R.setEnd(D,0);u=L.compareBoundaryPoints(Range.START_TO_END,
R);if(u===0)F=true;return u};(function(){var u=U.createElement("div"),D="script"+(new Date).getTime();u.innerHTML="<a name='"+D+"'/>";var L=U.documentElement;L.insertBefore(u,L.firstChild);if(U.getElementById(D)){S.find.ID=function(R,aa,Y){if(typeof aa.getElementById!=="undefined"&&!Y)return(aa=aa.getElementById(R[1]))?aa.id===R[1]||typeof aa.getAttributeNode!=="undefined"&&aa.getAttributeNode("id").nodeValue===R[1]?[aa]:p:[]};S.filter.ID=function(R,aa){var Y=typeof R.getAttributeNode!=="undefined"&&
R.getAttributeNode("id");return R.nodeType===1&&Y&&Y.nodeValue===aa}}L.removeChild(u);L=u=null})();(function(){var u=U.createElement("div");u.appendChild(U.createComment(""));if(u.getElementsByTagName("*").length>0)S.find.TAG=function(D,L){L=L.getElementsByTagName(D[1]);if(D[1]==="*"){D=[];for(var R=0;L[R];R++)L[R].nodeType===1&&D.push(L[R]);L=D}return L};u.innerHTML="<a href='#'></a>";if(u.firstChild&&typeof u.firstChild.getAttribute!=="undefined"&&u.firstChild.getAttribute("href")!=="#")S.attrHandle.href=
function(D){return D.getAttribute("href",2)};u=null})();U.querySelectorAll&&function(){var u=K,D=U.createElement("div");D.innerHTML="<p class='TEST'></p>";if(!(D.querySelectorAll&&D.querySelectorAll(".TEST").length===0)){K=function(R,aa,Y,qa){aa=aa||U;if(!qa&&aa.nodeType===9&&!ua(aa))try{return za(aa.querySelectorAll(R),Y)}catch(na){}return u(R,aa,Y,qa)};for(var L in u)K[L]=u[L];D=null}}();(function(){var u=U.createElement("div");u.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!u.getElementsByClassName||
u.getElementsByClassName("e").length===0)){u.lastChild.className="e";if(u.getElementsByClassName("e").length!==1){S.order.splice(1,0,"CLASS");S.find.CLASS=function(D,L,R){if(typeof L.getElementsByClassName!=="undefined"&&!R)return L.getElementsByClassName(D[1])};u=null}}})();var Ka=U.compareDocumentPosition?function(u,D){return!!(u.compareDocumentPosition(D)&16)}:function(u,D){return u!==D&&(u.contains?u.contains(D):true)},ua=function(u){return(u=(u?u.ownerDocument||u:0).documentElement)?u.nodeName!==
"HTML":false},ab=function(u,D){var L=[],R="",aa;for(D=D.nodeType?[D]:D;aa=S.match.PSEUDO.exec(u);){R+=aa[0];u=u.replace(S.match.PSEUDO,"")}u=S.relative[u]?u+"*":u;aa=0;for(var Y=D.length;aa<Y;aa++)K(u,D[aa],L);return K.filter(R,L)};c.find=K;c.expr=K.selectors;c.expr[":"]=c.expr.filters;c.unique=K.uniqueSort;c.text=b;c.isXMLDoc=ua;c.contains=Ka})();var Na=/Until$/,Ua=/^(?:parents|prevUntil|prevAll)/,Va=/,/;C=Array.prototype.slice;var kb=function(b,f,i){if(c.isFunction(f))return c.grep(b,function(k,
G){return!!f.call(k,G,k)===i});else if(f.nodeType)return c.grep(b,function(k){return k===f===i});else if(typeof f==="string"){var m=c.grep(b,function(k){return k.nodeType===1});if(V.test(f))return c.filter(f,m,!i);else f=c.filter(f,m)}return c.grep(b,function(k){return c.inArray(k,f)>=0===i})};c.fn.extend({find:function(b){for(var f=this.pushStack("","find",b),i=0,m=0,k=this.length;m<k;m++){i=f.length;c.find(b,this[m],f);if(m>0)for(var G=i;G<f.length;G++)for(var F=0;F<i;F++)if(f[F]===f[G]){f.splice(G--,
1);break}}return f},has:function(b){var f=c(b);return this.filter(function(){for(var i=0,m=f.length;i<m;i++)if(c.contains(this,f[i]))return true})},not:function(b){return this.pushStack(kb(this,b,false),"not",b)},filter:function(b){return this.pushStack(kb(this,b,true),"filter",b)},is:function(b){return!!b&&c.filter(b,this).length>0},closest:function(b,f){if(c.isArray(b)){var i=[],m=this[0],k,G={},F;if(m&&b.length){k=0;for(var T=b.length;k<T;k++){F=b[k];G[F]||(G[F]=c.expr.match.POS.test(F)?c(F,f||
this.context):F)}for(;m&&m.ownerDocument&&m!==f;){for(F in G){k=G[F];if(k.jquery?k.index(m)>-1:c(m).is(k)){i.push({selector:F,elem:m});delete G[F]}}m=m.parentNode}}return i}var K=c.expr.match.POS.test(b)?c(b,f||this.context):null;return this.map(function(S,ea){for(;ea&&ea.ownerDocument&&ea!==f;){if(K?K.index(ea)>-1:c(ea).is(b))return ea;ea=ea.parentNode}return null})},index:function(b){if(!b||typeof b==="string")return c.inArray(this[0],b?c(b):this.parent().children());return c.inArray(b.jquery?b[0]:
b,this)},add:function(b,f){b=typeof b==="string"?c(b,f||this.context):c.makeArray(b);f=c.merge(this.get(),b);return this.pushStack(ba(b[0])||ba(f[0])?f:c.unique(f))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(b){return(b=b.parentNode)&&b.nodeType!==11?b:null},parents:function(b){return c.dir(b,"parentNode")},parentsUntil:function(b,f,i){return c.dir(b,"parentNode",i)},next:function(b){return c.nth(b,2,"nextSibling")},prev:function(b){return c.nth(b,2,"previousSibling")},
nextAll:function(b){return c.dir(b,"nextSibling")},prevAll:function(b){return c.dir(b,"previousSibling")},nextUntil:function(b,f,i){return c.dir(b,"nextSibling",i)},prevUntil:function(b,f,i){return c.dir(b,"previousSibling",i)},siblings:function(b){return c.sibling(b.parentNode.firstChild,b)},children:function(b){return c.sibling(b.firstChild)},contents:function(b){return c.nodeName(b,"iframe")?b.contentDocument||b.contentWindow.document:c.makeArray(b.childNodes)}},function(b,f){c.fn[b]=function(i,
m){var k=c.map(this,f,i);Na.test(b)||(m=i);if(m&&typeof m==="string")k=c.filter(m,k);k=this.length>1?c.unique(k):k;if((this.length>1||Va.test(m))&&Ua.test(b))k=k.reverse();return this.pushStack(k,b,C.call(arguments).join(","))}});c.extend({filter:function(b,f,i){if(i)b=":not("+b+")";return c.find.matches(b,f)},dir:function(b,f,i){var m=[];for(b=b[f];b&&b.nodeType!==9&&(i===p||b.nodeType!==1||!c(b).is(i));){b.nodeType===1&&m.push(b);b=b[f]}return m},nth:function(b,f,i){f=f||1;for(var m=0;b;b=b[i])if(b.nodeType===
1&&++m===f)break;return b},sibling:function(b,f){for(var i=[];b;b=b.nextSibling)b.nodeType===1&&b!==f&&i.push(b);return i}});var lb=/ jQuery\d+="(?:\d+|null)"/g,Za=/^\s+/,mb=/(<([\w:]+)[^>]*?)\/>/g,sb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,nb=/<([\w:]+)/,tb=/<tbody/i,ub=/<|&#?\w+;/,gb=/<script|<object|<embed|<option|<style/i,hb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=function(b,f,i){return sb.test(i)?b:f+"></"+i+">"},La={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,"",""]};La.optgroup=La.option;La.tbody=La.tfoot=La.colgroup=La.caption=La.thead;La.th=La.td;if(!c.support.htmlSerialize)La._default=[1,"div<div>","</div>"];c.fn.extend({text:function(b){if(c.isFunction(b))return this.each(function(f){var i=c(this);
i.text(b.call(this,f,i.text()))});if(typeof b!=="object"&&b!==p)return this.empty().append((this[0]&&this[0].ownerDocument||U).createTextNode(b));return c.text(this)},wrapAll:function(b){if(c.isFunction(b))return this.each(function(i){c(this).wrapAll(b.call(this,i))});if(this[0]){var f=c(b,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&f.insertBefore(this[0]);f.map(function(){for(var i=this;i.firstChild&&i.firstChild.nodeType===1;)i=i.firstChild;return i}).append(this)}return this},
wrapInner:function(b){if(c.isFunction(b))return this.each(function(f){c(this).wrapInner(b.call(this,f))});return this.each(function(){var f=c(this),i=f.contents();i.length?i.wrapAll(b):f.append(b)})},wrap:function(b){return this.each(function(){c(this).wrapAll(b)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(b){this.nodeType===1&&this.appendChild(b)})},
prepend:function(){return this.domManip(arguments,true,function(b){this.nodeType===1&&this.insertBefore(b,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 b=c(arguments[0]);b.push.apply(b,this.toArray());return this.pushStack(b,"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 b=this.pushStack(this,"after",arguments);b.push.apply(b,c(arguments[0]).toArray());return b}},remove:function(b,f){for(var i=0,m;(m=this[i])!=null;i++)if(!b||c.filter(b,[m]).length){if(!f&&m.nodeType===1){c.cleanData(m.getElementsByTagName("*"));c.cleanData([m])}m.parentNode&&m.parentNode.removeChild(m)}return this},empty:function(){for(var b=0,f;(f=this[b])!=null;b++)for(f.nodeType===1&&c.cleanData(f.getElementsByTagName("*"));f.firstChild;)f.removeChild(f.firstChild);
return this},clone:function(b){var f=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var i=this.outerHTML,m=this.ownerDocument;if(!i){i=m.createElement("div");i.appendChild(this.cloneNode(true));i=i.innerHTML}return c.clean([i.replace(lb,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(Za,"")],m)[0]}else return this.cloneNode(true)});if(b===true){oa(this,f);oa(this.find("*"),f.find("*"))}return f},html:function(b){if(b===p)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(lb,
""):null;else if(typeof b==="string"&&!gb.test(b)&&(c.support.leadingWhitespace||!Za.test(b))&&!La[(nb.exec(b)||["",""])[1].toLowerCase()]){b=b.replace(mb,ob);try{for(var f=0,i=this.length;f<i;f++)if(this[f].nodeType===1){c.cleanData(this[f].getElementsByTagName("*"));this[f].innerHTML=b}}catch(m){this.empty().append(b)}}else c.isFunction(b)?this.each(function(k){var G=c(this),F=G.html();G.empty().append(function(){return b.call(this,k,F)})}):this.empty().append(b);return this},replaceWith:function(b){if(this[0]&&
this[0].parentNode){if(c.isFunction(b))return this.each(function(f){var i=c(this),m=i.html();i.replaceWith(b.call(this,f,m))});if(typeof b!=="string")b=c(b).detach();return this.each(function(){var f=this.nextSibling,i=this.parentNode;c(this).remove();f?c(f).before(b):c(i).append(b)})}else return this.pushStack(c(c.isFunction(b)?b():b),"replaceWith",b)},detach:function(b){return this.remove(b,true)},domManip:function(b,f,i){function m(pa){return c.nodeName(pa,"table")?pa.getElementsByTagName("tbody")[0]||
pa.appendChild(pa.ownerDocument.createElement("tbody")):pa}var k,G,F=b[0],T=[],K;if(!c.support.checkClone&&arguments.length===3&&typeof F==="string"&&hb.test(F))return this.each(function(){c(this).domManip(b,f,i,true)});if(c.isFunction(F))return this.each(function(pa){var za=c(this);b[0]=F.call(this,pa,f?za.html():p);za.domManip(b,f,i)});if(this[0]){k=F&&F.parentNode;k=c.support.parentNode&&k&&k.nodeType===11&&k.childNodes.length===this.length?{fragment:k}:W(b,this,T);K=k.fragment;if(G=K.childNodes.length===
1?(K=K.firstChild):K.firstChild){f=f&&c.nodeName(G,"tr");for(var S=0,ea=this.length;S<ea;S++)i.call(f?m(this[S],G):this[S],S>0||k.cacheable||this.length>1?K.cloneNode(true):K)}T.length&&c.each(T,z)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,f){c.fn[b]=function(i){var m=[];i=c(i);var k=this.length===1&&this[0].parentNode;if(k&&k.nodeType===11&&k.childNodes.length===1&&i.length===1){i[f](this[0]);
return this}else{k=0;for(var G=i.length;k<G;k++){var F=(k>0?this.clone(true):this).get();c.fn[f].apply(c(i[k]),F);m=m.concat(F)}return this.pushStack(m,b,i.selector)}}});c.extend({clean:function(b,f,i,m){f=f||U;if(typeof f.createElement==="undefined")f=f.ownerDocument||f[0]&&f[0].ownerDocument||U;for(var k=[],G=0,F;(F=b[G])!=null;G++){if(typeof F==="number")F+="";if(F){if(typeof F==="string"&&!ub.test(F))F=f.createTextNode(F);else if(typeof F==="string"){F=F.replace(mb,ob);var T=(nb.exec(F)||["",
""])[1].toLowerCase(),K=La[T]||La._default,S=K[0],ea=f.createElement("div");for(ea.innerHTML=K[1]+F+K[2];S--;)ea=ea.lastChild;if(!c.support.tbody){S=tb.test(F);T=T==="table"&&!S?ea.firstChild&&ea.firstChild.childNodes:K[1]==="<table>"&&!S?ea.childNodes:[];for(K=T.length-1;K>=0;--K)c.nodeName(T[K],"tbody")&&!T[K].childNodes.length&&T[K].parentNode.removeChild(T[K])}!c.support.leadingWhitespace&&Za.test(F)&&ea.insertBefore(f.createTextNode(Za.exec(F)[0]),ea.firstChild);F=ea.childNodes}if(F.nodeType)k.push(F);
else k=c.merge(k,F)}}if(i)for(G=0;k[G];G++)if(m&&c.nodeName(k[G],"script")&&(!k[G].type||k[G].type.toLowerCase()==="text/javascript"))m.push(k[G].parentNode?k[G].parentNode.removeChild(k[G]):k[G]);else{k[G].nodeType===1&&k.splice.apply(k,[G+1,0].concat(c.makeArray(k[G].getElementsByTagName("script"))));i.appendChild(k[G])}return k},cleanData:function(b){for(var f,i,m=c.cache,k=c.event.special,G=c.support.deleteExpando,F=0,T;(T=b[F])!=null;F++)if(i=T[c.expando]){f=m[i];if(f.events)for(var K in f.events)k[K]?
c.event.remove(T,K):ka(T,K,f.handle);if(G)delete T[c.expando];else T.removeAttribute&&T.removeAttribute(c.expando);delete m[i]}}});var vb=/z-?index|font-?weight|opacity|zoom|line-?height/i,pb=/alpha\([^)]*\)/,qb=/opacity=([^)]*)/,bb=/float/i,cb=/-([a-z])/ig,wb=/([A-Z])/g,xb=/^-?\d+(?:px)?$/i,yb=/^-?\d/,zb={position:"absolute",visibility:"hidden",display:"block"},Ab=["Left","Right"],Bb=["Top","Bottom"],Cb=U.defaultView&&U.defaultView.getComputedStyle,rb=c.support.cssFloat?"cssFloat":"styleFloat",db=
function(b,f){return f.toUpperCase()};c.fn.css=function(b,f){return y(this,b,f,true,function(i,m,k){if(k===p)return c.curCSS(i,m);if(typeof k==="number"&&!vb.test(m))k+="px";c.style(i,m,k)})};c.extend({style:function(b,f,i){if(!b||b.nodeType===3||b.nodeType===8)return p;if((f==="width"||f==="height")&&parseFloat(i)<0)i=p;var m=b.style||b,k=i!==p;if(!c.support.opacity&&f==="opacity"){if(k){m.zoom=1;f=parseInt(i,10)+""==="NaN"?"":"alpha(opacity="+i*100+")";b=m.filter||c.curCSS(b,"filter")||"";m.filter=
pb.test(b)?b.replace(pb,f):f}return m.filter&&m.filter.indexOf("opacity=")>=0?parseFloat(qb.exec(m.filter)[1])/100+"":""}if(bb.test(f))f=rb;f=f.replace(cb,db);if(k)m[f]=i;return m[f]},css:function(b,f,i,m){if(f==="width"||f==="height"){var k,G=f==="width"?Ab:Bb;function F(){k=f==="width"?b.offsetWidth:b.offsetHeight;m!=="border"&&c.each(G,function(){m||(k-=parseFloat(c.curCSS(b,"padding"+this,true))||0);if(m==="margin")k+=parseFloat(c.curCSS(b,"margin"+this,true))||0;else k-=parseFloat(c.curCSS(b,
"border"+this+"Width",true))||0})}b.offsetWidth!==0?F():c.swap(b,zb,F);return Math.max(0,Math.round(k))}return c.curCSS(b,f,i)},curCSS:function(b,f,i){var m,k=b.style;if(!c.support.opacity&&f==="opacity"&&b.currentStyle){m=qb.test(b.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return m===""?"1":m}if(bb.test(f))f=rb;if(!i&&k&&k[f])m=k[f];else if(Cb){if(bb.test(f))f="float";f=f.replace(wb,"-$1").toLowerCase();k=b.ownerDocument.defaultView;if(!k)return null;if(b=k.getComputedStyle(b,null))m=
b.getPropertyValue(f);if(f==="opacity"&&m==="")m="1"}else if(b.currentStyle){i=f.replace(cb,db);m=b.currentStyle[f]||b.currentStyle[i];if(!xb.test(m)&&yb.test(m)){f=k.left;var G=b.runtimeStyle.left;b.runtimeStyle.left=b.currentStyle.left;k.left=i==="fontSize"?"1em":m||0;m=k.pixelLeft+"px";k.left=f;b.runtimeStyle.left=G}}return m},swap:function(b,f,i){var m={};for(var k in f){m[k]=b.style[k];b.style[k]=f[k]}i.call(b);for(k in f)b.style[k]=m[k]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(b){var f=
b.offsetWidth,i=b.offsetHeight,m=b.nodeName.toLowerCase()==="tr";return f===0&&i===0&&!m?true:f>0&&i>0&&!m?false:c.curCSS(b,"display")==="none"};c.expr.filters.visible=function(b){return!c.expr.filters.hidden(b)}}var Db=A(),Eb=/<script(.|\s)*?\/script>/gi,Fb=/select|textarea/i,Gb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,Wa=/=\?(&|$)/,eb=/\?/,Hb=/(\?|&)_=.*?(&|$)/,Ib=/^(\w+:)?\/\/([^\/?#]+)/,Jb=/%20/g,Kb=c.fn.load;c.fn.extend({load:function(b,f,
i){if(typeof b!=="string")return Kb.call(this,b);else if(!this.length)return this;var m=b.indexOf(" ");if(m>=0){var k=b.slice(m,b.length);b=b.slice(0,m)}m="GET";if(f)if(c.isFunction(f)){i=f;f=null}else if(typeof f==="object"){f=c.param(f,c.ajaxSettings.traditional);m="POST"}var G=this;c.ajax({url:b,type:m,dataType:"html",data:f,complete:function(F,T){if(T==="success"||T==="notmodified")G.html(k?c("<div />").append(F.responseText.replace(Eb,"")).find(k):F.responseText);i&&G.each(i,[F.responseText,
T,F])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Fb.test(this.nodeName)||Gb.test(this.type))}).map(function(b,f){b=c(this).val();return b==null?null:c.isArray(b)?c.map(b,function(i){return{name:f.name,value:i}}):{name:f.name,value:b}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(b,f){c.fn[f]=function(i){return this.bind(f,i)}});c.extend({get:function(b,f,i,m){if(c.isFunction(f)){m=m||i;i=f;f=null}return c.ajax({type:"GET",url:b,data:f,success:i,dataType:m})},getScript:function(b,f){return c.get(b,null,f,"script")},getJSON:function(b,f,i){return c.get(b,f,i,"json")},post:function(b,f,i,m){if(c.isFunction(f)){m=m||i;i=f;f={}}return c.ajax({type:"POST",url:b,data:f,success:i,dataType:m})},ajaxSetup:function(b){c.extend(c.ajaxSettings,b)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:g.XMLHttpRequest&&(g.location.protocol!=="file:"||!g.ActiveXObject)?function(){return new g.XMLHttpRequest}:function(){try{return new g.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}},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(b){function f(){k.success&&
k.success.call(K,T,F,ua);k.global&&m("ajaxSuccess",[ua,k])}function i(){k.complete&&k.complete.call(K,ua,F);k.global&&m("ajaxComplete",[ua,k]);k.global&&!--c.active&&c.event.trigger("ajaxStop")}function m(aa,Y){(k.context?c(k.context):c.event).trigger(aa,Y)}var k=c.extend(true,{},c.ajaxSettings,b),G,F,T,K=b&&b.context||k,S=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string")k.data=c.param(k.data,k.traditional);if(k.dataType==="jsonp"){if(S==="GET")Wa.test(k.url)||(k.url+=(eb.test(k.url)?
"&":"?")+(k.jsonp||"callback")+"=?");else if(!k.data||!Wa.test(k.data))k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?";k.dataType="json"}if(k.dataType==="json"&&(k.data&&Wa.test(k.data)||Wa.test(k.url))){G=k.jsonpCallback||"jsonp"+Db++;if(k.data)k.data=(k.data+"").replace(Wa,"="+G+"$1");k.url=k.url.replace(Wa,"="+G+"$1");k.dataType="script";g[G]=g[G]||function(aa){T=aa;f();i();g[G]=p;try{delete g[G]}catch(Y){}za&&za.removeChild(Ea)}}if(k.dataType==="script"&&k.cache===null)k.cache=false;
if(k.cache===false&&S==="GET"){var ea=A(),pa=k.url.replace(Hb,"$1_="+ea+"$2");k.url=pa+(pa===k.url?(eb.test(k.url)?"&":"?")+"_="+ea:"")}if(k.data&&S==="GET")k.url+=(eb.test(k.url)?"&":"?")+k.data;k.global&&!c.active++&&c.event.trigger("ajaxStart");ea=(ea=Ib.exec(k.url))&&(ea[1]&&ea[1]!==location.protocol||ea[2]!==location.host);if(k.dataType==="script"&&S==="GET"&&ea){var za=U.getElementsByTagName("head")[0]||U.documentElement,Ea=U.createElement("script");Ea.src=k.url;if(k.scriptCharset)Ea.charset=
k.scriptCharset;if(!G){var Ca=false;Ea.onload=Ea.onreadystatechange=function(){if(!Ca&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){Ca=true;f();i();Ea.onload=Ea.onreadystatechange=null;za&&Ea.parentNode&&za.removeChild(Ea)}}}za.insertBefore(Ea,za.firstChild);return p}var Ka=false,ua=k.xhr();if(ua){k.username?ua.open(S,k.url,k.async,k.username,k.password):ua.open(S,k.url,k.async);try{if(k.data||b&&b.contentType)ua.setRequestHeader("Content-Type",k.contentType);if(k.ifModified){c.lastModified[k.url]&&
ua.setRequestHeader("If-Modified-Since",c.lastModified[k.url]);c.etag[k.url]&&ua.setRequestHeader("If-None-Match",c.etag[k.url])}ea||ua.setRequestHeader("X-Requested-With","XMLHttpRequest");ua.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(ab){}if(k.beforeSend&&k.beforeSend.call(K,ua,k)===false){k.global&&!--c.active&&c.event.trigger("ajaxStop");ua.abort();return false}k.global&&m("ajaxSend",[ua,k]);var u=ua.onreadystatechange=function(aa){if(!ua||
ua.readyState===0||aa==="abort"){Ka||i();Ka=true;if(ua)ua.onreadystatechange=c.noop}else if(!Ka&&ua&&(ua.readyState===4||aa==="timeout")){Ka=true;ua.onreadystatechange=c.noop;F=aa==="timeout"?"timeout":!c.httpSuccess(ua)?"error":k.ifModified&&c.httpNotModified(ua,k.url)?"notmodified":"success";var Y;if(F==="success")try{T=c.httpData(ua,k.dataType,k)}catch(qa){F="parsererror";Y=qa}if(F==="success"||F==="notmodified")G||f();else c.handleError(k,ua,F,Y);i();aa==="timeout"&&ua.abort();if(k.async)ua=null}};
try{var D=ua.abort;ua.abort=function(){ua&&D.call(ua);u("abort")}}catch(L){}k.async&&k.timeout>0&&setTimeout(function(){ua&&!Ka&&u("timeout")},k.timeout);try{ua.send(S==="POST"||S==="PUT"||S==="DELETE"?k.data:null)}catch(R){c.handleError(k,ua,null,R);i()}k.async||u();return ua}},handleError:function(b,f,i,m){if(b.error)b.error.call(b.context||b,f,i,m);if(b.global)(b.context?c(b.context):c.event).trigger("ajaxError",[f,b,m])},active:0,httpSuccess:function(b){try{return!b.status&&location.protocol===
"file:"||b.status>=200&&b.status<300||b.status===304||b.status===1223||b.status===0}catch(f){}return false},httpNotModified:function(b,f){var i=b.getResponseHeader("Last-Modified"),m=b.getResponseHeader("Etag");if(i)c.lastModified[f]=i;if(m)c.etag[f]=m;return b.status===304||b.status===0},httpData:function(b,f,i){var m=b.getResponseHeader("content-type")||"",k=f==="xml"||!f&&m.indexOf("xml")>=0;b=k?b.responseXML:b.responseText;k&&b.documentElement.nodeName==="parsererror"&&c.error("parsererror");
if(i&&i.dataFilter)b=i.dataFilter(b,f);if(typeof b==="string")if(f==="json"||!f&&m.indexOf("json")>=0)b=c.parseJSON(b);else if(f==="script"||!f&&m.indexOf("javascript")>=0)c.globalEval(b);return b},param:function(b,f){function i(F,T){if(c.isArray(T))c.each(T,function(K,S){f||/\[\]$/.test(F)?m(F,S):i(F+"["+(typeof S==="object"||c.isArray(S)?K:"")+"]",S)});else!f&&T!=null&&typeof T==="object"?c.each(T,function(K,S){i(F+"["+K+"]",S)}):m(F,T)}function m(F,T){T=c.isFunction(T)?T():T;k[k.length]=encodeURIComponent(F)+
"="+encodeURIComponent(T)}var k=[];if(f===p)f=c.ajaxSettings.traditional;if(c.isArray(b)||b.jquery)c.each(b,function(){m(this.name,this.value)});else for(var G in b)i(G,b[G]);return k.join("&").replace(Jb,"+")}});var fb={},Lb=/toggle|show|hide/,Mb=/^([+-]=)?([\d+-.]+)(.*)$/,$a,ib=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(b,f){if(b||b===0)return this.animate(fa("show",
3),b,f);else{b=0;for(f=this.length;b<f;b++){var i=c.data(this[b],"olddisplay");this[b].style.display=i||"";if(c.css(this[b],"display")==="none"){i=this[b].nodeName;var m;if(fb[i])m=fb[i];else{var k=c("<"+i+" />").appendTo("body");m=k.css("display");if(m==="none")m="block";k.remove();fb[i]=m}c.data(this[b],"olddisplay",m)}}b=0;for(f=this.length;b<f;b++)this[b].style.display=c.data(this[b],"olddisplay")||"";return this}},hide:function(b,f){if(b||b===0)return this.animate(fa("hide",3),b,f);else{b=0;
for(f=this.length;b<f;b++){var i=c.data(this[b],"olddisplay");!i&&i!=="none"&&c.data(this[b],"olddisplay",c.css(this[b],"display"))}b=0;for(f=this.length;b<f;b++)this[b].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(b,f){var i=typeof b==="boolean";if(c.isFunction(b)&&c.isFunction(f))this._toggle.apply(this,arguments);else b==null||i?this.each(function(){var m=i?b:c(this).is(":hidden");c(this)[m?"show":"hide"]()}):this.animate(fa("toggle",3),b,f);return this},fadeTo:function(b,
f,i){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:f},b,i)},animate:function(b,f,i,m){var k=c.speed(f,i,m);if(c.isEmptyObject(b))return this.each(k.complete);return this[k.queue===false?"each":"queue"](function(){var G=c.extend({},k),F,T=this.nodeType===1&&c(this).is(":hidden"),K=this;for(F in b){var S=F.replace(cb,db);if(F!==S){b[S]=b[F];delete b[F];F=S}if(b[F]==="hide"&&T||b[F]==="show"&&!T)return G.complete.call(this);if((F==="height"||F==="width")&&this.style){G.display=
c.css(this,"display");G.overflow=this.style.overflow}if(c.isArray(b[F])){(G.specialEasing=G.specialEasing||{})[F]=b[F][1];b[F]=b[F][0]}}if(G.overflow!=null)this.style.overflow="hidden";G.curAnim=c.extend({},b);c.each(b,function(ea,pa){var za=new c.fx(K,G,ea);if(Lb.test(pa))za[pa==="toggle"?T?"show":"hide":pa](b);else{var Ea=Mb.exec(pa),Ca=za.cur(true)||0;if(Ea){pa=parseFloat(Ea[2]);var Ka=Ea[3]||"px";if(Ka!=="px"){K.style[ea]=(pa||1)+Ka;Ca=(pa||1)/za.cur(true)*Ca;K.style[ea]=Ca+Ka}if(Ea[1])pa=(Ea[1]===
"-="?-1:1)*pa+Ca;za.custom(Ca,pa,Ka)}else za.custom(Ca,pa,"")}});return true})},stop:function(b,f){var i=c.timers;b&&this.queue([]);this.each(function(){for(var m=i.length-1;m>=0;m--)if(i[m].elem===this){f&&i[m](true);i.splice(m,1)}});f||this.dequeue();return this}});c.each({slideDown:fa("show",1),slideUp:fa("hide",1),slideToggle:fa("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,f){c.fn[b]=function(i,m){return this.animate(f,i,m)}});c.extend({speed:function(b,f,i){var m=
b&&typeof b==="object"?b:{complete:i||!i&&f||c.isFunction(b)&&b,duration:b,easing:i&&f||f&&!c.isFunction(f)&&f};m.duration=c.fx.off?0:typeof m.duration==="number"?m.duration:c.fx.speeds[m.duration]||c.fx.speeds._default;m.old=m.complete;m.complete=function(){m.queue!==false&&c(this).dequeue();c.isFunction(m.old)&&m.old.call(this)};return m},easing:{linear:function(b,f,i,m){return i+m*b},swing:function(b,f,i,m){return(-Math.cos(b*Math.PI)/2+0.5)*m+i}},timers:[],fx:function(b,f,i){this.options=f;this.elem=
b;this.prop=i;if(!f.orig)f.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(b){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(b=parseFloat(c.css(this.elem,this.prop,b)))&&b>-10000?b:parseFloat(c.curCSS(this.elem,
this.prop))||0},custom:function(b,f,i){function m(G){return k.step(G)}this.startTime=A();this.start=b;this.end=f;this.unit=i||this.unit||"px";this.now=this.start;this.pos=this.state=0;var k=this;m.elem=this.elem;if(m()&&c.timers.push(m)&&!$a)$a=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=
c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(b){var f=A(),i=true;if(b||f>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var m in this.options.curAnim)if(this.options.curAnim[m]!==true)i=false;if(i){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;b=c.data(this.elem,"olddisplay");this.elem.style.display=b?b:this.options.display;if(c.css(this.elem,
"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var k in this.options.curAnim)c.style(this.elem,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{k=f-this.startTime;this.state=k/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,k,0,1,this.options.duration);
this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var b=c.timers,f=0;f<b.length;f++)b[f]()||b.splice(f--,1);b.length||c.fx.stop()},stop:function(){clearInterval($a);$a=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(b){c.style(b.elem,"opacity",b.now)},_default:function(b){if(b.elem.style&&b.elem.style[b.prop]!=null)b.elem.style[b.prop]=(b.prop==="width"||b.prop==="height"?Math.max(0,b.now):b.now)+b.unit;else b.elem[b.prop]=
b.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(b){return c.grep(c.timers,function(f){return b===f.elem}).length};c.fn.offset="getBoundingClientRect"in U.documentElement?function(b){var f=this[0];if(b)return this.each(function(k){c.offset.setOffset(this,b,k)});if(!f||!f.ownerDocument)return null;if(f===f.ownerDocument.body)return c.offset.bodyOffset(f);var i=f.getBoundingClientRect(),m=f.ownerDocument;f=m.body;m=m.documentElement;return{top:i.top+(self.pageYOffset||c.support.boxModel&&
m.scrollTop||f.scrollTop)-(m.clientTop||f.clientTop||0),left:i.left+(self.pageXOffset||c.support.boxModel&&m.scrollLeft||f.scrollLeft)-(m.clientLeft||f.clientLeft||0)}}:function(b){var f=this[0];if(b)return this.each(function(ea){c.offset.setOffset(this,b,ea)});if(!f||!f.ownerDocument)return null;if(f===f.ownerDocument.body)return c.offset.bodyOffset(f);c.offset.initialize();var i=f.offsetParent,m=f,k=f.ownerDocument,G,F=k.documentElement,T=k.body;m=(k=k.defaultView)?k.getComputedStyle(f,null):f.currentStyle;
for(var K=f.offsetTop,S=f.offsetLeft;(f=f.parentNode)&&f!==T&&f!==F;){if(c.offset.supportsFixedPosition&&m.position==="fixed")break;G=k?k.getComputedStyle(f,null):f.currentStyle;K-=f.scrollTop;S-=f.scrollLeft;if(f===i){K+=f.offsetTop;S+=f.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.nodeName))){K+=parseFloat(G.borderTopWidth)||0;S+=parseFloat(G.borderLeftWidth)||0}m=i;i=f.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&G.overflow!==
"visible"){K+=parseFloat(G.borderTopWidth)||0;S+=parseFloat(G.borderLeftWidth)||0}m=G}if(m.position==="relative"||m.position==="static"){K+=T.offsetTop;S+=T.offsetLeft}if(c.offset.supportsFixedPosition&&m.position==="fixed"){K+=Math.max(F.scrollTop,T.scrollTop);S+=Math.max(F.scrollLeft,T.scrollLeft)}return{top:K,left:S}};c.offset={initialize:function(){var b=U.body,f=U.createElement("div"),i,m,k,G=parseFloat(c.curCSS(b,"marginTop",true))||0;c.extend(f.style,{position:"absolute",top:0,left:0,margin:0,
border:0,width:"1px",height:"1px",visibility:"hidden"});f.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>";b.insertBefore(f,b.firstChild);i=f.firstChild;m=i.firstChild;k=i.nextSibling.firstChild.firstChild;this.doesNotAddBorder=m.offsetTop!==5;this.doesAddBorderForTableAndCells=
k.offsetTop===5;m.style.position="fixed";m.style.top="20px";this.supportsFixedPosition=m.offsetTop===20||m.offsetTop===15;m.style.position=m.style.top="";i.style.overflow="hidden";i.style.position="relative";this.subtractsBorderForOverflowNotVisible=m.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=b.offsetTop!==G;b.removeChild(f);c.offset.initialize=c.noop},bodyOffset:function(b){var f=b.offsetTop,i=b.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){f+=parseFloat(c.curCSS(b,
"marginTop",true))||0;i+=parseFloat(c.curCSS(b,"marginLeft",true))||0}return{top:f,left:i}},setOffset:function(b,f,i){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var m=c(b),k=m.offset(),G=parseInt(c.curCSS(b,"top",true),10)||0,F=parseInt(c.curCSS(b,"left",true),10)||0;if(c.isFunction(f))f=f.call(b,i,k);i={top:f.top-k.top+G,left:f.left-k.left+F};"using"in f?f.using.call(b,i):m.css(i)}};c.fn.extend({position:function(){if(!this[0])return null;var b=this[0],f=this.offsetParent(),
i=this.offset(),m=/^body|html$/i.test(f[0].nodeName)?{top:0,left:0}:f.offset();i.top-=parseFloat(c.curCSS(b,"marginTop",true))||0;i.left-=parseFloat(c.curCSS(b,"marginLeft",true))||0;m.top+=parseFloat(c.curCSS(f[0],"borderTopWidth",true))||0;m.left+=parseFloat(c.curCSS(f[0],"borderLeftWidth",true))||0;return{top:i.top-m.top,left:i.left-m.left}},offsetParent:function(){return this.map(function(){for(var b=this.offsetParent||U.body;b&&!/^body|html$/i.test(b.nodeName)&&c.css(b,"position")==="static";)b=
b.offsetParent;return b})}});c.each(["Left","Top"],function(b,f){var i="scroll"+f;c.fn[i]=function(m){var k=this[0],G;if(!k)return null;return m!==p?this.each(function(){if(G=H(this))G.scrollTo(!b?m:c(G).scrollLeft(),b?m:c(G).scrollTop());else this[i]=m}):(G=H(k))?"pageXOffset"in G?G[b?"pageYOffset":"pageXOffset"]:c.support.boxModel&&G.document.documentElement[i]||G.document.body[i]:k[i]}});c.each(["Height","Width"],function(b,f){var i=f.toLowerCase();c.fn["inner"+f]=function(){return this[0]?c.css(this[0],
i,false,"padding"):null};c.fn["outer"+f]=function(m){return this[0]?c.css(this[0],i,false,m?"margin":"border"):null};c.fn[i]=function(m){var k=this[0];if(!k)return m==null?null:this;if(c.isFunction(m))return this.each(function(G){var F=c(this);F[i](m.call(this,G,F[i]()))});return"scrollTo"in k&&k.document?k.document.compatMode==="CSS1Compat"&&k.document.documentElement["client"+f]||k.document.body["client"+f]:k.nodeType===9?Math.max(k.documentElement["client"+f],k.body["scroll"+f],k.documentElement["scroll"+
f],k.body["offset"+f],k.documentElement["offset"+f]):m===p?c.css(k,i):this.css(i,typeof m==="string"?m:m+"px")}});g.jQuery=g.$=c})(window);(function(){var g=function(){},p=g.prototype;p.global={rootPath:"/",debugMode:true,stamp:Math.ceil(46118400291*Math.random())};p.registered=[];p.afterStack=[];p.init=function(q){var z=TT.registered;if(typeof q=="function")z[z.length]=q;else log.error("not a function",q)};p.initAfterStack=function(q){var z=TT.afterStack;if(typeof q=="function")z[z.length]=q;else log.error("not a function",q)};p.cancelBubble=function(q){if($.support.opacity)q.stopPropagation();else window.event.cancelBubble=true;return false};
p.undefined=function(q){return q===undefined||q==null};p.parseComment=function(q,z){q=z.indexOf("<!--"+q)+("<!--"+q).length;var y=z.indexOf("--\>");return z.substring(q,y)};p.extend=function(q,z,y){if(TT!==undefined)if(!(q===""||q==="."||q==="undefined"||TT.undefined(q)))if(typeof z=="object"){var A=q.split("."),B=TT;if(A.length>1)for(var E in A)if(E!=A.length-1)B=TT.undefined(B[A[E]])?(B[A[E]]={}):B[A[E]];else B[A[E]]=z;else B[A[0]]=z;if(TT.undefined(z.init))throw"no init function attached to "+
q;TT.undefined(y)||TT.init(y);TT.init(z.init);TT.log.debug("<< TT."+q+" >> extended and initialized")}else log.error("couldnt extend "+q,z)};p.extend_framework=function(q,z,y,A){this.extend("FW."+q,z,y,A)};p.extend_website=function(q,z,y,A){this.extend("WS."+q,z,y,A)};p.parent_TT=function(){return top.TT};p.is_iframe=function(){return TT.global.stamp!=TT.parent_TT().global.stamp};p.mouse={isLeftClick:function(q){return q.button==1&&window.event!=null||q.button==0}};p.cookie={set:function(q,z,y){q=
q+"="+escape(z)+";";TT.undefined(y)||(q+="expires="+(new Date(y)).toUTCString());log.debug("COOKIE:"+q);document.cookie=q},get:function(q){if(document.cookie.length){var z=document.cookie.indexOf(q+"=");if(z!=-1){z+=q.length+1;q=document.cookie.indexOf(";",z);if(q==-1)q=document.cookie.length;return unescape(document.cookie.substring(z,q))}}return""}};p.mergeTemplate=function(q,z){q=q;for(d in z)q=q.replace(new RegExp("[%]"+d+"[%]","g"),z[d]);return q};p.tmp={};TT=new g;jQuery(document).ready(function(){var q=
(new Date).valueOf(),z=TT.registered;for(func in z)z[func]();q=(new Date).valueOf()-q;z=document.getElementById("js_init_time");if(z!==null)z.innerHTML=q+"ms";q>200&&log.error("TOOK > 0.2 TO LOAD ~ "+q);TT.log.debug("READY ("+TT.global.stamp+") "+window.location,q);q=TT.afterStack;for(func in q)q[func]()})})();(function(){function g(z,y){log.ga.event("js-failure",z,y)}var p=function(){},q=p.prototype;q.show=function(){return TT.global.debugMode&&typeof console=="object"&&typeof console.log=="function"};q.init=function(){};q.debug=function(z,y){q.show()&&console.log(z,y)};q.warn=function(z,y){q.show()&&console.warn(z,y)};q.error=function(z,y){q.show()&&console.error(z,y);g(z,arguments.callee)};q.ga={getTracker:function(){return _gat._getTracker(jQuery("body").attr("analyticsID"))},page:function(){try{log.ga.getTracker()._trackPageview(pg);
log.debug("LOGGING GA PAGE: "+pg)}catch(z){}},event:function(z,y,A,B){try{var E=log.ga.getTracker();E._initData();var ca;ca=A===undefined&&B===undefined?E._trackEvent(z,y):B===undefined?E._trackEvent(z,y,A):E._trackEvent(z,y,A,new Number(B));log.debug("LOGGING GA EVT.. CATEGORY:"+z+", ACTION:"+y+", LABEL: "+A+", VALUE: "+B+" .. success? "+ca)}catch(ga){}}};TT.extend("log",new p,function(){log=TT.log})})();(function(){var g=function(){},p=g.prototype;p.defaults={type:"GET",dataType:"text",cache:false,timeout:3E4,async:true,error:function(){}};p.init=function(q){q=jQuery.extend([],this.defaults,q);q.url=TT.global.rootPath+q.url;return q};p.sync=function(q){q=this.init(q);q.async=false;return this.send(q,false)};p.async=function(q){q=this.init(q);q.async=true;return this.send(q,false)};p.send=function(q,z){if(TT.undefined(z))q=this.init(q);this.log(q);jQuery.ajax(q);return false};p.log=function(q){log.debug("NEW "+
(q.async?"async":"sync")+" AJAX REQUEST: "+q.type+" /"+q.url,q)};TT.extend("ajax",new g,function(){ajax=TT.ajax})})();(function(){var g=function(){},p=g.prototype;p.defaults={type:"GET",dataType:"json",cache:false,timeout:3E4,async:false,error:function(){}};p.init=function(q){return jQuery.extend([],this.defaults,q)};p.send=function(q){q=this.init(q);this.log(q);jQuery.ajax(q);return false};p.log=function(q){log.debug("NEW JSON REQUEST: /"+q.type+" /"+q.url,q)};TT.extend("json",new g,function(){json=TT.json})})();(function(){var g=function(){},p=g.prototype;p.init=function(){};p.failure=function(q){q=q+"&domain="+window.document.domain+"&lm="+window.document.lastModified+"&ref="+window.document.referrer+"&hl="+window.history.length+"&np="+navigator.platform+"&npg="+$(navigator.plugins).serialize()+"&nce="+navigator.cookieEnabled+"&nav="+navigator.appVersion;var z=$("img#script_error");if(typeof z!="undefined"&&z.size()>0)z.attr("src","/js_error/clear.gif?e="+q);else{z=new Image;z.id="script_error";z.src="/js_error/clear.gif?e="+
q;z.width=z.height=1;$("body").append(z)}return false};p.flash=function(q,z,y){jQuery("<div id='js_flash' />").html(q).addClass(y).appendTo("body").animate({opacity:"toggle"},400,"linear",function(){var A=jQuery(this);setTimeout(function(){A.animate({opacity:"toggle"},600,"linear",function(){$("div#js_flash").remove()})},z)})};TT.extend("notify",new g)})();(function(){var g=function(){},p=g.prototype;p.init=function(){jQuery("input.autocomplete").autocomplete({success:function(q){q=eval("("+q+")");var z=true,y=jQuery("#autocomplete_results");if(y.length==0){z=false;y=jQuery("<div id='autocomplete_results'></div>")}y.html("<ul>"+q.autocomplete.hits+"</ul>");y.find("ul li").filter(":first-child").addClass("selected");z||y.appendTo("#autocomplete_div");y.animate({opacity:"1",height:"100%"},200)}}).bind("blur",function(){var q=jQuery("#autocomplete_results");
q.length&&q.is(":visible")&&q.animate({opacity:"0",height:"0"},300)});jQuery("[fieldhint]").bind("blur",function(){TT.form.updateFieldHint(this)}).bind("focus",function(){if(this.value==this.getAttribute("fieldhint"))this.value=""}).trigger("blur")};(function(q){function z(y){if(y.keyCode)code=y.keyCode;else if(y.which)code=y.which;if(y.shiftKey||y.ctrlKey||y.altKey||y.metaKey)return false;if([9,13,20,27,33,34,35,36,37,38,39,40,45,46,91].indexOf(code)>-1)return false;return true}q.fn.autocomplete=
function(y){return jQuery(this).each(function(){jQuery(this).bind("keyup",function(A){var B=jQuery(this),E=B.val();if(E==""||E.length<3)jQuery("#autocomplete_results").html("");else z(A)&&ajax.async({url:"auto_complete",data:"q="+E+"&acType="+B.attr("acType"),success:function(ca){y.success(ca)}})})})}})(jQuery);p.updateFieldHint=function(q){if(q.value=="")q.value=q.getAttribute("fieldhint")};TT.extend("form",new g)})();var swfobject=function(){function g(){if(!Ha){try{var J=N.getElementsByTagName("body")[0].appendChild(c("span"));J.parentNode.removeChild(J)}catch(P){return}Ha=true;J=j.length;for(var da=0;da<J;da++)j[da]()}}function p(J){if(Ha)J();else j[j.length]=J}function q(J){if(typeof ja.addEventListener!=V)ja.addEventListener("load",J,false);else if(typeof N.addEventListener!=V)N.addEventListener("load",J,false);else if(typeof ja.attachEvent!=V)X(ja,"onload",J);else if(typeof ja.onload=="function"){var P=ja.onload;
ja.onload=function(){P();J()}}else ja.onload=J}function z(){h?y():A()}function y(){var J=N.getElementsByTagName("body")[0],P=c(M);P.setAttribute("type",ia);var da=J.appendChild(P);if(da){var ha=0;(function(){if(typeof da.GetVariable!=V){var ka=da.GetVariable("$version");if(ka){ka=ka.split(" ")[1].split(",");ma.pv=[parseInt(ka[0],10),parseInt(ka[1],10),parseInt(ka[2],10)]}}else if(ha<10){ha++;setTimeout(arguments.callee,10);return}J.removeChild(P);da=null;A()})()}else A()}function A(){var J=w.length;
if(J>0)for(var P=0;P<J;P++){var da=w[P].id,ha=w[P].callbackFn,ka={success:false,id:da};if(ma.pv[0]>0){var wa=H(da);if(wa)if(la(w[P].swfVersion)&&!(ma.wk&&ma.wk<312)){va(da,true);if(ha){ka.success=true;ka.ref=B(da);ha(ka)}}else if(w[P].expressInstall&&E()){ka={};ka.data=w[P].expressInstall;ka.width=wa.getAttribute("width")||"0";ka.height=wa.getAttribute("height")||"0";if(wa.getAttribute("class"))ka.styleclass=wa.getAttribute("class");if(wa.getAttribute("align"))ka.align=wa.getAttribute("align");var xa=
{};wa=wa.getElementsByTagName("param");for(var Da=wa.length,Fa=0;Fa<Da;Fa++)if(wa[Fa].getAttribute("name").toLowerCase()!="movie")xa[wa[Fa].getAttribute("name")]=wa[Fa].getAttribute("value");ca(ka,xa,da,ha)}else{ga(wa);ha&&ha(ka)}}else{va(da,true);if(ha){if((da=B(da))&&typeof da.SetVariable!=V){ka.success=true;ka.ref=da}ha(ka)}}}}function B(J){var P=null;if((J=H(J))&&J.nodeName=="OBJECT")if(typeof J.SetVariable!=V)P=J;else if(J=J.getElementsByTagName(M)[0])P=J;return P}function E(){return!Ba&&la("6.0.65")&&
(ma.win||ma.mac)&&!(ma.wk&&ma.wk<312)}function ca(J,P,da,ha){Ba=true;Z=ha||null;ra={success:false,id:da};var ka=H(da);if(ka){if(ka.nodeName=="OBJECT"){I=ta(ka);Q=null}else{I=ka;Q=da}J.id=sa;if(typeof J.width==V||!/%$/.test(J.width)&&parseInt(J.width,10)<310)J.width="310";if(typeof J.height==V||!/%$/.test(J.height)&&parseInt(J.height,10)<137)J.height="137";N.title=N.title.slice(0,47)+" - Flash Player Installation";ha=ma.ie&&ma.win?"ActiveX":"PlugIn";ha="MMredirectURL="+ja.location.toString().replace(/&/g,
"%26")+"&MMplayerType="+ha+"&MMdoctitle="+N.title;if(typeof P.flashvars!=V)P.flashvars+="&"+ha;else P.flashvars=ha;if(ma.ie&&ma.win&&ka.readyState!=4){ha=c("div");da+="SWFObjectNew";ha.setAttribute("id",da);ka.parentNode.insertBefore(ha,ka);ka.style.display="none";(function(){ka.readyState==4?ka.parentNode.removeChild(ka):setTimeout(arguments.callee,10)})()}ba(J,P,da)}}function ga(J){if(ma.ie&&ma.win&&J.readyState!=4){var P=c("div");J.parentNode.insertBefore(P,J);P.parentNode.replaceChild(ta(J),P);
J.style.display="none";(function(){J.readyState==4?J.parentNode.removeChild(J):setTimeout(arguments.callee,10)})()}else J.parentNode.replaceChild(ta(J),J)}function ta(J){var P=c("div");if(ma.win&&ma.ie)P.innerHTML=J.innerHTML;else if(J=J.getElementsByTagName(M)[0])if(J=J.childNodes)for(var da=J.length,ha=0;ha<da;ha++)!(J[ha].nodeType==1&&J[ha].nodeName=="PARAM")&&J[ha].nodeType!=8&&P.appendChild(J[ha].cloneNode(true));return P}function ba(J,P,da){var ha,ka=H(da);if(ma.wk&&ma.wk<312)return ha;if(ka){if(typeof J.id==
V)J.id=da;if(ma.ie&&ma.win){var wa="";for(var xa in J)if(J[xa]!=Object.prototype[xa])if(xa.toLowerCase()=="data")P.movie=J[xa];else if(xa.toLowerCase()=="styleclass")wa+=' class="'+J[xa]+'"';else if(xa.toLowerCase()!="classid")wa+=" "+xa+'="'+J[xa]+'"';xa="";for(var Da in P)if(P[Da]!=Object.prototype[Da])xa+='<param name="'+Da+'" value="'+P[Da]+'" />';ka.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+wa+">"+xa+"</object>";n[n.length]=J.id;ha=H(J.id)}else{Da=c(M);Da.setAttribute("type",
ia);for(wa in J)if(J[wa]!=Object.prototype[wa])if(wa.toLowerCase()=="styleclass")Da.setAttribute("class",J[wa]);else wa.toLowerCase()!="classid"&&Da.setAttribute(wa,J[wa]);for(var Fa in P)P[Fa]!=Object.prototype[Fa]&&Fa.toLowerCase()!="movie"&&oa(Da,Fa,P[Fa]);ka.parentNode.replaceChild(Da,ka);ha=Da}}return ha}function oa(J,P,da){var ha=c("param");ha.setAttribute("name",P);ha.setAttribute("value",da);J.appendChild(ha)}function W(J){var P=H(J);if(P&&P.nodeName=="OBJECT")if(ma.ie&&ma.win){P.style.display=
"none";(function(){P.readyState==4?fa(J):setTimeout(arguments.callee,10)})()}else P.parentNode.removeChild(P)}function fa(J){if(J=H(J)){for(var P in J)if(typeof J[P]=="function")J[P]=null;J.parentNode.removeChild(J)}}function H(J){var P=null;try{P=N.getElementById(J)}catch(da){}return P}function c(J){return N.createElement(J)}function X(J,P,da){J.attachEvent(P,da);C[C.length]=[J,P,da]}function la(J){var P=ma.pv;J=J.split(".");J[0]=parseInt(J[0],10);J[1]=parseInt(J[1],10)||0;J[2]=parseInt(J[2],10)||
0;return P[0]>J[0]||P[0]==J[0]&&P[1]>J[1]||P[0]==J[0]&&P[1]==J[1]&&P[2]>=J[2]?true:false}function U(J,P,da,ha){if(!(ma.ie&&ma.mac)){var ka=N.getElementsByTagName("head")[0];if(ka){da=da&&typeof da=="string"?da:"screen";if(ha)Ga=Ia=null;if(!Ia||Ga!=da){ha=c("style");ha.setAttribute("type","text/css");ha.setAttribute("media",da);Ia=ka.appendChild(ha);if(ma.ie&&ma.win&&typeof N.styleSheets!=V&&N.styleSheets.length>0)Ia=N.styleSheets[N.styleSheets.length-1];Ga=da}if(ma.ie&&ma.win)Ia&&typeof Ia.addRule==
M&&Ia.addRule(J,P);else Ia&&typeof N.createTextNode!=V&&Ia.appendChild(N.createTextNode(J+" {"+P+"}"))}}}function va(J,P){if(Oa){P=P?"visible":"hidden";if(Ha&&H(J))H(J).style.visibility=P;else U("#"+J,"visibility:"+P)}}function O(J){return/[\\\"<>\.;]/.exec(J)!=null&&typeof encodeURIComponent!=V?encodeURIComponent(J):J}var V="undefined",M="object",ia="application/x-shockwave-flash",sa="SWFObjectExprInst",ja=window,N=document,Aa=navigator,h=false,j=[z],w=[],n=[],C=[],I,Q,Z,ra,Ha=false,Ba=false,Ia,
Ga,Oa=true,ma=function(){var J=typeof N.getElementById!=V&&typeof N.getElementsByTagName!=V&&typeof N.createElement!=V,P=Aa.userAgent.toLowerCase(),da=Aa.platform.toLowerCase(),ha=da?/win/.test(da):/win/.test(P);da=da?/mac/.test(da):/mac/.test(P);P=/webkit/.test(P)?parseFloat(P.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false;var ka=!+"\u000b1",wa=[0,0,0],xa=null;if(typeof Aa.plugins!=V&&typeof Aa.plugins["Shockwave Flash"]==M){if((xa=Aa.plugins["Shockwave Flash"].description)&&!(typeof Aa.mimeTypes!=
V&&Aa.mimeTypes[ia]&&!Aa.mimeTypes[ia].enabledPlugin)){h=true;ka=false;xa=xa.replace(/^.*\s+(\S+\s+\S+$)/,"$1");wa[0]=parseInt(xa.replace(/^(.*)\..*$/,"$1"),10);wa[1]=parseInt(xa.replace(/^.*\.(.*)\s.*$/,"$1"),10);wa[2]=/[a-zA-Z]/.test(xa)?parseInt(xa.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof ja.ActiveXObject!=V)try{var Da=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(Da)if(xa=Da.GetVariable("$version")){ka=true;xa=xa.split(" ")[1].split(",");wa=[parseInt(xa[0],10),parseInt(xa[1],
10),parseInt(xa[2],10)]}}catch(Fa){}return{w3:J,pv:wa,wk:P,ie:ka,win:ha,mac:da}}();(function(){if(ma.w3){if(typeof N.readyState!=V&&N.readyState=="complete"||typeof N.readyState==V&&(N.getElementsByTagName("body")[0]||N.body))g();if(!Ha){typeof N.addEventListener!=V&&N.addEventListener("DOMContentLoaded",g,false);if(ma.ie&&ma.win){N.attachEvent("onreadystatechange",function(){if(N.readyState=="complete"){N.detachEvent("onreadystatechange",arguments.callee);g()}});ja==top&&function(){if(!Ha){try{N.documentElement.doScroll("left")}catch(J){setTimeout(arguments.callee,
0);return}g()}}()}ma.wk&&function(){Ha||(/loaded|complete/.test(N.readyState)?g():setTimeout(arguments.callee,0))}();q(g)}}})();(function(){ma.ie&&ma.win&&window.attachEvent("onunload",function(){for(var J=C.length,P=0;P<J;P++)C[P][0].detachEvent(C[P][1],C[P][2]);J=n.length;for(P=0;P<J;P++)W(n[P]);for(var da in ma)ma[da]=null;ma=null;for(var ha in swfobject)swfobject[ha]=null;swfobject=null})})();return{registerObject:function(J,P,da,ha){if(ma.w3&&J&&P){var ka={};ka.id=J;ka.swfVersion=P;ka.expressInstall=
da;ka.callbackFn=ha;w[w.length]=ka;va(J,false)}else ha&&ha({success:false,id:J})},getObjectById:function(J){if(ma.w3)return B(J)},embedSWF:function(J,P,da,ha,ka,wa,xa,Da,Fa,Pa){var Qa={success:false,id:P};if(ma.w3&&!(ma.wk&&ma.wk<312)&&J&&P&&da&&ha&&ka){va(P,false);p(function(){da+="";ha+="";var Ma={};if(Fa&&typeof Fa===M)for(var Na in Fa)Ma[Na]=Fa[Na];Ma.data=J;Ma.width=da;Ma.height=ha;Na={};if(Da&&typeof Da===M)for(var Ua in Da)Na[Ua]=Da[Ua];if(xa&&typeof xa===M)for(var Va in xa)if(typeof Na.flashvars!=
V)Na.flashvars+="&"+Va+"="+xa[Va];else Na.flashvars=Va+"="+xa[Va];if(la(ka)){Ua=ba(Ma,Na,P);Ma.id==P&&va(P,true);Qa.success=true;Qa.ref=Ua}else if(wa&&E()){Ma.data=wa;ca(Ma,Na,P,Pa);return}else va(P,true);Pa&&Pa(Qa)})}else Pa&&Pa(Qa)},switchOffAutoHideShow:function(){Oa=false},ua:ma,getFlashPlayerVersion:function(){return{major:ma.pv[0],minor:ma.pv[1],release:ma.pv[2]}},hasFlashPlayerVersion:la,createSWF:function(J,P,da){if(ma.w3)return ba(J,P,da)},showExpressInstall:function(J,P,da,ha){ma.w3&&E()&&
ca(J,P,da,ha)},removeSWF:function(J){ma.w3&&W(J)},createCSS:function(J,P,da,ha){ma.w3&&U(J,P,da,ha)},addDomLoadEvent:p,addLoadEvent:q,getQueryParamValue:function(J){var P=N.location.search||N.location.hash;if(P){if(/\?/.test(P))P=P.split("?")[1];if(J==null)return O(P);P=P.split("&");for(var da=0;da<P.length;da++)if(P[da].substring(0,P[da].indexOf("="))==J)return O(P[da].substring(P[da].indexOf("=")+1))}return""},expressInstallCallback:function(){if(Ba){var J=H(sa);if(J&&I){J.parentNode.replaceChild(I,
J);if(Q){va(Q,true);if(ma.ie&&ma.win)I.style.display="block"}Z&&Z(ra)}Ba=false}}}}();(function(g){function p(O,V){var M=g.extend({},X,V);return O.each(function(){var ia=g(this);if(!ia.hasClass(c)){ia.find("."+M.listClass).find("."+M.itemClass).hide();ia.data(fa,y(M,M.initialScale,M.radius));for(e in la)ia.bind(e+W,ia,la[e]);ia.addClass(c)}})}function q(O){var V=g(this),M=g(O.target),ia=g.radmenu.container;M.hasClass(ia.itemClz)||(M=M.closest("."+ia.itemClz));var sa=M.parents("."+ia.itemClz).length>0;M=M.index();sa?V.radmenu(M):V.parents("."+ia.clz).radmenu(M);z(O)}function z(O){if(g.support.opacity)O.stopPropagation();
else window.event.cancelBubble=true}function y(O,V,M){return g.extend({},O,{radius:M*V})}function A(O){return parseInt(Math.random()*O)}function B(O){var V=O.data;return{menu:V,opts:V.data(fa),raditems:function(){return V.find("."+g.radmenu.container.itemClz)}}}function E(O,V,M){if(V==M)M=V-1;var ia=g(O.raditems()[V]),sa=O.raditems()[M];V>M?ia.insertBefore(sa):ia.insertAfter(sa);oa(O,V<M)}function ca(O,V){var M=[];O.each(function(ia){var sa=g(this);ia=ta(ia,O.length,V);var ja="transform:rotate("+
ia.angle+"deg); ";M.push("<div class='"+g.radmenu.container.itemClz+"' ");M.push("style='");M.push("position:absolute;display:none;");M.push("left:"+ia.left+"px;");M.push("top:"+ia.top+"px;");if(V.rotate)for(rot in U.opts)M.push(U.opts[rot]+ja);M.push("'>");M.push(sa.html());M.push("</div>")});return M.join("")}function ga(O,V){return 2*Math.PI*parseFloat(O/V)}function ta(O,V,M,ia){var sa=M.radius,ja=ga(O,V);ja+=ba(M.angleOffset);var N=M.centerX+Math.cos(ja)*sa;sa=M.centerY+Math.sin(parseInt(ja*100)/
100)*sa;O=M.rotate?M.getRotation(ja*180/Math.PI,O,V):0;V=M.rotate?ga(1,V)*180/Math.PI:0;return{left:N,top:sa,angle:O,animObj:{left:N,top:sa,radrotate:(ia==true?"-=":"+=")+V}}}function ba(O){return O*Math.PI/180}function oa(O,V){var M=O.raditems(),ia=M.length;M.each(function(sa){var ja=g(this),N=ta(sa,ia,O.opts,V);ja.animate(N.animObj,O.opts.animSpeed,O.opts.animEasing,function(){sa==ia-1&&O.opts.afterAnimation(O)})})}var W=".radmenu",fa="options"+W,H="prevoptions"+W,c="ui-radmenu-parent",X={listClass:"list",
itemClass:"item",activeItemClass:"active",selectEvent:null,onSelect:function(){},radius:10,angleOffset:0,centerX:0,centerY:0,animSpeed:500,animEasing:"swing",initialScale:1,scaleAnimSpeed:0,scaleAnimEasing:"swing",scaleAnimOpts:{},onScaleItem:function(){},afterAnimation:function(){},onShow:function(O){O.show()},onHide:function(O){O.hide()},onNext:function(){return true},onPrev:function(){return true},rotate:false,getRotation:function(O){return O}};g.radmenu={container:{html:"<div></div>",css:{position:"relative"},
clz:"radial_div",itemClz:"radial_div_item"}};g.fn.radmenu=function(O,V){try{var M=g(this),ia=typeof O;if(arguments.length==0||ia=="object")return p(M,O);else if(ia=="string")return O=="items"||O=="opts"?M.triggerHandler(O+W):M.trigger(O+W,V||null);else if(ia=="number")return M.trigger("select"+W,O)}catch(sa){return"error : "+sa}};var la={opts:function(O){return B(O).opts},show:function(O,V){var M=B(O),ia=g.radmenu.container;M.menu.find("."+ia.clz).remove();var sa=M.menu.find("."+M.opts.itemClass),
ja=g(ia.html).addClass(ia.clz).css(ia.css).html(ca(sa,M.opts));sa=ja.find("."+ia.itemClz);M.opts.selectEvent!=null&&sa.bind(M.opts.selectEvent,q);ja.appendTo(M.menu);typeof V=="function"?V(sa):M.opts.onShow(sa);z(O)},hide:function(O){var V=B(O),M=V.menu.find("."+g.radmenu.container.clz);V.opts.onHide(M.find("."+g.radmenu.container.itemClz));M.remove();z(O)},select:function(O,V){var M=B(O);V=g(M.raditems().get(V));V.siblings().removeClass(M.opts.activeItemClass);V.addClass(M.opts.activeItemClass);
M.opts.onSelect(V);z(O)},next:function(O){O=B(O);O.opts.onNext(O)&&E(O,O.raditems().length-1,0)},prev:function(O){O=B(O);O.opts.onPrev(O)&&E(O,0,O.raditems().length-1)},shuffle:function(O){O=B(O);var V=O.raditems().length;E(O,A(V),A(V))},destroy:function(O){O=B(O);O.menu.data(fa,null).data(H,null).removeClass(c).unbind(W);return O.menu},items:function(O){return B(O).raditems()},scale:function(O,V){var M=B(O);if(V){var ia=M.opts;O=g.radmenu.container;var sa=M.menu.data(H);sa||M.menu.data(H,sa=ia);
var ja=M.menu.find("."+O.itemClz),N=y(ia,V,sa.radius);M.menu.data(fa,N);ja.each(function(Aa){var h=g(this);Aa=ta(Aa,ja.length,N);var j={top:Aa.top,left:Aa.left};if(typeof ia.scaleAnimOpts=="object")j=g.extend({},ia.scaleAnimOpts,j);h.animate(j,ia.scaleAnimSpeed,ia.scaleAnimEasing);M.opts.onScaleItem(h,V,Aa)})}return M.menu}},U={};U.attr=undefined;U.opts=["","-webkit-","-moz-","-ms-","-o-"];U.cssattrs=["","Webkit","Moz","ms","O"];U.getCSSAttr=function(O){if(this.attr)return this.attr;return this.attr=
function(){for(var V=0;V<U.cssattrs.length;V++){var M=U.cssattrs[V]+"Transform";if(O[0].style[M])return M}return"transform"}()};U.getTransformValue=function(O){return jQuery.style(O[0],U.getCSSAttr(O))};var va={};va.cur=g.fx.prototype.cur;g.fx.prototype.cur=function(){if(this.prop=="radrotate"){var O=g(this.elem);if(O=U.getTransformValue(O)||"none")if((O=O.match(/rotate\(([^)]+)\)/))&&O[1])return parseFloat(O[1]);return 0}return va.cur.apply(this,arguments)};g.fx.step.radrotate=function(O){var V=
g(O.elem);V.css(U.getCSSAttr(V),"rotate("+O.now+"deg)")}})(jQuery);(function(g){var p={};p.ytplayers={};p.inits=[];p.iframeScriptInited=false;p.inited=false;g.tubeplayer={};g.tubeplayer.defaults={afterReady:function(){},stateChange:function(A){var B=this.onPlayer;return function(E){if(typeof E=="object")E=E.data;switch(E){case -1:return B.unstarted[A]();case 0:return B.ended[A]();case 1:return B.playing[A]();case 2:return B.paused[A]();case 3:return B.buffering[A]();case 5:return B.cued[A]();default:return null}}},onError:function(A){var B=this.onErr;return function(E){if(typeof E==
"object")E=E.data;switch(E){case 2:return B.invalidParameter[A]();case 100:return B.notFound[A]();case 101:case 150:return B.notEmbeddable[A]();default:return null}}},qualityChange:function(A){var B=this;return function(E){if(typeof E=="object")E=E.data;return B.onQualityChange[A](E)}},onQualityChange:{},onPlayer:{unstarted:{},ended:{},playing:{},paused:{},buffering:{},cued:{}},onErr:{notFound:{},notEmbeddable:{},invalidParameter:{}}};var q={width:425,height:355,allowFullScreen:"true",initialVideo:"DkoeNLuMbcI",
start:0,preferredQuality:"default",showControls:true,showRelated:false,autoPlay:false,autoHide:true,theme:"dark",color:"red",showinfo:false,modestbranding:true,wmode:"transparent",swfobjectURL:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",loadSWFObject:true,allowScriptAccess:"always",playerID:"tubeplayer-player-container",iframed:true,onPlay:function(){},onPause:function(){},onStop:function(){},onSeek:function(){},onMute:function(){},onUnMute:function(){},onPlayerUnstarted:function(){},
onPlayerEnded:function(){},onPlayerPlaying:function(){},onPlayerPaused:function(){},onPlayerBuffering:function(){},onPlayerCued:function(){},onQualityChange:function(){},onErrorNotFound:function(){},onErrorNotEmbeddable:function(){},onErrorInvalidParameter:function(){}};g.fn.tubeplayer=function(A,B){var E=g(this),ca=typeof A;if(arguments.length==0||ca=="object")return E.each(function(){p.init(g(this),A)});else if(ca=="string")return E.triggerHandler(A+".tubeplayer",B||null)};var z=function(A){return function(B,
E){var ca=p.getPkg(B);if(ca.ytplayer){B=A(B,E,ca);if(typeof B=="undefined")B=ca.$player;return B}return ca.$player}};g.tubeplayer.getPlayers=function(){return p.ytplayers};p.init=function(A,B){if(A.hasClass("jquery-youtube-tubeplayer"))return A;B=g.extend({},q,B);B.playerID=B.playerID+(new Date).valueOf()+"_"+Math.random();A.addClass("jquery-youtube-tubeplayer").data("opts.tubeplayer",B);for(e in y)A.bind(e+".tubeplayer",A,y[e]);p.initDefaults(g.tubeplayer.defaults,B);jQuery("<div></div>").attr("id",
B.playerID).appendTo(A);p.initPlayer(A,B);return A};p.getPkg=function(A){A=A.data;var B=A.data("opts.tubeplayer");return{$player:A,opts:B,ytplayer:p.ytplayers[B.playerID]}};p.iframeReady=function(A){p.inits.push(function(){new YT.Player(A.playerID,{videoId:A.initialVideo,width:A.width,height:A.height,playerVars:{autoplay:A.autoPlay?1:0,autohide:A.autoHide?1:0,controls:A.showControls?1:0,rel:A.showRelated?1:0,fs:A.allowFullScreen?1:0,wmode:A.wmode,showinfo:A.showinfo?1:0,modestbranding:A.modestbranding?
1:0,start:A.start,theme:A.theme,color:A.color},events:{onReady:function(B){p.ytplayers[A.playerID]=B.target;B=g(B.target).parents(".jquery-youtube-tubeplayer");g.tubeplayer.defaults.afterReady(B)},onPlaybackQualityChange:g.tubeplayer.defaults.qualityChange(A.playerID),onStateChange:g.tubeplayer.defaults.stateChange(A.playerID),onError:g.tubeplayer.defaults.onError(A.playerID)}})});if(p.inits.length>=1&&!p.inited)return function(){for(var B=0;B<p.inits.length;B++)p.inits[B]();p.inited=true};p.inited&&
p.inits.pop()();return onYouTubePlayerAPIReady};p.supportsHTML5=function(){return!!document.createElement("video").canPlayType};p.initDefaults=function(A,B){var E=B.playerID,ca=A.onPlayer;ca.unstarted[E]=B.onPlayerUnstarted;ca.ended[E]=B.onPlayerEnded;ca.playing[E]=B.onPlayerPlaying;ca.paused[E]=B.onPlayerPaused;ca.buffering[E]=B.onPlayerBuffering;ca.cued[E]=B.onPlayerCued;A.onQualityChange[E]=B.onQualityChange;A=A.onErr;A.notFound[E]=B.onErrorNotFound;A.notEmbeddable[E]=B.onErrorNotEmbeddable;A.invalidParameter[E]=
B.onErrorInvalidParameter};p.initPlayer=function(A,B){B.iframed&&p.supportsHTML5()?p.initIframePlayer(A,B):p.initFlashPlayer(A,B)};p.initIframePlayer=function(A,B){if(!p.iframeScriptInited){A=document.createElement("script");A.src="http://www.youtube.com/player_api";var E=document.getElementsByTagName("script")[0];E.parentNode.insertBefore(A,E);p.iframeScriptInited=true}onYouTubePlayerAPIReady=p.iframeReady(B)};p.initFlashPlayer=function(A,B){B.loadSWFObject?g.getScript(B.swfobjectURL,p.initFlashPlayerFN(B)):
p.initFlashPlayerFN(B)()};p.initFlashPlayerFN=function(A){return function(){var B=["//www.youtube.com/v/"];B.push(A.initialVideo);B.push("?fs="+(A.allowFullScreen?1:0));B.push("&enablejsapi=1&version=3");B.push("&playerapiid="+A.playerID);B.push("&rel= "+(A.showRelated?1:0));B.push("&autoplay="+(A.autoPlay?1:0));B.push("&autohide="+(A.autoHide?1:0));B.push("&controls="+(A.showControls?1:0));B.push("&showinfo="+(A.showinfo?1:0));B.push("&modestbranding="+(A.modestbranding?1:0));B.push("&start="+A.start);
B.push("&theme="+A.theme);B.push("&color="+A.color);swfobject.embedSWF(B.join(""),A.playerID,A.width,A.height,"8",null,null,{allowScriptAccess:A.allowScriptAccess,wmode:A.wmode,allowFullScreen:A.allowFullScreen},{id:A.playerID});onYouTubePlayerReady=function(E){var ca=document.getElementById(E);p.ytplayers[E]=ca;ca.addEventListener("onStateChange","$.tubeplayer.defaults.stateChange('"+E+"')");ca.addEventListener("onError","$.tubeplayer.defaults.onError('"+E+"')");ca.addEventListener("onPlaybackQualityChange",
"$.tubeplayer.defaults.qualityChange('"+E+"')");E=g(ca).parents(".jquery-youtube-tubeplayer");g.tubeplayer.defaults.afterReady(E)}}};p.getVideoIDFromURL=function(A){var B=A.indexOf("?");A=A.substring(B,A.length);B=A.indexOf("v=");if(B>-1){var E=A.indexOf("&",B);if(E==-1)E=A.length;return videoParam=A.substring(B+2,E)}return""};var y={cue:z(function(A,B,E){E.ytplayer.cueVideoById(B,E.opts.preferredQuality)}),play:z(function(A,B,E){if(typeof B=="object")E.ytplayer.loadVideoById(B.id,B.time,E.opts.preferredQuality);
else B?E.ytplayer.loadVideoById(B,0,E.opts.preferredQuality):E.ytplayer.playVideo();E.opts.onPlay(B)}),pause:z(function(A,B,E){E.ytplayer.pauseVideo();E.opts.onPause()}),stop:z(function(A,B,E){E.ytplayer.stopVideo();E.opts.onStop()}),seek:z(function(A,B,E){E.ytplayer.seekTo(B,true);E.opts.onSeek(B)}),mute:z(function(A,B,E){E.$player.attr("data-prev-mute-volume",E.ytplayer.getVolume());E.ytplayer.mute();E.opts.onMute()}),unmute:z(function(A,B,E){E.ytplayer.unMute();E.ytplayer.setVolume(E.$player.attr("data-prev-mute-volume")||
50);E.opts.onUnMute()}),isMuted:z(function(A,B,E){return E.ytplayer.isMuted()}),volume:z(function(A,B,E){if(B){E.ytplayer.setVolume(B);E.$player.attr("data-prev-mute-volume",E.ytplayer.getVolume())}else return E.ytplayer.getVolume()||0}),quality:z(function(A,B,E){if(B)E.ytplayer.setPlaybackQuality(B);else return E.ytplayer.getPlaybackQuality()}),data:z(function(A,B,E){A={};E=E.ytplayer;A.bytesLoaded=E.getVideoBytesLoaded();A.bytesTotal=E.getVideoBytesTotal();A.startBytes=E.getVideoStartBytes();A.state=
E.getPlayerState();A.currentTime=E.getCurrentTime();A.availableQualityLevels=E.getAvailableQualityLevels();A.duration=E.getDuration();A.videoURL=E.getVideoUrl();A.getVideoEmbedCode=E.getVideoEmbedCode();A.videoID=p.getVideoIDFromURL(A.videoURL);return A}),videoId:z(function(A,B,E){return p.getVideoIDFromURL(E.ytplayer.getVideoUrl())}),size:z(function(A,B,E){if(B.width&&B.height){E.ytplayer.setSize(B.width,B.height);g(E.ytplayer).css(B)}}),destroy:z(function(A,B,E){E.$player.removeClass("jquery-youtube-tubeplayer").data("opts.tubeplayer",
null).unbind(".tubeplayer").html("");delete p.ytplayers[E.opts.playerID];g(E.ytplayer).remove();return null}),player:z(function(A,B,E){return E.ytplayer})}})(jQuery);jQTubeUtil=function(g){function p(H,c,X){var la={"max-results":c.max||ca,"start-index":c.start||ga};if(c.time)la.time=c.time;H=A(H,la);return y(H,c.callback||X)}function q(H,c){switch(typeof H){case "function":return{callback:H,time:undefined};case "object":var X={max:H.max,start:H["start-index"]};if(c)X.time=H.time;return X;default:return{}}}function z(H,c){H=A(ta,H);return y(H,c)}function y(H,c){var X={};g.ajax({type:"GET",dataType:"json",url:H,success:function(la){if(!(typeof la=="undefined"||
la==null)){var U=[];if(la.feed){var va=la.feed,O=la.feed.entry;for(entry in O)U.push(new fa(O[entry]));X.startIndex=va.openSearch$startIndex.$t;X.itemsPerPage=va.openSearch$itemsPerPage.$t;X.totalResults=va.openSearch$totalResults.$t}else U.push(new fa(la.entry));X.version=la.version;X.searchURL=H;X.videos=U;typeof c=="function"&&c(X)}},error:function(la){throw Exception("couldn't fetch YouTube request : "+H+" : "+la);}});return X}function A(H,c){var X="?",la,U=true,va=g.extend({},c,oa);for(o in va){c=
o;la=va[o];X+=(U?"":"&")+c+"="+la;U=false}return H+X}var B=function(){},E=B.prototype,ca=10,ga=1,ta="http://gdata.youtube.com/feeds/api/videos";MostPopular="http://gdata.youtube.com/feeds/api/standardfeeds/most_popular";MostRecent="http://gdata.youtube.com/feeds/api/standardfeeds/most_recent";TopRated="http://gdata.youtube.com/feeds/api/standardfeeds/top_rated";TopFavs="http://gdata.youtube.com/feeds/api/standardfeeds/top_favorites";RecentlyFeatured="http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured";
SuggestURL="http://suggestqueries.google.com/complete/search";Times=["today","this_week","this_month","all_time"];OrderBy=["relevance","published","viewCount","rating"];Categories=["Film","Autos","Music","Animals","Sports","Travel","Shortmov","Videoblog","Games","Comedy","People","News","Entertainment","Education","Howto","Nonprofit","Tech"];var ba={q:"",orderby:OrderBy[2],time:Times[3],"max-results":ca},oa={key:"",format:5,alt:"json",callback:"?"},W={hl:"en",ds:"yt",client:"youtube",hjson:"t",cp:1};
E.init=function(H){if(!H.key)throw"jQTubeUtil requires a key!";oa.key=H.key;if(H.orderby)ba.orderby=H.orderby;if(H.time)ba.time=H.time;if(H.maxResults)ba["max-results"]=ca=H.maxResults;if(H.lang)W.hl=H.lang};E.getTimes=function(){return Times};E.getOrders=function(){return OrderBy};E.getCategories=function(){return Categories};E.suggest=function(H,c){H={q:encodeURIComponent(H)};var X=A(SuggestURL,g.extend({},W,H));g.ajax({type:"GET",dataType:"json",url:X,success:function(la){var U=[],va={};for(entry in la[1])U.push(la[1][entry][0]);
va.suggestions=U;va.searchURL=X;typeof c=="function"&&c(va)}})};E.search=function(H,c,X){if(typeof H=="string")H={q:encodeURIComponent(H)};X=null!=X?{category:X}:{};return z(g.extend({},ba,H,X),c)};E.video=function(H,c){return y("http://gdata.youtube.com/feeds/api/videos/"+H+"?alt=json",c)};E.related=function(H,c){return y("http://gdata.youtube.com/feeds/api/videos/"+H+"/related?alt=json",c)};E.mostViewed=function(H,c){return p("http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed",q(H,true),
c)};E.mostRecent=function(H,c){return p(MostRecent,q(H,false),c)};E.mostPopular=function(H,c){return p(MostPopular,q(H,true),c)};E.topRated=function(H,c){return p(TopRated,q(H,true),c)};E.topFavs=function(H,c){return p(TopFavs,q(H,true),c)};var fa=function(H){var c=[],X=H.id.$t,la=X.lastIndexOf("/")+1;this.videoId=X.substring(la,X.length);this.entry=H;this.title=H.title.$t;try{this.updated=H.updated.$t}catch(U){c.push("updated")}try{this.thumbs=H.media$group.media$thumbnail}catch(va){c.push("thumbs")}try{this.duration=
H.media$group.yt$duration.seconds}catch(O){c.push("duration")}try{this.favCount=H.yt$statistics.favoriteCount}catch(V){c.push("favCount")}try{this.rating=H.gd$rating}catch(M){alert(M);c.push("rating")}try{this.viewCount=H.yt$statistics.viewCount}catch(ia){c.push("viewCount")}try{this.category=H.media$group.media$category[0].$t}catch(sa){c.push("category")}try{this.categoryLabel=H.media$group.media$category[0].label}catch(ja){c.push("categoryLabel")}try{this.description=H.media$group.media$description.$t}catch(N){c.push("description")}try{this.keywords=
H.media$group.media$keywords.$t}catch(Aa){c.push("keywords")}this.unavailAttributes=c};return new B}(jQuery);(function(g,p){function q(z,y){function A(){return typeof p==="function"&&typeof p.tmpl==="function"}function B(){return typeof _==="function"}function E(n){return n%(parseInt(n)/Number(n))===0}function ca(n,C,I){var Q=ta.getTemplatingEngine(),Z;I=p.extend({},{start:0},I);C=I.end?C.slice(I.start,I.end):C.slice(I.start);if(Q.name==="jQuery")Z=Q.engine(n,C);else if(Q.name==="Underscore"){var ra=Q.engine(n);p.each(C,function(Ha,Ba){Z+=ra(Ba)});Z=Z.replace(/undefined/,"")}else throw new Error("Could not determine engine type.");
return Z}function ga(n,C,I,Q){I=I||{};Q=Q||"";for(var Z in n)if(C||n.hasOwnProperty(Z)){var ra=n[Z];if(ra&&typeof ra==="object"&&!(ra instanceof Date||ra instanceof RegExp))ga(ra,C,I,Q+Z+"_");else I[Q+Z]=ra}return I}var ta=this;ta.getTemplatingEngine=function(){var n,C;if(A()){n="jQuery";C=p.tmpl}else if(B()){n="Underscore";C=_.template}else throw new Error("Either the jQuery template or Underscore template engines must be installed to convert a collection to html");return{name:n,engine:C}};if(!z)throw new Error("You must supply an API key to use the API!");
var ba=this;this.apiKey=z;this.constants={endPoint:"http://developer.echonest.com/api/",endPointVersion:"v4",format:"jsonp"};this.options={};p.extend(this.options,y);this.artist=function(n){return new fa(n)};var oa=function(n){this.data=n;if(this.data.response.status.code!=0)throw new Error(this.data.response.status.message);};oa.prototype.getData=function(){return this.data.response};var W=function(){function n(){return ba.constants.endPoint+ba.constants.endPointVersion+"/"}function C(){return ba.constants.format}
function I(){return ba.apiKey}this.extendedDetails=p.extend.apply(true,arguments);this.settings=function(Q){var Z={format:C(),api_key:I()};p.extend(Z,this.extendedDetails);return{url:n()+Q.endPoint,dataType:"jsonp",type:Q.type,data:Z,cache:true,success:function(ra){Q.success&&Q.success(new oa(ra))}}}};W.prototype.get=function(n,C){p.ajax(this.settings({endPoint:n,success:C,type:"GET"}))};var fa=function(n){this.name=n;this.endPoint="artist/"};fa.prototype.audio=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+
"audio",function(I){n(new H(I.getData()))})};fa.prototype.biographies=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"biographies",function(I){n(new X(I.getData()))})};fa.prototype.blogs=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"blogs",function(I){n(new c(I.getData()))})};fa.prototype.familiarity=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"familiarity",function(I){n(new la(I.getData()))})};fa.prototype.hotttnesss=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+
"hotttnesss",function(I){n(new U(I.getData()))})};fa.prototype.images=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"images",function(I){n(new va(I.getData()))})};fa.prototype.news=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"news",function(I){n(new O(I.getData()))})};fa.prototype.profile=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"profile",function(I){n(new V(I.getData()))})};fa.prototype.reviews=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+
"reviews",function(I){n(new M(I.getData()))})};fa.prototype.search=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"search",function(I){n(new ia(I.getData()))})};fa.prototype.songs=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"songs",function(I){n(new sa(I.getData()))})};fa.prototype.similar=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"similar",function(I){n(new ja(I.getData()))})};fa.prototype.terms=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+
"terms",function(I){n(new N(I.getData()))})};fa.prototype.top_hottt=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"top_hottt",function(I){n(new Aa(I.getData()))})};fa.prototype.top_terms=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"top_terms",function(I){n(new h(I.getData()))})};fa.prototype.urls=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+"urls",function(I){n(new j(I.getData()))})};fa.prototype.video=function(n,C){(new W(C,{name:this.name})).get(this.endPoint+
"video",function(I){n(new w(I.getData()))})};z=function(){};z.prototype.getData=function(){return this.data[this.name]};z.prototype.to_html=function(n,C){return ca(n,this.getData(),C)};y=function(){this.workingWith=null};y.prototype.getData=function(){return this.getWorkingWith()?this.data[this.name][this.getWorkingWith()]:this.data[this.name]};y.prototype.setWorkingWith=function(n){return this.workingWith=n};y.prototype.getWorkingWith=function(){return this.workingWith};y.prototype.start=function(){return parseInt(this.data.start,
10)};y.prototype.total=function(){return parseInt(this.data.total,10)};y.prototype.size=function(){return this.getData().length};y.prototype.to_html=function(n,C){if(this.size()<1)throw new RangeError("Empty collection");return ca(n,this.getData(),C)};y.prototype.at=function(n){E(n)?this.setWorkingWith(n):this.setWorkingWith(null);return this};var H=function(n){this.data=n;this.name="audio"};H.prototype=new y;H.prototype.constructor=H;var c=function(n){this.data=n;this.name="blogs"};c.prototype=new y;
c.prototype.constructor=c;var X=function(n){var C=this;this.data=n;this.name="biographies";p.each(this.data[this.name],function(I,Q){C.data[C.name][I]=ga(Q)})};X.prototype=new y;X.prototype.constructor=X;var la=function(n){this.data=n;this.name="artist"};la.prototype=new z;la.prototype.constructor=la;var U=function(n){this.data=n;this.name="artist"};U.prototype=new z;U.prototype.constructor=U;var va=function(n){this.data=n;this.name="images"};va.prototype=new y;va.prototype.constructor=va;var O=function(n){this.data=
n;this.name="news"};O.prototype=new y;O.prototype.constructor=O;var V=function(n){this.data=n;this.name="artist"};V.prototype=new z;V.prototype.constructor=V;var M=function(n){this.data=n;this.name="reviews"};M.prototype=new y;M.prototype.constructor=M;var ia=function(n){var C=this;this.data=n;this.name="artists";p.each(this.data[this.name],function(I,Q){C.data[C.name][I]=ga(Q)})};ia.prototype=new y;ia.prototype.constructor=ia;var sa=function(n){this.data=n;this.name="songs"};sa.prototype=new y;sa.prototype.constructor=
sa;var ja=function(n){var C=this;this.data=n;this.name="artists";p.each(this.data[this.name],function(I,Q){C.data[C.name][I]=ga(Q)})};ja.prototype=new y;ja.prototype.constructor=ja;var N=function(n){this.data=n;this.name="terms"};N.prototype=new y;N.prototype.constructor=N;var Aa=function(n){this.data=n;this.name="artists"};Aa.prototype=new y;Aa.prototype.constructor=Aa;var h=function(n){this.data=n;this.name="terms"};h.prototype=new y;h.prototype.constructor=h;var j=function(n){this.data=n;this.name=
"urls"};j.prototype=new y;j.prototype.constructor=j;var w=function(n){this.data=n;this.name="video"};w.prototype=new y;w.prototype.constructor=w}g.EchoNest=q})(window,jQuery);LastFM=function(g,p){var q=function(){},z=q.prototype,y={};y.rootURL="http://ws.audioscrobbler.com/";y.version="2.0";var A={};A.api_key=g;A.format="json";z.options={};z.options.search={};z.options.search.limit=10;z.options.search.autocorrect=1;z.search={};z.search.albumTracks=function(H,c,X){H=fa("album.getInfo",{artist:c,album:H,limit:z.options.search.limit,autocorrect:z.options.search.autocorrect});z.search._go(H,function(la){X(new E(la))})};z.search.tracks=function(H,c,X){H=fa("track.search",{track:H,
limit:z.options.search.limit,page:X||1});z.search._go(H,function(la){c(new ca(la))})};var B=function(H){this.name=H.name;this.duration=H.duration;this.artistName=typeof H.artist=="object"?H.artist.name:H.artist;if(H.image)this.thumb=H.image[2]["#text"]},E=function(H){this.tracks=[];if(H=H.album){if(H.releasedate)this.released=H.releasedate;H=H.tracks.track;for(var c=0;c<H.length;c++)this.tracks.push(new B(H[c]))}},ca=function(H){this.tracks=[];this.totalResults=H.totalResults;if((H=H.results)&&H.trackmatches)if(H=
H.trackmatches.track)for(var c=0;c<H.length;c++)this.tracks.push(new B(H[c]))};z.search.topAlbums=function(H,c,X){H=fa("artist.getTopAlbums",{artist:H,limit:z.options.search.limit,page:X||1,autocorrect:z.options.search.autocorrect});z.search._go(H,function(la){c(new ta(la))})};z.search.albums=function(H,c,X){H=fa("album.search",{album:H,limit:z.options.search.limit,page:X||1,autocorrect:z.options.search.autocorrect});z.search._go(H,function(la){c(new ba(la))})};var ga=function(H){this.thumb=H.image[0]["#text"];
this.image=H.image[3]["#text"];this.artist=H.artist;this.artistName=typeof this.artist=="object"?this.artist.name:this.artist;this.name=H.name;this.id=H.id},ta=function(H){this.albums=[];if(H=H.topalbums.album)for(var c=0;c<H.length;c++)this.albums.push(new ga(H[c]))},ba=function(H){this.albums=[];this.totalResults=H.totalResults;if(H=H.results.albummatches.album)for(var c=0;c<H.length;c++)this.albums.push(new ga(H[c]))};z.search.artist=function(H,c,X){H=fa("artist.search",{artist:H,limit:z.options.search.limit,
page:X||1,autocorrect:z.options.search.autocorrect});z.search._go(H,function(la){c(new W(la))})};var oa=function(H){this.thumb=H.image[0]["#text"];this.image=H.image[3]["#text"];this.mbid=H.mbid;this.name=H.name},W=function(H){this.artists=[];this.totalResults=H.totalResults;if(H=H.results.artistmatches.artist)for(var c=0;c<H.length;c++)this.artists.push(new oa(H[c]))};z.search._go=function(H,c){p.ajax({type:"GET",dataType:"jsonp",url:H,success:function(X){c(X)},error:function(){throw"Error performing LastFM search";
}})};var fa=function(H,c){var X=[y.rootURL];X.push(y.version+"/?");X.push("method="+H);H=p.extend({},c,A);for(_key in H){X.push("&");X.push(_key);X.push("=");X.push(encodeURI(H[_key]))}return X.join("")};return new q}("17067e2c7f7c10cfb325f79f4214599d",jQuery);(function(g){function p(ba,oa){var W=g.extend({},ca,ba);return oa.each(function(){var fa=g(this);fa.keyup(z(W));fa.data("opts",W);var H=g("#"+W.containerId);H.find("."+W.itemClass).live("mouseenter",function(){var c=g(this);c.siblings("."+W.itemClass).andSelf().removeClass(W.activeClass);c.addClass(W.activeClass)});H.live("click",function(c){var X=g(c.target);if(X.is("."+W.itemClass)||X.parents("."+W.itemClass).length){X.siblings().removeClass(W.activeClass);X.addClass(W.activeClass);X=X.is("."+W.itemClass)?
X:X.parents("."+W.itemClass);W.doSelect(X,c);q(W,"",true)}});g(window).bind("click",function(){var c=g("#"+W.containerId);c.is(":visible")&&c.hide()});for(x in ta)fa.bind(x,fa,ta[x])})}function q(ba,oa,W){ba=g("#"+ba.containerId);oa&&ba.html(oa);if(W)ba.is(":visible")&&ba.hide().html("");else ba.is(":visible")||ba.show()}function z(ba){return function(oa){var W=g(this).val();W=y(oa,window.event?window.event.keyCode:oa.which,ba,W,"");if(typeof W=="string"&&g.trim(W)==""||W){oa=g.trim(W)=="";q(ba,W,
oa)}else oa.preventDefault()}}function y(ba,oa,W,fa,H){var c=[],X=[],la=g("#"+W.containerId);H=la.find("."+W.activeClass);switch(oa){case 38:case 40:c=oa==38;X=H.siblings("."+W.itemClass);if(X.length==0)X=la.find("."+W.itemClass);fa=H.index("."+W.itemClass);if(fa==-1)fa=0;fa=c?X.get(fa-1):X.get(fa);if(!c&&(fa==undefined||fa==null))fa=X.get(0);c=g(fa);if(c.length){c.addClass(W.activeClass);H.removeClass(W.activeClass)}return false;case 9:case 13:H.length?W.doSelect(H,ba):W.doNativeFormSubmit();return"";
case 27:H.removeClass(W.activeClass);return"";case 16:case 17:case 18:case 19:case 20:case 27:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 45:case 46:case 91:case 144:case 145:return false;default:if(fa.length>W.keyThreshold){H=W.data;if(typeof H=="function")H=W.data(fa,A,W);if(!H)return;for(d in H){la=H[d];ba=la[W.matchAttr].toLowerCase();if(ba.indexOf(fa)==0)c.push(la);else ba.indexOf(fa)>0&&X.push(la)}H=A(W,c,c.length>0);if(c.length<W.maxResults&&X.length>0){fa=W.maxResults-
c.length;if(fa>X.length)fa=X.length;H+=A(W,X.splice(0,fa),c.length==0,false,true)}}else H="";return H}}function A(ba,oa,W,fa,H){var c=[];fa=fa?ba.tmpl[fa]:ba.tmpl[ba.defaultTemplate];for(var X=0;X<oa.length;X++){var la=oa[X];la.activeClass=X==0&&W?ba.activeClass:"";c.push(B(fa,la))}ba=c;if(ba!="")if(H)ba=["<hr/>"].concat(c);return ba.join("")}function B(ba,oa){ba=ba;for(d in oa){var W=oa[d];ba=ba.replace(new RegExp("[%]"+d+"[%]","g"),W)}return ba}var E=function(){},ca={maxResults:10,showDirectMatch:true,
showContainsMatch:true,data:{abbacus:{tis:"ABBA",is:"CUS",a:"S",test:"SSSS"},dinosaur:{tis:"THIS",is:"IS",a:"A",test:"TEST"}},activeClass:"ac-active",itemClass:"ac-item",containerId:"ac-container",tmpl:{"default":"<li class='%activeClass%'>%tis% %is% %a% %test%</li>"},matchAttr:"tis",keyThreshold:2,defaultTemplate:"default",doSelect:function(){},doNativeFormSubmit:function(){}};E.prototype.init=function(){};var ga=0;g.fn.autocomplete=function(ba,oa){var W=g(this);switch(typeof ba){case "object":case "undefined":ga++;
return p(ba,W);case "string":return W.triggerHandler(ba,oa);default:return W}};var ta={update:function(ba,oa){(ba=g(ba.data).data("opts"))&&q(ba,oa,g.trim(oa)=="")},autobox:function(ba){ba=g(ba.data);return g("#"+ba.data("opts").containerId)},destroy:function(){g(this).unbind("keyup")}};TT.extend("autocomplete",new E)})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(g,p,q,z,y){return jQuery.easing[jQuery.easing.def](g,p,q,z,y)},easeInQuad:function(g,p,q,z,y){return z*(p/=y)*p+q},easeOutQuad:function(g,p,q,z,y){return-z*(p/=y)*(p-2)+q},easeInOutQuad:function(g,p,q,z,y){if((p/=y/2)<1)return z/2*p*p+q;return-z/2*(--p*(p-2)-1)+q},easeInCubic:function(g,p,q,z,y){return z*(p/=y)*p*p+q},easeOutCubic:function(g,p,q,z,y){return z*((p=p/y-1)*p*p+1)+q},easeInOutCubic:function(g,p,q,z,y){if((p/=y/2)<1)return z/
2*p*p*p+q;return z/2*((p-=2)*p*p+2)+q},easeInQuart:function(g,p,q,z,y){return z*(p/=y)*p*p*p+q},easeOutQuart:function(g,p,q,z,y){return-z*((p=p/y-1)*p*p*p-1)+q},easeInOutQuart:function(g,p,q,z,y){if((p/=y/2)<1)return z/2*p*p*p*p+q;return-z/2*((p-=2)*p*p*p-2)+q},easeInQuint:function(g,p,q,z,y){return z*(p/=y)*p*p*p*p+q},easeOutQuint:function(g,p,q,z,y){return z*((p=p/y-1)*p*p*p*p+1)+q},easeInOutQuint:function(g,p,q,z,y){if((p/=y/2)<1)return z/2*p*p*p*p*p+q;return z/2*((p-=2)*p*p*p*p+2)+q},easeInSine:function(g,
p,q,z,y){return-z*Math.cos(p/y*(Math.PI/2))+z+q},easeOutSine:function(g,p,q,z,y){return z*Math.sin(p/y*(Math.PI/2))+q},easeInOutSine:function(g,p,q,z,y){return-z/2*(Math.cos(Math.PI*p/y)-1)+q},easeInExpo:function(g,p,q,z,y){return p==0?q:z*Math.pow(2,10*(p/y-1))+q},easeOutExpo:function(g,p,q,z,y){return p==y?q+z:z*(-Math.pow(2,-10*p/y)+1)+q},easeInOutExpo:function(g,p,q,z,y){if(p==0)return q;if(p==y)return q+z;if((p/=y/2)<1)return z/2*Math.pow(2,10*(p-1))+q;return z/2*(-Math.pow(2,-10*--p)+2)+q},
easeInCirc:function(g,p,q,z,y){return-z*(Math.sqrt(1-(p/=y)*p)-1)+q},easeOutCirc:function(g,p,q,z,y){return z*Math.sqrt(1-(p=p/y-1)*p)+q},easeInOutCirc:function(g,p,q,z,y){if((p/=y/2)<1)return-z/2*(Math.sqrt(1-p*p)-1)+q;return z/2*(Math.sqrt(1-(p-=2)*p)+1)+q},easeInElastic:function(g,p,q,z,y){g=1.70158;var A=0,B=z;if(p==0)return q;if((p/=y)==1)return q+z;A||(A=y*0.3);if(B<Math.abs(z)){B=z;g=A/4}else g=A/(2*Math.PI)*Math.asin(z/B);return-(B*Math.pow(2,10*(p-=1))*Math.sin((p*y-g)*2*Math.PI/A))+q},easeOutElastic:function(g,
p,q,z,y){g=1.70158;var A=0,B=z;if(p==0)return q;if((p/=y)==1)return q+z;A||(A=y*0.3);if(B<Math.abs(z)){B=z;g=A/4}else g=A/(2*Math.PI)*Math.asin(z/B);return B*Math.pow(2,-10*p)*Math.sin((p*y-g)*2*Math.PI/A)+z+q},easeInOutElastic:function(g,p,q,z,y){g=1.70158;var A=0,B=z;if(p==0)return q;if((p/=y/2)==2)return q+z;A||(A=y*0.3*1.5);if(B<Math.abs(z)){B=z;g=A/4}else g=A/(2*Math.PI)*Math.asin(z/B);if(p<1)return-0.5*B*Math.pow(2,10*(p-=1))*Math.sin((p*y-g)*2*Math.PI/A)+q;return B*Math.pow(2,-10*(p-=1))*Math.sin((p*
y-g)*2*Math.PI/A)*0.5+z+q},easeInBack:function(g,p,q,z,y,A){if(A==undefined)A=1.70158;return z*(p/=y)*p*((A+1)*p-A)+q},easeOutBack:function(g,p,q,z,y,A){if(A==undefined)A=1.70158;return z*((p=p/y-1)*p*((A+1)*p+A)+1)+q},easeInOutBack:function(g,p,q,z,y,A){if(A==undefined)A=1.70158;if((p/=y/2)<1)return z/2*p*p*(((A*=1.525)+1)*p-A)+q;return z/2*((p-=2)*p*(((A*=1.525)+1)*p+A)+2)+q},easeInBounce:function(g,p,q,z,y){return z-jQuery.easing.easeOutBounce(g,y-p,0,z,y)+q},easeOutBounce:function(g,p,q,z,y){return(p/=
y)<1/2.75?z*7.5625*p*p+q:p<2/2.75?z*(7.5625*(p-=1.5/2.75)*p+0.75)+q:p<2.5/2.75?z*(7.5625*(p-=2.25/2.75)*p+0.9375)+q:z*(7.5625*(p-=2.625/2.75)*p+0.984375)+q},easeInOutBounce:function(g,p,q,z,y){if(p<y/2)return jQuery.easing.easeInBounce(g,p*2,0,z,y)*0.5+q;return jQuery.easing.easeOutBounce(g,p*2-y,0,z,y)*0.5+z*0.5+q}});(function(g){function p(y){var A;if(y&&y.constructor==Array&&y.length==3)return y;if(A=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(y))return[parseInt(A[1]),parseInt(A[2]),parseInt(A[3])];if(A=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(y))return[parseFloat(A[1])*2.55,parseFloat(A[2])*2.55,parseFloat(A[3])*2.55];if(A=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(y))return[parseInt(A[1],16),parseInt(A[2],
16),parseInt(A[3],16)];if(A=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(y))return[parseInt(A[1]+A[1],16),parseInt(A[2]+A[2],16),parseInt(A[3]+A[3],16)];return z[g.trim(y).toLowerCase()]}function q(y,A){var B;do{B=g.curCSS(y,A);if(B!=""&&B!="transparent"||g.nodeName(y,"body"))break;A="backgroundColor"}while(y=y.parentNode);return p(B)}g.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(y,A){g.fx.step[A]=function(B){if(B.state==
0){B.start=q(B.elem,A);B.end=p(B.end)}B.elem.style[A]="rgb("+[Math.max(Math.min(parseInt(B.pos*(B.end[0]-B.start[0])+B.start[0]),255),0),Math.max(Math.min(parseInt(B.pos*(B.end[1]-B.start[1])+B.start[1]),255),0),Math.max(Math.min(parseInt(B.pos*(B.end[2]-B.start[2])+B.start[2]),255),0)].join(",")+")"}});var z={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,
100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,
128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(g){function p(h){if(h){h.preventDefault&&h.preventDefault();return h.returnValue=false}}function q(){g("marquee").marquee("marquee").mouseover(function(){g(this).trigger("stop")}).mouseout(function(){g(this).trigger("start")}).mousemove(function(h){if(g(this).data("drag")==true)this.scrollLeft=g(this).data("scrollX")+(g(this).data("x")-h.clientX)}).mousedown(function(h){g(this).data("drag",true).data("x",h.clientX).data("scrollX",this.scrollLeft)}).mouseup(function(){g(this).data("drag",
false)})}var z=function(){},y=z.prototype;y.init=function(){var h=g("body").attr("target");if(h==""||h=="home")y.initHome();else if(h=="station"||h=="video"||h=="beta")y.initStation()};var A={};A.initHomeTabs=function(){if(!this.interval)this.interval=setInterval(function(){var h=g("#tab-selectors li"),j=h.filter(".active"),w=h.index(j)+1;if(w==h.length)w=0;g(h.get(w)).triggerHandler("click");h=g(".js-fb-feed");j=h.filter(":visible");w=h.index(j)+1;if(w==h.length)w=0;j.hide();g(h.get(w)).show()},
3500)};A.clearInterval=function(){if(A.interval){window.clearInterval(A.interval);A.interval=undefined}};y.initHome=function(){N.init();N.getTubeloopRecentActivity();U.init();ga.init();g(".js-tab-selector li").bind("click",function(){var h=g(this);if(!h.hasClass("active")){var j=h.attr("tab");j=g(".js-tab-area").find("[tab='"+j+"']");j.siblings().css("opacity",0);h.siblings().removeClass("active");h.addClass("active");j.animate({opacity:1},650)}});A.initHomeTabs();g("#tabs").bind("mouseenter",function(){A.clearInterval()}).bind("mouseleave",
function(){A.initHomeTabs()})};y.initStation=function(){oa.start();ja.init();N.init();_Echonest.init();ia.init();O.init();M.init();va.init();U.init();X.init();la.init();c.init();H.init();fa.init();ba.init({closeText:"close"});ta.init();ga.init();ca.init();oa.done(1400)};var B={};B.LOOPS_INFO=0;B.init=function(h){!TT.undefined(h)&&h==B.LOOPS_INFO&&g(".edit-loop-info-videos, .library .loops-list").scrollbar()};var E={};E.ok=false;E.init=function(){if(this.ok)return true;var h=window.webkitNotifications;
if(h){h.checkPermission()&&h.requestPermission(function(){E.ok=true});return true}return false};y.notify=function(h,j,w,n){var C=window.webkitNotifications;try{var I=C.createNotification(h,j,w);I.show();setTimeout(function(){I.cancel()},n)}catch(Q){}};y.initNotifications=function(){E.init()};var ca={};ca.isIn=function(h,j){if(h.is("."+j)||h.parents("."+j).length)return true;return false};ca.get=function(h,j){if(h.is("."+j))return h;return h.parents("."+j)};ca.init=function(){g("[draggable='true']").live("dragstart",
function(h){var j=g(this).attr("data-youtube-id");if(!(!j||j=="")){if(window.event){window.event.dataTransfer.effectAllowed="all";window.event.dataTransfer.setData("text",j)}else{h.originalEvent.dataTransfer.effectAllowed="all";h.originalEvent.dataTransfer.setData("text",j)}h=g(this);h.addClass("dragging");ca.isIn(h,"videos-carousel-container")&&h.attr("drag-type","in-carousel");return true}}).live("dragend",function(){var h=g(this);if(ca.isIn(h,"youtube-video-playable"))h=ca.get(h,"youtube-video-playable");
g(".dragging").removeClass("dragging");h.attr("drag-type","");return false}).live("dragenter",function(){g(this);return false});g(".droppable").live("dragover",function(h){h.preventDefault&&h.preventDefault();var j=g(this);if(!(j.hasClass("dragover")||j.closest(".dragover").length)){h=g(h.target);var w=g(".tubeloop-loop.currently-selected");w=w.length&&w.attr("data-loop-owner")=="true";var n=ca.isIn(h,"videos-carousel-container"),C=ca.isIn(h,"tubeloop-loop.currently-selected");if(!(!w&&n))if(!(!w&&
C))if(!(h.is(".tubeloop-loop")&&h.attr("data-loop-owner")=="false"))if(n&&g(".dragging").attr("drag-type")=="in-carousel"){h.is(".youtube-video-playable")||(h=h.parents(".youtube-video-playable"));h.addClass("insert-youtube-video")}else if(g(".dragging").attr("drag-type")=="in-carousel")if(ca.isIn(j,"tubeloop-loop")){j.is(".tubeloop-loop")||(j=j.parents(".tubeloop-loop"));j.attr("data-loop-owner")=="true"&&j.addClass("dragover")}else{if(ca.isIn(j,"new-loop")||ca.isIn(j,"player-drop-zone"))j.addClass("dragover")}else j.addClass("dragover");
if(n)w&&g(".tubeloop-loop.currently-selected").addClass("dragover");else C&&w&&g(".videos-carousel-container").addClass("dragover");return false}}).live("dragleave",function(h){g(this).removeClass("dragover");h=g(h.target);if(ca.isIn(h,"videos-carousel-container"))g(".tubeloop-loop.currently-selected").removeClass("dragover");else ca.isIn(h,"tubeloop-loop.currently-selected")&&g(".videos-carousel-container").removeClass("dragover");g(".insert-youtube-video").removeClass("insert-youtube-video");return false}).live("drop",
function(h){h.stopPropagation&&h.stopPropagation();h=window.event?window.event.dataTransfer.getData("text"):h.originalEvent.dataTransfer.getData("text");var j=g(this);if(ca.isIn(j,"new-loop"))y.loop.add(h,false);else if(ca.isIn(j,"player-drop-zone"))y.play(h);else if(ca.isIn(j,"videos-carousel-container")){g(".revert-draggable").remove();j.is(".youtube-video-playable")||j.parents(".youtube-video-playable");j=-1;var w=g(".insert-youtube-video");if(w.length)j=w.parent().find(".youtube-video-playable").index(w);
j==-1?y.loop.add(h,sa.getActiveLoopHnd()):y.loop.swap(h,sa.getActiveLoopHnd(),j)}else{j=parseInt(j.attr("data-loop-hnd"));y.loop.add(h,j)}g(".dragover").removeClass("dragover");g(".insert-youtube-video").removeClass("insert-youtube-video");return false})};var ga={};ga.init=function(){var h=g(".input-fieldhint");h.bind("focus",function(){var j=g(this);j.attr("data-input-fieldhint")==j.val()&&j.removeClass("active-fieldhint").val("")});h.bind("blur",function(){var j=g(this),w=j.attr("data-input-fieldhint");
j.val()==""&&j.addClass("active-fieldhint").val(w)});h.trigger("blur")};var ta={};ta.init=function(){g(window).bind("unload",function(){var h=g("#player-container"),j=h.tubeplayer("data");if(j.state==1){j=j.currentTime;h=h.tubeplayer("videoId");TT.cookie.set("tubeloop.player",[j,h].join(","))}else TT.cookie.set("tubeloop.player","")})};var ba={};ba.init=function(h){var j=g("#site-dialog");j.remove();j=[];j.push("<div id='site-dialog' style='display:none;'>");j.push("<div id='site-dialog-inner'>");
j.push("<div id='site-dialog-close'>"+h.closeText+"</div>");j.push("<div id='site-dialog-inner-response'></div>");j.push("</div></div>");j=g(j.join(""));g("#site-dialog-close").live("click",function(){ba.hide()});g("body").prepend(j);g("#site-dialog").animate({opacity:1},1E3)};ba.show=function(h){var j=g("#site-dialog");g("#site-dialog-inner-response").html(h);if(!j.hasClass("showing")){j.addClass("showing");g("object").css("visibility","hidden")}};ba.hide=function(){if(g("#site-dialog").hasClass("showing")){g("#site-dialog").removeClass("showing");
g("object").css("visibility","visible")}};y.showDialog=function(h){ba.hide();ba.show(h)};var oa={};oa.start=function(){};oa.done=function(h){setTimeout(function(){g(".website-cover").animate({opacity:"toggle"},1E3,function(){TT.WS.tubeloop2.loadComplete&&TT.WS.tubeloop2.loadComplete();B.init(B.LOOPS_INFO)})},h)};y.cookieInit=function(){var h=TT.cookie.get("tubeloop.player");if(h){var j=h.split(",");h=Math.ceil(parseFloat(j[0]));j=g.trim(j[1]);if(j.length>0){y.play(j,h);W.shiftVideos(j)}}};var W={};
W.shiftVideos=function(h){h=g("#loops-videos-container").find("[data-youtube-id='"+h+"']");if(h.length){var j="-="+h.position().left+"px";h.prevAll("li").addClass("invisible");g("#loops-videos-container").animate({left:j},600)}};var fa={};fa.init=function(){setInterval(function(){ajax.async({url:"ping",success:function(){log.ga.event("tubeloop-beta","session-ping")}})},12E5)};var H={};H.init=function(){g(".theme-selector .theme").click(function(){var h=g(this),j=h.attr("hnd");log.ga.event("tubeloop-beta",
"set-theme",j);ajax.async({url:"user_ses",data:{action:"set_theme",theme:j}});g("html").removeClass(TT.tmp.allThemes).addClass(h.attr("theme"));h.siblings().removeClass("selected-option");h.addClass("selected-option")})};var c={};c.init=function(){g(".facebook-pagination dd").live("click",this.fbCallback);g(".youtube-pagination dd").live("click",this.ytCallback);g(".pagination-next, .pagination-prev").bind("click",function(){var h=g(this),j=h.hasClass("pagination-next");h=h.parents(".pagination-list");
var w=h.find(".active-page"),n=parseInt(w.text());h=h.find("dl dd").filter(function(){if(g(this).text().trim()==g.trim(""+(j?n+1:n-1)))return true;return false});n>0&&h.length&&h.click()})};c.ytCallback=function(h){var j=g(this);c.genericCallback(j,h,".youtube-pagination","#youtube-results .youtube-video-playable",function(w,n,C){if(C.find("[data-page]").filter("[data-page="+n+"]").length==0){w=g("[name=youtube-searches]").find(":selected").text();n=parseInt(j.attr("data-page-id"));M.youtubePage(w,
n,function(I){return function(Q,Z,ra){g("#youtube-results").append(Q);c.buildList(ra,".youtube-pagination-list",I)}}(n));log.ga.event("tubeloop-beta","pagination","youtube",n);C.hide()}})};c.fbCallback=function(h){var j=g(this);c.genericCallback(j,h,".facebook-pagination","#facebook-results .facebook-video",function(w,n,C){w=C.find("[videoId]");w.find(".loaded").length==0&&w.each(function(){var I=g(this).attr("videoId");ja.fetchVideo(I,n)});log.ga.event("tubeloop-beta","pagination","facebook",n);
C.animate({opacity:"toggle"},1E3);C=parseInt(C.siblings().andSelf().filter(":last-child").attr("data-page"));c.buildList(C,".facebook-pagination-list",n)})};c.genericCallback=function(h,j,w,n,C){h=parseInt(h.attr("data-page-id"));if(!isNaN(h)){g(n).hide();j=g(n+"[data-page="+h+"]");C(n,h,j);g(w+" [data-page-id]").removeClass("active-page");g(w+" [data-page-id='"+h+"']").addClass("active-page")}};c.threshold=7;c.buildList=function(h,j,w){var n=g("#pagination-list-item").html(),C=[],I=false;if(h&&h>
0)for(var Q=1;Q<=h;Q++){parseInt(h/2);var Z=parseInt(this.threshold/2),ra=true;if(Q!=h&&Q!=1){if(Q>=w+Z)ra=false;else if(Q<=w-Z)ra=false;if(!ra)if(Q==h-1||Q==2)I=true}Z=ra?"":"never";if(Q==w)Z="active-page";if(I){C.push(TT.mergeTemplate(n,{page:"&hellip;",clz:""}));I=false}C.push(TT.mergeTemplate(n,{page:Q,clz:Z}))}C.length==0?g(j).closest(".pagination-list").addClass("short"):g(j).closest(".pagination-list").removeClass("short");g(j).html(C.join(""))};var X={};X.init=function(){g(".carousel-loops-next, .carousel-loops-prev").bind("click",
this.nextPrev(".tubeloop-loop","#users-loops-list"));g(".carousel-videos-next, .carousel-videos-prev").bind("click",this.nextPrev(".youtube-video-playable","#loops-videos-container"));y.loopCarousel=function(h){if(!TT.tmp.loopCarouselIndex)TT.tmp.loopCarouselIndex=1;var j=g("#user-loop-carousel li"),w;if(h>0){if(TT.tmp.loopCarouselIndex<j.length){w="-=";TT.tmp.loopCarouselIndex+=1}}else if(TT.tmp.loopCarouselIndex>1){w="+=";TT.tmp.loopCarouselIndex-=1}if(w){h=g(j.get(TT.tmp.loopCarouselIndex-1)).outerWidth();
g("#user-loop-carousel").animate({left:w+h+"px"},400)}};g(".music-search-carousel-wrapper").find(".prev,.next").bind("click",function(){var h=g(this);if(!h.hasClass("inactive")){var j=h.parents(".music-search-carousel-wrapper"),w=j.find(".music-search-carousel"),n=w.find(".js-carousel-element"),C=g(n.get(0)).outerWidth(true),I=h.hasClass("next");h=C;if(I){h="-="+C;j.find(".prev").removeClass("inactive");var Q=n.length-1;I=Q*n.outerWidth(true);n=parseInt(g(n[Q]).css("left"));Math.abs(n)+C==I&&j.find(".next").addClass("inactive")}else{h=
"+="+C;j.find(".next").removeClass("inactive");n=parseInt(g(n[0]).css("left"))+C;n==0&&j.find(".prev").addClass("inactive")}w.find(".js-carousel-element").animate({left:h},400,function(){})}})};X.isShifting=false;X.nextPrev=function(h,j){return function(){if(!X.isShifting){X.isShifting=true;var w=g(this).hasClass("carousel-next"),n=g(".carousel-container").find(h),C;if(w){n=n.not(".invisible");C=g(n.get(0))}else{n=n.filter(".invisible");C=g(n.get(n.length-1))}n=C.outerWidth(true);w||C.removeClass("invisible");
var I=g(j),Q=Math.abs(parseInt(I.css("left"))),Z=0;I.find(h).each(function(){Z+=g(this).outerWidth(true)});Q>Z+1||I.animate({left:(w?"-=":"+=")+n},200,function(){w&&C.addClass("invisible");X.isShifting=false})}}};var la={};la.init=function(){g(document).bind("keydown",function(h){var j=window.event?window.event.keyCode:h.which,w=g("#player-container");if(!g(h.target).is("input")){if(j==38||j==40||j==32||j==27||j==77||j==37||j==39||j==76)log.ga.event("tubeloop-beta","keyboard",j);switch(j){case 38:case 40:var n=
w.tubeplayer("volume");if(j==40){if(n>0)n-=10;if(n<=0){n=0;w.tubeplayer("mute")}}else if(j==38){if(n<100)n+=10;if(n>100)n=100}w.tubeplayer("volume",n);return p(h);case 32:w.tubeplayer("data").state==1?w.tubeplayer("pause"):w.tubeplayer("play");return p(h);case 27:if(g("#site-dialog").hasClass("showing"))g("#site-dialog-close").click();else w.tubeplayer("isMuted")?w.tubeplayer("unmute"):w.tubeplayer("mute");return p(h);case 77:g(".player-controls").find(".expand-collapse-toggle:visible").click();return p(h);
case 37:y.loop.playPrevVideo();break;case 39:y.loop.playNextVideo();break;case 76:g(".library-tab").triggerHandler("click");return p(h);default:return}}})};var U={};U.init=function(){var h=jQuery("#search-type-options"),j=jQuery("#search-input-text");j.autocomplete({maxResults:8,doNativeFormSubmit:function(){y.search()},doSelect:function(w,n){var C="youtube";if(w.attr("data-friend-id")!=null)C="facebook";window.scrollTo(0,0);switch(C){case "youtube":j.val(w.text());j.removeAttr("fbHnd");y.search();
TT.cancelBubble(n);log.ga.event("tubeloop-beta","autocomplete","youtube");return;case "facebook":n=w.attr("data-friend-id");j.val(w.find(".name").text());j.attr("fbHnd",n);N.userPosts(n);log.ga.event("tubeloop-beta","autocomplete","facebook");return;default:return}},data:function(w,n,C){var I={};switch(h.val()){case "youtube":jQTubeUtil.suggest(w,function(Q){var Z=Q.suggestions,ra={};Q=[];for(s in Z){var Ha=Z[s];ra[s]=g.extend({},Ha,{name:Ha,searchType:"youtube-autocomplete",type:"youtube"});Q.push(ra[s])}Z=
[];Q=n(C,Q,false,"youtube");if(Q!=""){Z.push("<li class='youtube-suggestions'><h5>YouTube Suggestions:</h5></li>");Z.push(Q)}Q=j.autocomplete("autobox").find(".facebook-friend, hr");Q=g("<div></div>").append(Q.clone()).html();g.trim(Q)!=""&&Q!=null&&Z.push("<li class='facebook-suggestions'><h5>Facebook Suggestions:</h5></li>"+Q);j.autocomplete("update",Z.join(""));j.autocomplete("autobox").find(".ac-item").removeClass("ac-active")});case "artists":case "facebook":if(w=TT.WS.tubeloop2.getFriends())for(z in w)I[z]=
jQuery.extend({},w[z],{id:z,searchType:"facebook-friend",type:"facebook"});return I;default:return I}},matchAttr:"name",keyThreshold:1,defaultTemplate:"facebook",tmpl:{facebook:"<li class='ac-item %searchType% %activeClass% %type%' data-friend-id='%id%'> <img src='%pic%'> <span class='name'>%name%</span></li>",youtube:"<li class='ac-item %searchType% %activeClass% %type%' data-search-title='%name%'>%name%</li>"}})};var va={};va.init=function(){var h=g(".alert");if(h.hasClass("success")||h.hasClass("error")||
h.hasClass("warning"))setTimeout(function(){h.animate({opacity:"toggle",height:"toggle"},600).html("")},3E3)};va.success=function(h){h=g("<div class='alert success'>"+h+"</div>");g("#alert-div").append(h);va.init()};va.note=function(h){h="<div class='alert success'>"+h+"</div>";g("#alert-div").html(h);va.init()};var O={};O.loop={};O.loop.edit=function(h){var j=g("#edit-loop-html").html(),w=h.attr("data-loop-hnd"),n=h.find(".loop-title").text();h={title:n,hnd:w,shareLink:function(C){return"http://www.tubeloop.com/station?loop="+
C.attr("data-loop-hnd")}(h),created:g(h.find(".created")[0]).text(),duration:g(h.find(".duration")[0]).text(),author:N.getUserName()};j=TT.mergeTemplate(j,h);g("#library-loop-header").text(n.toUpperCase());n=g(".loops-list").find("[data-loop-hnd]");n.removeClass("active");n.filter("[data-loop-hnd='"+w+"']").addClass("active");g("#users-library").html(j);g("#bottom-fixed-trays").addClass("open");n=g("#loop-action-links");j=g("#action-links-html").html();j=TT.mergeTemplate(j,h);n.html(j);ajax.async({url:"user_ses",
data:{action:"edit_loop_videos",hnd:w},success:function(C){var I=g(".edit-loop-info-videos");I.html(C);B.init(B.LOOPS_INFO);FB.XFBML.parse(I[0])}})};O.loop.remove=function(h){if(confirm("Are you sure you want to delete this loop?")){json.send({url:"user_ses",data:{action:"remove_loop",hnd:h.attr("data-loop-hnd")},success:function(j){j.loop&&j.loop.removed=="true"&&h.animate({opacity:"toggle"},800,function(){g(this).remove();j.loop.wasActive=="true"&&O.videosContainerCollapse(h)})}});log.ga.event("tubeloop-beta",
"loop","remove-success")}else log.ga.event("tubeloop-beta","loop","remove-cancel")};O.videosContainerCollapse=function(h){var j=g(".loops-videos-container");if(j.is(":visible")){j.slideToggle(200);if(h.hasClass("currently-selected")){ajax.async({url:"user_ses",data:{action:"remove_last_loaded"}});j.attr("data-loop-hnd","");h.removeClass("currently-selected");return true}}return false};O.init=function(){g(".results-tab-header dd").bind("click",function(){var j=g(this);if(!j.hasClass("active")){j.siblings().andSelf().removeClass("active");
j.addClass("active");var w=j.parent("dl"),n=[];w.length&&w.find("dd").each(function(){var C=g(this).attr("type");n.push("[type='"+C+"']")});w=g(".results-videos");if(n.length)w=w.filter(function(){for(var C=g(this),I=0;I<n.length;I++)if(C.is(n[I]))return true;return false});j=j.attr("type");w.hide();w.filter("[type='"+j+"']").animate({opacity:"1",height:"100%"},200);log.ga.event("tubeloop-beta","results-tab",j)}});g(".tubeloop-loop").live("click",function(j){var w=g(this);j=g(j.target);if(j.is(".settings")||
j.parents(".settings").length)if(j.is(".edit-loop"))return O.loop.edit(w);else if(j.is(".remove-loop"))return O.loop.remove(w);var n=w.attr("data-loop-hnd");if(!O.videosContainerCollapse(w)){var C=g(".loops-videos-container");M.loop(n,function(){C.slideToggle(1E3);C.attr("data-loop-hnd",n);g(".loops-videos-list").animate({left:"0px"},250)});w.siblings().removeClass("currently-selected");w.addClass("currently-selected")}});var h=function(j){return function(){if(j){var w=g(this).attr("artist");if(TT.undefined(w)||
w==""){w=prompt("Please enter an artist:");if(!w)return}var n=w+" auto"}else{n=prompt("Give your loop a title:","");if(!n){TT.WS.tubeloop2.loop.addCancelled=true;log.ga.event("tubeloop-beta","new-loop","bail");return}}json.send({url:"user_ses",data:{action:"new_loop",title:n,isAuto:j||"",artist:w||""},success:function(C){var I=TT.mergeTemplate(g("#new-loop-html").html(),{title:n||"New Loop",hnd:C.loop.hnd,numVideos:j?C.loop.size:0,duration:j?C.loop.duration:0,durationStr:j?C.loop.durationStr:"0:00"});
log.ga.event("tubeloop-beta","new-loop","success");I=g(I);I.prependTo(g("#users-loops-list"));I.click();I=g(".loops-videos-list");I.attr("data-loop-hnd",C.loop.hnd).animate({left:"0px"},250);j||I.html(g("#empty-videos-container").html());g("#users-loops-list").animate({left:"10px"},300)}})}};g(".new-loop").click(h(false));g(".new-auto-loop").click(h(true));g("#facebook-share-button").bind("click",function(){var j=g("#player-container").tubeplayer("data").videoURL,w=g("#player-container").tubeplayer("videoId"),
n=g("[data-youtube-id='"+w+"']");if(n.length==0)n=g("#player-active-video-container");j={_id:w,_name:g(n.find(".title")[0]).text(),_url:j,_thumb:n.find("img").attr("src"),_desc:g(n.find(".description")[0]).text(),_dur:g(n.find(".duration")[0]).text()};log.ga.event("tubeloop-beta","facebook-share-video");N.shareMessage(j)});g("[name=youtube-searches]").bind("change",function(){var j=g(this).find(":selected").text();g("[name=search-input]").val(j);g("[name=search-type]").find("[value=youtube]").attr("selected",
"selected");log.ga.event("tubeloop-beta","youtube-historical");y.search()});g(".bottom-list").bind("click",function(){window.scrollTo(0,0)});g(".keymap-button-container").click(function(){});g(".facebook-friend-loops").live("click",function(){var j=g(this);if(j.hasClass("current-user")){j.siblings().andSelf().removeClass("current-user").show();g("#tubeloop-users-loops").hide()}else{var w=j.attr("data-friend-id");ajax.async({url:"tube_loops_inline",data:{hnd:w},success:function(n){log.ga.event("tubeloop-beta",
"friend-tubeloops",w);j.siblings().andSelf().hide().removeClass("current-user");g("#tubeloop-users-loops").html(n).show();window.scrollTo(0,0);j.addClass("current-user").show()}})}});g(".facebook-share-with-friends").live("click",function(){FB.ui({method:"apprequests",message:"Check TubeLoop out; You can rediscover YouTube videos you've posted and can share YouTube playlists quickly and easily!",title:"Share TubeLoop with Your Friends!"})});g("#search-sort .inner").bind("click",function(){var j=g(this);
if(!j.hasClass("active")){j.siblings().andSelf().removeClass("active");j.addClass("active");j.attr("type");j=g("#search-input-text");j.val()!=j.attr("data-input-fieldhint")&&!j.val()==""&&y.search()}});g("#facebook-search-selection .inner").bind("click",function(){var j=g(this);if(!j.hasClass("active")){j.siblings().andSelf().removeClass("active");j.addClass("active");var w=j.attr("type");j=g("[name='facebook-searches']");w=j.find("[value='"+w+"']");if(w.attr("selected")!="selected"){w.attr("selected",
"selected");j.triggerHandler("change")}}});g("#tubeloops-sort .inner").bind("click",function(){var j=g(this);if(!j.hasClass("active")){j.siblings().andSelf().removeClass("active");j.addClass("active");j=j.attr("type");ajax.async({url:"tubeloop_loops",data:{type:j},success:function(w){g("#tubeloop-loops-container").html(w)}})}});g("[name='show-related-videos']").bind("click",function(){g(this).is(":checked")?g("#related-videos .youtube-video-playable").show():g("#related-videos .youtube-video-playable").hide()});
g("#fav-playlist").bind("click",function(){var j=sa.getActiveLoopHnd(),w=g(this).hasClass("selected");log.ga.event("user-fav-loop",j,w);ajax.async({url:"user_ses",data:{action:"fav_loop",loopHnd:j,isFav:w},success:function(n){n=eval("("+n+")");n.fav&&g("#favorites-container").html(n.fav.fav_html)}})});g("#quality-change-button").bind("click",function(){var j=g(this),w=j.hasClass("selected")?"low":"high";j.toggleClass("selected");y.setPlayerQuality(w);log.ga.event("player-controls","quality-change",
w)});g("#music-search-autocomplete").bind("keyup",function(j){switch(window.event?window.event.keyCode:j.which){case 38:case 40:case 9:case 27:case 16:case 17:case 18:case 19:case 20:case 27:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 45:case 46:case 91:case 144:case 145:return}var w=g(this).val();if(!(w.length<2)){window.location.hash="explore/"+w;TT.undefined(V.currentSearch)||clearTimeout(V.currentSearch);V.currentSearch=setTimeout(function(){V.doSearch(w)},600)}});g("#library-loop-header").live("click",
function(){if(g("#users-library").find("[data-loop-hnd]").length!=0){var j=g(this);if(!j.find("input").length){var w=j.text(),n=g("<input type='text' />");n.val(w);n.bind("blur",function(){var C=g(this).val(),I=g("#users-library").find("[data-loop-hnd]").attr("data-loop-hnd");TT.undefined(I)||I==""||y.updateLoop(I,C)});j.html(n);n.focus()}}})};var V={};V.currentSearch=null;V.doInsert=function(h,j,w){g("#music-search-data-"+w).html(h.join(""));g(g(".music-search-carousel-wrapper")[j]).find(".prev").addClass("inactive");
g(g(".music-search-carousel-wrapper")[j]).find(".next").removeClass("inactive");clearTimeout(V.currentSearch)};V.doSearch=function(h){log.ga.event("music-search",h);LastFM.search.artist(h,function(j){var w=g("#music-search-artists-tmpl").html(),n=[];for(a in j.artists){var C=j.artists[a];if(!C.image||C.image=="")C.image="/images/tubeloop/artist.png";n.push(TT.mergeTemplate(w,C))}g("#music-search-total-results-count").text(j.totalResults);V.doInsert(n,1,"artists")});LastFM.search.albums(h,function(j){var w=
g("#music-search-albums-tmpl").html(),n=[];for(a in j.albums){var C=j.albums[a];if(!C.image||C.image=="")C.image="/images/tubeloop/album.png";n.push(TT.mergeTemplate(w,C))}g("#music-search-total-results-count").text(j.totalResults);V.doInsert(n,2,"albums")});LastFM.search.tracks(h,function(j){var w=g("#music-search-tracks-tmpl").html(),n=[];for(t in j.tracks){var C=j.tracks[t];if(!C.thumb||C.thumb=="")C.thumb="/images/tubeloop/track.png";n.push(TT.mergeTemplate(w,C))}g("#music-search-total-results-count").text(j.totalResults);
V.doInsert(n,3,"songs")})};y.searchAndPlay=function(h){M.youtubePage({query:h,maxResults:1},1,function(j){g("#player-active-video-container").html(j);j=g("#player-active-video-container").find(".youtube-video-playable").attr("data-youtube-id");y.play(j);log.ga.event("song-youtube-map",h,j)})};y.getTracks=function(h,j,w){var n=[],C=g(h);if(C.hasClass("active")){C.siblings().removeClass("faded");C.removeClass("active")}else{C.siblings().addClass("faded");C.removeClass("faded").addClass("active")}if(w){log.ga.event("music-search-album",
j,w);LastFM.search.albumTracks(j,w,function(I){var Q=g("#music-search-tracks-tmpl").html();for(a in I.tracks){var Z=I.tracks[a];Z.thumb=C.find("img").attr("src");n.push(TT.mergeTemplate(Q,Z))}V.doInsert(n,2,"songs")})}else{log.ga.event("music-search-top-albums",j);LastFM.search.topAlbums(j,function(I){var Q=g("#music-search-albums-tmpl").html();for(a in I.albums){var Z=I.albums[a];if(!Z.image||Z.thumb=="")Z.image="/images/tubeloop/album.png";n.push(TT.mergeTemplate(Q,Z))}V.doInsert(n,1,"albums")})}};
var M={};M.init=function(){this._Hash.init();this._Hash.FB._searchInit()};M._Hash={};M._Hash.getType=function(){var h=window.location.hash.substring(1);if(h.indexOf("youtube")==0)return"youtube";if(h.indexOf("facebook")==0)if(FB.getAuthResponse())return"facebook";if(h.indexOf("discover")==0)return"discover";if(h.indexOf("my-friends")==0)return"my-friends";if(h.indexOf("my-likes")==0)return"my-likes";if(h.indexOf("my-favs")==0)return"my-favs";if(h.indexOf("explore")==0)return"explore"};M._Hash.init=
function(){var h=window.location.hash.substring(1);switch(this.getType()){case "youtube":var j=jQuery("#search-input-text");j.val(decodeURIComponent(h.substring(8)));y.search();return;case "facebook":switch(h.substring(9).split("/")[0]){case "news-feed":M._Hash.FB.search("news-feed",2700);break;case "my-posts":M._Hash.FB.search("my-posts",2700);break;case "friends-posts":M._Hash.FB.search("my-friends",2700);break;case "my-likes":M._Hash.FB.search("my-likes",2700);break;default:M._Hash.FB.search("my-posts",
2700);return}return;case "my-friends":setTimeout(function(){g(".results-tab-header .my-friends").click()},2100);return;case "discover":g(".results-tab-header .discovery").click();return;case "my-favs":g(".results-tab-header .my-favs").click();return;case "explore":g(".results-tab-header .music-search").click();j=h.substring(8);V.doSearch(j);return;default:if(window.location.href.indexOf("/video?")>-1){M.showYouTubeTab();setTimeout(function(){var w=window.location.search.substring(1);w=w.substring(w.indexOf("v=")+
2,w.length);g.tubeplayer.defaults.afterReady=function(){TT.WS.tubeloop2.play(w)}},2700);return}else if(N.cache.user){g("[name='facebook-searches']");M._Hash.FB.search("my-posts",2E3)}return}};M._Hash.FB={};M._Hash.FB._searchInit=function(){g("[name='facebook-searches']").bind("change",function(){switch(g(this).find(":selected").val()){case "news-feed":N.newsFeed();return;case "my-posts":N.userPosts(FB.getAuthResponse().userID);return;case "my-friends":var h=window.location.hash.substring(24);N.userPosts(h);
return;case "my-likes":N.myLikes();return;default:return}})};M._Hash.FB.search=function(h,j){setTimeout(function(){N.setSearchType(h,true)},j)};y.loadLoop=function(h,j,w){j&&g("#site-dialog-close").click();if(j==false||w){w=g(".tubeloop-loop[data-loop-hnd="+h+"]");if(w.length){w.click();return}}M.loop(h,function(){var n=g(".loops-videos-container");if(!n.is(":visible")){n.slideToggle(1E3);n.attr("data-loop-hnd",h);g(".loops-videos-list").animate({left:"10px"},250);n=g(".tubeloop-loop[data-loop-hnd="+
h+"]");if(n.length){var C=n.position().left;n.prevAll().addClass("invisible");g("#users-loops-list").animate({left:"-"+C+"px"},250);n.addClass("currently-selected")}}},j);log.ga.event("tubeloop-beta","tubeloop","load")};y.updateLoop=function(h,j){var w=g(".edit-loop-error"),n=g(".edit-loop-success");if(j==""||g.trim(j)==""){w.text("Gotta have something.");n.text("")}else json.send({url:"user_ses",data:{action:"loop_update",hnd:h,title:j},success:function(C){C=C.update;if(C.status)if(C.status=="error"){w.text(C.reason);
n.text("");log.ga.event("tubeloop-beta","tubeloop-edit","error")}else{g(".tubeloop-loop[data-loop-hnd='"+h+"'], .library .loops-list dd[data-loop-hnd='"+h+"']").find(".loop-title").text(j);g("#library-loop-header").html(j);w.text("");n.text("Title updated!").show();setTimeout(function(){n.fadeOut()},2E3);log.ga.event("tubeloop-beta","tubeloop-edit","success")}else{w.text("Sorry-something went wrong");log.ga.event("tubeloop-beta","tubeloop-edit","error-problem");n.text("")}}});return false};M.loop=
function(h,j,w){json.send({url:"loop_load",data:{hnd:h,beta:true,stub:w||""},complete:function(n){n=eval("("+n.responseText+")");var C=n.loop;C.isFav=="true"?g("#fav-playlist").addClass("selected"):g("#fav-playlist").removeClass("selected");var I=[];for(vid in C.vids)I.push(C.vids[vid]);if(I.length==0){var Q="empty-videos-container";if(C.owner=="true")Q="empty-videos-container-user";I.push(g("#"+Q).html())}C=I.join("");g("#loops-videos-container").html(C);if(w){if(n.loop.stub){C=g(n.loop.stub);C.prependTo(g("#users-loops-list"));
C.siblings().removeClass("currently-selected");C.addClass("currently-selected");g(".loops-videos-list").attr("data-loop-hnd",n.loop.hnd).animate({left:"0px"},250);g("#users-loops-list").animate({left:"10px"},300)}g("#loops-videos-container").find(".youtube-video-playable:first-child .img").triggerHandler("click")}j&&typeof j=="function"&&j()}})};M.youtube=function(h,j){var w=g("#loading-results").html();g("#youtube-results").html(w);M.showYouTubeTab();M.youtubePage(h,j,function(n,C,I){g("#youtube-results").html(n);
g("[name='youtube-searches']").append("<option selected>"+C+"</option>");c.buildList(I,".youtube-pagination-list",1)})};M.showYouTubeTab=function(){g(".results-tab-header").removeClass("active");g(".results-tab-header .youtube").click()};M.sanitizeSearch=function(h){if(h.indexOf("youtube.com/watch?v=")>-1){var j=h.indexOf("youtube.com/watch?v=");h=h.substring(j+20);j=h.indexOf("&");if(j>-1)h=h.substring(0,j);return h}return h};M.getOrderBy=function(){return g("#search-sort").find(".active").attr("type")};
M.youtubePage=function(h,j,w){var n=15,C=false;if(typeof h=="object"){if(h.maxResults)n=h.maxResults;h=h.query;C=true}log.ga.event("youtube","search",h,j);h=M.sanitizeSearch(h);jQTubeUtil.search({q:encodeURIComponent(h),"start-index":(j-1)*n||1,"max-results":n,orderby:M.getOrderBy()},function(I){window.location.hash="youtube/"+h;var Q=undefined,Z=[];Z=M.buildYoutubePageHTML(I);if(!C){g(".results-tab-header .youtube").click();g("#youtube-search-start").html(I.startIndex);Q=I.itemsPerPage+I.startIndex-
1;if(Q>I.totalResults)Q=I.totalResults;g("#youtube-search-num").html(Q);Q=TT.commaSep(I.totalResults);g("#youtube-search-num-results")[0].innerHTML=Q;Q=Math.round(parseInt(I.totalResults*100/I.itemsPerPage)/100);if(Q>20)Q=20;if(isNaN(Q)){Z.push(g("#no-results").html());g(".youtube-results-info").hide()}else g(".youtube-results-info").show()}w(Z.join(""),h,Q)})};M.buildYoutubePageHTML=function(h){var j=[],w=h.startIndex-1,n;for(v in h.videos){var C=h.videos[v];n=Math.floor(w/h.itemsPerPage)+1;n=this.buildYouTubeVideo(C,
n);j.push(n);++w}return j};M.buildYouTubeVideo=function(h,j){return TT.mergeTemplate(g("#youtube-video-result").html(),{title:h.title,duration:TT.duration(h.duration),durationSeconds:h.duration,rating:h.rating?parseInt(h.rating.average*20)+"%":"",id:h.videoId,description:h.description,viewCount:TT.commaSep(h.viewCount),category:h.category,page:j})};M.facebook=function(){};M.artists=function(){};y.search=function(){var h=jQuery("#search-input-text").val();if(h!=""){var j=g("[name=search-type]").find(":selected").val();
window.scrollTo(0,0);switch(j){case "youtube":return M.youtube(h);case "facebook":return M.facebook;default:return}}};y.refreshFacebookSearch=function(){var h=g("#search-input-text").attr("fbHnd");TT.undefined(h)?jQuery("[name=facebook-searches]").triggerHandler("change"):N.userPosts(h);return false};y.searchYouTube=function(h){g("#search-input-text").val(h).removeClass("active-fieldhint");return M.youtube(h)};y.searchArtists=function(h){window.scrollTo(0,0);g("#music-search-autocomplete").val(h).removeClass("active-fieldhint");
return g("#music-search-autocomplete").triggerHandler("keyup")};var ia={};ia.updateComments=function(h,j){var w="",n=g("#fb-likes-fbml").html();w=j?"http://www.tubeloop.com/video?v="+ja.sanitizeId(h):h;if(g("#player-active-video-comments.fb_iframe_widget").attr("href")!=w){h=TT.mergeTemplate(n,{href:w});h=g("#player-active-video-comments").html(h);FB.XFBML.parse(h[0])}};y.setPlayerQuality=function(h){ia.setDesiredQuality(h)};ia.init=function(){g("#player-container").tubeplayer({iframed:false,loadSWFObject:false,
width:560,height:315,onPlay:function(h){if(typeof h=="object")h=h.id;if(h){var j=g(g(".youtube-video-playable[data-youtube-id='"+h+"']")[0]),w=g("<div></div>").append(j.clone()).html();j=j.find(".title").text();g("#player-active-video-title").html("<marquee behavior='scroll' scrollamount='2' scrolldelay='100'>"+j+"</marquee>");q();g("#player-active-video-container").html(w);g("[data-youtube-id]").removeClass("currently-playing");g("[data-youtube-id='"+h+"']").addClass("currently-playing");TT.cookie.set("tubeloop.player",
"")}},onMute:function(){g(".player-control-muted").hide();g(".player-control-unmuted").css("display","inline-block")},onUnMute:function(){g(".player-control-muted").css("display","inline-block");g(".player-control-unmuted").hide()},onPlayerPlaying:function(){g(".pause-control").css("display","inline-block");g(".play-control").hide();ia.updateComments(g("#player-container").tubeplayer("data").videoURL,true);g(".paused").removeClass("paused")},onPlayerPaused:function(){g(".pause-control").hide();g(".play-control").css("display",
"inline-block");g(".youtube-video-playable.currently-playing").addClass("paused")},onPlayerEnded:function(){if(!y.loop.playNextVideo()){var h=sa.getActiveLoopHnd();h>0&&ajax.async({url:"user_ses",data:{action:"watched_loop",loopHnd:h},success:function(){}});h=g("#loop-playlist").hasClass("selected");h&=g(".tubeloop-loop.currently-selected").length>0;if(h){h=Aa.getVideos();Aa.getActiveIndex(h);if(h.length){var j=g(h.get(0)).attr("data-youtube-id");y.play(j);g("#loops-videos-container").animate({left:"10px"},
300);h.removeClass("invisible");return}}g("[data-youtube-id]").removeClass("currently-playing");g("#player-active-video-title").text("");g("#player-active-video-container").html("");ia.updateComments("http://www.tubeloop.com/");g(".youtube-video-playable.paused").removeClass("paused")}},onErrorNotFound:function(){var h=g("#player-container").tubeplayer("videoId");ajax.async({url:"tube-video-error",data:{videoId:h,error:"not-found"}});log.ga.event("youtube","video-error",h);y.loop.playNextVideo()},
onErrorNotEmbeddable:function(){var h=g("#player-container").tubeplayer("videoId");ajax.async({url:"tube-video-error",data:{videoId:h,error:"not-embeddable"}});log.ga.event("youtube","video-error",h);y.loop.playNextVideo()},onErrorInvalidParameter:function(){var h=jQuery("#loops-videos-container").find(".youtube-video-playable:first-child").attr("data-youtube-id");h&&h!=""&&y.play(h)}});g.tubeplayer.defaults.afterReady=function(){g("#player-container").tubeplayer("cue"," ");TT.WS.tubeloop2.cookieInit();
g(window).trigger("resize")};g(window).resize(function(){var h=g("#player-container");if(h.is(":visible")){var j=g(".player-wrapper").outerWidth()-20,w;w=g("#player-expanded-link").is(":visible")?"35px":parseInt(0.5625*j);h.tubeplayer("size",{width:j,height:w})}})};ia.setDesiredQuality=function(h){var j=g("#player-container").data("opts.tubeplayer");switch(h){case "high":val="highres";break;case "low":val="medium";break;default:val="default";break}j.preferredQuality=val;g("#player-container").data("opts.tubeplayer",
j);g("#player-container").tubeplayer("quality",val)};var sa={};sa.getActiveLoopHnd=function(){var h=g(".tubeloop-loop.currently-selected");if(h.length)return parseInt(h.attr("data-loop-hnd"));return-1};var ja={};ja.init=function(){jQTubeUtil.init({key:"AI39si60UmOiyTb4Pg9kSmqg4Vo2RC290YMztfSKl-vE1eoXj6rDZDgZfT5D7QQ6mKWWeRX5Pjr6hy3dT6OOUcBCTmvHja0mgg",orderby:jQTubeUtil.getOrders()[0]})};ja.shortLinkURL="youtu.be/";ja.gdataLinkRegex="/videos/";ja.substr=function(h,j){j=h.indexOf(j)+j.length;var w=
h.indexOf("?",j);if(j<w)return h.substring(j,w);else{w=h.indexOf("&",j);if(j<w)return h.substring(j,w);return h.substring(j)}};ja.sanitizeId=function(h){if(h.indexOf(ja.shortLinkURL)>-1)return ja.substr(h,ja.shortLinkURL);if(h.indexOf(ja.gdataLinkRegex)>-1)return ja.substr(h,ja.gdataLinkRegex);var j=h.indexOf("?")+1;j=j+h.substring(j).indexOf("v=");var w=j+h.substring(j).indexOf("&");if(w<j)w=h.length;return h.substring(j,w).substring(2)};ja.fetchVideo=function(h,j){jQTubeUtil.video(h,ja.handleFetchVideo(h,
j))};ja.fetchVideoByTitle=function(h){jQTubeUtil.search({q:h,"max-results":"1"},ja.handleFetchVideo("AAA"+parseInt(Math.random()*125),1))};ja.handleFetchVideo=function(h,j){return function(w){w=M.buildYouTubeVideo(w.videos[0],j);g(".video-container").filter("[videoId='"+h+"']").addClass("loaded").html(w)}};var N={};N.cache={user:{}};_Echonest={};_Echonest.init=function(){this.util=new EchoNest("N6E4NIOVYMTHNDM8J");TT.nest=this.util};N.init=function(){try{FB.init({apiKey:"a2a61d1a5863970a0c5a4767caec2c83",
appId:"137262982980588",status:true,cookie:true,xfbml:true,oath:true});FB.Event.subscribe("auth.login",function(){window.location.reload()});FB.getLoginStatus(function(j){if(j.status=="connected"){log.ga.event("facebook","login",j.authResponse.userID);g("#facebook-fetch-status").show();FB.api("/me",function(w){if(w){w.verified||log.ga.event("facebook","login","not-verified");N.cache.user[w.id]={name:w.name,type:"user",uid:w.id};N.initFriendsCache()}})}else g("body").attr("signedin")=="true"&&N.logout(function(){window.location.reload()})});
FB.Event.subscribe("auth.logout",function(){window.location.href="/"})}catch(h){}};N.getTubeloopRecentActivity=function(){FB.api({method:"fql.query",query:"SELECT owner_comment, title, summary, url, image_urls FROM link WHERE owner = 151698451510398 LIMIT 6"},function(h){if(h)if(!h.error_code){var j=true,w=g("#links-tmpl").html(),n=[];for(l in h){var C=h[l];C={clz:j?"":"never",owner_comment:C.owner_comment,summary:C.summary,title:C.title,url:C.url,image:C.image_urls.length?C.image_urls[0]:""};j=false;
n.push(TT.mergeTemplate(w,C))}g("#links").html(n.join(""))}})};N.initFriendsCache=function(){FB.api({method:"fql.query",query:"SELECT id, name, pic_square, type FROM profile WHERE id IN (SELECT target_id FROM connection WHERE source_id = me() )"},function(h){if(h){var j,w=0;for(z in h){var n=h[z];j={name:n.name,pic:n.pic_square,type:n.type,uid:n.id};N.cache.user[n.id]=j;w++}log.ga.event("facebook","num-friends",w);g("#facebook-fetch-status").hide()}})};y.getFriends=function(){if(FB)return N.cache.user};
y.getFriendsViaApp=function(){N.getFriendsInApp()};N.friendsInAppInitd=false;N.getFriendsInApp=function(){if(!N.friendsInAppInitd){N.friendsInAppInitd=true;FB.api({method:"friends.getAppUsers"},function(h){try{var j=[],w=g("#facebook-friend-via-app").html(),n=[];for(fId in h)n.push(N.cache.user[parseInt(h[fId])]);var C=n.sort(function(Q,Z){Q=Q.name;Z=Z.name;return Q<Z?-1:Z<Q?1:0});for(_f in C)j.push(TT.mergeTemplate(w,C[_f]));g("#num-friends-on-tubeloop").text(j.length+" ");log.ga.event("facebook",
"users-friends-on-tubeloop",j.length);j.length==0&&j.push("<h1>Get started and Invite Friends Now!</h1>");g("#tubeloop-results").html(j.join(""));g("#tubeloop-results").parents(".loading-frame").removeClass("loading-frame");ajax.async({url:"user_ses",data:{action:"friends_loops",friends:h},success:function(Q){Q=eval("("+Q+")").friends;for(z in Q){var Z=Q[z];g(".num-loops-"+z).text(Z+" loop"+(Z==0||Z>1?"s":""))}}});window.location.hash="my-friends";N.cache.appUsers=h}catch(I){g("#tubeloop-results").html("<h1>No Friends Yet.</h1><h2>Invite them!</h2>")}})}};
N.newsFeed=function(){if(!this.buildingSearch()){var h=new Date;h.setDate(h.getDate()-2);h=parseInt(h.getTime()/1E3);FB.api({method:"fql.query",query:"select post_id, actor_id, message, created_time, attachment.href, comments, likes FROM stream WHERE filter_key='nf' AND ( strpos(attachment.href, 'youtube.com')>=0 OR strpos(attachment.href, 'tubeloop.com')>=0 OR strpos(attachment.href, 'youtu.be')>=0 ) AND updated_time > "+h+" ORDER BY created_time DESC"},function(j){var w=g("#facebook-video-result-feed").html(),
n=[],C=0;for(r in j){var I={},Q=j[r],Z=Math.floor(C*100/N.itemsPerPage/100)+1,ra=N.cache.user[Q.actor_id];I.postBy=ra?ra.name:"";I.postById=ra?Q.actor_id:"";I.postByPic=ra?ra.pic:"";I.created=y.epochDate(Q.created_time);I.message=Q.message;I.likes=Q.likes.count;I.likeUnlikeLink="TT.WS.tubeloop2.likeVideo('"+Q.post_id+"',this)";if(Q.likes.user_likes){I.likes-=1;I.likeClz="user-likes-this";if(I.likes>0)I.likes=" +"+I.likes;if(I.likes==0)I.likes=""}else I.likeClz="";I.comments=Q.comments.count;I.page=
Z;I.xtraClass=Z==1?"":"never";Q=ja.sanitizeId(Q.attachment.href);I.videoId=Q;n.push(TT.mergeTemplate(w,I));Z==1&&ja.fetchVideo(Q,Z);++C}N.showHideResultsInfo(Z,n);log.ga.event("facebook","news-feed-num-videos",n.length);g("#facebook-results").html(n.join(""));window.location.hash="facebook/news-feed";N.updateResultsInfo(n.length,"in your news feed");c.buildList(Z,".facebook-pagination-list",1);N._currentlyBuilding=false;N.setSearchPic(null)})}};y.likeVideo=function(h,j){g(j).hasClass("user-likes-this")||
g.ajax({type:"POST",url:"https://graph.facebook.com/"+h+"/likes",data:{access_token:FB.getAuthResponse().accessToken},success:function(){var w=g(j),n=w.find(".like-count");n.text()=="0"?n.text(""):n.text(" +"+n.text());w.addClass("user-likes-this")}})};N.setSearchType=function(h,j){var w=g("[name='facebook-searches']");g(".results-tab-header .facebook").click();w.find("[value='"+h+"']").attr("selected","selected");var n=g("#facebook-search-selection .inner");n.removeClass("active");n.filter("[type='"+
h+"']").addClass("active");j&&w.trigger("change")};N.updateResultsInfo=function(h,j){g("#facebook-search-numposts").html(h||"");g("#facebook-search-type").html(j||"")};y.epochDate=function(h){h=new Date(parseInt(h+"000"));return TT.WS.tubeloop2.prettyDate(h)};y.prettyDate=function(h){h=h||new Date((h||"").replace(/-/g,"/").replace(/[TZ]/g," "));var j=((new Date).getTime()-h.getTime())/1E3,w=Math.floor(j/86400);if(!(isNaN(w)||w<0)){if(w>=31){h=h.toGMTString().split(" ");return h[0]+" "+h[1]+" "+h[2]+
" "+h[3]}return w==0&&(j<60&&"just now"||j<120&&"1 minute ago"||j<3600&&Math.floor(j/60)+" minutes ago"||j<7200&&"1 hour ago"||j<86400&&Math.floor(j/3600)+" hours ago")||w==1&&"Yesterday"||w<7&&w+" days ago"||w<31&&Math.ceil(w/7)+" weeks ago"}};y.getFriends=function(){return N.cache.user};N.doResponse=function(){};N._currentlyBuilding=false;N.buildingSearch=function(){if(N._currentlyBuilding)return true;N._currentlyBuilding=true;var h=g("#loading-results").html();g(".results-tab-header .facebook").click();
g("#facebook-results").html(h);return false};y.streamPublish=function(h){var j={},w=g(".tubeloop-loop[data-loop-hnd="+h+"]");if(w.length){j.title=w.find(".loop-title").text();j.creator=N.getUserName();j.duration=w.find(".duration").text();j.props={};g("#edit-loop-info-videos tr").each(function(n){j.props[n]=g(this).find(".shortName").text()});j.href="http://www.tubeloop.com/station?loop="+h;j.caption="A YouTube Video Playlist";N.streamPublish(j);log.ga.event("facebook","share-loop",h)}return false};
N.getFriendsInvolvedText="Check out TubeLoop, It's a great way to discover YouTube videos on Facebook, Create and Share playlists instantly!";N.tellFriends=function(){FB.ui({method:"feed",message:this.getFriendsInvolvedText})};N.streamPublish=function(h){FB.ui({method:"stream.publish",message:"Sweet Playlist!",attachment:{name:"'"+h.title+"' looped by "+h.creator+" ("+h.duration+") ",caption:h.caption,properties:h.props,href:h.href,action_links:[{text:"Watch Videos",href:h.href}]}},function(){})};
N.shareMessage=function(h){FB&&FB.ui({method:"feed",name:h._name+" ("+h._dur+") ",link:"http://www.tubeloop.com/video?v="+h._id,source:"http://www.youtube.com/v/"+h._id+"&fs=1?autoplay=1",picture:h._thumb,caption:"YouTube Video via TubeLoop.com",description:h._desc,message:"Check this _________ video out!"},function(j){j&&j.post_id?log.ga.event("facebook","share-video","published"):log.ga.event("facebook","share-video","not-published")})};y.searchFacebookUser=function(h,j){j&&ba.hide();N.userPosts(h)};
y.nudgeFacebookUser=function(h){FB.ui({method:"apprequests",to:h,message:"Hey, I like your style! Create more playlists!",title:"TubeLoop | Nudge User"})};N.showHideResultsInfo=function(h,j){if(isNaN(h)||h==0){h&&j.push(g("#no-results").html());g(".facebook-results-info").hide()}else g(".facebook-results-info").show()};N.itemsPerPage=8;N.queryTemplates={};N.queryTemplates.fromLinkRegex="select link_id, owner, title, summary, image_urls, url, owner_comment, created_time  from link where owner={0} and  ( strpos(url, 'youtube.com')>=0 or strpos(url, 'youtu.be')>=0 or strpos(url, 'tubeloop.com')>=0 ) limit 250";
N.queryTemplates.fromLinkApp="select post_id, actor_id, message, created_time, attachment.href, comments, likes FROM stream WHERE app_id = {1} and source_id = {0}AND ( strpos(attachment.href, 'youtube.com') >= 0 or strpos(attachment.href, 'youtu.be') >= 0 or strpos(attachment.href, 'tubeloop.com')>=0 )  ORDER BY created_time DESC";N.queryTemplates.fromLinkLikesRegex="select user_id, object_id from like where object_id in (select link_id from {0})";N.queryTemplates.fromLinkCommentsRegex="select post_fbid, object_id from comment where object_id in (select link_id from {0})";
N.queryTemplates.myLikesRegex="select ";N.showFriends=function(){g("#facebook-results").html(g("#facebook-friends-tmpl").html());g(".facebook-results-info").hide();g(".pagination-list").addClass("short").find("dd").hide();window.location.hash="facebook/friends-posts";N._currentlyBuilding=false};N.userPosts=function(h){if(!this.buildingSearch())if(h){option=h==FB.getAuthResponse.userID?"my-posts":"my-friends";N.setSearchType(option);var j=FB.Data.query(this.queryTemplates.fromLinkRegex,h),w=FB.Data.query(this.queryTemplates.fromLinkApp,
h,137262982980588),n=FB.Data.query(this.queryTemplates.fromLinkLikesRegex,j),C=FB.Data.query(this.queryTemplates.fromLinkCommentsRegex,j);FB.Data.waitOn([j,w,n,C],function(){var I=j.value,Q=w.value,Z=n.value,ra=C.value,Ha=[];for(av in Q){var Ba=Q[av],Ia=true,Ga={};Ga.title=Ba.message;Ga.owner_comment=Ba.message;Ga.url=Ba.attachment.href;Ga.created_time=Ba.created_time;Ga.owner=h;Ga.likes=Ba.likes.count;Ga.can_like=!Ba.likes.user_likes;if(!Ga.can_like)Ga.likeClz="user-likes-this";Ga.post_id=Ba.post_id;
Ga.comments=Ba.comments.count;if(Ga.url.indexOf("tubeloop.com")>-1)if(Ga.url.indexOf("v=")==-1)Ia=false;Ia&&Ha.push(Ga)}Q=function(Oa,ma,J,P){var da=0;if(Oa&&Oa.length)for(var ha=0;ha<Oa.length;ha++){var ka=Oa[ha];if(ka[J]==ma){da++;if(!TT.undefined(P)&&!TT.undefined(ka.user_id)){P.can_like=ka.user_id!=FB.getAuthResponse().userID;P.likeClz=P.user_likes?"user-likes-this":""}}}return da};for(rv in I){Ba=I[rv];Ba.likes=Q(Z,Ba.link_id,"object_id",Ba);Ba.post_id=FB.getAuthResponse().userID+"_"+Ba.link_id;
Ba.comments=Q(ra,Ba.link_id,"object_id")}I=N.joinVidsByCreated(Ha,I);N.buildVideoCallback(h,I);N.setSearchPic(h)})}else N.showFriends()};N.setSearchPic=function(h){var j=g("#facebook-results-pic");h&&h!=null?j.css("background","url(https://graph.facebook.com/"+h+"/picture)").show():j.hide()};N.myLikes=function(){};N.joinVidsByCreated=function(h,j){var w=[];if(!h)return w;if(!j)return h;h=h.concat(j);h.sort(function(n,C){n=parseInt(n.created_time);C=parseInt(C.created_time);return n<C?1:C<n?-1:0});
return h};N.buildVideoCallback=function(h,j){var w=g("#facebook-video-result-post").html(),n=[],C=0,I,Q;for(r in j){var Z={},ra=j[r];if(ra.url){I=Math.floor(C*100/N.itemsPerPage/100)+1;Q=N.cache.user[ra.owner];Z.postBy=Q.name;Z.postById=Q.uid;Z.message=ra.owner_comment;Z.created=y.epochDate(ra.created_time);Z.videoId=ja.sanitizeId(ra.url);Z.likes=TT.undefined(ra.likes)?"?":ra.likes;if(ra.can_like==false){Z.likes-=1;Z.likeClz="user-likes-this";if(Z.likes>0)Z.likes=" +"+Z.likes;if(Z.likes==0)Z.likes=
""}else Z.likeClz="";Z.likeUnlikeLink="TT.WS.tubeloop2.likeVideo('"+ra.post_id+"', this);";Z.comments=TT.undefined(ra.comments)?"?":ra.comments;Z.page=I;Z.xtraClass=I==1?"":"never";n.push(TT.mergeTemplate(w,Z));I==1&&ja.fetchVideo(Z.videoId,I);++C}}n.length==0&&n.push(g("#no-results").html());N.showHideResultsInfo(I,n);g("#facebook-results").html(n.join(""));log.ga.event("facebook","users-posts-num-videos",n.length);j=h==FB.getAuthResponse().userID;window.location.hash="facebook/"+(!j?"friends-posts/"+
h:"my-posts");N.updateResultsInfo(n.length,j?"On Your Wall":"from "+N.cache.user[h].name);c.buildList(I,".facebook-pagination-list",1);N._currentlyBuilding=false};y.play=function(h,j){var w=g(g(".youtube-video-playable[data-youtube-id='"+h+"']")[0]);if(w.length==0)jQTubeUtil.video(h,function(n){n=M.buildYouTubeVideo(n.videos[0],1);g("<div style='display:none;'></div>").html(n).appendTo("#gutter");y.play(h,j||0)});else{g("#player-container").tubeplayer("play",{id:h,time:j||0});g("[name='show-related-videos']").is(":checked")&&
jQTubeUtil.related(h,function(n){n=M.buildYoutubePageHTML(n);g("#related-videos").html(n.join(""))});E.init()&&y.notify(w.find("img").attr("src"),"Now playing.. ",w.find(".title").text(),6E3)}};N.logout=function(h){ajax.send({url:"logout",success:function(){FB.logout(function(){});h&&typeof h=="function"&&h()}});log.ga.event("tubeloop-beta","logout")};y.loop={};y.loop.edit=function(h){h=g(".tubeloop-loop[data-loop-hnd='"+h+"']");O.loop.edit(h)};y.loop.swap=function(h,j,w){var n=g(g(".loops-videos-container [data-youtube-id='"+
h+"']")[0]),C=g(".loops-videos-container"),I=j;I||(I=C.attr("data-loop-hnd"));g(".tubeloop-loop[data-loop-hnd="+I+"]");I=n.index();if(I!=w){n.insertBefore(g(C.find(".youtube-video-playable").get(w)));ajax.async({url:"user_ses",data:{action:"swap_vids",loopHnd:j,videoId:h,from:I,to:w},success:function(){}})}};y.loop.add=function(h,j){var w=g(g("[data-youtube-id='"+h+"']")[0]),n=g(".loops-videos-container"),C=j;C||(C=n.attr("data-loop-hnd"));var I=g(".tubeloop-loop[data-loop-hnd="+C+"]"),Q=C=="";Q|=
I.hasClass("is-not-owner");Q|=!TT.undefined(j)&&j==false;if(Q){g("#create-new-loop").triggerHandler("click");setTimeout(function(){if(TT.WS.tubeloop2.loop.addCancelled)TT.WS.tubeloop2.loop.addCancelled=false;else y.loop.add(h)},500)}else{ajax.async({url:"user_ses",data:{action:"loop_add",hnd:C,id:h}});g("#loops-videos-container").find(".message-wrapper").remove();n=parseInt(n.attr("data-loop-hnd"));if(!j||j&&j==n)g("#loops-videos-container").append(w.clone());log.ga.event("tubeloop-beta","loop","add");
this.updateLoopInformation(w,I,true)}};y.loop.updateLoopInformation=function(h,j,w){var n=w?"added-video":"removed-video";j.addClass(n);var C=j.find(".duration"),I=parseInt(g(C.filter("[data-dur]")[0]).attr("data-dur"));h=parseInt(h.find(".duration").attr("data-duration-seconds"));if(w)I+=h;else I-=h;C.attr("data-dur",I);C.text(TT.duration(I));C=j.find(".num-videos");I=parseInt(C.text());if(w)I+=1;else I-=1;C.text(I);setTimeout(function(){j.removeClass(n)},1500)};y.loop.remove=function(){};y.loop.removeVideo=
function(h,j){var w=g(".loops-videos-container");j=g(j).parents("[data-youtube-id]");w=w.attr("data-loop-hnd");var n=g(".tubeloop-loop[data-loop-hnd="+w+"]");ajax.async({url:"user_ses",data:{action:"loop_remove_vid",hnd:w,id:h,index:j.siblings().andSelf().index(j)}});log.ga.event("tubeloop-beta","loop","remove");this.updateLoopInformation(j,n,false);j.animate({opacity:"0"},500,function(){g(this).remove()})};y.loop.settings=function(){};y.loop.playNextVideo=function(){return this.playLoopVideo(true)};
y.loop.playPrevVideo=function(){return this.playLoopVideo(false)};var Aa={};Aa.getVideos=function(){return g("#loops-videos-container").find(".youtube-video-playable")};Aa.getActiveIndex=function(h){return h.index(h.filter(".currently-playing"))};y.loop.playLoopVideo=function(h){if(g(".tubeloop-loop.currently-selected").length==0)return false;var j=Aa.getVideos(),w=Aa.getActiveIndex(j),n;if(h){if(w<j.length)n=w+1}else if(w>0)n=w-1;if(n){n=j.get(n);do{if(TT.undefined(n))return false;w=g(n);if(w.length==
0)return false;if(j=w.hasClass("inactive")){n=h?w.next():w.prev();w.addClass("invisible")}g(".carousel-videos-"+(h?"next":"prev")).click()}while(j);g("[data-youtube-id]").removeClass("currently-playing");y.play(g(n).attr("data-youtube-id"));return true}else return false};y.logout=function(){N.logout()};N.getUserName=function(){var h=N.cache.user[FB.getAuthResponse().userID];return h?h.name:""};TT.commaSep=function(h){if(isNaN(h))return"-";h=new String(h);if(h.length<4)return h;return TT.commaSep(h.substring(0,
h.length-3))+","+h.substring(h.length-3,h.length)};TT.duration=function(h){var j=Math.round(h);if(isNaN(j))return"-";var w={min:null,sec:null};if(j>59){w.hours=Math.floor(j/60/60);w.min=w.hours?Math.floor(j/60)%60:Math.floor(j/60);w.sec=j%60;h="";if(w.hours)h+=w.hours+"";if(w.hours)h+=":";h+=(w.hours?w.min>=10?w.min:"0"+w.min:w.min)+"";h+=":";h+=(w.sec>=10?w.sec:"0"+w.sec)+"";return h}else return"0:"+Math.round(h)+""};TT.extend_website("tubeloop2",new z)})(jQuery);(function(g,p){g.fn.scrollbar=function(q){var z=g.extend({},g.fn.scrollbar.defaults,q);return this.each(function(){var y=g(this),A={arrows:z.arrows};z.containerHeight!="auto"&&y.height(z.containerHeight);A.containerHeight=y.height();A.contentHeight=g.fn.scrollbar.contentHeight(y);if(A.contentHeight<=A.containerHeight)return true;(new g.fn.scrollbar.Scrollbar(y,A,z)).buildHtml().initHandle().appendEvents()})};g.fn.scrollbar.defaults={containerHeight:"auto",arrows:true,handleHeight:"auto",handleMinHeight:30,
scrollSpeed:50,scrollStep:20,scrollSpeedArrows:40,scrollStepArrows:3};g.fn.scrollbar.Scrollbar=function(q,z,y){this.container=q;this.props=z;this.opts=y;this.mouse={};this.props.arrows=this.container.hasClass("no-arrows")?false:this.props.arrows};g.fn.scrollbar.Scrollbar.prototype={buildHtml:function(){this.container.children().wrapAll('<div class="scrollbar-pane"/>');this.container.append('<div class="scrollbar-handle-container"><div class="scrollbar-handle"/></div>');this.props.arrows&&this.container.append('<div class="scrollbar-handle-up"/>').append('<div class="scrollbar-handle-down"/>');
var q=this.container.height();this.pane=this.container.find(".scrollbar-pane");this.handle=this.container.find(".scrollbar-handle");this.handleContainer=this.container.find(".scrollbar-handle-container");this.handleArrows=this.container.find(".scrollbar-handle-up, .scrollbar-handle-down");this.handleArrowUp=this.container.find(".scrollbar-handle-up");this.handleArrowDown=this.container.find(".scrollbar-handle-down");this.pane.defaultCss({top:0,left:0});this.handleContainer.defaultCss({right:0});this.handle.defaultCss({top:0,
right:0});this.handleArrows.defaultCss({right:0});this.handleArrowUp.defaultCss({top:0});this.handleArrowDown.defaultCss({bottom:0});this.container.css({position:this.container.css("position")==="absolute"?"absolute":"relative",overflow:"hidden",height:q});this.pane.css({position:"absolute",overflow:"visible",height:"auto"});this.handleContainer.css({position:"absolute",top:this.handleArrowUp.outerHeight(true),height:this.props.containerHeight-(this.container.outerHeight(true)-this.container.height())-
this.handleArrowUp.outerHeight(true)-this.handleArrowDown.outerHeight(true)+"px"});this.handle.css({position:"absolute",cursor:"pointer"});this.handleArrows.css({position:"absolute",cursor:"pointer"});return this},initHandle:function(){this.props.handleContainerHeight=this.handleContainer.height();this.props.contentHeight=this.pane.height();this.props.handleHeight=this.opts.handleHeight=="auto"?Math.max(Math.ceil(this.props.containerHeight*this.props.handleContainerHeight/this.props.contentHeight),
this.opts.handleMinHeight):this.opts.handleHeight;this.handle.height(this.props.handleHeight);this.handle.height(2*this.handle.height()-this.handle.outerHeight(true));this.props.handleTop={min:0,max:this.props.handleContainerHeight-this.props.handleHeight};this.props.handleContentRatio=(this.props.contentHeight-this.props.containerHeight)/(this.props.handleContainerHeight-this.props.handleHeight);this.handle.top=0;return this},appendEvents:function(){this.handle.bind("mousedown.handle",g.proxy(this,
"startOfHandleMove"));this.handleContainer.bind("mousedown.handle",g.proxy(this,"onHandleContainerMousedown"));this.handleContainer.bind("mouseenter.container mouseleave.container",g.proxy(this,"onHandleContainerHover"));this.handleArrows.bind("mousedown.arrows",g.proxy(this,"onArrowsMousedown"));this.container.bind("mousewheel.container",g.proxy(this,"onMouseWheel"));this.container.bind("mouseenter.container mouseleave.container",g.proxy(this,"onContentHover"));this.handle.bind("click.scrollbar",
this.preventClickBubbling);this.handleContainer.bind("click.scrollbar",this.preventClickBubbling);this.handleArrows.bind("click.scrollbar",this.preventClickBubbling);return this},mousePosition:function(q){return q.pageY||q.clientY+(p.documentElement.scrollTop||p.body.scrollTop)||0},startOfHandleMove:function(q){q.preventDefault();q.stopPropagation();this.mouse.start=this.mousePosition(q);this.handle.start=this.handle.top;g(p).bind("mousemove.handle",g.proxy(this,"onHandleMove")).bind("mouseup.handle",
g.proxy(this,"endOfHandleMove"));this.handle.addClass("move");this.handleContainer.addClass("move")},onHandleMove:function(q){q.preventDefault();this.handle.top=this.handle.start+(this.mousePosition(q)-this.mouse.start);this.setHandlePosition();this.setContentPosition()},endOfHandleMove:function(){g(p).unbind(".handle");this.handle.removeClass("move");this.handleContainer.removeClass("move")},setHandlePosition:function(){this.handle.top=this.handle.top>this.props.handleTop.max?this.props.handleTop.max:
this.handle.top;this.handle.top=this.handle.top<this.props.handleTop.min?this.props.handleTop.min:this.handle.top;this.handle[0].style.top=this.handle.top+"px"},setContentPosition:function(){this.pane.top=-1*this.props.handleContentRatio*this.handle.top;this.pane[0].style.top=this.pane.top+"px"},onMouseWheel:function(q,z){this.handle.top-=z;this.setHandlePosition();this.setContentPosition();this.handle.top>this.props.handleTop.min&&this.handle.top<this.props.handleTop.max&&q.preventDefault()},onHandleContainerMousedown:function(q){q.preventDefault();
if(!g(q.target).hasClass("scrollbar-handle-container"))return false;this.handle.direction=this.handle.offset().top<this.mousePosition(q)?1:-1;this.handle.step=this.opts.scrollStep;var z=this;g(p).bind("mouseup.handlecontainer",function(){clearInterval(y);z.handle.unbind("mouseenter.handlecontainer");g(p).unbind("mouseup.handlecontainer")});this.handle.bind("mouseenter.handlecontainer",function(){clearInterval(y)});var y=setInterval(g.proxy(this.moveHandle,this),this.opts.scrollSpeed)},onArrowsMousedown:function(q){q.preventDefault();
this.handle.direction=g(q.target).hasClass("scrollbar-handle-up")?-1:1;this.handle.step=this.opts.scrollStepArrows;g(q.target).addClass("move");var z=setInterval(g.proxy(this.moveHandle,this),this.opts.scrollSpeedArrows);g(p).one("mouseup.arrows",function(){clearInterval(z);g(q.target).removeClass("move")})},moveHandle:function(){this.handle.top=this.handle.direction===1?Math.min(this.handle.top+this.handle.step,this.props.handleTop.max):Math.max(this.handle.top-this.handle.step,this.props.handleTop.min);
this.handle[0].style.top=this.handle.top+"px";this.setContentPosition()},onContentHover:function(q){if(q.type==="mouseenter"){this.container.addClass("hover");this.handleContainer.addClass("hover")}else{this.container.removeClass("hover");this.handleContainer.removeClass("hover")}},onHandleContainerHover:function(q){q.type==="mouseenter"?this.handleArrows.addClass("hover"):this.handleArrows.removeClass("hover")},preventClickBubbling:function(q){q.stopPropagation()}};g.fn.scrollbar.contentHeight=function(q){q.wrapInner("<div/>");
return q.find(":first").css({overflow:"hidden"}).height()};g.fn.defaultCss=function(q){var z={right:"auto",left:"auto",top:"auto",bottom:"auto",position:"static"};return this.each(function(){var y=g(this);for(var A in q)y.css(A)===z[A]&&y.css(A,q[A])})};g.event.special.mousewheel={setup:function(){if(this.addEventListener){this.addEventListener("mousewheel",g.fn.scrollbar.mouseWheelHandler,false);this.addEventListener("DOMMouseScroll",g.fn.scrollbar.mouseWheelHandler,false)}else this.onmousewheel=
g.fn.scrollbar.mouseWheelHandler},teardown:function(){if(this.removeEventListener){this.removeEventListener("mousewheel",g.fn.scrollbar.mouseWheelHandler,false);this.removeEventListener("DOMMouseScroll",g.fn.scrollbar.mouseWheelHandler,false)}else this.onmousewheel=null}};g.fn.extend({mousewheel:function(q){return q?this.bind("mousewheel",q):this.trigger("mousewheel")},unmousewheel:function(q){return this.unbind("mousewheel",q)}});g.fn.scrollbar.mouseWheelHandler=function(q){var z=q||window.event,
y=[].slice.call(arguments,1),A=0,B=0,E=0;q=g.event.fix(z);q.type="mousewheel";if(q.wheelDelta)A=q.wheelDelta/120;if(q.detail)A=-q.detail/3;if(z.axis!==undefined&&z.axis===z.HORIZONTAL_AXIS){E=0;B=-1*A}if(z.wheelDeltaY!==undefined)E=z.wheelDeltaY/120;if(z.wheelDeltaX!==undefined)B=-1*z.wheelDeltaX/120;y.unshift(q,A,B,E);return g.event.handle.apply(this,y)}})(jQuery,document);(function(g){g.fn.marquee=function(p){function q(B,E,ca){var ga=ca.behavior,ta=ca.width,ba=ca.dir,oa=0;return oa=ga=="alternate"?B==1?E[ca.widthAxis]-ta*2:ta:ga=="slide"?B==-1?ba==-1?E[ca.widthAxis]:ta:ba==-1?E[ca.widthAxis]-ta*2:0:B==-1?E[ca.widthAxis]:0}function z(){for(var B=y.length,E=null,ca=null,ga={},ta=[],ba=false;B--;){E=y[B];ca=g(E);ga=ca.data("marqueeState");if(ca.data("paused")!==true){E[ga.axis]+=ga.scrollamount*ga.dir;ba=ga.dir==-1?E[ga.axis]<=q(ga.dir*-1,E,ga):E[ga.axis]>=q(ga.dir*
-1,E,ga);if(ga.behavior=="scroll"&&ga.last==E[ga.axis]||ga.behavior=="alternate"&&ba&&ga.last!=-1||ga.behavior=="slide"&&ba&&ga.last!=-1){if(ga.behavior=="alternate")ga.dir*=-1;ga.last=-1;ca.trigger("stop");ga.loops--;if(ga.loops===0){E[ga.axis]=ga.behavior!="slide"?q(ga.dir,E,ga):q(ga.dir*-1,E,ga);ca.trigger("end")}else{ta.push(E);ca.trigger("start");E[ga.axis]=q(ga.dir,E,ga)}}else ta.push(E);ga.last=E[ga.axis];ca.data("marqueeState",ga)}else ta.push(E)}y=ta;y.length&&setTimeout(z,25)}var y=[],A=
this.length;this.each(function(B){var E=g(this),ca=E.attr("width")||E.width(),ga=E.attr("height")||E.height(),ta=E.after("<div "+(p?'class="'+p+'" ':"")+'style="display: block-inline; width: '+ca+"px; height: "+ga+'px; overflow: hidden;"><div style="float: left; white-space: nowrap;">'+E.html()+"</div></div>").next(),ba=ta.get(0),oa=(E.attr("direction")||"left").toLowerCase(),W={dir:/down|right/.test(oa)?-1:1,axis:/left|right/.test(oa)?"scrollLeft":"scrollTop",widthAxis:/left|right/.test(oa)?"scrollWidth":
"scrollHeight",last:-1,loops:E.attr("loop")||-1,scrollamount:E.attr("scrollamount")||this.scrollAmount||2,behavior:(E.attr("behavior")||"scroll").toLowerCase(),width:/left|right/.test(oa)?ca:ga};if(E.attr("loop")==-1&&W.behavior=="slide")W.loops=1;E.remove();/left|right/.test(oa)?ta.find("> div").css("padding","0 "+ca+"px"):ta.find("> div").css("padding",ga+"px 0");ta.bind("stop",function(){ta.data("paused",true)}).bind("pause",function(){ta.data("paused",true)}).bind("start",function(){ta.data("paused",
false)}).bind("unpause",function(){ta.data("paused",false)}).data("marqueeState",W);y.push(ba);ba[W.axis]=q(W.dir,ba,W);ta.trigger("start");B+1==A&&z()});return g(y)}})(jQuery);

