/*
 * jQuery JavaScript Library v1.4
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://docs.jquery.com/License
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Jan 13 15:23:05 2010 -0500
 */
(function(window,undefined){var jQuery=function(selector,context){return new jQuery.fn.init(selector,context)},_jQuery=window.jQuery,_$=window.$,document=window.document,rootjQuery,quickExpr=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/,rnotwhite=/\S/,rtrim=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,userAgent=navigator.userAgent,browserMatch,readyBound=false,readyList=[],DOMContentLoaded,toString=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,push=Array.prototype.push,slice=Array.prototype.slice,indexOf=Array.prototype.indexOf;jQuery.fn=jQuery.prototype={init:function(selector,context){var match,elem,ret,doc;if(!selector){return this}if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this}if(typeof selector==="string"){match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){doc=(context?context.ownerDocument||context:document);ret=rsingleTag.exec(selector);if(ret){if(jQuery.isPlainObject(context)){selector=[document.createElement(ret[1])];jQuery.fn.attr.call(selector,context,true)}else{selector=[doc.createElement(ret[1])]}}else{ret=buildFragment([match[1]],[doc]);selector=(ret.cacheable?ret.fragment.cloneNode(true):ret.fragment).childNodes}}else{elem=document.getElementById(match[2]);if(elem){if(elem.id!==match[2]){return rootjQuery.find(selector)}this.length=1;this[0]=elem}this.context=document;this.selector=selector;return this}}else{if(!context&&/^\w+$/.test(selector)){this.selector=selector;this.context=document;selector=document.getElementsByTagName(selector)}else{if(!context||context.jquery){return(context||rootjQuery).find(selector)}else{return jQuery(context).find(selector)}}}}else{if(jQuery.isFunction(selector)){return rootjQuery.ready(selector)}}if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context}return jQuery.isArray(selector)?this.setArray(selector):jQuery.makeArray(selector,this)},selector:"",jquery:"1.4",length:0,size:function(){return this.length},toArray:function(){return slice.call(this,0)},get:function(num){return num==null?this.toArray():(num<0?this.slice(num)[0]:this[num])},pushStack:function(elems,name,selector){var ret=jQuery(elems||null);ret.prevObject=this;ret.context=this.context;if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"}}return ret},setArray:function(elems){this.length=0;push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){jQuery.bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{if(readyList){readyList.push(fn)}}return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(slice.apply(this,arguments),"slice",slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},end:function(){return this.prevObject||jQuery(null)},push:push,sort:[].sort,splice:[].splice};jQuery.fn.init.prototype=jQuery.fn;jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options,name,src,copy;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}}if(length===i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){src=target[name];copy=options[name];if(target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||jQuery.isArray(copy))){var clone=src&&(jQuery.isPlainObject(src)||jQuery.isArray(src))?src:jQuery.isArray(copy)?[]:{};target[name]=jQuery.extend(deep,clone,copy)}else{if(copy!==undefined){target[name]=copy}}}}}return target};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isReady:false,ready:function(){if(!jQuery.isReady){if(!document.body){return setTimeout(jQuery.ready,13)}jQuery.isReady=true;if(readyList){var fn,i=0;while((fn=readyList[i++])){fn.call(document,jQuery)}readyList=null}if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready")}}},bindReady:function(){if(readyBound){return}readyBound=true;if(document.readyState==="complete"){return jQuery.ready()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",DOMContentLoaded,false);window.addEventListener("load",jQuery.ready,false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",DOMContentLoaded);window.attachEvent("onload",jQuery.ready);var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel){doScrollCheck()}}}},isFunction:function(obj){return toString.call(obj)==="[object Function]"},isArray:function(obj){return toString.call(obj)==="[object Array]"},isPlainObject:function(obj){if(!obj||toString.call(obj)!=="[object Object]"||obj.nodeType||obj.setInterval){return false}if(obj.constructor&&!hasOwnProperty.call(obj,"constructor")&&!hasOwnProperty.call(obj.constructor.prototype,"isPrototypeOf")){return false}var key;for(key in obj){}return key===undefined||hasOwnProperty.call(obj,key)},isEmptyObject:function(obj){for(var name in obj){return false}return true},noop:function(){},globalEval:function(data){if(data&&rnotwhite.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))}else{script.text=data}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()===name.toUpperCase()},each:function(object,callback,args){var name,i=0,length=object.length,isObj=length===undefined||jQuery.isFunction(object);if(args){if(isObj){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(isObj){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},trim:function(text){return(text||"").replace(rtrim,"")},makeArray:function(array,results){var ret=results||[];if(array!=null){if(array.length==null||typeof array==="string"||jQuery.isFunction(array)||(typeof array!=="function"&&array.setInterval)){push.call(ret,array)}else{jQuery.merge(ret,array)}}return ret},inArray:function(elem,array){if(array.indexOf){return array.indexOf(elem)}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=first.length,j=0;if(typeof second.length==="number"){for(var l=second.length;j<l;j++){first[i++]=second[j]}}else{while(second[j]!==undefined){first[i++]=second[j++]}}first.length=i;return first},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!==!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback,arg){var ret=[],value;for(var i=0,length=elems.length;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)},guid:1,proxy:function(fn,proxy,thisObject){if(arguments.length===2){if(typeof proxy==="string"){thisObject=fn;fn=thisObject[proxy];proxy=undefined}else{if(proxy&&!jQuery.isFunction(proxy)){thisObject=proxy;proxy=undefined}}}if(!proxy&&fn){proxy=function(){return fn.apply(thisObject||this,arguments)}}if(fn){proxy.guid=fn.guid=fn.guid||proxy.guid||jQuery.guid++}return proxy},uaMatch:function(ua){var ret={browser:""};ua=ua.toLowerCase();if(/webkit/.test(ua)){ret={browser:"webkit",version:/webkit[\/ ]([\w.]+)/}}else{if(/opera/.test(ua)){ret={browser:"opera",version:/version/.test(ua)?/version[\/ ]([\w.]+)/:/opera[\/ ]([\w.]+)/}}else{if(/msie/.test(ua)){ret={browser:"msie",version:/msie ([\w.]+)/}}else{if(/mozilla/.test(ua)&&!/compatible/.test(ua)){ret={browser:"mozilla",version:/rv:([\w.]+)/}}}}}ret.version=(ret.version&&ret.version.exec(ua)||[0,"0"])[1];return ret},browser:{}});browserMatch=jQuery.uaMatch(userAgent);if(browserMatch.browser){jQuery.browser[browserMatch.browser]=true;jQuery.browser.version=browserMatch.version}if(jQuery.browser.webkit){jQuery.browser.safari=true}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem)}}rootjQuery=jQuery(document);if(document.addEventListener){DOMContentLoaded=function(){document.removeEventListener("DOMContentLoaded",DOMContentLoaded,false);jQuery.ready()}}else{if(document.attachEvent){DOMContentLoaded=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",DOMContentLoaded);jQuery.ready()}}}}function doScrollCheck(){if(jQuery.isReady){return}try{document.documentElement.doScroll("left")}catch(error){setTimeout(doScrollCheck,1);return}jQuery.ready()}if(indexOf){jQuery.inArray=function(elem,array){return indexOf.call(array,elem)}}function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function access(elems,key,value,exec,fn,pass){var length=elems.length;if(typeof key==="object"){for(var k in key){access(elems,k,key[k],exec,fn,value)}return elems}if(value!==undefined){exec=!pass&&exec&&jQuery.isFunction(value);for(var i=0;i<length;i++){fn(elems[i],key,exec?value.call(elems[i],i,fn(elems[i],key)):value,pass)}return elems}return length?fn(elems[0],key):null}function now(){return(new Date).getTime()}(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+now();div.style.display="none";div.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return}jQuery.support={leadingWhitespace:div.firstChild.nodeType===3,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:/^0.55$/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:div.getElementsByTagName("input")[0].value==="on",optSelected:document.createElement("select").appendChild(document.createElement("option")).selected,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function click(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",click)});div.cloneNode(true).fireEvent("onclick")}jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none";div=null});var eventSupported=function(eventName){var el=document.createElement("div");eventName="on"+eventName;var isSupported=(eventName in el);if(!isSupported){el.setAttribute(eventName,"return;");isSupported=typeof el[eventName]==="function"}el=null;return isSupported};jQuery.support.submitBubbles=eventSupported("submit");jQuery.support.changeBubbles=eventSupported("change");root=script=div=all=a=null})();jQuery.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var expando="jQuery"+now(),uuid=0,windowData={};var emptyObject={};jQuery.extend({cache:{},expando:expando,noData:{embed:true,object:true,applet:true},data:function(elem,name,data){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache;if(!name&&!id){return null}if(!id){id=++uuid}if(typeof name==="object"){elem[expando]=id;thisCache=cache[id]=jQuery.extend(true,{},name)}else{if(cache[id]){thisCache=cache[id]}else{if(typeof data==="undefined"){thisCache=emptyObject}else{thisCache=cache[id]={}}}}if(data!==undefined){elem[expando]=id;thisCache[name]=data}return typeof name==="string"?thisCache[name]:thisCache},removeData:function(elem,name){if(elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()]){return}elem=elem==window?windowData:elem;var id=elem[expando],cache=jQuery.cache,thisCache=cache[id];if(name){if(thisCache){delete thisCache[name];if(jQuery.isEmptyObject(thisCache)){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete cache[id]}}});jQuery.fn.extend({data:function(key,value){if(typeof key==="undefined"&&this.length){return jQuery.data(this[0])}else{if(typeof key==="object"){return this.each(function(){jQuery.data(this,key)})}}var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}});jQuery.extend({queue:function(elem,type,data){if(!elem){return}type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!data){return q||[]}if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))}else{q.push(data)}return q},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),fn=queue.shift();if(fn==="inprogress"){fn=queue.shift()}if(fn){if(type==="fx"){queue.unshift("inprogress")}fn.call(elem,function(){jQuery.dequeue(elem,type)})}}});jQuery.fn.extend({queue:function(type,data){if(typeof type!=="string"){data=type;type="fx"}if(data===undefined){return jQuery.queue(this[0],type)}return this.each(function(i,elem){var queue=jQuery.queue(this,type,data);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})},delay:function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(){var elem=this;setTimeout(function(){jQuery.dequeue(elem,type)},time)})},clearQueue:function(type){return this.queue(type||"fx",[])}});var rclass=/[\n\t]/g,rspace=/\s+/,rreturn=/\r/g,rspecialurl=/href|src|style/,rtype=/(button|input)/i,rfocusable=/(button|input|object|select|textarea)/i,rclickable=/^(a|area)$/i,rradiocheck=/radio|checkbox/;jQuery.fn.extend({attr:function(name,value){return access(this,name,value,true,jQuery.attr)},removeAttr:function(name,fn){return this.each(function(){jQuery.attr(this,name,"");if(this.nodeType===1){this.removeAttribute(name)}})},addClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.addClass(value.call(this,i,self.attr("class")))})}if(value&&typeof value==="string"){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1){if(!elem.className){elem.className=value}else{var className=" "+elem.className+" ";for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){elem.className+=" "+classNames[c]}}}}}}return this},removeClass:function(value){if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.removeClass(value.call(this,i,self.attr("class")))})}if((value&&typeof value==="string")||value===undefined){var classNames=(value||"").split(rspace);for(var i=0,l=this.length;i<l;i++){var elem=this[i];if(elem.nodeType===1&&elem.className){if(value){var className=(" "+elem.className+" ").replace(rclass," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ")}elem.className=className.substring(1,className.length-1)}else{elem.className=""}}}}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool=typeof stateVal==="boolean";if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);self.toggleClass(value.call(this,i,self.attr("class"),stateVal),stateVal)})}return this.each(function(){if(type==="string"){var className,i=0,self=jQuery(this),state=stateVal,classNames=value.split(rspace);while((className=classNames[i++])){state=isBool?state:!self.hasClass(className);self[state?"addClass":"removeClass"](className)}}else{if(type==="undefined"||type==="boolean"){if(this.className){jQuery.data(this,"__className__",this.className)}this.className=this.className||value===false?"":jQuery.data(this,"__className__")||""}}})},hasClass:function(selector){var className=" "+selector+" ";for(var i=0,l=this.length;i<l;i++){if((" "+this[i].className+" ").replace(rclass," ").indexOf(className)>-1){return true}}return false},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type==="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one){return value}values.push(value)}}return values}if(rradiocheck.test(elem.type)&&!jQuery.support.checkOn){return elem.getAttribute("value")===null?"on":elem.value}return(elem.value||"").replace(rreturn,"")}return undefined}var isFunction=jQuery.isFunction(value);return this.each(function(i){var self=jQuery(this),val=value;if(this.nodeType!==1){return}if(isFunction){val=value.call(this,i,self.val())}if(typeof val==="number"){val+=""}if(jQuery.isArray(val)&&rradiocheck.test(this.type)){this.checked=jQuery.inArray(self.val(),val)>=0}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(val);jQuery("option",this).each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0});if(!values.length){this.selectedIndex=-1}}else{this.value=val}}})}});jQuery.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(elem,name,value,pass){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}if(pass&&name in jQuery.attrFn){return jQuery(elem)[name](value)}var notxml=elem.nodeType!==1||!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.nodeType===1){var special=rspecialurl.test(name);if(name==="selected"&&!jQuery.support.optSelected){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex}}}if(name in elem&&notxml&&!special){if(set){if(name==="type"&&rtype.test(elem.nodeName)&&elem.parentNode){throw"type property can't be changed"}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}if(name==="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}return elem[name]}if(!jQuery.support.style&&notxml&&name==="style"){if(set){elem.style.cssText=""+value}return elem.style.cssText}if(set){elem.setAttribute(name,""+value)}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}return jQuery.style(elem,name,value)}});var fcleanup=function(nm){return nm.replace(/[^\w\s\.\|`]/g,function(ch){return"\\"+ch})};jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType===3||elem.nodeType===8){return}if(elem.setInterval&&(elem!==window&&!elem.frameElement)){elem=window}if(!handler.guid){handler.guid=jQuery.guid++}if(data!==undefined){var fn=handler;handler=jQuery.proxy(fn);handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle"),eventHandle;if(!handle){eventHandle=function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(eventHandle.elem,arguments):undefined};handle=jQuery.data(elem,"handle",eventHandle)}if(!handle){return}handle.elem=elem;types=types.split(/\s+/);var type,i=0;while((type=types[i++])){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice(0).sort().join(".");var handlers=events[type],special=this.special[type]||{};if(!handlers){handlers=events[type]={};if(!special.setup||special.setup.call(elem,data,namespaces,handler)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}if(special.add){var modifiedHandler=special.add.call(elem,handler,data,namespaces,handlers);if(modifiedHandler&&jQuery.isFunction(modifiedHandler)){modifiedHandler.guid=modifiedHandler.guid||handler.guid;handler=modifiedHandler}}handlers[handler.guid]=handler;this.global[type]=true}elem=null},global:{},remove:function(elem,types,handler){if(elem.nodeType===3||elem.nodeType===8){return}var events=jQuery.data(elem,"events"),ret,type,fn;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)===".")){for(type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}types=types.split(/\s+/);var i=0;while((type=types[i++])){var namespaces=type.split(".");type=namespaces.shift();var all=!namespaces.length,cleaned=jQuery.map(namespaces.slice(0).sort(),fcleanup),namespace=new RegExp("(^|\\.)"+cleaned.join("\\.(?:.*\\.)?")+"(\\.|$)"),special=this.special[type]||{};if(events[type]){if(handler){fn=events[type][handler.guid];delete events[type][handler.guid]}else{for(var handle in events[type]){if(all||namespace.test(events[type][handle].type)){delete events[type][handle]}}}if(special.remove){special.remove.call(elem,namespaces,fn)}for(ret in events[type]){break}if(!ret){if(!special.teardown||special.teardown.call(elem,namespaces)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}}}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(event,data,elem){var type=event.type||event,bubbling=arguments[3];if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}if(!elem){event.stopPropagation();if(this.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)}})}}if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle){handle.apply(elem,data)}var nativeFn,nativeHandler;try{if(!(elem&&elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()])){nativeFn=elem[type];nativeHandler=elem["on"+type]}}catch(e){}var isClick=jQuery.nodeName(elem,"a")&&type==="click";if(!bubbling&&nativeFn&&!event.isDefaultPrevented()&&!isClick){this.triggered=true;try{elem[type]()}catch(e){}}else{if(nativeHandler&&elem["on"+type].apply(elem,data)===false){event.result=false}}this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent){jQuery.event.trigger(event,data,parent,true)}}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}if(event.isImmediatePropagationStopped()){break}}}return event.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(event){if(event[expando]){return event}var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType===3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement===event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},guid:100000000,proxy:jQuery.proxy,special:{ready:{setup:jQuery.bindReady,teardown:jQuery.noop},live:{add:function(proxy,data,namespaces,live){jQuery.extend(proxy,data||{});proxy.guid+=data.selector+data.live;jQuery.event.add(this,data.live,liveHandler,data)},remove:function(namespaces){if(namespaces.length){var remove=0,name=new RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type)){remove++}});if(remove<1){jQuery.event.remove(this,namespaces[0],liveHandler)}}},special:{}},beforeunload:{setup:function(data,namespaces,fn){if(this.setInterval){this.onbeforeunload=fn}return false},teardown:function(namespaces,fn){if(this.onbeforeunload===fn){this.onbeforeunload=null}}}}};jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)}if(src&&src.type){this.originalEvent=src;this.type=src.type}else{this.type=src}this.timeStamp=now();this[expando]=true};function returnFalse(){return false}function returnTrue(){return true}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e){return}if(e.preventDefault){e.preventDefault()}e.returnValue=false},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e){return}if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!==this){try{parent=parent.parentNode}catch(e){break}}if(parent!==this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}},delegate=function(event){event.type=event.data;jQuery.event.handle.apply(this,arguments)};jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(orig,fix){jQuery.event.special[orig]={setup:function(data){jQuery.event.add(this,fix,data&&data.selector?delegate:withinElement,orig)},teardown:function(data){jQuery.event.remove(this,fix,data&&data.selector?delegate:withinElement)}}});if(!jQuery.support.submitBubbles){jQuery.event.special.submit={setup:function(data,namespaces,fn){if(this.nodeName.toLowerCase()!=="form"){jQuery.event.add(this,"click.specialSubmit."+fn.guid,function(e){var elem=e.target,type=elem.type;if((type==="submit"||type==="image")&&jQuery(elem).closest("form").length){return trigger("submit",this,arguments)}});jQuery.event.add(this,"keypress.specialSubmit."+fn.guid,function(e){var elem=e.target,type=elem.type;if((type==="text"||type==="password")&&jQuery(elem).closest("form").length&&e.keyCode===13){return trigger("submit",this,arguments)}})}else{return false}},remove:function(namespaces,fn){jQuery.event.remove(this,"click.specialSubmit"+(fn?"."+fn.guid:""));jQuery.event.remove(this,"keypress.specialSubmit"+(fn?"."+fn.guid:""))}}}if(!jQuery.support.changeBubbles){var formElems=/textarea|input|select/i;function getVal(elem){var type=elem.type,val=elem.value;if(type==="radio"||type==="checkbox"){val=elem.checked}else{if(type==="select-multiple"){val=elem.selectedIndex>-1?jQuery.map(elem.options,function(elem){return elem.selected}).join("-"):""}else{if(elem.nodeName.toLowerCase()==="select"){val=elem.selectedIndex}}}return val}function testChange(e){var elem=e.target,data,val;if(!formElems.test(elem.nodeName)||elem.readOnly){return}data=jQuery.data(elem,"_change_data");val=getVal(elem);if(val===data){return}if(e.type!=="focusout"||elem.type!=="radio"){jQuery.data(elem,"_change_data",val)}if(elem.type!=="select"&&(data!=null||val)){e.type="change";return jQuery.event.trigger(e,arguments[1],this)}}jQuery.event.special.change={filters:{focusout:testChange,click:function(e){var elem=e.target,type=elem.type;if(type==="radio"||type==="checkbox"||elem.nodeName.toLowerCase()==="select"){return testChange.call(this,e)}},keydown:function(e){var elem=e.target,type=elem.type;if((e.keyCode===13&&elem.nodeName.toLowerCase()!=="textarea")||(e.keyCode===32&&(type==="checkbox"||type==="radio"))||type==="select-multiple"){return testChange.call(this,e)}},beforeactivate:function(e){var elem=e.target;if(elem.nodeName.toLowerCase()==="input"&&elem.type==="radio"){jQuery.data(elem,"_change_data",getVal(elem))}}},setup:function(data,namespaces,fn){for(var type in changeFilters){jQuery.event.add(this,type+".specialChange."+fn.guid,changeFilters[type])}return formElems.test(this.nodeName)},remove:function(namespaces,fn){for(var type in changeFilters){jQuery.event.remove(this,type+".specialChange"+(fn?"."+fn.guid:""),changeFilters[type])}return formElems.test(this.nodeName)}};var changeFilters=jQuery.event.special.change.filters}function trigger(type,elem,args){args[0].type=type;return jQuery.event.handle.apply(elem,args)}if(document.addEventListener){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){jQuery.event.special[fix]={setup:function(){this.addEventListener(orig,handler,true)},teardown:function(){this.removeEventListener(orig,handler,true)}};function handler(e){e=jQuery.event.fix(e);e.type=fix;return jQuery.event.handle.call(this,e)}})}jQuery.each(["bind","one"],function(i,name){jQuery.fn[name]=function(type,data,fn){if(typeof type==="object"){for(var key in type){this[name](key,data,type[key],fn)}return this}if(jQuery.isFunction(data)){thisObject=fn;fn=data;data=undefined}var handler=name==="one"?jQuery.proxy(fn,function(event){jQuery(this).unbind(event,handler);return fn.apply(this,arguments)}):fn;return type==="unload"&&name!=="one"?this.one(type,data,fn,thisObject):this.each(function(){jQuery.event.add(this,type,handler,data)})}});jQuery.fn.extend({unbind:function(type,fn){if(typeof type==="object"&&!type.preventDefault){for(var key in type){this.unbind(key,type[key])}return this}return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.proxy(fn,args[i++])}return this.click(jQuery.proxy(fn,function(event){var lastToggle=(jQuery.data(this,"lastToggle"+fn.guid)||0)%i;jQuery.data(this,"lastToggle"+fn.guid,lastToggle+1);event.preventDefault();return args[lastToggle].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)},live:function(type,data,fn){if(jQuery.isFunction(data)){fn=data;data=undefined}jQuery(this.context).bind(liveConvert(type,this.selector),{data:data,selector:this.selector,live:type},fn);return this},die:function(type,fn){jQuery(this.context).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this}});function liveHandler(event){var stop=true,elems=[],selectors=[],args=arguments,related,match,fn,elem,j,i,data,live=jQuery.extend({},jQuery.data(this,"events").live);for(j in live){fn=live[j];if(fn.live===event.type||fn.altLive&&jQuery.inArray(event.type,fn.altLive)>-1){data=fn.data;if(!(data.beforeFilter&&data.beforeFilter[event.type]&&!data.beforeFilter[event.type](event))){selectors.push(fn.selector)}}else{delete live[j]}}match=jQuery(event.target).closest(selectors,event.currentTarget);for(i=0,l=match.length;i<l;i++){for(j in live){fn=live[j];elem=match[i].elem;related=null;if(match[i].selector===fn.selector){if(fn.live==="mouseenter"||fn.live==="mouseleave"){related=jQuery(event.relatedTarget).closest(fn.selector)[0]}if(!related||related!==elem){elems.push({elem:elem,fn:fn})}}}}for(i=0,l=elems.length;i<l;i++){match=elems[i];event.currentTarget=match.elem;event.data=match.fn.data;if(match.fn.apply(match.elem,args)===false){stop=false;break}}return stop}function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"&")].join(".")}jQuery.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(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)};if(jQuery.attrFn){jQuery.attrFn[name]=true}});if(window.attachEvent&&!window.addEventListener){window.attachEvent("onunload",function(){for(var id in jQuery.cache){if(jQuery.cache[id].handle){try{jQuery.event.remove(jQuery.cache[id].handle.elem)}catch(e){}}}});
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
}(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,done=0,toString=Object.prototype.toString,hasDuplicate=false,baseHasDuplicate=true;[0,0].sort(function(){baseHasDuplicate=false;return 0});var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[]}if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,extra,prune=true,contextXML=isXML(context),soFar=selector;while((chunker.exec(""),m=chunker.exec(soFar))!==null){soFar=m[3];parts.push(m[1]);if(m[2]){extra=m[3];break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector]){selector+=parts.shift()}set=posProcess(selector,set)}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0]}if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,contextXML)}}else{checkSet=parts=[]}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else{if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results)}return results};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=baseHasDuplicate;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.leftMatch[type].exec(expr))){var left=match[1];match.splice(1,1);if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.leftMatch[type].exec(expr))!=null&&match[2]){var filter=Expr.filter[type],found,item,left=match[1];anyFound=false;match.splice(1,1);if(left.substr(left.length-1)==="\\"){continue}if(curLoop===result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else{if(match===true){continue}}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else{if(pass){result.push(item);anyFound=true}}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr===old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr}else{break}}old=expr}return curLoop};var Expr=Sizzle.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(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag){part=part.toLowerCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName.toLowerCase()===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=part.toLowerCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName.toLowerCase()===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!/\W/.test(part)){var nodeCheck=part=part.toLowerCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").replace(/[\t\n]/g," ").indexOf(match)>=0)){if(!inplace){result.push(elem)}}else{if(inplace){curLoop[i]=false}}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){return match[1].toLowerCase()},CHILD:function(match){if(match[1]==="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]==="even"&&"2n"||match[2]==="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if((chunker.exec(match[3])||"").length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else{if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return !!elem.firstChild},empty:function(elem){return !elem.firstChild},has:function(elem,i,match){return !!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toLowerCase()==="button"},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0===i},eq:function(elem,i,match){return match[3]-0===i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else{if(name==="contains"){return(elem.textContent||elem.innerText||getText([elem])||"").indexOf(match[3])>=0}else{if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}else{throw"Syntax error, unrecognized expression: "+name}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while((node=node.previousSibling)){if(node.nodeType===1){return false}}if(type==="first"){return true}node=elem;case"last":while((node=node.nextSibling)){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first===1&&last===0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first===0){return diff===0}else{return(diff%first===0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName.toLowerCase()===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!==check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);Expr.leftMatch[type]=new RegExp(/(^(?:.|\r|\n)*?)/.source+Expr.match[type].source.replace(/\\(\d+)/g,function(all,num){return"\\"+(num-0+1)}))}var makeArray=function(array,results){array=Array.prototype.slice.call(array,0);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){hasDuplicate=true}return a.compareDocumentPosition?-1:1}var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){hasDuplicate=true}return a.sourceIndex?-1:1}var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){hasDuplicate=true}return a.ownerDocument?-1:1}var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.setStart(a,0);aRange.setEnd(a,0);bRange.setStart(b,0);bRange.setEnd(b,0);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}}}function getText(elems){var ret="",elem;for(var i=0;elems[i];i++){elem=elems[i];if(elem.nodeType===3||elem.nodeType===4){ret+=elem.nodeValue}else{if(elem.nodeType!==8){ret+=getText(elem.childNodes)}}}return ret}(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form);root=form=null})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}div=null})();if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop]}div=null})()}(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(!div.getElementsByClassName||div.getElementsByClassName("e").length===0){return}div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return}Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}};div=null})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName.toLowerCase()===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){var documentElement=(elem?elem.ownerDocument||elem:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;jQuery.unique=Sizzle.uniqueSort;jQuery.getText=getText;jQuery.isXMLDoc=isXML;jQuery.contains=contains;return;window.Sizzle=Sizzle})();var runtil=/Until$/,rparentsprev=/^(?:parents|prevUntil|prevAll)/,rmultiselector=/,/,slice=Array.prototype.slice;var winnow=function(elements,qualifier,keep){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return !!qualifier.call(elem,i,elem)===keep})}else{if(qualifier.nodeType){return jQuery.grep(elements,function(elem,i){return(elem===qualifier)===keep})}else{if(typeof qualifier==="string"){var filtered=jQuery.grep(elements,function(elem){return elem.nodeType===1});if(isSimple.test(qualifier)){return jQuery.filter(qualifier,filtered,!keep)}else{qualifier=jQuery.filter(qualifier,elements)}}}}return jQuery.grep(elements,function(elem,i){return(jQuery.inArray(elem,qualifier)>=0)===keep})};jQuery.fn.extend({find:function(selector){var ret=this.pushStack("","find",selector),length=0;for(var i=0,l=this.length;i<l;i++){length=ret.length;jQuery.find(selector,this[i],ret);if(i>0){for(var n=length;n<ret.length;n++){for(var r=0;r<length;r++){if(ret[r]===ret[n]){ret.splice(n--,1);break}}}}}return ret},has:function(target){var targets=jQuery(target);return this.filter(function(){for(var i=0,l=targets.length;i<l;i++){if(jQuery.contains(this,targets[i])){return true}}})},not:function(selector){return this.pushStack(winnow(this,selector,false),"not",selector)},filter:function(selector){return this.pushStack(winnow(this,selector,true),"filter",selector)},is:function(selector){return !!selector&&jQuery.filter(selector,this).length>0},closest:function(selectors,context){if(jQuery.isArray(selectors)){var ret=[],cur=this[0],match,matches={},selector;if(cur&&selectors.length){for(var i=0,l=selectors.length;i<l;i++){selector=selectors[i];if(!matches[selector]){matches[selector]=jQuery.expr.match.POS.test(selector)?jQuery(selector,context||this.context):selector}}while(cur&&cur.ownerDocument&&cur!==context){for(selector in matches){match=matches[selector];if(match.jquery?match.index(cur)>-1:jQuery(cur).is(match)){ret.push({selector:selector,elem:cur});delete matches[selector]}}cur=cur.parentNode}}return ret}var pos=jQuery.expr.match.POS.test(selectors)?jQuery(selectors,context||this.context):null;return this.map(function(i,cur){while(cur&&cur.ownerDocument&&cur!==context){if(pos?pos.index(cur)>-1:jQuery(cur).is(selectors)){return cur}cur=cur.parentNode}return null})},index:function(elem){if(!elem||typeof elem==="string"){return jQuery.inArray(this[0],elem?jQuery(elem):this.parent().children())}return jQuery.inArray(elem.jquery?elem[0]:elem,this)},add:function(selector,context){var set=typeof selector==="string"?jQuery(selector,context||this.context):jQuery.makeArray(selector),all=jQuery.merge(this.get(),set);return this.pushStack(isDisconnected(set[0])||isDisconnected(all[0])?all:jQuery.unique(all))},andSelf:function(){return this.add(this.prevObject)}});function isDisconnected(node){return !node||!node.parentNode||node.parentNode.nodeType===11}jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);if(!runtil.test(name)){selector=until}if(selector&&typeof selector==="string"){ret=jQuery.filter(selector,ret)}ret=this.length>1?jQuery.unique(ret):ret;if((this.length>1||rmultiselector.test(selector))&&rparentsprev.test(name)){ret=ret.reverse()}return this.pushStack(ret,name,slice.call(arguments).join(","))}});jQuery.extend({filter:function(expr,elems,not){if(not){expr=":not("+expr+")"}return jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){var matched=[],cur=elem[dir];while(cur&&cur.nodeType!==9&&(until===undefined||!jQuery(cur).is(until))){if(cur.nodeType===1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType===1&&++num===result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){r.push(n)}}return r}});var rinlinejQuery=/ jQuery\d+="(?:\d+|null)"/g,rleadingWhitespace=/^\s+/,rxhtmlTag=/(<([\w:]+)[^>]*?)\/>/g,rselfClosing=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,rtagName=/<([\w:]+)/,rtbody=/<tbody/i,rhtml=/<|&\w+;/,fcloseTag=function(all,front,tag){return rselfClosing.test(tag)?all:front+"></"+tag+">"},wrapMap={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,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!jQuery.support.htmlSerialize){wrapMap._default=[1,"div<div>","</div>"]}jQuery.fn.extend({text:function(text){if(jQuery.isFunction(text)){return this.each(function(i){var self=jQuery(this);return self.text(text.call(this,i,self.text()))})}if(typeof text!=="object"&&text!==undefined){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}return jQuery.getText(this)},wrapAll:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))})}if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(function(){var elem=this;while(elem.firstChild&&elem.firstChild.nodeType===1){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType===1){this.insertBefore(elem,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)})}else{if(arguments.length){var set=jQuery(arguments[0]);set.push.apply(set,this.toArray());return this.pushStack(set,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})}else{if(arguments.length){var set=this.pushStack(this,"after",arguments);set.push.apply(set,jQuery(arguments[0]).toArray());return set}}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML,ownerDocument=this.ownerDocument;if(!html){var div=ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(rinlinejQuery,"").replace(rleadingWhitespace,"")],ownerDocument)[0]}else{return this.cloneNode(true)}});if(events===true){cloneCopyEvent(this,ret);cloneCopyEvent(this.find("*"),ret.find("*"))}return ret},html:function(value){if(value===undefined){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(rinlinejQuery,""):null}else{if(typeof value==="string"&&!/<script/i.test(value)&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){try{for(var i=0,l=this.length;i<l;i++){if(this[i].nodeType===1){cleanData(this[i].getElementsByTagName("*"));this[i].innerHTML=value}}}catch(e){this.empty().append(value)}}else{if(jQuery.isFunction(value)){this.each(function(i){var self=jQuery(this),old=self.html();self.empty().append(function(){return value.call(this,i,old)})})}else{this.empty().append(value)}}}return this},replaceWith:function(value){if(this[0]&&this[0].parentNode){if(!jQuery.isFunction(value)){value=jQuery(value).detach()}return this.each(function(){var next=this.nextSibling,parent=this.parentNode;jQuery(this).remove();if(next){jQuery(next).before(value)}else{jQuery(parent).append(value)}})}else{return this.pushStack(jQuery(jQuery.isFunction(value)?value():value),"replaceWith",value)}},detach:function(selector){return this.remove(selector,true)},domManip:function(args,table,callback){var results,first,value=args[0],scripts=[];if(jQuery.isFunction(value)){return this.each(function(i){var self=jQuery(this);args[0]=value.call(this,i,table?self.html():undefined);return self.domManip(args,table,callback)})}if(this[0]){if(args[0]&&args[0].parentNode&&args[0].parentNode.nodeType===11){results={fragment:args[0].parentNode}}else{results=buildFragment(args,this,scripts)}first=results.fragment.firstChild;if(first){table=table&&jQuery.nodeName(first,"tr");for(var i=0,l=this.length;i<l;i++){callback.call(table?root(this[i],first):this[i],results.cacheable||this.length>1||i>0?results.fragment.cloneNode(true):results.fragment)}}if(scripts){jQuery.each(scripts,evalScript)}}return this;function root(elem,cur){return jQuery.nodeName(elem,"table")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}}});function cloneCopyEvent(orig,ret){var i=0;ret.each(function(){if(this.nodeName!==(orig[i]&&orig[i].nodeName)){return}var oldData=jQuery.data(orig[i++]),curData=jQuery.data(this,oldData),events=oldData&&oldData.events;if(events){delete curData.handle;curData.events={};for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}}})}function buildFragment(args,nodes,scripts){var fragment,cacheable,cached,cacheresults,doc;if(args.length===1&&typeof args[0]==="string"&&args[0].length<512&&args[0].indexOf("<option")<0){cacheable=true;cacheresults=jQuery.fragments[args[0]];if(cacheresults){if(cacheresults!==1){fragment=cacheresults}cached=true}}if(!fragment){doc=(nodes&&nodes[0]?nodes[0].ownerDocument||nodes[0]:document);fragment=doc.createDocumentFragment();jQuery.clean(args,doc,fragment,scripts)}if(cacheable){jQuery.fragments[args[0]]=cacheresults?fragment:1}return{fragment:fragment,cacheable:cacheable}}jQuery.fragments={};jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}return this.pushStack(ret,name,insert.selector)}});jQuery.each({remove:function(selector,keepData){if(!selector||jQuery.filter(selector,[this]).length){if(!keepData&&this.nodeType===1){cleanData(this.getElementsByTagName("*"));cleanData([this])}if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){if(this.nodeType===1){cleanData(this.getElementsByTagName("*"))}while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.extend({clean:function(elems,context,fragment,scripts){context=context||document;if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}var ret=[];jQuery.each(elems,function(i,elem){if(typeof elem==="number"){elem+=""}if(!elem){return}if(typeof elem==="string"&&!rhtml.test(elem)){elem=context.createTextNode(elem)}else{if(typeof elem==="string"){elem=elem.replace(rxhtmlTag,fcloseTag);var tag=(rtagName.exec(elem)||["",""])[1].toLowerCase(),wrap=wrapMap[tag]||wrapMap._default,depth=wrap[0],div=context.createElement("div");div.innerHTML=wrap[1]+elem+wrap[2];while(depth--){div=div.lastChild}if(!jQuery.support.tbody){var hasBody=rtbody.test(elem),tbody=tag==="table"&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]==="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}}if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)){div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]),div.firstChild)}elem=jQuery.makeArray(div.childNodes)}}if(elem.nodeType){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});if(fragment){for(var i=0;ret[i];i++){if(scripts&&jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))}fragment.appendChild(ret[i])}}}return ret}});function cleanData(elems){for(var i=0,elem,id;(elem=elems[i])!=null;i++){if(!jQuery.noData[elem.nodeName.toLowerCase()]&&(id=elem[expando])){delete jQuery.cache[id]}}}var rexclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,ralpha=/alpha\([^)]*\)/,ropacity=/opacity=([^)]*)/,rfloat=/float/i,rdashAlpha=/-([a-z])/ig,rupper=/([A-Z])/g,rnumpx=/^-?\d+(?:px)?$/i,rnum=/^-?\d/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssWidth=["Left","Right"],cssHeight=["Top","Bottom"],getComputedStyle=document.defaultView&&document.defaultView.getComputedStyle,styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat",fcamelCase=function(all,letter){return letter.toUpperCase()};jQuery.fn.css=function(name,value){return access(this,name,value,true,function(elem,name,value){if(value===undefined){return jQuery.curCSS(elem,name)}if(typeof value==="number"&&!rexclude.test(name)){value+="px"}jQuery.style(elem,name,value)})};jQuery.extend({style:function(elem,name,value){if(!elem||elem.nodeType===3||elem.nodeType===8){return undefined}if((name==="width"||name==="height")&&parseFloat(value)<0){value=undefined}var style=elem.style||elem,set=value!==undefined;if(!jQuery.support.opacity&&name==="opacity"){if(set){style.zoom=1;var opacity=parseInt(value,10)+""==="NaN"?"":"alpha(opacity="+value*100+")";var filter=style.filter||jQuery.curCSS(elem,"filter")||"";style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):opacity}return style.filter&&style.filter.indexOf("opacity=")>=0?(parseFloat(ropacity.exec(style.filter)[1])/100)+"":""}if(rfloat.test(name)){name=styleFloat}name=name.replace(rdashAlpha,fcamelCase);if(set){style[name]=value}return style[name]},css:function(elem,name,force,extra){if(name==="width"||name==="height"){var val,props=cssShow,which=name==="width"?cssWidth:cssHeight;function getWH(){val=name==="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border"){return}jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0}})}if(elem.offsetWidth!==0){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,Math.round(val))}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style,filter;if(!jQuery.support.opacity&&name==="opacity"&&elem.currentStyle){ret=ropacity.test(elem.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return ret===""?"1":ret}if(rfloat.test(name)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(getComputedStyle){if(rfloat.test(name)){name="float"}name=name.replace(rupper,"-$1").toLowerCase();var defaultView=elem.ownerDocument.defaultView;if(!defaultView){return null}var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle){ret=computedStyle.getPropertyValue(name)}if(name==="opacity"&&ret===""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(rdashAlpha,fcamelCase);ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!rnumpx.test(ret)&&rnum.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=camelCase==="fontSize"?"1em":(ret||0);ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.hidden=function(elem){var width=elem.offsetWidth,height=elem.offsetHeight,skip=elem.nodeName.toLowerCase()==="tr";return width===0&&height===0&&!skip?true:width>0&&height>0&&!skip?false:jQuery.curCSS(elem,"display")==="none"};jQuery.expr.filters.visible=function(elem){return !jQuery.expr.filters.hidden(elem)}}var jsc=now(),rscript=/<script(.|\s)*?\/script>/gi,rselectTextarea=/select|textarea/i,rinput=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,jsre=/=\?(&|$)/,rquery=/\?/,rts=/(\?|&)_=.*?(&|$)/,rurl=/^(\w+:)?\/\/([^\/?#]+)/,r20=/%20/g;jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string"){return this._load(url)}else{if(!this.length){return this}}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{if(typeof params==="object"){params=jQuery.param(params,jQuery.ajaxSettings.traditional);type="POST"}}}jQuery.ajax({url:url,type:type,dataType:"html",data:params,context:this,complete:function(res,status){if(status==="success"||status==="notmodified"){this.html(selector?jQuery("<div />").append(res.responseText.replace(rscript,"")).find(selector):res.responseText)}if(callback){this.each(callback,[res.responseText,status,res])}}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||rselectTextarea.test(this.nodeName)||rinput.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:window.XMLHttpRequest&&(window.location.protocol!=="file:"||!window.ActiveXObject)?function(){return new window.XMLHttpRequest()}:function(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}},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(origSettings){var s=jQuery.extend(true,{},jQuery.ajaxSettings,origSettings);var jsonp,status,data,callbackContext=s.context||s,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional)}if(s.dataType==="jsonp"){if(type==="GET"){if(!jsre.test(s.url)){s.url+=(rquery.test(s.url)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!jsre.test(s.data)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType==="json"&&(s.data&&jsre.test(s.data)||jsre.test(s.url))){jsonp=s.jsonpCallback||("jsonp"+jsc++);if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=window[jsonp]||function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType==="script"&&s.cache===null){s.cache=false}if(s.cache===false&&type==="GET"){var ts=now();var ret=s.url.replace(rts,"$1_="+ts+"$2");s.url=ret+((ret===s.url)?(rquery.test(s.url)?"&":"?")+"_="+ts:"")}if(s.data&&type==="GET"){s.url+=(rquery.test(s.url)?"&":"?")+s.data}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var parts=rurl.exec(s.url),remote=parts&&(parts[1]&&parts[1]!==location.protocol||parts[2]!==location.host);if(s.dataType==="script"&&type==="GET"&&remote){var head=document.getElementsByTagName("head")[0]||document.documentElement;var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;if(head&&script.parentNode){head.removeChild(script)}}}}head.insertBefore(script,head.firstChild);return undefined}var requestDone=false;var xhr=s.xhr();if(!xhr){return}if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data||origSettings&&origSettings.contentType){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){if(jQuery.lastModified[s.url]){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url])}if(jQuery.etag[s.url]){xhr.setRequestHeader("If-None-Match",jQuery.etag[s.url])}}if(!remote){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest")}xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend.call(callbackContext,xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}xhr.abort();return false}if(s.global){trigger("ajaxSend",[xhr,s])}var onreadystatechange=xhr.onreadystatechange=function(isTimeout){if(!xhr||xhr.readyState===0){if(!requestDone){complete()}requestDone=true;if(xhr){xhr.onreadystatechange=jQuery.noop}}else{if(!requestDone&&xhr&&(xhr.readyState===4||isTimeout==="timeout")){requestDone=true;xhr.onreadystatechange=jQuery.noop;status=isTimeout==="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status==="success"){try{data=jQuery.httpData(xhr,s.dataType,s)}catch(e){status="parsererror"}}if(status==="success"||status==="notmodified"){if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(isTimeout==="timeout"){xhr.abort()}if(s.async){xhr=null}}}};try{var oldAbort=xhr.abort;xhr.abort=function(){if(xhr){oldAbort.call(xhr);if(xhr){xhr.readyState=0}}onreadystatechange()}}catch(e){}if(s.async&&s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")}},s.timeout)}try{xhr.send(type==="POST"||type==="PUT"||type==="DELETE"?s.data:null)}catch(e){jQuery.handleError(s,xhr,null,e);complete()}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success.call(callbackContext,data,status,xhr)}if(s.global){trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete.call(callbackContext,xhr,status)}if(s.global){trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}function trigger(type,args){(s.context?jQuery(s.context):jQuery.event).trigger(type,args)}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error.call(s.context||window,xhr,status,e)}if(s.global){(s.context?jQuery(s.context):jQuery.event).trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol==="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status===304||xhr.status===1223||xhr.status===0}catch(e){}return false},httpNotModified:function(xhr,url){var lastModified=xhr.getResponseHeader("Last-Modified"),etag=xhr.getResponseHeader("Etag");if(lastModified){jQuery.lastModified[url]=lastModified}if(etag){jQuery.etag[url]=etag}return xhr.status===304||xhr.status===0},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){throw"parsererror"}if(s&&s.dataFilter){data=s.dataFilter(data,type)}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){if(/^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){if(window.JSON&&window.JSON.parse){data=window.JSON.parse(data)}else{data=(new Function("return "+data))()}}else{throw"Invalid JSON: "+data}}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){jQuery.globalEval(data)}}}return data},param:function(a,traditional){var s=[];if(traditional===undefined){traditional=jQuery.ajaxSettings.traditional}function add(key,value){value=jQuery.isFunction(value)?value():value;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)})}else{jQuery.each(a,function buildParams(prefix,obj){if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"||jQuery.isArray(v)?i:"")+"]",v)}})}else{if(!traditional&&obj!=null&&typeof obj==="object"){jQuery.each(obj,function(k,v){buildParams(prefix+"["+k+"]",v)})}else{add(prefix,obj)}}})}return s.join("&").replace(r20,"+")}});var elemdisplay={},rfxtypes=/toggle|show|hide/,rfxnum=/^([+-]=)?([\d+-.]+)(.*)$/,timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];jQuery.fn.extend({show:function(speed,callback){if(speed!=null){return this.animate(genFx("show",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var nodeName=this[i].nodeName,display;if(elemdisplay[nodeName]){display=elemdisplay[nodeName]}else{var elem=jQuery("<"+nodeName+" />").appendTo("body");display=elem.css("display");if(display==="none"){display="block"}elem.remove();elemdisplay[nodeName]=display}jQuery.data(this[i],"olddisplay",display)}}for(var j=0,k=this.length;j<k;j++){this[j].style.display=jQuery.data(this[j],"olddisplay")||""}return this}},hide:function(speed,callback){if(speed!=null){return this.animate(genFx("hide",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))}}for(var j=0,k=this.length;j<k;j++){this[j].style.display="none"}return this}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";if(jQuery.isFunction(fn)&&jQuery.isFunction(fn2)){this._toggle.apply(this,arguments)}else{if(fn==null||bool){this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()})}else{this.animate(genFx("toggle",3),fn,fn2)}}return this},fadeTo:function(speed,to,callback){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);if(jQuery.isEmptyObject(prop)){return this.each(optall.complete)}return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType===1&&jQuery(this).is(":hidden"),self=this;for(p in prop){var name=p.replace(rdashAlpha,fcamelCase);if(p!==name){prop[name]=prop[p];delete prop[p];p=name}if(prop[p]==="hide"&&hidden||prop[p]==="show"&&!hidden){return opt.complete.call(this)}if((p==="height"||p==="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}if(jQuery.isArray(prop[p])){(opt.specialEasing=opt.specialEasing||{})[p]=prop[p][1];prop[p]=prop[p][0]}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(rfxtypes.test(val)){e[val==="toggle"?hidden?"show":"hide":val](prop)}else{var parts=rfxnum.exec(val),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!=="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]==="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem===this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)}});jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(jQuery.fx.tick,13)}},show:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now(),done=true;if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var old=jQuery.data(this.elem,"olddisplay");this.elem.style.display=old?old:this.options.display;if(jQuery.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){jQuery(this.elem).hide()}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.style(this.elem,p,this.options.orig[p])}}this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;var specialEasing=this.options.specialEasing&&this.options.specialEasing[this.prop];var defaultEasing=this.options.easing||(jQuery.easing.swing?"swing":"linear");this.pos=jQuery.easing[specialEasing||defaultEasing](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{tick:function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}},stop:function(){clearInterval(timerId);timerId=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.style(fx.elem,"opacity",fx.now)},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=(fx.prop==="width"||fx.prop==="height"?Math.max(0,fx.now):fx.now)+fx.unit}else{fx.elem[fx.prop]=fx.now}}}});if(jQuery.expr&&jQuery.expr.filters){jQuery.expr.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length}}function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type});return obj}if("getBoundingClientRect" in document.documentElement){jQuery.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null}if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}var box=elem.getBoundingClientRect(),doc=elem.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.support.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.support.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left}}}else{jQuery.fn.offset=function(options){var elem=this[0];if(!elem||!elem.ownerDocument){return null}if(options){return this.each(function(i){jQuery.offset.setOffset(this,options,i)})}if(elem===elem.ownerDocument.body){return jQuery.offset.bodyOffset(elem)}jQuery.offset.initialize();var offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle,top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){break}computedStyle=defaultView?defaultView.getComputedStyle(elem,null):elem.currentStyle;top-=elem.scrollTop;left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop;left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.nodeName))){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseFloat(computedStyle.borderTopWidth)||0;left+=parseFloat(computedStyle.borderLeftWidth)||0}prevComputedStyle=computedStyle}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop;left+=body.offsetLeft}if(jQuery.offset.supportsFixedPosition&&prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop);left+=Math.max(docElem.scrollLeft,body.scrollLeft)}return{top:top,left:left}}}jQuery.offset={initialize:function(){var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,bodyMarginTop=parseFloat(jQuery.curCSS(body,"marginTop",true))||0,html="<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>";jQuery.extend(container.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild;checkDiv=innerDiv.firstChild;td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);checkDiv.style.position="fixed",checkDiv.style.top="20px";this.supportsFixedPosition=(checkDiv.offsetTop===20||checkDiv.offsetTop===15);checkDiv.style.position=checkDiv.style.top="";innerDiv.style.overflow="hidden",innerDiv.style.position="relative";this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(body.offsetTop!==bodyMarginTop);body.removeChild(container);body=container=innerDiv=checkDiv=table=td=null;jQuery.offset.initialize=jQuery.noop},bodyOffset:function(body){var top=body.offsetTop,left=body.offsetLeft;jQuery.offset.initialize();if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseFloat(jQuery.curCSS(body,"marginTop",true))||0;left+=parseFloat(jQuery.curCSS(body,"marginLeft",true))||0}return{top:top,left:left}},setOffset:function(elem,options,i){if(/static/.test(jQuery.curCSS(elem,"position"))){elem.style.position="relative"}var curElem=jQuery(elem),curOffset=curElem.offset(),curTop=parseInt(jQuery.curCSS(elem,"top",true),10)||0,curLeft=parseInt(jQuery.curCSS(elem,"left",true),10)||0;if(jQuery.isFunction(options)){options=options.call(elem,i,curOffset)}var props={top:(options.top-curOffset.top)+curTop,left:(options.left-curOffset.left)+curLeft};if("using" in options){options.using.call(elem,props)}else{curElem.css(props)}}};jQuery.fn.extend({position:function(){if(!this[0]){return null}var elem=this[0],offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].nodeName)?{top:0,left:0}:offsetParent.offset();offset.top-=parseFloat(jQuery.curCSS(elem,"marginTop",true))||0;offset.left-=parseFloat(jQuery.curCSS(elem,"marginLeft",true))||0;parentOffset.top+=parseFloat(jQuery.curCSS(offsetParent[0],"borderTopWidth",true))||0;parentOffset.left+=parseFloat(jQuery.curCSS(offsetParent[0],"borderLeftWidth",true))||0;return{top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.nodeName)&&jQuery.css(offsetParent,"position")==="static")){offsetParent=offsetParent.offsetParent}return offsetParent})}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){var elem=this[0],win;if(!elem){return null}if(val!==undefined){return this.each(function(){win=getWindow(this);if(win){win.scrollTo(!i?val:jQuery(win).scrollLeft(),i?val:jQuery(win).scrollTop())}else{this[method]=val}})}else{win=getWindow(elem);return win?("pageXOffset" in win)?win[i?"pageYOffset":"pageXOffset"]:jQuery.support.boxModel&&win.document.documentElement[method]||win.document.body[method]:elem[method]}}});function getWindow(elem){return("scrollTo" in elem&&elem.document)?elem:elem.nodeType===9?elem.defaultView||elem.parentWindow:false}jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],type,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],type,false,margin?"margin":"border"):null};jQuery.fn[type]=function(size){var elem=this[0];if(!elem){return size==null?null:this}return("scrollTo" in elem&&elem.document)?elem.document.compatMode==="CSS1Compat"&&elem.document.documentElement["client"+name]||elem.document.body["client"+name]:(elem.nodeType===9)?Math.max(elem.documentElement["client"+name],elem.body["scroll"+name],elem.documentElement["scroll"+name],elem.body["offset"+name],elem.documentElement["offset"+name]):size===undefined?jQuery.css(elem,type):this.css(type,typeof size==="string"?size:size+"px")}});window.jQuery=window.$=jQuery})(window);var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};jaaulde.utils.cookies=(function(){var cookies=[];var defaultOptions={hoursToLive:null,path:"/",domain:null,secure:false};var resolveOptions=function(options){var returnValue;if(typeof options!=="object"||options===null){returnValue=defaultOptions}else{returnValue={hoursToLive:(typeof options.hoursToLive==="number"&&options.hoursToLive!==0?options.hoursToLive:defaultOptions.hoursToLive),path:(typeof options.path==="string"&&options.path!==""?options.path:defaultOptions.path),domain:(typeof options.domain==="string"&&options.domain!==""?options.domain:defaultOptions.domain),secure:(typeof options.secure==="boolean"&&options.secure?options.secure:defaultOptions.secure)}}return returnValue};var expiresGMTString=function(hoursToLive){var dateObject=new Date();dateObject.setTime(dateObject.getTime()+(hoursToLive*60*60*1000));return dateObject.toGMTString()};var assembleOptionsString=function(options){options=resolveOptions(options);return((typeof options.hoursToLive==="number"?"; expires="+expiresGMTString(options.hoursToLive):"")+"; path="+options.path+(typeof options.domain==="string"?"; domain="+options.domain:"")+(options.secure===true?"; secure":""))};var splitCookies=function(){cookies={};var pair,name,value,separated=document.cookie.split(";");for(var i=0;i<separated.length;i=i+1){pair=separated[i].split("=");name=pair[0].replace(/^\s*/,"").replace(/\s*$/,"");value=decodeURIComponent(pair[1]);cookies[name]=value}return cookies};var constructor=function(){};constructor.prototype.get=function(cookieName){var returnValue;splitCookies();if(typeof cookieName==="string"){returnValue=(typeof cookies[cookieName]!=="undefined")?cookies[cookieName]:null}else{if(typeof cookieName==="object"&&cookieName!==null){returnValue={};for(var item in cookieName){if(typeof cookies[cookieName[item]]!=="undefined"){returnValue[cookieName[item]]=cookies[cookieName[item]]}else{returnValue[cookieName[item]]=null}}}else{returnValue=cookies}}return returnValue};constructor.prototype.filter=function(cookieNameRegExp){var returnValue={};splitCookies();if(typeof cookieNameRegExp==="string"){cookieNameRegExp=new RegExp(cookieNameRegExp)}for(var cookieName in cookies){if(cookieName.match(cookieNameRegExp)){returnValue[cookieName]=cookies[cookieName]}}return returnValue};constructor.prototype.set=function(cookieName,value,options){if(typeof value==="undefined"||value===null){if(typeof options!=="object"||options===null){options={}}value="";options.hoursToLive=-8760}var optionsString=assembleOptionsString(options);document.cookie=cookieName+"="+encodeURIComponent(value)+optionsString};constructor.prototype.del=function(cookieName,options){var allCookies={};if(typeof options!=="object"||options===null){options={}}if(typeof cookieName==="boolean"&&cookieName===true){allCookies=this.get()}else{if(typeof cookieName==="string"){allCookies[cookieName]=true}}for(var name in allCookies){if(typeof name==="string"&&name!==""){this.set(name,null,options)}}};constructor.prototype.test=function(){var returnValue=false,testName="cT",testValue="data";this.set(testName,testValue);if(this.get(testName)===testValue){this.del(testName);returnValue=true}return returnValue};constructor.prototype.setOptions=function(options){if(typeof options!=="object"){options=null}defaultOptions=resolveOptions(options)};return new constructor()})();(function(){if(window.jQuery){(function($){$.cookies=jaaulde.utils.cookies;var extensions={cookify:function(options){return this.each(function(){var i,resolvedName=false,resolvedValue=false,name="",value="",nameAttrs=["name","id"],nodeName,inputType;for(i in nameAttrs){if(!isNaN(i)){name=$(this).attr(nameAttrs[i]);if(typeof name==="string"&&name!==""){resolvedName=true;break}}}if(resolvedName){nodeName=this.nodeName.toLowerCase();if(nodeName!=="input"&&nodeName!=="textarea"&&nodeName!=="select"&&nodeName!=="img"){value=$(this).html();resolvedValue=true}else{inputType=$(this).attr("type");if(typeof inputType==="string"&&inputType!==""){inputType=inputType.toLowerCase()}if(inputType!=="radio"&&inputType!=="checkbox"){value=$(this).val();resolvedValue=true}}if(resolvedValue){if(typeof value!=="string"||value===""){value=null}$.cookies.set(name,value,options)}}})},cookieFill:function(){return this.each(function(){var i,resolvedName=false,name="",value,nameAttrs=["name","id"],iteration=0,nodeName;for(i in nameAttrs){if(!isNaN(i)){name=$(this).attr(nameAttrs[i]);if(typeof name==="string"&&name!==""){resolvedName=true;break}}}if(resolvedName){value=$.cookies.get(name);if(value!==null){nodeName=this.nodeName.toLowerCase();if(nodeName==="input"||nodeName==="textarea"||nodeName==="select"){$(this).val(value)}else{$(this).html(value)}}}iteration=0})},cookieBind:function(options){return this.each(function(){$(this).cookieFill().change(function(){$(this).cookify(options)})})}};$.each(extensions,function(i){$.fn[i]=this})})(window.jQuery)}})();(function(jQuery){jQuery.fn.__bind__=jQuery.fn.bind;jQuery.fn.__unbind__=jQuery.fn.unbind;jQuery.fn.__find__=jQuery.fn.find;var hotkeys={version:"0.7.9",override:/keypress|keydown|keyup/g,triggersMap:{},specialKeys:{27:"esc",9:"tab",32:"space",13:"return",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",109:"-",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",191:"/"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"},newTrigger:function(type,combi,callback){var result={};result[type]={};result[type][combi]={cb:callback,disableInInput:false};return result}};hotkeys.specialKeys=jQuery.extend(hotkeys.specialKeys,{96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"});jQuery.fn.find=function(selector){this.query=selector;return jQuery.fn.__find__.apply(this,arguments)};jQuery.fn.unbind=function(type,combi,fn){if(jQuery.isFunction(combi)){fn=combi;combi=null}if(combi&&typeof combi==="string"){var selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var hkTypes=type.split(" ");for(var x=0;x<hkTypes.length;x++){delete hotkeys.triggersMap[selectorId][hkTypes[x]][combi]}}return this.__unbind__(type,fn)};jQuery.fn.bind=function(type,data,fn){var handle=type.match(hotkeys.override);if(jQuery.isFunction(data)||!handle){return this.__bind__(type,data,fn)}else{var result=null,pass2jq=jQuery.trim(type.replace(hotkeys.override,""));if(pass2jq){result=this.__bind__(pass2jq,data,fn)}if(typeof data==="string"){data={combi:data}}if(data.combi){for(var x=0;x<handle.length;x++){var eventType=handle[x];var combi=data.combi.toLowerCase(),trigger=hotkeys.newTrigger(eventType,combi,fn),selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();trigger[eventType][combi].disableInInput=data.disableInInput;if(!hotkeys.triggersMap[selectorId]){hotkeys.triggersMap[selectorId]=trigger}else{if(!hotkeys.triggersMap[selectorId][eventType]){hotkeys.triggersMap[selectorId][eventType]=trigger[eventType]}}var mapPoint=hotkeys.triggersMap[selectorId][eventType][combi];if(!mapPoint){hotkeys.triggersMap[selectorId][eventType][combi]=[trigger[eventType][combi]]}else{if(mapPoint.constructor!==Array){hotkeys.triggersMap[selectorId][eventType][combi]=[mapPoint]}else{hotkeys.triggersMap[selectorId][eventType][combi][mapPoint.length]=trigger[eventType][combi]}}this.each(function(){var jqElem=jQuery(this);if(jqElem.attr("hkId")&&jqElem.attr("hkId")!==selectorId){selectorId=jqElem.attr("hkId")+";"+selectorId}jqElem.attr("hkId",selectorId)});result=this.__bind__(handle.join(" "),data,hotkeys.handler)}}return result}};hotkeys.findElement=function(elem){if(!jQuery(elem).attr("hkId")){if(jQuery.browser.opera||jQuery.browser.safari){while(!jQuery(elem).attr("hkId")&&elem.parentNode){elem=elem.parentNode}}}return elem};hotkeys.handler=function(event){var target=hotkeys.findElement(event.currentTarget),jTarget=jQuery(target),ids=jTarget.attr("hkId");if(ids){ids=ids.split(";");var code=event.which,type=event.type,special=hotkeys.specialKeys[code],character=!special&&String.fromCharCode(code).toLowerCase(),shift=event.shiftKey,ctrl=event.ctrlKey,alt=event.altKey||event.originalEvent.altKey,mapPoint=null;for(var x=0;x<ids.length;x++){if(hotkeys.triggersMap[ids[x]][type]){mapPoint=hotkeys.triggersMap[ids[x]][type];break}}if(mapPoint){var trigger;if(!shift&&!ctrl&&!alt){trigger=mapPoint[special]||(character&&mapPoint[character])}else{var modif="";if(alt){modif+="alt+"}if(ctrl){modif+="ctrl+"}if(shift){modif+="shift+"}trigger=mapPoint[modif+special];if(!trigger){if(character){trigger=mapPoint[modif+character]||mapPoint[modif+hotkeys.shiftNums[character]]||(modif==="shift+"&&mapPoint[hotkeys.shiftNums[character]])}}}if(trigger){var result=false;for(var x=0;x<trigger.length;x++){if(trigger[x].disableInInput){var elem=jQuery(event.target);if(jTarget.is("input")||jTarget.is("textarea")||jTarget.is("select")||elem.is("input")||elem.is("textarea")||elem.is("select")){return true}}result=result||trigger[x].cb.apply(this,[event])}return result}}}};window.hotkeys=hotkeys;return jQuery})(jQuery);(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,p=function(s,l){if(!l){l=2}return("000"+s).slice(l*-1)};$P.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};$P.setTimeToNow=function(){var n=new Date();this.setHours(n.getHours());this.setMinutes(n.getMinutes());this.setSeconds(n.getSeconds());this.setMilliseconds(n.getMilliseconds());return this};$D.today=function(){return new Date().clearTime()};$D.compare=function(date1,date2){if(isNaN(date1)||isNaN(date2)){throw new Error(date1+" - "+date2)}else{if(date1 instanceof Date&&date2 instanceof Date){return(date1<date2)?-1:(date1>date2)?1:0}else{throw new TypeError(date1+" - "+date2)}}};$D.equals=function(date1,date2){return(date1.compareTo(date2)===0)};$D.getDayNumberFromName=function(name){var n=$C.dayNames,m=$C.abbreviatedDayNames,o=$C.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s||o[i].toLowerCase()==s){return i}}return -1};$D.getMonthNumberFromName=function(name){var n=$C.monthNames,m=$C.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i}}return -1};$D.isLeapYear=function(year){return((year%4===0&&year%100!==0)||year%400===0)};$D.getDaysInMonth=function(year,month){return[31,($D.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month]};$D.getTimezoneAbbreviation=function(offset){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].offset===offset){return z[i].name}}return null};$D.getTimezoneOffset=function(name){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].name===name.toUpperCase()){return z[i].offset}}return null};$P.clone=function(){return new Date(this.getTime())};$P.compareTo=function(date){return Date.compare(this,date)};$P.equals=function(date){return Date.equals(this,date||new Date())};$P.between=function(start,end){return this.getTime()>=start.getTime()&&this.getTime()<=end.getTime()};$P.isAfter=function(date){return this.compareTo(date||new Date())===1};$P.isBefore=function(date){return(this.compareTo(date||new Date())===-1)};$P.isToday=$P.isSameDay=function(date){return this.clone().clearTime().equals((date||new Date()).clone().clearTime())};$P.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value*1);return this};$P.addSeconds=function(value){return this.addMilliseconds(value*1000)};$P.addMinutes=function(value){return this.addMilliseconds(value*60000)};$P.addHours=function(value){return this.addMilliseconds(value*3600000)};$P.addDays=function(value){this.setDate(this.getDate()+value*1);return this};$P.addWeeks=function(value){return this.addDays(value*7)};$P.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value*1);this.setDate(Math.min(n,$D.getDaysInMonth(this.getFullYear(),this.getMonth())));return this};$P.addYears=function(value){return this.addMonths(value*12)};$P.add=function(config){if(typeof config=="number"){this._orient=config;return this}var x=config;if(x.milliseconds){this.addMilliseconds(x.milliseconds)}if(x.seconds){this.addSeconds(x.seconds)}if(x.minutes){this.addMinutes(x.minutes)}if(x.hours){this.addHours(x.hours)}if(x.weeks){this.addWeeks(x.weeks)}if(x.months){this.addMonths(x.months)}if(x.years){this.addYears(x.years)}if(x.days){this.addDays(x.days)}return this};var $y,$m,$d;$P.getWeek=function(){var a,b,c,d,e,f,g,n,s,w;$y=(!$y)?this.getFullYear():$y;$m=(!$m)?this.getMonth()+1:$m;$d=(!$d)?this.getDate():$d;if($m<=2){a=$y-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=0;f=$d-1+(31*($m-1))}else{a=$y;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=s+1;f=$d+((153*($m-3)+2)/5)+58+s}g=(a+b)%7;d=(f+g-e)%7;n=(f+3-d)|0;if(n<0){w=53-((g-s)/5|0)}else{if(n>364+s){w=1}else{w=(n/7|0)+1}}$y=$m=$d=null;return w};$P.getISOWeek=function(){$y=this.getUTCFullYear();$m=this.getUTCMonth()+1;$d=this.getUTCDate();return p(this.getWeek())};$P.setWeek=function(n){return this.moveToDayOfWeek(1).addWeeks(n-this.getWeek())};var validate=function(n,min,max,name){if(typeof n=="undefined"){return false}else{if(typeof n!="number"){throw new TypeError(n+" is not a Number.")}else{if(n<min||n>max){throw new RangeError(n+" is not a valid value for "+name+".")}}}return true};$D.validateMillisecond=function(value){return validate(value,0,999,"millisecond")};$D.validateSecond=function(value){return validate(value,0,59,"second")};$D.validateMinute=function(value){return validate(value,0,59,"minute")};$D.validateHour=function(value){return validate(value,0,23,"hour")};$D.validateDay=function(value,year,month){return validate(value,1,$D.getDaysInMonth(year,month),"day")};$D.validateMonth=function(value){return validate(value,0,11,"month")};$D.validateYear=function(value){return validate(value,0,9999,"year")};$P.set=function(config){if($D.validateMillisecond(config.millisecond)){this.addMilliseconds(config.millisecond-this.getMilliseconds())}if($D.validateSecond(config.second)){this.addSeconds(config.second-this.getSeconds())}if($D.validateMinute(config.minute)){this.addMinutes(config.minute-this.getMinutes())}if($D.validateHour(config.hour)){this.addHours(config.hour-this.getHours())}if($D.validateMonth(config.month)){this.addMonths(config.month-this.getMonth())}if($D.validateYear(config.year)){this.addYears(config.year-this.getFullYear())}if($D.validateDay(config.day,this.getFullYear(),this.getMonth())){this.addDays(config.day-this.getDate())}if(config.timezone){this.setTimezone(config.timezone)}if(config.timezoneOffset){this.setTimezoneOffset(config.timezoneOffset)}if(config.week&&validate(config.week,0,53,"week")){this.setWeek(config.week)}return this};$P.moveToFirstDayOfMonth=function(){return this.set({day:1})};$P.moveToLastDayOfMonth=function(){return this.set({day:$D.getDaysInMonth(this.getFullYear(),this.getMonth())})};$P.moveToNthOccurrence=function(dayOfWeek,occurrence){var shift=0;if(occurrence>0){shift=occurrence-1}else{if(occurrence===-1){this.moveToLastDayOfMonth();if(this.getDay()!==dayOfWeek){this.moveToDayOfWeek(dayOfWeek,-1)}return this}}return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek,+1).addWeeks(shift)};$P.moveToDayOfWeek=function(dayOfWeek,orient){var diff=(dayOfWeek-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff)};$P.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff)};$P.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1};$P.getTimezone=function(){return $D.getTimezoneAbbreviation(this.getUTCOffset())};$P.setTimezoneOffset=function(offset){var here=this.getTimezoneOffset(),there=Number(offset)*-6/10;return this.addMinutes(there-here)};$P.setTimezone=function(offset){return this.setTimezoneOffset($D.getTimezoneOffset(offset))};$P.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset())};$P.isDaylightSavingTime=function(){return Date.today().set({month:0,day:1}).getTimezoneOffset()!=this.getTimezoneOffset()};$P.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r.charAt(0)+r.substr(2)}else{r=(n+10000).toString();return"+"+r.substr(1)}};$P.getElapsed=function(date){return(date||new Date())-this};if(!$P.toISOString){$P.toISOString=function(){function f(n){return n<10?"0"+n:n}return'"'+this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+'Z"'}}$P._toString=$P.toString;$P.toString=function(format){var x=this;if(format&&format.length==1){var c=$C.formatPatterns;x.t=x.toString;switch(format){case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth)}}var ord=function(n){switch(n*1){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};return format?format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(m){if(m.charAt(0)==="\\"){return m.replace("\\","")}x.h=x.getHours;switch(m){case"hh":return p(x.h()<13?(x.h()===0?12:x.h()):(x.h()-12));case"h":return x.h()<13?(x.h()===0?12:x.h()):(x.h()-12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(),4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth()+1));case"M":return x.getMonth()+1;case"t":return x.h()<12?$C.amDesignator.substring(0,1):$C.pmDesignator.substring(0,1);case"tt":return x.h()<12?$C.amDesignator:$C.pmDesignator;case"S":return ord(x.getDate());default:return m}}):this._toString()}}());Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};var TimeSpan=function(days,hours,minutes,seconds,milliseconds){var attrs="days hours minutes seconds milliseconds".split(/\s+/);var gFn=function(attr){return function(){return this[attr]}};var sFn=function(attr){return function(val){this[attr]=val;return this}};for(var i=0;i<attrs.length;i++){var $a=attrs[i],$b=$a.slice(0,1).toUpperCase()+$a.slice(1);TimeSpan.prototype[$a]=0;TimeSpan.prototype["get"+$b]=gFn($a);TimeSpan.prototype["set"+$b]=sFn($a)}if(arguments.length==4){this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds)}else{if(arguments.length==5){this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds);this.setMilliseconds(milliseconds)}else{if(arguments.length==1&&typeof days=="number"){var orient=(days<0)?-1:+1;this.setMilliseconds(Math.abs(days));this.setDays(Math.floor(this.getMilliseconds()/86400000)*orient);this.setMilliseconds(this.getMilliseconds()%86400000);this.setHours(Math.floor(this.getMilliseconds()/3600000)*orient);this.setMilliseconds(this.getMilliseconds()%3600000);this.setMinutes(Math.floor(this.getMilliseconds()/60000)*orient);this.setMilliseconds(this.getMilliseconds()%60000);this.setSeconds(Math.floor(this.getMilliseconds()/1000)*orient);this.setMilliseconds(this.getMilliseconds()%1000);this.setMilliseconds(this.getMilliseconds()*orient)}}}this.getTotalMilliseconds=function(){return(this.getDays()*86400000)+(this.getHours()*3600000)+(this.getMinutes()*60000)+(this.getSeconds()*1000)};this.compareTo=function(time){var t1=new Date(1970,1,1,this.getHours(),this.getMinutes(),this.getSeconds()),t2;if(time===null){t2=new Date(1970,1,1,0,0,0)}else{t2=new Date(1970,1,1,time.getHours(),time.getMinutes(),time.getSeconds())}return(t1<t2)?-1:(t1>t2)?1:0};this.equals=function(time){return(this.compareTo(time)===0)};this.add=function(time){return(time===null)?this:this.addSeconds(time.getTotalMilliseconds()/1000)};this.subtract=function(time){return(time===null)?this:this.addSeconds(-time.getTotalMilliseconds()/1000)};this.addDays=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*86400000))};this.addHours=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*3600000))};this.addMinutes=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*60000))};this.addSeconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+(n*1000))};this.addMilliseconds=function(n){return new TimeSpan(this.getTotalMilliseconds()+n)};this.get12HourHour=function(){return(this.getHours()>12)?this.getHours()-12:(this.getHours()===0)?12:this.getHours()};this.getDesignator=function(){return(this.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator};this.toString=function(format){this._toString=function(){if(this.getDays()!==null&&this.getDays()>0){return this.getDays()+"."+this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}else{return this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}};this.p=function(s){return(s.toString().length<2)?"0"+s:s};var me=this;return format?format.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(format){switch(format){case"d":return me.getDays();case"dd":return me.p(me.getDays());case"H":return me.getHours();case"HH":return me.p(me.getHours());case"h":return me.get12HourHour();case"hh":return me.p(me.get12HourHour());case"m":return me.getMinutes();case"mm":return me.p(me.getMinutes());case"s":return me.getSeconds();case"ss":return me.p(me.getSeconds());case"t":return((me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(me.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator}}):this._toString()};return this};Date.prototype.getTimeOfDay=function(){return new TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};var TimePeriod=function(years,months,days,hours,minutes,seconds,milliseconds){var attrs="years months days hours minutes seconds milliseconds".split(/\s+/);var gFn=function(attr){return function(){return this[attr]}};var sFn=function(attr){return function(val){this[attr]=val;return this}};for(var i=0;i<attrs.length;i++){var $a=attrs[i],$b=$a.slice(0,1).toUpperCase()+$a.slice(1);TimePeriod.prototype[$a]=0;TimePeriod.prototype["get"+$b]=gFn($a);TimePeriod.prototype["set"+$b]=sFn($a)}if(arguments.length==7){this.years=years;this.months=months;this.setDays(days);this.setHours(hours);this.setMinutes(minutes);this.setSeconds(seconds);this.setMilliseconds(milliseconds)}else{if(arguments.length==2&&arguments[0] instanceof Date&&arguments[1] instanceof Date){var d1=years.clone();var d2=months.clone();var temp=d1.clone();var orient=(d1>d2)?-1:+1;this.years=d2.getFullYear()-d1.getFullYear();temp.addYears(this.years);if(orient==+1){if(temp>d2){if(this.years!==0){this.years--}}}else{if(temp<d2){if(this.years!==0){this.years++}}}d1.addYears(this.years);if(orient==+1){while(d1<d2&&d1.clone().addDays(Date.getDaysInMonth(d1.getYear(),d1.getMonth()))<d2){d1.addMonths(1);this.months++}}else{while(d1>d2&&d1.clone().addDays(-d1.getDaysInMonth())>d2){d1.addMonths(-1);this.months--}}var diff=d2-d1;if(diff!==0){var ts=new TimeSpan(diff);this.setDays(ts.getDays());this.setHours(ts.getHours());this.setMinutes(ts.getMinutes());this.setSeconds(ts.getSeconds());this.setMilliseconds(ts.getMilliseconds())}}}return this};var Base64=(function(){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var obj={encode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else{if(isNaN(chr3)){enc4=64}}output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4)}while(i<input.length);return output},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2)}if(enc4!=64){output=output+String.fromCharCode(chr3)}}while(i<input.length);return output}};return obj})();var MD5=(function(){var hexcase=0;var b64pad="";var chrsz=8;var safe_add=function(x,y){var lsw=(x&65535)+(y&65535);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&65535)};var bit_rol=function(num,cnt){return(num<<cnt)|(num>>>(32-cnt))};var str2binl=function(str){var bin=[];var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz){bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32)}return bin};var binl2str=function(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz){str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask)}return str};var binl2hex=function(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&15)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&15)}return str};var binl2b64=function(binarray){var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";var triplet,j;for(var i=0;i<binarray.length*4;i+=3){triplet=(((binarray[i>>2]>>8*(i%4))&255)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&255)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&255);for(j=0;j<4;j++){if(i*8+j*6>binarray.length*32){str+=b64pad}else{str+=tab.charAt((triplet>>6*(3-j))&63)}}}return str};var md5_cmn=function(q,a,b,x,s,t){return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)};var md5_ff=function(a,b,c,d,x,s,t){return md5_cmn((b&c)|((~b)&d),a,b,x,s,t)};var md5_gg=function(a,b,c,d,x,s,t){return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t)};var md5_hh=function(a,b,c,d,x,s,t){return md5_cmn(b^c^d,a,b,x,s,t)};var md5_ii=function(a,b,c,d,x,s,t){return md5_cmn(c^(b|(~d)),a,b,x,s,t)};var core_md5=function(x,len){x[len>>5]|=128<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var olda,oldb,oldc,oldd;for(var i=0;i<x.length;i+=16){olda=a;oldb=b;oldc=c;oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd)}return[a,b,c,d]};var core_hmac_md5=function(key,data){var bkey=str2binl(key);if(bkey.length>16){bkey=core_md5(bkey,key.length*chrsz)}var ipad=new Array(16),opad=new Array(16);for(var i=0;i<16;i++){ipad[i]=bkey[i]^909522486;opad[i]=bkey[i]^1549556828}var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128)};var obj={hexdigest:function(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz))},b64digest:function(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz))},hash:function(s){return binl2str(core_md5(str2binl(s),s.length*chrsz))},hmac_hexdigest:function(key,data){return binl2hex(core_hmac_md5(key,data))},hmac_b64digest:function(key,data){return binl2b64(core_hmac_md5(key,data))},hmac_hash:function(key,data){return binl2str(core_hmac_md5(key,data))},test:function(){return MD5.hexdigest("abc")==="900150983cd24fb0d6963f7d28e17f72"}};return obj})();if(!Function.prototype.bind){Function.prototype.bind=function(obj){var func=this;return function(){return func.apply(obj,arguments)}}}if(!Function.prototype.prependArg){Function.prototype.prependArg=function(arg){var func=this;return function(){var newargs=[arg];for(var i=0;i<arguments.length;i++){newargs.push(arguments[i])}return func.apply(this,newargs)}}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt){var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len}for(;from<len;from++){if(from in this&&this[from]===elt){return from}}return -1}}(function(callback){var Strophe;function $build(name,attrs){return new Strophe.Builder(name,attrs)}function $msg(attrs){return new Strophe.Builder("message",attrs)}function $iq(attrs){return new Strophe.Builder("iq",attrs)}function $pres(attrs){return new Strophe.Builder("presence",attrs)}Strophe={VERSION:"@VERSION@",NS:{HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas"},addNamespace:function(name,value){Strophe.NS[name]=value},Status:{ERROR:0,CONNECTING:1,CONNFAIL:2,AUTHENTICATING:3,AUTHFAIL:4,CONNECTED:5,DISCONNECTED:6,DISCONNECTING:7,ATTACHED:8},LogLevel:{DEBUG:0,INFO:1,WARN:2,ERROR:3,FATAL:4},ElementType:{NORMAL:1,TEXT:3},TIMEOUT:1.1,SECONDARY_TIMEOUT:0.1,forEachChild:function(elem,elemName,func){var i,childNode;for(i=0;i<elem.childNodes.length;i++){childNode=elem.childNodes[i];if(childNode.nodeType==Strophe.ElementType.NORMAL&&(!elemName||this.isTagEqual(childNode,elemName))){func(childNode)}}},isTagEqual:function(el,name){return el.tagName.toLowerCase()==name.toLowerCase()},_xmlGenerator:null,_makeGenerator:function(){var doc;if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.appendChild(doc.createElement("strophe"))}else{doc=document.implementation.createDocument("jabber:client","strophe",null)}return doc},xmlElement:function(name){if(!name){return null}var node=null;if(!Strophe._xmlGenerator){Strophe._xmlGenerator=Strophe._makeGenerator()}node=Strophe._xmlGenerator.createElement(name);var a,i,k;for(a=1;a<arguments.length;a++){if(!arguments[a]){continue}if(typeof(arguments[a])=="string"||typeof(arguments[a])=="number"){node.appendChild(Strophe.xmlTextNode(arguments[a]))}else{if(typeof(arguments[a])=="object"&&typeof(arguments[a].sort)=="function"){for(i=0;i<arguments[a].length;i++){if(typeof(arguments[a][i])=="object"&&typeof(arguments[a][i].sort)=="function"){node.setAttribute(arguments[a][i][0],arguments[a][i][1])}}}else{if(typeof(arguments[a])=="object"){for(k in arguments[a]){if(arguments[a].hasOwnProperty(k)){node.setAttribute(k,arguments[a][k])}}}}}}return node},xmlescape:function(text){text=text.replace(/\&/g,"&amp;");text=text.replace(/</g,"&lt;");text=text.replace(/>/g,"&gt;");return text},xmlTextNode:function(text){text=Strophe.xmlescape(text);if(!Strophe._xmlGenerator){Strophe._xmlGenerator=Strophe._makeGenerator()}return Strophe._xmlGenerator.createTextNode(text)},getText:function(elem){if(!elem){return null}var str="";if(elem.childNodes.length===0&&elem.nodeType==Strophe.ElementType.TEXT){str+=elem.nodeValue}for(var i=0;i<elem.childNodes.length;i++){if(elem.childNodes[i].nodeType==Strophe.ElementType.TEXT){str+=elem.childNodes[i].nodeValue}}return str},copyElement:function(elem){var i,el;if(elem.nodeType==Strophe.ElementType.NORMAL){el=Strophe.xmlElement(elem.tagName);for(i=0;i<elem.attributes.length;i++){el.setAttribute(elem.attributes[i].nodeName.toLowerCase(),elem.attributes[i].value)}for(i=0;i<elem.childNodes.length;i++){el.appendChild(Strophe.copyElement(elem.childNodes[i]))}}else{if(elem.nodeType==Strophe.ElementType.TEXT){el=Strophe.xmlTextNode(elem.nodeValue)}}return el},escapeNode:function(node){return node.replace(/^\s+|\s+$/g,"").replace(/\\/g,"\\5c").replace(/ /g,"\\20").replace(/\"/g,"\\22").replace(/\&/g,"\\26").replace(/\'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40")},unescapeNode:function(node){return node.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},getNodeFromJid:function(jid){if(jid.indexOf("@")<0){return null}return jid.split("@")[0]},getDomainFromJid:function(jid){var bare=Strophe.getBareJidFromJid(jid);if(bare.indexOf("@")<0){return bare}else{var parts=bare.split("@");parts.splice(0,1);return parts.join("@")}},getResourceFromJid:function(jid){var s=jid.split("/");if(s.length<2){return null}s.splice(0,1);return s.join("/")},getBareJidFromJid:function(jid){return jid.split("/")[0]},log:function(level,msg){return},debug:function(msg){this.log(this.LogLevel.DEBUG,msg)},info:function(msg){this.log(this.LogLevel.INFO,msg)},warn:function(msg){this.log(this.LogLevel.WARN,msg)},error:function(msg){this.log(this.LogLevel.ERROR,msg)},fatal:function(msg){this.log(this.LogLevel.FATAL,msg)},serialize:function(elem){var result;if(!elem){return null}if(typeof(elem.tree)==="function"){elem=elem.tree()}var nodeName=elem.nodeName;var i,child;if(elem.getAttribute("_realname")){nodeName=elem.getAttribute("_realname")}result="<"+nodeName;for(i=0;i<elem.attributes.length;i++){if(elem.attributes[i].nodeName!="_realname"){result+=" "+elem.attributes[i].nodeName.toLowerCase()+"='"+elem.attributes[i].value.replace("&","&amp;").replace("'","&apos;").replace("<","&lt;")+"'"}}if(elem.childNodes.length>0){result+=">";for(i=0;i<elem.childNodes.length;i++){child=elem.childNodes[i];if(child.nodeType==Strophe.ElementType.NORMAL){result+=Strophe.serialize(child)}else{if(child.nodeType==Strophe.ElementType.TEXT){result+=child.nodeValue}}}result+="</"+nodeName+">"}else{result+="/>"}return result},_requestId:0,_connectionPlugins:{},addConnectionPlugin:function(name,ptype){Strophe._connectionPlugins[name]=ptype}};Strophe.Builder=function(name,attrs){if(name=="presence"||name=="message"||name=="iq"){if(attrs&&!attrs.xmlns){attrs.xmlns=Strophe.NS.CLIENT}else{if(!attrs){attrs={xmlns:Strophe.NS.CLIENT}}}}this.nodeTree=Strophe.xmlElement(name,attrs);this.node=this.nodeTree};Strophe.Builder.prototype={tree:function(){return this.nodeTree},toString:function(){return Strophe.serialize(this.nodeTree)},up:function(){this.node=this.node.parentNode;return this},attrs:function(moreattrs){for(var k in moreattrs){if(moreattrs.hasOwnProperty(k)){this.node.setAttribute(k,moreattrs[k])}}return this},c:function(name,attrs){var child=Strophe.xmlElement(name,attrs);this.node.appendChild(child);this.node=child;return this},cnode:function(elem){this.node.appendChild(elem);this.node=elem;return this},t:function(text){var child=Strophe.xmlTextNode(text);this.node.appendChild(child);return this}};Strophe.Handler=function(handler,ns,name,type,id,from,options){this.handler=handler;this.ns=ns;this.name=name;this.type=type;this.id=id;this.options=options||{matchbare:false};if(!this.options.matchBare){this.options.matchBare=false}if(this.options.matchBare){this.from=Strophe.getBareJidFromJid(from)}else{this.from=from}this.user=true};Strophe.Handler.prototype={isMatch:function(elem){var nsMatch;var from=null;if(this.options.matchBare){from=Strophe.getBareJidFromJid(elem.getAttribute("from"))}else{from=elem.getAttribute("from")}nsMatch=false;if(!this.ns){nsMatch=true}else{var self=this;Strophe.forEachChild(elem,null,function(elem){if(elem.getAttribute("xmlns")==self.ns){nsMatch=true}});nsMatch=nsMatch||elem.getAttribute("xmlns")==this.ns}if(nsMatch&&(!this.name||Strophe.isTagEqual(elem,this.name))&&(!this.type||elem.getAttribute("type")===this.type)&&(!this.id||elem.getAttribute("id")===this.id)&&(!this.from||from===this.from)){return true}return false},run:function(elem){var result=null;try{result=this.handler(elem)}catch(e){if(e.sourceURL){Strophe.fatal("error: "+this.handler+" "+e.sourceURL+":"+e.line+" - "+e.name+": "+e.message)}else{if(e.fileName){if(typeof(console)!="undefined"){console.trace();console.error(this.handler," - error - ",e,e.message)}Strophe.fatal("error: "+this.handler+" "+e.fileName+":"+e.lineNumber+" - "+e.name+": "+e.message)}else{Strophe.fatal("error: "+this.handler)}}throw e}return result},toString:function(){return"{Handler: "+this.handler+"("+this.name+","+this.id+","+this.ns+")}"}};Strophe.TimedHandler=function(period,handler){this.period=period;this.handler=handler;this.lastCalled=new Date().getTime();this.user=true};Strophe.TimedHandler.prototype={run:function(){this.lastCalled=new Date().getTime();return this.handler()},reset:function(){this.lastCalled=new Date().getTime()},toString:function(){return"{TimedHandler: "+this.handler+"("+this.period+")}"}};Strophe.Request=function(elem,func,rid,sends){this.id=++Strophe._requestId;this.xmlData=elem;this.data=Strophe.serialize(elem);this.origFunc=func;this.func=func;this.rid=rid;this.date=NaN;this.sends=sends||0;this.abort=false;this.dead=null;this.age=function(){if(!this.date){return 0}var now=new Date();return(now-this.date)/1000};this.timeDead=function(){if(!this.dead){return 0}var now=new Date();return(now-this.dead)/1000};this.xhr=this._newXHR()};Strophe.Request.prototype={getResponse:function(){var node=null;if(this.xhr.responseXML&&this.xhr.responseXML.documentElement){node=this.xhr.responseXML.documentElement;if(node.tagName=="parsererror"){Strophe.error("invalid response received");Strophe.error("responseText: "+this.xhr.responseText);Strophe.error("responseXML: "+Strophe.serialize(this.xhr.responseXML));throw"parsererror"}}else{if(this.xhr.responseText){Strophe.error("invalid response received");Strophe.error("responseText: "+this.xhr.responseText);Strophe.error("responseXML: "+Strophe.serialize(this.xhr.responseXML))}}return node},_newXHR:function(){var xhr=null;if(window.XMLHttpRequest){xhr=new XMLHttpRequest();if(xhr.overrideMimeType){xhr.overrideMimeType("text/xml")}}else{if(window.ActiveXObject){xhr=new ActiveXObject("Microsoft.XMLHTTP")}}xhr.onreadystatechange=this.func.prependArg(this);return xhr}};Strophe.Connection=function(service){this.service=service;this.jid="";this.rid=Math.floor(Math.random()*4294967295);this.sid=null;this.streamId=null;this.do_session=false;this.do_bind=false;this.timedHandlers=[];this.handlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[];this._idleTimeout=null;this._disconnectTimeout=null;this.authenticated=false;this.disconnecting=false;this.connected=false;this.errors=0;this.paused=false;this.hold=1;this.wait=60;this.window=5;this._data=[];this._requests=[];this._uniqueId=Math.round(Math.random()*10000);this._sasl_success_handler=null;this._sasl_failure_handler=null;this._sasl_challenge_handler=null;this._idleTimeout=setTimeout(this._onIdle.bind(this),100);for(var k in Strophe._connectionPlugins){if(Strophe._connectionPlugins.hasOwnProperty(k)){var ptype=Strophe._connectionPlugins[k];var F=function(){};F.prototype=ptype;this[k]=new F();this[k].init(this)}}};Strophe.Connection.prototype={reset:function(){this.rid=Math.floor(Math.random()*4294967295);this.sid=null;this.streamId=null;this.do_session=false;this.do_bind=false;this.timedHandlers=[];this.handlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[];this.authenticated=false;this.disconnecting=false;this.connected=false;this.errors=0;this._requests=[];this._uniqueId=Math.round(Math.random()*10000)},pause:function(){this.paused=true},resume:function(){this.paused=false},getUniqueId:function(suffix){if(typeof(suffix)=="string"||typeof(suffix)=="number"){return ++this._uniqueId+":"+suffix}else{return ++this._uniqueId+""}},connect:function(jid,pass,callback,wait,hold){this.jid=jid;this.pass=pass;this.connect_callback=callback;this.disconnecting=false;this.connected=false;this.authenticated=false;this.errors=0;this.wait=wait||this.wait;this.hold=hold||this.hold;this.domain=Strophe.getDomainFromJid(this.jid);var body=this._buildBody().attrs({to:this.domain,"xml:lang":"en",wait:this.wait,hold:this.hold,content:"text/xml; charset=utf-8",ver:"1.6","xmpp:version":"1.0","xmlns:xmpp":Strophe.NS.BOSH});this._changeConnectStatus(Strophe.Status.CONNECTING,null);this._requests.push(new Strophe.Request(body.tree(),this._onRequestStateChange.bind(this).prependArg(this._connect_cb.bind(this)),body.tree().getAttribute("rid")));this._throttledRequestHandler()},attach:function(jid,sid,rid,callback,wait,hold,wind){this.jid=jid;this.sid=sid;this.rid=rid;this.connect_callback=callback;this.domain=Strophe.getDomainFromJid(this.jid);this.authenticated=true;this.connected=true;this.wait=wait||this.wait;this.hold=hold||this.hold;this.window=wind||this.window;this._changeConnectStatus(Strophe.Status.ATTACHED,null)},xmlInput:function(elem){return},xmlOutput:function(elem){return},rawInput:function(data){return},rawOutput:function(data){return},send:function(elem){if(elem===null){return}if(typeof(elem.sort)==="function"){for(var i=0;i<elem.length;i++){this._queueData(elem[i])}}else{if(typeof(elem.tree)==="function"){this._queueData(elem.tree())}else{this._queueData(elem)}}this._throttledRequestHandler();clearTimeout(this._idleTimeout);this._idleTimeout=setTimeout(this._onIdle.bind(this),100)},flush:function(){clearTimeout(this._idleTimeout);this._onIdle()},sendIQ:function(elem,callback,errback,timeout){var timeoutHandler=null;var that=this;if(typeof(elem.tree)==="function"){elem=elem.tree()}var id=elem.getAttribute("id");if(!id){id=this.getUniqueId("sendIQ");elem.setAttribute("id",id)}var handler=this.addHandler(function(stanza){if(timeoutHandler){that.deleteTimedHandler(timeoutHandler)}var iqtype=stanza.getAttribute("type");if(iqtype==="result"){if(callback){callback(stanza)}}else{if(iqtype==="error"){if(errback){errback(stanza)}}else{throw {name:"StropheError",message:"Got bad IQ type of "+iqtype}}}},null,"iq",null,id);if(timeout){timeoutHandler=this.addTimedHandler(timeout,function(){that.deleteHandler(handler);if(errback){errback(null)}return false})}this.send(elem);return id},_queueData:function(element){if(element===null||!element.tagName||!element.childNodes){throw {name:"StropheError",message:"Cannot queue non-DOMElement."}}this._data.push(element)},_sendRestart:function(){this._data.push("restart");this._throttledRequestHandler();clearTimeout(this._idleTimeout);this._idleTimeout=setTimeout(this._onIdle.bind(this),100)},addTimedHandler:function(period,handler){var thand=new Strophe.TimedHandler(period,handler);this.addTimeds.push(thand);return thand},deleteTimedHandler:function(handRef){this.removeTimeds.push(handRef)},addHandler:function(handler,ns,name,type,id,from,options){var hand=new Strophe.Handler(handler,ns,name,type,id,from,options);this.addHandlers.push(hand);return hand},deleteHandler:function(handRef){this.removeHandlers.push(handRef)},disconnect:function(reason){this._changeConnectStatus(Strophe.Status.DISCONNECTING,reason);Strophe.info("Disconnect was called because: "+reason);if(this.connected){this._disconnectTimeout=this._addSysTimedHandler(3000,this._onDisconnectTimeout.bind(this));this._sendTerminate()}},_changeConnectStatus:function(status,condition){for(var k in Strophe._connectionPlugins){if(Strophe._connectionPlugins.hasOwnProperty(k)){var plugin=this[k];if(plugin.statusChanged){try{plugin.statusChanged(status,condition)}catch(err){Strophe.error(""+k+" plugin caused an exception changing status: "+err)}}}}if(this.connect_callback){try{this.connect_callback(status,condition)}catch(e){Strophe.error("User connection callback caused an exception: "+e)}}},_buildBody:function(){var bodyWrap=$build("body",{rid:this.rid++,xmlns:Strophe.NS.HTTPBIND});if(this.sid!==null){bodyWrap.attrs({sid:this.sid})}return bodyWrap},_removeRequest:function(req){Strophe.debug("removing request");var i;for(i=this._requests.length-1;i>=0;i--){if(req==this._requests[i]){this._requests.splice(i,1)}}req.xhr.onreadystatechange=function(){};this._throttledRequestHandler()},_restartRequest:function(i){var req=this._requests[i];if(req.dead===null){req.dead=new Date()}this._processRequest(i)},_processRequest:function(i){var req=this._requests[i];var reqStatus=-1;try{if(req.xhr.readyState==4){reqStatus=req.xhr.status}}catch(e){Strophe.error("caught an error in _requests["+i+"], reqStatus: "+reqStatus)}if(typeof(reqStatus)=="undefined"){reqStatus=-1}var time_elapsed=req.age();var primaryTimeout=(!isNaN(time_elapsed)&&time_elapsed>Math.floor(Strophe.TIMEOUT*this.wait));var secondaryTimeout=(req.dead!==null&&req.timeDead()>Math.floor(Strophe.SECONDARY_TIMEOUT*this.wait));var requestCompletedWithServerError=(req.xhr.readyState==4&&(reqStatus<1||reqStatus>=500));if(primaryTimeout||secondaryTimeout||requestCompletedWithServerError){if(secondaryTimeout){Strophe.error("Request "+this._requests[i].id+" timed out (secondary), restarting")}req.abort=true;req.xhr.abort();req.xhr.onreadystatechange=function(){};this._requests[i]=new Strophe.Request(req.xmlData,req.origFunc,req.rid,req.sends);req=this._requests[i]}if(req.xhr.readyState===0){Strophe.debug("request id "+req.id+"."+req.sends+" posting");req.date=new Date();try{req.xhr.open("POST",this.service,true)}catch(e2){Strophe.error("XHR open failed.");if(!this.connected){this._changeConnectStatus(Strophe.Status.CONNFAIL,"bad-service")}this.disconnect();return}var sendFunc=function(){req.xhr.send(req.data)};if(req.sends>1){var backoff=Math.pow(req.sends,3)*1000;setTimeout(sendFunc,backoff)}else{sendFunc()}req.sends++;this.xmlOutput(req.xmlData);this.rawOutput(req.data)}else{Strophe.debug("_processRequest: "+(i===0?"first":"second")+" request has readyState of "+req.xhr.readyState)}},_throttledRequestHandler:function(){if(!this._requests){Strophe.debug("_throttledRequestHandler called with undefined requests")}else{Strophe.debug("_throttledRequestHandler called with "+this._requests.length+" requests")}if(!this._requests||this._requests.length===0){return}if(this._requests.length>0){this._processRequest(0)}if(this._requests.length>1&&Math.abs(this._requests[0].rid-this._requests[1].rid)<this.window-1){this._processRequest(1)}},_onRequestStateChange:function(func,req){Strophe.debug("request id "+req.id+"."+req.sends+" state changed to "+req.xhr.readyState);if(req.abort){req.abort=false;return}var reqStatus;if(req.xhr.readyState==4){reqStatus=0;try{reqStatus=req.xhr.status}catch(e){}if(typeof(reqStatus)=="undefined"){reqStatus=0}if(this.disconnecting){if(reqStatus>=400){this._hitError(reqStatus);return}}var reqIs0=(this._requests[0]==req);var reqIs1=(this._requests[1]==req);if((reqStatus>0&&reqStatus<500)||req.sends>5){this._removeRequest(req);Strophe.debug("request id "+req.id+" should now be removed")}if(reqStatus==200){if(reqIs1||(reqIs0&&this._requests.length>0&&this._requests[0].age()>Math.floor(Strophe.SECONDARY_TIMEOUT*this.wait))){this._restartRequest(0)}Strophe.debug("request id "+req.id+"."+req.sends+" got 200");func(req);this.errors=0}else{Strophe.error("request id "+req.id+"."+req.sends+" error "+reqStatus+" happened");if(reqStatus===0||(reqStatus>=400&&reqStatus<600)||reqStatus>=12000){this._hitError(reqStatus);if(reqStatus>=400&&reqStatus<500){this._changeConnectStatus(Strophe.Status.DISCONNECTING,null);this._doDisconnect()}}}if(!((reqStatus>0&&reqStatus<10000)||req.sends>5)){this._throttledRequestHandler()}}},_hitError:function(reqStatus){this.errors++;Strophe.warn("request errored, status: "+reqStatus+", number of errors: "+this.errors);if(this.errors>4){this._onDisconnectTimeout()}},_doDisconnect:function(){Strophe.info("_doDisconnect was called");this.authenticated=false;this.disconnecting=false;this.sid=null;this.streamId=null;this.rid=Math.floor(Math.random()*4294967295);if(this.connected){this._changeConnectStatus(Strophe.Status.DISCONNECTED,null);this.connected=false}this.handlers=[];this.timedHandlers=[];this.removeTimeds=[];this.removeHandlers=[];this.addTimeds=[];this.addHandlers=[]},_dataRecv:function(req){try{var elem=req.getResponse()}catch(e){if(e!="parsererror"){throw e}this.disconnect("strophe-parsererror")}if(elem===null){return}this.xmlInput(elem);this.rawInput(Strophe.serialize(elem));var i,hand;while(this.removeHandlers.length>0){hand=this.removeHandlers.pop();i=this.handlers.indexOf(hand);if(i>=0){this.handlers.splice(i,1)}}while(this.addHandlers.length>0){this.handlers.push(this.addHandlers.pop())}if(this.disconnecting&&this._requests.length===0){this.deleteTimedHandler(this._disconnectTimeout);this._disconnectTimeout=null;this._doDisconnect();return}var typ=elem.getAttribute("type");var cond,conflict;if(typ!==null&&typ=="terminate"){cond=elem.getAttribute("condition");conflict=elem.getElementsByTagName("conflict");if(cond!==null){if(cond=="remote-stream-error"&&conflict.length>0){cond="conflict"}this._changeConnectStatus(Strophe.Status.CONNFAIL,cond)}else{this._changeConnectStatus(Strophe.Status.CONNFAIL,"unknown")}this.disconnect();return}var self=this;Strophe.forEachChild(elem,null,function(child){var i,newList;newList=self.handlers;self.handlers=[];for(i=0;i<newList.length;i++){var hand=newList[i];if(hand.isMatch(child)&&(self.authenticated||!hand.user)){if(hand.run(child)){self.handlers.push(hand)}}else{self.handlers.push(hand)}}})},_sendTerminate:function(){Strophe.info("_sendTerminate was called");var body=this._buildBody().attrs({type:"terminate"});if(this.authenticated){body.c("presence",{xmlns:Strophe.NS.CLIENT,type:"unavailable"})}this.disconnecting=true;var req=new Strophe.Request(body.tree(),this._onRequestStateChange.bind(this).prependArg(this._dataRecv.bind(this)),body.tree().getAttribute("rid"));this._requests.push(req);this._throttledRequestHandler()},_connect_cb:function(req){Strophe.info("_connect_cb was called");this.connected=true;var bodyWrap=req.getResponse();if(!bodyWrap){return}this.xmlInput(bodyWrap);this.rawInput(Strophe.serialize(bodyWrap));var typ=bodyWrap.getAttribute("type");var cond,conflict;if(typ!==null&&typ=="terminate"){cond=bodyWrap.getAttribute("condition");conflict=bodyWrap.getElementsByTagName("conflict");if(cond!==null){if(cond=="remote-stream-error"&&conflict.length>0){cond="conflict"}this._changeConnectStatus(Strophe.Status.CONNFAIL,cond)}else{this._changeConnectStatus(Strophe.Status.CONNFAIL,"unknown")}return}if(!this.sid){this.sid=bodyWrap.getAttribute("sid")}if(!this.stream_id){this.stream_id=bodyWrap.getAttribute("authid")}var wind=bodyWrap.getAttribute("requests");if(wind){this.window=parseInt(wind,10)}var hold=bodyWrap.getAttribute("hold");if(hold){this.hold=parseInt(hold,10)}var wait=bodyWrap.getAttribute("wait");if(wait){this.wait=parseInt(wait,10)}var do_sasl_plain=false;var do_sasl_digest_md5=false;var do_sasl_anonymous=false;var mechanisms=bodyWrap.getElementsByTagName("mechanism");var i,mech,auth_str,hashed_auth_str;if(mechanisms.length>0){for(i=0;i<mechanisms.length;i++){mech=Strophe.getText(mechanisms[i]);if(mech=="DIGEST-MD5"){do_sasl_digest_md5=true}else{if(mech=="PLAIN"){do_sasl_plain=true}else{if(mech=="ANONYMOUS"){do_sasl_anonymous=true}}}}}else{var body=this._buildBody();this._requests.push(new Strophe.Request(body.tree(),this._onRequestStateChange.bind(this).prependArg(this._connect_cb.bind(this)),body.tree().getAttribute("rid")));this._throttledRequestHandler();return}if(Strophe.getNodeFromJid(this.jid)===null&&do_sasl_anonymous){this._changeConnectStatus(Strophe.Status.AUTHENTICATING,null);this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null);this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null);this.send($build("auth",{xmlns:Strophe.NS.SASL,mechanism:"ANONYMOUS"}).tree())}else{if(Strophe.getNodeFromJid(this.jid)===null){this._changeConnectStatus(Strophe.Status.CONNFAIL,"x-strophe-bad-non-anon-jid");this.disconnect()}else{if(do_sasl_digest_md5){this._changeConnectStatus(Strophe.Status.AUTHENTICATING,null);this._sasl_challenge_handler=this._addSysHandler(this._sasl_challenge1_cb.bind(this),null,"challenge",null,null);this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null);this.send($build("auth",{xmlns:Strophe.NS.SASL,mechanism:"DIGEST-MD5"}).tree())}else{if(do_sasl_plain){auth_str=Strophe.getBareJidFromJid(this.jid);auth_str=auth_str+"\u0000";auth_str=auth_str+Strophe.getNodeFromJid(this.jid);auth_str=auth_str+"\u0000";auth_str=auth_str+this.pass;this._changeConnectStatus(Strophe.Status.AUTHENTICATING,null);this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null);this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null);hashed_auth_str=Base64.encode(auth_str);this.send($build("auth",{xmlns:Strophe.NS.SASL,mechanism:"PLAIN"}).t(hashed_auth_str).tree())}else{this._changeConnectStatus(Strophe.Status.AUTHENTICATING,null);this._addSysHandler(this._auth1_cb.bind(this),null,null,null,"_auth_1");this.send($iq({type:"get",to:this.domain,id:"_auth_1"}).c("query",{xmlns:Strophe.NS.AUTH}).c("username",{}).t(Strophe.getNodeFromJid(this.jid)).tree())}}}}},_sasl_challenge1_cb:function(elem){var attribMatch=/([a-z]+)=("[^"]+"|[^,"]+)(?:,|$)/;var challenge=Base64.decode(Strophe.getText(elem));var cnonce=MD5.hexdigest(Math.random()*1234567890);var realm="";var host=null;var nonce="";var qop="";var matches;this.deleteHandler(this._sasl_failure_handler);while(challenge.match(attribMatch)){matches=challenge.match(attribMatch);challenge=challenge.replace(matches[0],"");matches[2]=matches[2].replace(/^"(.+)"$/,"$1");switch(matches[1]){case"realm":realm=matches[2];break;case"nonce":nonce=matches[2];break;case"qop":qop=matches[2];break;case"host":host=matches[2];break}}var digest_uri="xmpp/"+this.domain;if(host!==null){digest_uri=digest_uri+"/"+host}var A1=MD5.hash(Strophe.getNodeFromJid(this.jid)+":"+realm+":"+this.pass)+":"+nonce+":"+cnonce;var A2="AUTHENTICATE:"+digest_uri;var responseText="";responseText+="username="+this._quote(Strophe.getNodeFromJid(this.jid))+",";responseText+="realm="+this._quote(realm)+",";responseText+="nonce="+this._quote(nonce)+",";responseText+="cnonce="+this._quote(cnonce)+",";responseText+='nc="00000001",';responseText+='qop="auth",';responseText+="digest-uri="+this._quote(digest_uri)+",";responseText+="response="+this._quote(MD5.hexdigest(MD5.hexdigest(A1)+":"+nonce+":00000001:"+cnonce+":auth:"+MD5.hexdigest(A2)))+",";responseText+='charset="utf-8"';this._sasl_challenge_handler=this._addSysHandler(this._sasl_challenge2_cb.bind(this),null,"challenge",null,null);this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null);this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null);this.send($build("response",{xmlns:Strophe.NS.SASL}).t(Base64.encode(responseText)).tree());return false},_quote:function(str){return'"'+str.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},_sasl_challenge2_cb:function(elem){this.deleteHandler(this._sasl_success_handler);this.deleteHandler(this._sasl_failure_handler);this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null);this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null);this.send($build("response",{xmlns:Strophe.NS.SASL}).tree());return false},_auth1_cb:function(elem){var iq=$iq({type:"set",id:"_auth_2"}).c("query",{xmlns:Strophe.NS.AUTH}).c("username",{}).t(Strophe.getNodeFromJid(this.jid)).up().c("password").t(this.pass);if(!Strophe.getResourceFromJid(this.jid)){this.jid=Strophe.getBareJidFromJid(this.jid)+"/strophe"}iq.up().c("resource",{}).t(Strophe.getResourceFromJid(this.jid));this._addSysHandler(this._auth2_cb.bind(this),null,null,null,"_auth_2");this.send(iq.tree());return false},_sasl_success_cb:function(elem){Strophe.info("SASL authentication succeeded.");this.deleteHandler(this._sasl_failure_handler);this._sasl_failure_handler=null;if(this._sasl_challenge_handler){this.deleteHandler(this._sasl_challenge_handler);this._sasl_challenge_handler=null}this._addSysHandler(this._sasl_auth1_cb.bind(this),null,"stream:features",null,null);this._sendRestart();return false},_sasl_auth1_cb:function(elem){var i,child;for(i=0;i<elem.childNodes.length;i++){child=elem.childNodes[i];if(child.nodeName=="bind"){this.do_bind=true}if(child.nodeName=="session"){this.do_session=true}}if(!this.do_bind){this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);return false}else{this._addSysHandler(this._sasl_bind_cb.bind(this),null,null,null,"_bind_auth_2");var resource=Strophe.getResourceFromJid(this.jid);if(resource){this.send($iq({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:Strophe.NS.BIND}).c("resource",{}).t(resource).tree())}else{this.send($iq({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:Strophe.NS.BIND}).tree())}}return false},_sasl_bind_cb:function(elem){if(elem.getAttribute("type")=="error"){Strophe.info("SASL binding failed.");this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);return false}var bind=elem.getElementsByTagName("bind");var jidNode;if(bind.length>0){jidNode=bind[0].getElementsByTagName("jid");if(jidNode.length>0){this.jid=Strophe.getText(jidNode[0]);if(this.do_session){this._addSysHandler(this._sasl_session_cb.bind(this),null,null,null,"_session_auth_2");this.send($iq({type:"set",id:"_session_auth_2"}).c("session",{xmlns:Strophe.NS.SESSION}).tree())}else{this.authenticated=true;this._changeConnectStatus(Strophe.Status.CONNECTED,null)}}}else{Strophe.info("SASL binding failed.");this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);return false}},_sasl_session_cb:function(elem){if(elem.getAttribute("type")=="result"){this.authenticated=true;this._changeConnectStatus(Strophe.Status.CONNECTED,null)}else{if(elem.getAttribute("type")=="error"){Strophe.info("Session creation failed.");this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);return false}}return false},_sasl_failure_cb:function(elem){if(this._sasl_success_handler){this.deleteHandler(this._sasl_success_handler);this._sasl_success_handler=null}if(this._sasl_challenge_handler){this.deleteHandler(this._sasl_challenge_handler);this._sasl_challenge_handler=null}this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);return false},_auth2_cb:function(elem){if(elem.getAttribute("type")=="result"){this.authenticated=true;this._changeConnectStatus(Strophe.Status.CONNECTED,null)}else{if(elem.getAttribute("type")=="error"){this._changeConnectStatus(Strophe.Status.AUTHFAIL,null);this.disconnect()}}return false},_addSysTimedHandler:function(period,handler){var thand=new Strophe.TimedHandler(period,handler);thand.user=false;this.addTimeds.push(thand);return thand},_addSysHandler:function(handler,ns,name,type,id){var hand=new Strophe.Handler(handler,ns,name,type,id);hand.user=false;this.addHandlers.push(hand);return hand},_onDisconnectTimeout:function(){Strophe.info("_onDisconnectTimeout was called");var req;while(this._requests.length>0){req=this._requests.pop();req.abort=true;req.xhr.abort();req.xhr.onreadystatechange=function(){}}this._doDisconnect();return false},_onIdle:function(){var i,thand,since,newList;while(this.removeTimeds.length>0){thand=this.removeTimeds.pop();i=this.timedHandlers.indexOf(thand);if(i>=0){this.timedHandlers.splice(i,1)}}while(this.addTimeds.length>0){this.timedHandlers.push(this.addTimeds.pop())}var now=new Date().getTime();newList=[];for(i=0;i<this.timedHandlers.length;i++){thand=this.timedHandlers[i];if(this.authenticated||!thand.user){since=thand.lastCalled+thand.period;if(since-now<=0){if(thand.run()){newList.push(thand)}}else{newList.push(thand)}}}this.timedHandlers=newList;var body,time_elapsed;if(this.authenticated&&this._requests.length===0&&this._data.length===0&&!this.disconnecting){Strophe.info("no requests during idle cycle, sending blank request");this._data.push(null)}if(this._requests.length<2&&this._data.length>0&&!this.paused){body=this._buildBody();for(i=0;i<this._data.length;i++){if(this._data[i]!==null){if(this._data[i]==="restart"){body.attrs({to:this.domain,"xml:lang":"en","xmpp:restart":"true","xmlns:xmpp":Strophe.NS.BOSH})}else{body.cnode(this._data[i]).up()}}}delete this._data;this._data=[];this._requests.push(new Strophe.Request(body.tree(),this._onRequestStateChange.bind(this).prependArg(this._dataRecv.bind(this)),body.tree().getAttribute("rid")));this._processRequest(this._requests.length-1)}if(this._requests.length>0){time_elapsed=this._requests[0].age();if(this._requests[0].dead!==null){if(this._requests[0].timeDead()>Math.floor(Strophe.SECONDARY_TIMEOUT*this.wait)){this._throttledRequestHandler()}}if(time_elapsed>Math.floor(Strophe.TIMEOUT*this.wait)){Strophe.warn("Request "+this._requests[0].id+" timed out, over "+Math.floor(Strophe.TIMEOUT*this.wait)+" seconds since last activity");this._throttledRequestHandler()}}clearTimeout(this._idleTimeout);this._idleTimeout=setTimeout(this._onIdle.bind(this),100)}};if(callback){callback(Strophe,$build,$msg,$iq,$pres)}})(function(){window.Strophe=arguments[0];window.$build=arguments[1];window.$msg=arguments[2];window.$iq=arguments[3];window.$pres=arguments[4]});var ESCAPENEEDED=/(#|\;|&|\,|\.|\+|\*|~|\'|\:|\"|\!|\^|\$|\[|\]|\(|\)|\=|\>|\||\/|@|\s)/g;(function($){$.selectorEscape=function(str){var retval=str.replace(ESCAPENEEDED,"\\$1");return retval}})(jQuery);var Dispatch={LOG_ALL_EVENTS:false,LOG_ALL_NON_TIME_EVENTS:false,chains:{},prioritymap:{low:100,med:50,high:1},publish:function(event,data){if((this.LOG_ALL_EVENTS&&!this.LOG_ALL_NON_TIME_EVENTS)||(this.LOG_ALL_NON_TIME_EVENTS&&event!=="collecta_second_tick")){console.log(event)}var chain=Dispatch._find_chain(event);for(var i=0;i<chain.length;i++){try{chain[i].handler(data)}catch(error){console.error(error)}}},publish_async:function(event,data){setTimeout(function(){Dispatch.publish(event,data)},0)},subscribe:function(event,fn,priority){var chain=Dispatch._find_chain(event);var prio=50;if(priority){prio=priority;if(Dispatch.prioritymap[priority]){prio=Dispatch.prioritymap[priority]}}var handler={handler:fn,priority:prio};chain.push(handler);chain.sort(function(a,b){return a.priority-b.priority});return fn},_find_chain:function(event){var chain=Dispatch.chains[event];if(!chain){chain=Dispatch.chains[event]=[]}return chain}};var Paraphrase={_SUMMIZE_URL:"http://search.twitter.com/search.json",_HOURLY_LIMIT:100,_INTERVAL:1000,_MONTH:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},_NS_RESULTS:"http://api.collecta.com/ns/search-0#results",_time_start:null,_requests:null,_queries:null,_timer:null,init:function(){this._reset();this._refresh_timer()},stop:function(){if(this._idle_timer){clearTimeout(this._timer)}this._reset()},_reset:function(){this._requests=0;this._time_start=new Date();this._queries={}},_process:function(){var now=new Date();var elapsed=now-this._time_start;if(elapsed>=3600000){elapsed=0;this._time_start=now}var length=0;$.each(this._queries,function(){length+=1});var latency=((3600000-elapsed)/100)*(length>0?length:1);var that=this;$.each(this._queries,function(query){var time_since_last=now-this.last_fetched;if(time_since_last>latency){that._fetch(query)}});this._refresh_timer()},_bind:function(func,obj){return function(){return func.apply(obj,arguments)}},_refresh_timer:function(){if(this._idle_timer){clearTimeout(this._timer)}this._timer=setTimeout(this._bind(this._process,this),this._INTERVAL)},_fetch:function(query){if(this._queries[query]){var tquery=$.trim(query.replace(/site:.+/,""));var url=this._SUMMIZE_URL+"?q="+escape(tquery);var since=this._queries[query].last_since_id;if(since){url+="&since_id="+since}else{url+="&rpp=10"}url+="&callback=?";var that=this;this._queries[query].last_fetched=new Date();$.getJSON(url,function(data){if(!data||!data.results){if(data.error){console.log("Twitter API error fetching "+url+": "+data.error)}else{console.log("unexpected twitter api response: "+data)}return}if(data.results.length>0&&that._queries[query]){that._queries[query].last_since_id=data.results[0].id}$.each(data.results.reverse(),function(){that._event(query,this)});Dispatch.publish("paraphrase_results_done",{initial:that._queries[query].initial,query:query});that._queries[query].initial=false})}},_event:function(query,data){var payload=this._build_payload(data);var obj={payload:payload,query:query};Dispatch.publish("paraphrase_result",obj)},_convert_date:function(indate){var date_parts=indate.split(/ +/);var outdate=[];outdate.push(date_parts[3]);outdate.push("-");outdate.push(this._MONTH[date_parts[2]]);outdate.push("-");outdate.push(date_parts[1]);outdate.push("T");outdate.push(date_parts[4]);outdate.push("Z");return outdate.join("")},_text_to_xml:function(text){var doc=null;if(window.DOMParser){var parser=new DOMParser();doc=parser.parseFromString(text,"text/xml")}else{if(window.ActiveXObject){doc=new ActiveXObject("MSXML2.DOMDocument");doc.async=false;doc.loadXML(text)}else{throw {type:"ParaphraseError",message:"No DOMParser object found."}}}var elem=doc.documentElement;if($(elem).filter("parsererror").length>0){throw {type:"ParaphraseError",message:"Couldn't parse input."}}return elem},_build_payload:function(data){var atom=[];atom.push("<entry xmlns='http://www.w3.org/2005/Atom'>");atom.push("<source>");atom.push("<title>"+data.from_user+"</title>");atom.push("<icon>"+data.profile_image_url+"</icon>");atom.push("<author><name>"+data.from_user+"</name></author>");atom.push("<link href='http://twitter.com/"+data.from_user+"'/>");atom.push("</source>");atom.push("<link href='http://twitter.com/"+data.from_user+"/status/"+data.id+"'/>");atom.push("<id>http://twitter.com/"+data.from_user+"/status/"+data.id+"</id>");atom.push("<title>"+data.text+"</title>");atom.push("<content>"+data.text+"</content>");atom.push("<updated>"+this._convert_date(data.created_at)+"</updated>");atom.push("<language xmlns='"+this._NS_RESULTS+"'>en</language>");atom.push("<category xmlns='"+this._NS_RESULTS+"'>update</category>");atom.push("<link rel='collecta-abstract-image' href='"+data.profile_image_url+"'/>");atom.push("</entry>");return this._text_to_xml(atom.join(""))},subscribe:function(query){if(!this._queries[query]){this._queries[query]={last_since_id:null,last_fetched:null,initial:true}}this._fetch(query)},unsubscribe:function(query){if(this._queries){delete this._queries[query]}}};if(!window.console){window.console={log:function(data){},info:function(data){},error:function(data){},warn:function(data){}}}var Collecta={TREND_NODE:"/home/collecta.com/trend",FAVICON_MAP:{},TrendingModel:{},Trending:{},SearchModel:{},Search:{},_filters:{},urlwbr:function(str,num){return str.replace(RegExp("(\\S{"+num+"})(\\S)","g"),function(all,text,char_){return text+"<wbr />"+char_})},cleanJS:function(text){var content_html=$("<div>"+text+"</div>");content_html.find("script").remove();content_html.find("[style]").attr("style","");content_html.find("a").attr("target","_blank");return content_html.html()},escapeRegex:function(text){var retval=text;var replace_regex=/(\?|\+|\-|\||\^|\$|\(|\)|\*|\"|\'|\:|\;|\.|\,|\/|\~|\\|\]|\[|\}|\{)/g;retval=text.replace(replace_regex,"\\$1");return retval},addClickThrough:function($elem,click_through_url,search){var url=$elem.attr("href");clrep=Collecta.escapeRegex(click_through_url);var rem_url=url.replace(clrep,"");b=new Image;b.src=click_through_url+encodeURIComponent(rem_url)+"&q="+encodeURIComponent(search)+"&fromimg=1"},runFilter:function(filterName,params){var retval=params.data;if(Collecta._filters[filterName]!==undefined){retval=Collecta._filters[filterName](params)}return retval},addFilter:function(filterName,func){Collecta._filters[filterName]=func},wordCount:function(text){var retval=0;if(text!==""){var text2=text.replace(/\s+/g," ");text2=text2.replace(/[^0-9a-zA-Z]/g," ");text2=jQuery.trim(text2);var text3=text2.split(" ");retval=text3.length}return retval},addTimer:function(time,func){var second_count=0;Dispatch.subscribe("collecta_second_tick",function(){if(second_count===time){func();second_count=0}else{second_count=second_count+1}})},atomToDate:function(atom){var atomFormat=/^\d+-\d+-\d+T\d+:\d+:\d+Z$/i;if(!atomFormat.test(atom)){return false}var year=atom.substr(0,4);year=parseInt(year,10);var month=/-\d+-/.exec(atom);month=month[0].replace(/-/g,"");month=parseInt(month,10);var day=/-\d+T/.exec(atom);day=day[0].replace(/-/g,"").replace(/T/,"");day=parseInt(day,10);var hour=/T\d+:/.exec(atom);hour=hour[0].replace(/:/g,"").replace(/T/,"");hour=parseInt(hour,10);var minute=/:\d+:/.exec(atom);minute=minute[0].replace(/:/g,"");minute=parseInt(minute,10);var sec=/:\d+Z/.exec(atom);sec=sec[0].replace(/:/g,"").replace(/Z/,"");sec=parseInt(sec,10);var date=new Date(year,month,day,hour,minute,sec);return date},getNextPart:function(s,sep){var idx=s.indexOf(sep);if(idx>=0){return s.slice(idx+1)}return null},findSource:function(tag){var match=/^http:\/\/([^\/]+)\/(.*)$/.exec(tag);if(match){var domain=match[1];var path=match[2];var dpart=domain;while(dpart){var m=Collecta.FAVICON_MAP[dpart];if(m&&m.sort){var pparts=path.split("/");var i;for(i=0;i<pparts.length;i++){if(pparts[i].length>0&&m[i]&&m[i][pparts[i]]){return m[i][pparts[i]]}}return null}else{if(m){return m}}dpart=Collecta.getNextPart(dpart,".")}return["http://",domain,"/favicon.ico"].join("")}return null},createFavIcon:function(faviconUrl){var favicon=$('<img src="'+faviconUrl+'" alt="" class="displayNone" />');var extImg=new Image();extImg.src=faviconUrl;if(extImg.complete){favicon.removeClass("displayNone")}else{extImg.onload=function(){favicon.removeClass("displayNone")}}return favicon}};Collecta.ErrorView=function(){return{display:function(msg){var error_html=$("#result_error").clone();error_html.removeAttr("id");error_html.html(msg);error_html.show();$("#msgs").find("span").html(error_html.html());$("#msgs").slideDown()},hide:function(){$("#msgs").fadeOut();$("#msgs").find("span").empty()}}}();Collecta.timer=function(){var start_time={};var elapsed_time={};return{init:function(time,id){if(!time){start_time[id]=new Date()}else{start_time[id]=new Date(parseInt(time,10))}return this},elapsedTime:function(now,id){if(!now){now=new Date()}if(start_time[id]){elapsed_time[id]=new TimeSpan(now-start_time[id])}else{elapsed_time[id]=false}return elapsed_time[id]},resetTimer:function(id){elapsed_time[id]=false},getStartTime:function(id){if(start_time[id]){return start_time[id]}else{return false}},getElapsedTime:function(id){if(elapsed_time[id]){return elapsed_time[id]}else{return false}}}}();Collecta.ReconnectView=function(){var timeout_time=50;var saved_timeout=50;var display_msg=true;var obj={updateReconnectTimer:function(){$("#reconnect_timer").text(timeout_time);if(timeout_time===0){timeout_time=saved_timeout*2;saved_timeout=timeout_time;Collecta.ReconnectView.reset();Collecta.ClientModel.reconnect()}else{if(!display_msg){setTimeout(Collecta.ReconnectView.updateReconnectTimer,1000);timeout_time=timeout_time-1}}},reset:function(){display_msg=true;if(saved_timeout<50){timeout_time=saved_timeout}else{timeout_time=50;saved_timeout=50}Collecta.ErrorView.hide();if($(".activeSearch :first span").text()!==""){$(".resultsCount").show()}},reconnectWithTimer:function(){if(display_msg){var $main_visible=$("#main");if($main_visible.is(":visible")){Collecta.ErrorView.display("You are no longer connected. You will be reconnected in <span id='reconnect_timer'>60</span> seconds. <a href='#' id='reconnect_app'>Reconnect</a> now.")}$(".resultsCount").hide();$("#reconnect_app").click(function(){Collecta.ClientModel.reconnect()});setTimeout(Collecta.ReconnectView.updateReconnectTimer,1000);display_msg=false}}};return obj}();Dispatch.subscribe("collecta.xmpp.connection.disconnect",function(){Collecta.ReconnectView.reconnectWithTimer()});Collecta.XMPP={BOSH_URL:"/xmpp-httpbind",PREBIND_URL:"/http-pre-bind",DOMAIN:"collecta.com",DEFAULT_WAIT:60,DEFAULT_HOLD:1,DEFAULT_ROUTE:"xmpp:xmpp.collecta.com:5222",DEFAULT_WINDOW:5,PUBSUB_COMPONENT:"pubsub.collecta.com",SEARCH_COMPONENT:"search.collecta.com",ARCHIVE_COMPONENT:"search.collecta.com",SEARCH_NODE:"search",MAX_SCROLL_SIZE:500,MAX_ITEM_SIZE:2000,NS:{SEARCH:"jabber:iq:search",PUBSUB:"http://jabber.org/protocol/pubsub",PUBSUB_SUBSCRIBE_OPTIONS:"http://jabber.org/protocol/pubsub#subscribe_options",ARCHIVE_OPTIONS:"collecta#options",DSL_OPTIONS:"collecta#query",RESULTS_OPTIONS:"collecta#notify",API_KEY_OPTIONS:"x-collecta#apikey"}};Collecta.ClientModel=function(){var conn=new Strophe.Connection(Collecta.XMPP.PREBIND_URL);var connected=false;var disconnected=true;var anonymous=true;var auth_fail=false;var subscribing=false;var userHostJid=function(){var jid=conn.jid;var userhostjidar=conn.jid.split("/");if(userhostjidar.length>0){jid=userhostjidar[0]}return jid};var unsubscribe=function(jid,service,node,call_back){var subid=conn.getUniqueId("unsubscribenode");var sub=$iq({from:jid,to:service,type:"set",id:subid});sub.c("pubsub",{xmlns:Collecta.XMPP.NS.PUBSUB}).c("unsubscribe",{node:node,jid:jid});conn.send(sub.tree());conn.addHandler(call_back,null,"iq",null,subid,null);return subid};var connFail=function(cond){var xmpp_error_message="";if(cond==="remote-connection-failed"&&!connected){xmpp_error_message="Error: Remote connection failed. Please check the domain portion of your username and try again."}else{if(cond==="remote-connection-failed"&&connected){xmpp_error_message="Error: Remote connection failed."}else{if(cond==="conflict"){xmpp_error_message="Error: You have been logged out due to a second login attempt from the same JID and resource."}else{if(cond==="bad-service"){xmpp_error_message="Error: Unable to contact web server."}else{if(disconnected){xmpp_error_message="Error: An unknown error occurred. Please try again, and if this problem persists, contact support."}}}}}if(xmpp_error_message.length!==0){Dispatch.publish("collecta.xmpp.connection.fail",[xmpp_error_message])}};var connecting=function(cond){Dispatch.publish("collecta.xmpp.connection.connecting",cond)};var clientDisconnect=function(cond){if(connected){disconnected=true;connected=false;conn.disconnect();Dispatch.publish("collecta.xmpp.connection.disconnect")}};var authFail=function(cond){auth_fail=true;clientDisconnect();Dispatch.publish("collecta.xmpp.authfail",cond)};var setConnected=function(cond){connected=true;disconnected=false;var presence=$pres({from:conn.jid}).tree();conn.send(presence);Dispatch.publish("collecta.xmpp.connection.connected",[cond])};var disconnectedHandler=function(cond){disconnected=true;connected=false;Dispatch.publish("collecta.xmpp.connection.disconnect",[cond])};var disconnecting=function(cond){if(!connected){Dispatch.publish("collecta.xmpp.connection.disconnecting",[cond])}};var connectCallback=function(status,cond){var statusMap={0:connFail,2:connFail,3:connecting,4:authFail,5:setConnected,6:disconnectedHandler,7:disconnecting};var callme=statusMap[status];if(callme){callme([cond])}};var prebindCallback=function(status){var $status=$(status);var jid=$status.find("jid").text();var sid=$status.find("body").attr("sid");var rid=parseInt($status.find("body").attr("rid"),10)+1;conn.service=Collecta.XMPP.BOSH_URL;conn.attach(jid,sid,rid,connectCallback);setConnected()};var addApiKey=function(){var retval=false;if(Collecta.XMPP.NS.API_KEY_OPTIONS){var apikey_elem=Strophe.xmlElement("field",[["var",Collecta.XMPP.NS.API_KEY_OPTIONS],["type","text-single"],["label","API key"]]);var apivalue=Strophe.xmlElement("value",[]);if(Collecta.XMPP.API_KEY){var apitext=Strophe.xmlTextNode(Collecta.XMPP.API_KEY);apivalue.appendChild(apitext);apikey_elem.appendChild(apivalue);retval=apikey_elem}}return retval};var search=function(jid,service,options,set,call_back){var subid=conn.getUniqueId("searcharchive");var sub_options=Strophe.xmlElement("pubsub",[["xmlns",Collecta.XMPP.NS.PUBSUB]]);var options_elem=Strophe.xmlElement("options",[["node","search"]]);var items=Strophe.xmlElement("items",[["node","search"]]);var x=Strophe.xmlElement("x",[["xmlns","jabber:x:data"],["type","submit"]]);var form_field=Strophe.xmlElement("field",[["var","FORM_TYPE"],["type","hidden"]]);var value=Strophe.xmlElement("value",[]);var text=Strophe.xmlTextNode(Collecta.XMPP.NS.ARCHIVE_OPTIONS);value.appendChild(text);form_field.appendChild(value);x.appendChild(form_field);var api_key_elem=addApiKey();if(api_key_elem){x.appendChild(api_key_elem)}jQuery.each(options,function(i,val){var form_field=Strophe.xmlElement("field",[["var",Collecta.XMPP.NS.DSL_OPTIONS]]);var value=Strophe.xmlElement("value",[]);var text=Strophe.xmlTextNode(val);value.appendChild(text);form_field.appendChild(value);x.appendChild(form_field)});var set_xml=null;if(set&&("function"===typeof(set))){call_back=set}else{set_xml=$build("set",{});jQuery.each(set,function(i,val){var text_node=Strophe.xmlTextNode(val);set_xml.c(i).cnode(text_node).up().up()})}if(options.length!==0){options_elem.appendChild(x);sub_options.appendChild(items);sub_options.appendChild(options_elem)}var sub=$iq({from:jid,to:service,type:"get",id:subid});if(set_xml){options_elem.appendChild(set_xml.tree())}sub.cnode(sub_options);conn.addHandler(call_back,null,"iq",null,subid,null);conn.send(sub.tree());return subid};var handleMessage=function(stanza){if(subscribing===false){var data=[stanza];Dispatch.publish("collecta.xmpp.new_message",data)}return true};var unsubCallback=function(stanza){var error=$(stanza).find("error");if(error.length!==0){console.error("Error unsubscribing from node, id "+$(stanza).attr("id"))}else{Dispatch.publish("collecta.xmpp.unsubscribed",[stanza])}};var subscribe=function(jid,service,node,options,call_back){var subid=conn.getUniqueId("subscribenode");var sub_options=Strophe.xmlElement("options",[]);var x=Strophe.xmlElement("x",[["xmlns","jabber:x:data"],["type","submit"]]);var form_field=Strophe.xmlElement("field",[["var","FORM_TYPE"],["type","hidden"]]);var value=Strophe.xmlElement("value",[]);var text=Strophe.xmlTextNode(Collecta.XMPP.NS.PUBSUB_SUBSCRIBE_OPTIONS);value.appendChild(text);form_field.appendChild(value);x.appendChild(form_field);jQuery.each(options,function(i,val){x.appendChild(val)});if(options.length!==0){sub_options.appendChild(x)}var sub=$iq({from:jid,to:service,type:"set",id:subid});sub.c("pubsub",{xmlns:Collecta.XMPP.NS.PUBSUB}).c("subscribe",{node:node,jid:jid}).up().cnode(sub_options);conn.send(sub.tree());conn.addHandler(call_back,null,"iq",null,subid,null);return subid};var xmppSearchSubscribe=function(keywords,updates,cb){var retval={};var search_options=[];var api_key_elem=addApiKey();if(api_key_elem){search_options.push(api_key_elem)}var keyword_elem=Strophe.xmlElement("field",[["var",Collecta.XMPP.NS.DSL_OPTIONS],["type","text-single"],["label","keyword to match"]]);var value=Strophe.xmlElement("value",[]);if(keywords){var text=Strophe.xmlTextNode(keywords);value.appendChild(text);keyword_elem.appendChild(value);search_options.push(keyword_elem)}if(updates){var notify_elem=Strophe.xmlElement("field",[["var",Collecta.XMPP.NS.RESULTS_OPTIONS],["type","text-multi"],["label","keyword to notify"]]);jQuery.each(updates,function(i,val){var value=Strophe.xmlElement("value",[]);var text=Strophe.xmlTextNode(val);value.appendChild(text);notify_elem.appendChild(value);search_options.push(notify_elem)})}var iqid=subscribe(conn.jid,Collecta.XMPP.SEARCH_COMPONENT,Collecta.XMPP.SEARCH_NODE,search_options,function(stanza){var error=$(stanza).find("error");if(error.length!==0){console.error("Error subscribing to node.");Dispatch.publish("collecta.xmpp.error",["Error subscribing to node."])}else{subscribing=false;Dispatch.publish("collecta.xmpp.subscribed",[])}});retval.searchid=iqid;if(cb){cb(retval)}};var obj={connection:function(){return conn},disconnect:function(){clientDisconnect()},attach:function(status){if(!connected){prebindCallback(status)}},unload:function(){Dispatch.publish("collecta.exit",[]);Dispatch.subscribe("collecta.exit",function(){unsubscribe(conn.jid,Collecta.XMPP.SEARCH_COMPONENT,Collecta.XMPP.SEARCH_NODE,function(){conn.disconnect()})},"low")},setRawInput:function(log_func){conn.rawInput=log_func},setRawOutput:function(log_func){conn.rawOutput=log_func},archivePage:function(keywords,options,call_back){var aid=search(conn.jid,Collecta.XMPP.ARCHIVE_COMPONENT,[keywords],options,function(data){var $data=$(data);if($data.find("error").length>0){console.error("error requesting archive.");console.log(data);Dispatch.publish("collecta.xmpp.archive_error",[data])}else{if($(data).find("item").length===0){console.log("Empty archive result returned.")}call_back(data)}});return aid},reconnect:function(){if(!connected){Collecta.ClientModel.run();Dispatch.publish("collecta.xmpp.connection.reconnect")}},searchUnSubscribe:function(){subscribing=true;unsubscribe(conn.jid,Collecta.XMPP.SEARCH_COMPONENT,Collecta.XMPP.SEARCH_NODE,unsubCallback)},searchWoUnSubscribe:function(keywords,updates,cb){xmppSearchSubscribe(keywords,updates,cb)},getTrendSubscribe:function(){return(subscribedNodes[Collecta.TREND_NODE]===undefined)?false:subscribedNodes[Collecta.TREND_NODE]},subscribedNodes:{},unsubscribeNode:function(node){if(subscribedNodes!==undefined){var jid=userHostJid();unsubscribe(jid,Collecta.XMPP.PUBSUB_COMPONENT,node,function(){console.info("unsubscribe trend");subscribedNodes[node]=undefined});conn.flush()}},subscribeNode:function(SubToNode,requestLastItem,cb){var jid=userHostJid();var iqid=subscribe(jid,Collecta.XMPP.PUBSUB_COMPONENT,SubToNode,[],function(stanza){var error=$(stanza).find("error");if(error.length!==0){console.error("Error subscribing to node: "+SubToNode)}else{Collecta.ClientModel.subscribedNodes[SubToNode]=true}});if(requestLastItem){var retid=conn.getUniqueId();conn.addHandler(((cb===undefined)?function(){}:cb),null,"iq",null,retid,Collecta.XMPP.PUBSUB_COMPONENT);var itemiq=$iq({to:Collecta.XMPP.PUBSUB_COMPONENT,id:retid,type:"get"}).c("pubsub",{xmlns:Collecta.XMPP.NS.PUBSUB}).c("items",{node:SubToNode});conn.send(itemiq.tree())}return iqid},unSubscribeTrend:function(){unSubscribeNode(Collecta.TREND_NODE)},subscribeTrend:function(newTopics){this.subscribeNode(Collecta.TREND_NODE,true,newTopics)},run:function(username,password){if(!connected){if(!username&&!password){username=Collecta.XMPP.DOMAIN;password="password";anonymous=true}else{anonymous=false}var connection_callback=connectCallback;if(conn.service===Collecta.XMPP.PREBIND_URL){connection_callback=prebindCallback;var prebindreq="<body rid='"+conn.rid+"' to='"+Collecta.XMPP.DOMAIN+"' wait='"+Collecta.XMPP.DEFAULT_WAIT+"' hold='"+Collecta.XMPP.DEFAULT_HOLD+"' />";jQuery.ajax({type:"POST",processData:false,url:Collecta.XMPP.PREBIND_URL,data:prebindreq,error:function(a,b,c){console.error("Error with pre-bind.");conn.service=Collecta.XMPP.BOSH_URL;Collecta.ClientModel.run(username,password)},success:connection_callback})}else{conn.connect(username,password,connection_callback,Collecta.XMPP.DEFAULT_WAIT,Collecta.XMPP.DEFAULT_HOLD,Collecta.XMPP.DEFAULT_WINDOW,Collecta.XMPP.DEFAULT_ROUTE)}}conn.addHandler(handleMessage,null,"message",null,null,null)}};return obj}();Dispatch.subscribe("collecta.init",function(){Collecta.ClientModel.run();window.onbeforeunload=function(){if(Collecta.ClientModel.connection()){Collecta.ClientModel.unload()}};$(window).unload(function(){if(Collecta.ClientModel.connection()){Collecta.ClientModel.unload()}})},1);Collecta.Client=function(){var debug=false;var shareURL="http://collecta.com/s/";var connected=false;var $pageDownSelector=null;var $pageUpSelector=null;var $col2Selector=null;var $timeResults=null;var initSelectors=function(){if(!$col2Selector){$col2Selector=$("#col2")}if(!$pageDownSelector){$pageDownSelector=$("#pageDown")}if(!$pageUpSelector){$pageUpSelector=$("#pageUp")}};var obj={disabledEvents:false,setConnected:function(conn){connected=conn},getShareURL:function(){return shareURL},setShareURL:function(url){shareURL=url},getConnected:function(){return connected},toggleDebugMode:function(){if(debug===false){Collecta.ClientModel.setRawInput(function(data){console.log(" IN: "+data)});Collecta.ClientModel.setRawOutput(function(data){console.log("OUT: "+data)});if($.cookies.test()){$.cookies.set("debugMode","true",8760)}debug=true}else{Collecta.ClientModel.setRawInput(function(data){});Collecta.ClientModel.setRawOutput(function(data){});if($.cookies.test()){$.cookies.set("debugMode","false",8760)}debug=false}},resetSearchUI:function(){$("#hot_topics").fadeOut("slow");$(".results").css("margin-top",0);Collecta.Col2Results.displayResults=true;$("#pauseButton").attr("src","http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/pause.gif");$(".resultsCount .minorText").html("Click to pause.");Collecta.Col2Results.showCount();Collecta.Col2Results.resetPagingButtons()},pageSize:function(){return Math.floor(Collecta.Client.pageHeight()/Collecta.Col2Results.resultItemHeight())},pageHeight:function(){initSelectors();return Math.floor($(window).height()-parseInt($col2Selector.css("margin-top").replace(/[^0-9]/g,""),10)-($pageUpSelector.height())-($pageDownSelector.height())-Collecta.Col2Results.resultItemHeight())},clock:function(){if(Collecta.searchTimer.getStartTime()){var elapsed_time=Collecta.searchTimer.elapsedTime();if(elapsed_time){var timer_text="";var days=elapsed_time.getDays();var hrs=elapsed_time.getHours();var min=elapsed_time.getMinutes();var sec=elapsed_time.getSeconds();if(days>1){timer_text+=days+" days "}else{if(days===1){timer_text+="day "}else{if(hrs>1){timer_text+=hrs+" hours "}else{if(hrs===1){timer_text+="hour "}else{if(min>1){timer_text+=min+" minutes "}else{if(min===1){timer_text+="1 minute "}else{if(sec>1){timer_text+=sec+" seconds"}else{if(sec===1){timer_text+="1 second"}}}}}}}}if(!$timeResults){$timeResults=$("#timeResults")}$timeResults.text(timer_text)}}},getTopicFromURL:function(){var retval="";var trend_index=window.location.hash.lastIndexOf("#trends");if(trend_index!==-1){retval="trends"}return retval},getSearchFromURL:function(){var search_term=false;var query_parm="q=";var search_index=window.location.hash.lastIndexOf(query_parm);if(search_index!==-1){var search_string=window.location.hash.substr(search_index+query_parm.length);search_term=unescape(search_string);search_term=search_term.replace(/\+/g," ")}return search_term},shareMap:{Twitter:function(url,title){return"http://twitter.com/home?status="+title+" Via: "+encodeURIComponent(url)},Facebook:function(url,title){return"http://www.facebook.com/sharer.php?u="+encodeURIComponent(url)+"&t="+title},Digg:function(url,title){return"http://digg.com/submit?url="+encodeURIComponent(url)+"&title="+title},Reddit:function(url,title){return"http://reddit.com/submit?url="+encodeURIComponent(url)+"&title="+title},Delicious:function(url,title){return"http://delicious.com/save?url="+encodeURIComponent(url)+"&title="+title},Mixx:function(url,title){return"http://www.mixx.com/submit?page_url="+encodeURIComponent(url)},StumbleUpon:function(url,title){return"http://stumbleupon.com/submit?url="+url+"&title="+title}},createShareTitle:function(searchTerm){var retval="See what people are saying about "+searchTerm+" right now on Collecta.";return retval},populateShareBoxes:function(element,searchTerm){return element.find(".shareLink").val(shareURL+encodeURIComponent(searchTerm).replace(/%20/g,"+")).end().find(".shareEmbed").val('<a href="'+shareURL+encodeURIComponent(searchTerm).replace(/%20/g,"+")+'">'+Collecta.Client.createShareTitle(searchTerm)+"</a>").end()},secondTick:function(){Dispatch.publish("collecta_second_tick");setTimeout(Collecta.Client.secondTick,1000)}};return obj}();Dispatch.subscribe("collecta.init",function(){setTimeout(Collecta.Client.secondTick,1000);$("#mainMsgSpot").hover(function(){$(this).css("background","#e32527")},function(){$(this).css("background","#2c2954")});$("#msgsClose").click(function(){$("#msgs").fadeOut()});$(window).unload(function(){Collecta.SearchModel.save()});$("#disconnect").click(function(){Collecta.ClientModel.disconnect();return false});$("#col1 h2").click(function(){$("#hot_topics_list").click()});$(".icons img").live("mouseover",function(){var $this=$(this);$this.parent().next().text($this.attr("class"))});$(".icons img").live("mouseout",function(){$(this).parent().next().text("")});$(".icons img").live("click",function(){var searchTerm=$("li.activeSearch .searchTerm").text();var title="";var url=Collecta.Client.getShareURL()+encodeURIComponent(searchTerm);var $this=$(this);if($this.parent().hasClass("col1ShareIcons")){title=encodeURIComponent(Collecta.Client.createShareTitle($this.closest("li").find(".searchTerm").text()))}else{var slug=$("#fullResults .title").text();var contentLink=$("#fullResultsFooter a.moreAnchor").attr("href");if($this.attr("class")==="Twitter"){var $author=$("#col3 .resultFull .author");if($author.attr("href")&&$author.attr("href").match(/http:\/\/twitter.com/)){title=encodeURIComponent("RT @"+$author.text()+": "+slug)}else{title=encodeURIComponent(slug.substr(0,70)+"... "+contentLink)}}else{title=encodeURIComponent(slug);url=contentLink}}var link=Collecta.Client.shareMap[$this.attr("class")](url,title);if(link!==""){window.open(link)}});$(".shareLink, .shareEmbed").live("click",function(){this.select()});if($.cookies.test()){if($.cookies.get("debugMode")==="true"){Collecta.Client.toggleDebugMode()}}var search_term=Collecta.Client.getSearchFromURL();var showtopics=Collecta.Client.getTopicFromURL();if(search_term&&(showtopics==="")){Collecta.SearchModel.add(search_term);var selector="#"+$.selectorEscape(search_term);$(selector).click()}else{$("#hot_topics").show();Collecta.Trending.resize()}$("#main").show();Collecta.Trending.resize()},100);Dispatch.subscribe("collecta.xmpp.connection.connected",function(data){Collecta.Client.setConnected(true);console.info("Connected");Collecta.ReconnectView.reset()});Dispatch.subscribe("collecta.xmpp.connection.disconnected",function(){Collecta.Client.setConnected(false)});Dispatch.subscribe("collecta.xmpp.connection.disconnect",function(){Collecta.Client.setConnected(false)});Dispatch.subscribe("collecta.xmpp.connection.fail",function(message){Collecta.Client.setConnected(false);console.error(message)});Dispatch.subscribe("collecta.exit",function(){console.info("Exiting")});Dispatch.subscribe("collecta.xmpp.error",function(error){console.error(error)});Dispatch.subscribe("collecta_second_tick",Collecta.Client.clock);Dispatch.subscribe("collecta.search.started.error",function(){setTimeout(function(){if(!Collecta.Client.getConnected()){Collecta.ErrorView.display('Collecta is currently unavailable. We will continue to try to reconnect. To refresh, <a href="/">click here</a>')}},60000)});Collecta.ResultsModel=function(){var results={};var results_by_search={};var result_ids=[];var category_counts={};var archiveids={};var fetching={};var after_id={};var since_id=null;var twitterArchive={};var archive={};var RESULTS_MAX=100;var RESULTS_NS="http://api.collecta.com/ns/search-0#results";var randomString=function(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=8;var randomstring="";for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring};var convertAtomDateToSeconds=function(str){var retval="";var atomFormat=/^(\d{4})-(\d{1,2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d*)?(Z|[+\-]\d{2}:\d{2})$/i;var matches=atomFormat.exec(str);if(matches){var year=matches[1];var month=matches[2];var day=matches[3];var hour=matches[4];var minute=matches[5];var second=matches[6];var date=new Date(Date.UTC(year,month,day,hour,minute,second));retval=date.getTime().toString()}return retval};var binarySearch=function(items,value){var startIndex=0;var stopIndex=items.length-1;var middle=Math.max(0,(Math.floor((stopIndex+startIndex)/2)));var vts=value.timesaved;while(items[middle]&&startIndex<stopIndex){var ts=items[middle].timesaved;if(vts>ts){stopIndex=middle-1}else{if(vts<ts){startIndex=middle+1}else{break}}middle=Math.max(0,(Math.floor((stopIndex+startIndex)/2)))}if(items[middle]&&vts<items[middle].timesaved){middle++}return middle};var addSearchResult=function(search,item){if(!results[item.id]){results[item.id]=item;result_ids.push(item.id);if(!results_by_search[search]){results_by_search[search]=[item];item.position=0}else{item.position=binarySearch(results_by_search[search],item);results_by_search[search].splice(item.position,0,item)}if(result_ids.length>RESULTS_MAX){var id=result_ids[0];var del_item=results[id];result_ids.pop();delete results[id];var index=results_by_search[search].indexOf(del_item);if(index!==-1){results_by_search[search].splice(index,1)}Dispatch.publish("collecta.results.cache.removed",id)}if(item.id!=="waitMessage"+item.search&&(!item.archive||!Collecta.ResultsModel.initialLoadDone(item.search))){if(category_counts[item.search]){if(category_counts[item.search][item.category]){category_counts[item.search][item.category]+=1}else{category_counts[item.search][item.category]=1}}else{category_counts[item.search]={};category_counts[item.search][item.category]=1}}Dispatch.publish("collecta.search.results.new",item)}else{if(item.archive){Dispatch.publish("collecta.search.results.new",item)}}};var processEntry=function($it,item){var id=$it.find("id").text();if(!id){id=randomString()}item.id=id+item.search.replace(/\s/g,"");item.source=$it.find("link[rel='alternate']").attr("href");if(!item.source){item.source=$it.children("link").attr("href")}if(!item.source){item.source=$it.find("link").attr("href");if(!item.source){item.source=$it.find("source").text()}}item.author=$it.find("author > name").text();item.author_url=$it.find("author > uri").text();if(!item.author_url){item.author_url=$it.find("source > link").attr("href")}var summary=$it.find("summary");var abstract_obj=$it.find("abstract");item.abstract_text=abstract_obj.text();var content=$it.find("content");if(summary.length>0&&content.length===0){content=summary}item.content=content.text();item.content_type=content.attr("type");item.category=$it.find("category[xmlns="+RESULTS_NS+"]").text();if(!item.category){item.category="story"}var title=null;if(item.category==="update"){title=content.text()}else{title=$it.children("title").text();if(title===""){title=$it.find("title").text()}}if(title===""){title=summary.text();if(title===""){title=content.text()}title=title.replace(/<\/?[^>]+>/g,"");var title_match=/(?:\S+\s+){1,10}/.exec(title);if(title_match!==null){title=title_match[0]}else{title="Untitled"}}item.title=title;item.avatar=$it.find("icon").text();var timesaved=$it.find("timesaved[xmlns="+RESULTS_NS+"]");if(timesaved.length>1){timesaved=$(timesaved.get(0)).text()}else{timesaved=timesaved.text()}if(!timesaved){var updated_text=$it.find("updated").text();if(updated_text){timesaved=convertAtomDateToSeconds(updated_text)}}item.timesaved=timesaved;var image="";if(item.category==="photo"||item.category==="video"){image=$it.find("link[rel=collecta-abstract-image]").attr("href");if(image!==""){var image_ext=/\.(?:jpg|png|gif)$/.exec(image);if(image_ext===null){image=""}}}item.image=image;addSearchResult(item.search,item)};var handleMessage=function(stanza){var $stanza=$(stanza);if($stanza.find("entry").length!==0){var search=$stanza.find("header[name=x-collecta#query]").text();var stanza_id=search;$stanza.find("item").each(function(i,it){var item={};var $it=$(it);item.search=search;item.stanza_id=stanza_id;item.archive=false;item=processEntry($it,item)})}};var handleArchiveMessage=function(stanza){var $stanza=$(stanza);var id=$stanza.attr("id");var search=archiveids[id];search=search.replace(/\s*-category:[a-zA-Z0-9]+/g,"");var since_obj=$stanza.find("set > first");if(since_obj.length>0){since_id=since_obj.text()}var after_obj=$stanza.find("set > last");if(after_obj.length>0){after_id[search]=after_obj.text()}$stanza.find("item").each(function(i,it){var item={};var $it=$(it);item.search=search;item.stanza_id=id;item.archive=true;item=processEntry($it,item)});archive[search]=false;Collecta.ResultsModel.clearArchiveId(id,search);var num_items=$stanza.find("item").length;console.log("Archive request "+id+" returned "+num_items+" items.");var is_last_result=(num_items===0);Dispatch.publish("collecta.search.archive.fetch.finished",{id:id,last_result:is_last_result})};var handleTwitter=function(stanza){if(Collecta.Col2Results.displayResults){var $stanza=$(stanza.payload);var search=stanza.query;var item={};item.search=search;if(twitterArchive[search]!==false&&twitterArchive[search]!==true){twitterArchive[search]=true}item.archive=twitterArchive[search];item=processEntry($stanza,item)}};var handleTwitterSetDone=function(data){twitterArchive[data.query]=false};var archivePage=function(keywords,options){var aid=Collecta.ClientModel.archivePage(keywords,options,handleArchiveMessage);archiveids[aid]=keywords;return aid};return{init:function(){Dispatch.subscribe("collecta.xmpp.new_message",handleMessage);Dispatch.subscribe("paraphrase_result",handleTwitter);Dispatch.subscribe("paraphrase_result_done",handleTwitterSetDone)},clearArchiveId:function(id,search){fetching[search]=false;if(archiveids[id]){delete archiveids[id]}},setAfterId:function(search,id){after_id[search]=id},setArchiveFinished:function(search){archive[search]=false},fetchNextResults:function(search,rpp,filter,initial){if(!initial){initial=false}else{fetching[search]=false;after_id[search]=false}if(initial&&results_by_search[search]){fetching[search]=true;setTimeout(function(){var res_by_search=results_by_search[search];var last_index=rpp;if((res_by_search.length-1)<rpp){last_index=res_by_search.length}var last_id=res_by_search[last_index-1].id;after_id[search]=false;for(var j=0;j<last_index;j++){var item=res_by_search[j];item.archive=true;item.stanza_id="cache";Dispatch.publish("collecta.search.results.new",item)}fetching[search]=false;Dispatch.publish("collecta.search.archive.fetch.finished",{id:last_id,last_result:false})},0)}else{if(fetching[search]===true){return}fetching[search]=true;var page_options={max:rpp.toString()};if(after_id[search]){page_options.after=after_id[search]}var query=search;if(filter){query+=" "+filter}var aid=archivePage(query,page_options);var activeaid=aid+(initial?"init":"")+search;console.log("FETCHING "+rpp+" ENTRIES FROM ARCHIVE FOR <<"+search+">> ID "+activeaid+" after id "+after_id[search]);Dispatch.publish("collecta.search.results.archive.fetch")}},add:function(item){addSearchResult(item.search,item)},getCategoryCounts:function(search){return category_counts[search]},resetSearchCount:function(search){category_counts[search]={}},getCount:function(search){var retval=0;if(results_by_search[search]){retval=results_by_search[search].length}return retval},get:function(id){return results[id]},initialLoadDone:function(search){return(archive[search]===false&&!twitterArchive[search])},_processEntry:function($item,item){processEntry($item,item)}}}();Dispatch.subscribe("collecta.init",function(){Collecta.ResultsModel.init()});Collecta.Col2Results=function(){var $col2Results=null;var $col2TemplateSelector=null;var $numResultsSelector=null;var $numResultsLabelSelector=null;var $numResultsSinceSelector=null;var $timeResultsSelector=null;var $pageDownSelector=null;var $pageUpSelector=null;var $resultsCount=null;var $col3=null;var testTitleDupe=function(title,abstract_text){var retval=false;var replace_regex=/\?|\+|\-|\||\^|\$|\(|\)|\*|\"|\'|\:|\;|\.|\,|\/|\~|\\|\]|\[|\}|\{/g;var abstract_test=abstract_text.toLowerCase().replace(replace_regex,"");var title_test=title.toLowerCase().replace(replace_regex,"");try{if(abstract_test===title_test){retval=true}else{if(title_test.search(abstract_test)!==-1||abstract_test.search(title_test)!==-1){retval=true}}}catch(error){console.log(title_test);console.log(abstract_test);console.error(error)}return retval};var countViaShownCategories=function(){var mycount=0;var active_search=Collecta.SearchModel.getActiveSearch();var categoryCounts=Collecta.ResultsModel.getCategoryCounts(active_search);if(!categoryCounts){return 0}var activeSearchSelector="#"+$.selectorEscape(active_search);$.each(categoryCounts,function(cat,cnt){if(cnt>0){if($(activeSearchSelector+" .searchOptions ."+cat+"Result").is(":checked")){mycount+=cnt}}});return mycount};var FOLD=4;var obj={displayResults:true,archiveMessageText:"Getting more results...",archiveErrorText:"There was an error getting older results.",init:function(){$col3=$("#col3");$col2Results=$("#col2 .results");$col2TemplateSelector=$("#search_result :first");$numResultsSelector=$("#col2 .numResults");$numResultsLabelSelector=$(".numResultsLabel");$numResultsSinceSelector=$(".numResultsLabelSince");$timeResultsSelector=$("#timeResults");$pageDownSelector=$("#pageDown");$pageUpSelector=$("#pageUp");$resultsCount=$("#col2 .resultsCount")},hideTimer:function(){$numResultsSinceSelector.hide();$timeResultsSelector.hide()},showCount:function(){var currentCount=countViaShownCategories();if(currentCount>0){$numResultsSelector.text(currentCount);if(currentCount===1){$numResultsLabelSelector.text("Result").show()}else{$numResultsLabelSelector.text("Results").show()}if(Collecta.searchTimer.elapsedTime()){$numResultsSinceSelector.show();$timeResultsSelector.show()}}},maybeSelectFirstResult:function(){var active=$col2Results.find(".activeResult");if(active.not("#waitMessage").length===0||active.is(":hidden")){active.removeClass(".activeResult");$col2Results.find("li:not(#waitMessage, .firstResult):visible:first").click()}},shortenAbstract:function(activeSearchTerm,text){var retval=text;if(text){activeSearchTerm=activeSearchTerm.replace(/OR|AND|\-\w+|\w+:\w+/,"");var index=0;var quote_test=/^\"(.+)\"$/.exec(activeSearchTerm);var match_term_array=[];var match_term="";if(quote_test===null){match_term_array=activeSearchTerm.split(" ")}else{var replace_regex=new RegExp("[^a-zA-Z0-9_\\s]","g");match_term_array.push(quote_test[1].replace(replace_regex,""))}var text_lower=text.toLowerCase();jQuery.each(match_term_array,function(i,val){var index_x=text_lower.indexOf(val.toLowerCase());if(index_x!==-1){index=index_x;match_term=val;return false}});if(index!==-1||index!==0){var tail=text.substring(index);var head=text.substring(0,index);var tail_count=Collecta.wordCount(tail);var head_count=Collecta.wordCount(head);var regex_tail_count=7;var regex_head_count=3;if(tail_count<7){regex_head_count=regex_head_count+(7-tail_count)}if(head_count<3){regex_tail_count=regex_tail_count+head_count}var last_regex=new RegExp("(?:\\S+\\s+){0,"+regex_tail_count+"}");var last_match=last_regex.exec(tail);var last="";if(last_match){last=last_match[0]}var regex=new RegExp("((?:\\S+\\s+){0,"+regex_head_count+"})?("+match_term+")","i");var first_match=regex.exec(text);var first="";if(first_match){if(first_match[1]){first=first_match[1]}}retval=first+last;if(retval===null){retval=text}}}return retval},updateSavedSearchCounts:function(item){var search=item.search;if(search===""){console.error("Search is empty.");return}var count=Collecta.ResultsModel.getCount(item.search);if(count>4&&count<10){$("#"+$.selectorEscape(search)).find(".numResults").show()}else{if(count>9&&count<20){$("#"+$.selectorEscape(search)).find(".numResults").show().css("width",5)}else{if(count>19){$("#"+$.selectorEscape(search)).find(".numResults").show().css("width",15).find("span").text("new")}}}},resultItemHeight:function(){var $resultsli=$col2Results.children("li");if($resultsli.length>0){return $resultsli.height()+parseInt($resultsli.css("margin-top").replace(/[^0-9]/g,""),10)+parseInt($resultsli.css("margin-bottom").replace(/[^0-9]/g,""),10)}else{return 50}},slideResults:function(direction){var currentMargin=parseInt($("#col2 .results").css("margin-top").replace(/[^\-0-9]/g,""),10);var height=Collecta.Client.pageHeight();var reset=false;var amountSlide;if(direction==="up"){var newMargin=currentMargin+height;if((newMargin>=20)||(newMargin===0)){reset=true}amountSlide=newMargin}else{amountSlide=currentMargin-height;$resultsCount.hide();$pageUpSelector.show()}$col2Results.animate({marginTop:amountSlide},1250,"linear",function(){Collecta.Client.disabledEvents=false;if(reset){Collecta.Client.resetSearchUI()}else{Collecta.Col2Results.resetPagingButtons()}})},resultsBelowFold:function(){var resultHeight=this.resultItemHeight();var foldHeight=Collecta.Client.pageSize()*resultHeight*FOLD;var lastPosition=$col2Results.find("li:visible:last").position();var lastBottom=lastPosition?lastPosition.top+resultHeight:0;return(lastBottom>=foldHeight)},resetPagingButtons:function(){var resultsMarginTop=parseInt($col2Results.css("margin-top"),10);if(resultsMarginTop<0){$pageUpSelector.show();$resultsCount.hide()}else{$pageUpSelector.hide();$resultsCount.show()}if($col2Results.height()+resultsMarginTop>Collecta.Client.pageHeight()){$pageDownSelector.show()}else{$pageDownSelector.hide()}},fetchNextResults:function(initial){var rpp=Collecta.Client.pageSize()*FOLD;if(rpp<1){console.error("Results per page is less than one.");return}var query=Collecta.SearchModel.getActiveSearch();if(query!==""){var filter=Collecta.Search.buildFilterString(query);Collecta.ResultsModel.fetchNextResults(query,rpp,filter,initial)}},showArchiveMessage:function(text){$("#archiveMessage").remove();var archive_message=$("#archiveMessageTemplate").clone().attr("id","archiveMessage");var date_str="0257439999322";archive_message.find(".timesaved").attr("id",date_str);archive_message.find(".resultTitle").text(text);archive_message.css("cursor","default");$col2Results.append(archive_message);$("#archiveMessage .resultLayout .resultContext").text("");$("#archiveMessage").show()},trimResults:function(){if(Collecta.Col2Results.displayResults===true){var length=$col2Results.find("li:visible").not("#waitMessage").length;var last_element=$col2Results.find("li:last");while(length>Collecta.Client.pageSize()*(FOLD+1)){if(last_element.attr("id")==="#waitMessage"){last_element=last_element.prev()}last_element.remove();$col3.removeData(last_element[0]);var tsid=last_element.find(".timesaved").attr("id");if(tsid){var asearch=Collecta.SearchModel.getActiveSearch();Collecta.ResultsModel.setAfterId(asearch,tsid)}length--}}},cacheDelete:function(id){$col2Results.removeData(id)},show:function(item){if($col2Results.find("#"+$.selectorEscape(item.id)).length>0){return}var col2html=$col2Results.data(item.id);if(item.id=="waitMessage"+item.search){if($col2Results.find("#waitMessage").length!==0){$col2Results.find("#waitMessage").remove()}if(!col2html){var waitMessage=$("#waitMessageTemplate").clone().removeAttr("id");waitMessage.find(".linkToGoogle").attr("href",Collecta.runFilter("defaultsearchlink",{data:"http://google.com/search?q="})+item.search);var columnTwoSlug=$("#search_result").find(":first").clone();columnTwoSlug.find(".resultTitle").text(item.title);columnTwoSlug.attr("id","waitMessage");columnTwoSlug.addClass("activeResult");columnTwoSlug.addClass("firstResult");columnTwoSlug.find(".timesaved").attr("id",item.timesaved);col2html=columnTwoSlug;$col3.data("waitMessage",waitMessage);$("#fullResults").empty();$("#fullResults").prepend(waitMessage);$("#fullResults .resultFullwaitMessage").removeClass("resultFullHide")}else{col2html.removeClass("activeResult")}$col2Results.data(item.id,col2html)}else{if(!col2html){var faviconUrl;if(item.source){faviconUrl=Collecta.findSource(item.source)}var favIcon;if(faviconUrl){favIcon=Collecta.createFavIcon(faviconUrl)}var title_text=Collecta.cleanJS(item.title);var published_item_html=$col2TemplateSelector.clone();var published_item_title=published_item_html.find(".resultTitle");if(item.timesaved&&item.timesaved!==""){var ts=published_item_html.find(".timesaved");ts.attr("id",item.timesaved)}if(item.category==="update"){var updateImage=title_text.match(/http:\/\/(?:www\.)?(twitpic\.com|yfrog\.com)\/([A-Za-z0-9]+)/);if(updateImage){if(updateImage[1]==="twitpic.com"){item.image="http://twitpic.com/show/thumb/"+updateImage[2]}else{if(updateImage[1]==="yfrog.com"){item.image="http://yfrog.com/"+updateImage[2]+".th.jpg"}}if(item.image){item.category="photo"}}else{published_item_title.html(title_text);published_item_html.find(".resultContext").remove()}}if(item.image!==""){published_item_title.css("background","url("+item.image+") left center no-repeat")}else{published_item_title.html(title_text);var abstract_p=null;var abstract_text=item.abstract_text;if(abstract_text.length>0){if(testTitleDupe(title_text,abstract_text)){abstract_p="title"}}if(abstract_p!==null){published_item_html.find(".resultContext").html(item.content.substring(0,50)).show()}else{abstract_text=Collecta.Col2Results.shortenAbstract(Collecta.SearchModel.getActiveSearch(),abstract_text);published_item_html.find(".resultContext").html(abstract_text).show()}if(item.avatar){published_item_html.find(".col2Icon").html('<img src="'+item.avatar+'">').removeClass("displayNone")}else{if(favIcon){published_item_html.find(".col2Icon").html(favIcon).addClass("col2Favicon").removeClass("displayNone")}}}published_item_html.addClass(item.category+"Result");published_item_html.attr("id",item.id);col2html=published_item_html;$col2Results.data(item.id,col2html)}}if(item.archive||Collecta.Col2Results.displayResults){col2html=Collecta.runFilter("col2html",{data:col2html,item:item,query:Collecta.SearchModel.getActiveSearch()});if(item.stanza_id&&item.stanza_id==="cache"){$col2Results.append(col2html)}else{var sort_items=$col2Results.children("li").get();var i=item.position;if((!i&&i!==0)||(i>=sort_items.length)){$col2Results.append(col2html)}else{$(sort_items[i]).before(col2html)}}if(col2html.hasClass("activeResult")){$col2Results.find(".activeResult :visible").click()}}Collecta.Col2Results.showCount();Collecta.Col2Results.trimResults();if(!item.archive&&item.stanza_id){Collecta.Col2Results.maybeSelectFirstResult()}}};return obj}();Collecta.Col3Results=function(item){var $resultTemplate=null;var $col3=null;var click_through_url="";if(Collecta.CLICK_THROUGH){click_through_url=Collecta.CLICK_THROUGH}var obj={init:function(){$resultTemplate=$("#fullResultTemplate :first");$col3=$("#col3");$("#col3 .moreAnchor").live("mousedown",function(){var asearch_url=Collecta.SearchModel.getActiveSearch();var $this=$(this);if($this.attr("href")){Collecta.addClickThrough($this,click_through_url,asearch_url)}})},getClickThroughUrl:function(){return click_through_url},setClickThroughUrl:function(url){click_through_url=url},show:function(id,firstResult){if(!firstResult){firstResult=false}var col3html=$col3.data(id);if(!col3html){Collecta.Col3Results.store(id);col3html=$col3.data(id);if(!col3html){console.error(id+": Does not contain data. ");return}}var $col3fullResults=$("#col3 #fullResults");if($col3fullResults.find("#"+$.selectorEscape(id)).length>0){return}var asearch_url=Collecta.SearchModel.getActiveSearch();var item=Collecta.ResultsModel.get(id);col3html.find("a").each(function(){$(this).mousedown(function(){var $this=$(this);if($this.attr("href")){Collecta.addClickThrough($this,click_through_url,asearch_url)}});if((this.href!==undefined)&&(this.href!=="")){var startofrealurl=$(this).attr("href");if(startofrealurl.indexOf("://")===-1){var base=item.source.match(/[a-z]+:\/\/.*?\//);$(this).attr("href",base+startofrealurl.substring(1));$(this).attr("target","_blank")}}});$col3fullResults.empty();col3html=Collecta.runFilter("col3html",{data:col3html,item:item,query:Collecta.SearchModel.getActiveSearch()});$col3fullResults.append(col3html);if(firstResult){$("#col3 .entryHeader, #col3 .copyright, #col3 .moreAnchor, #col3 .entryShareOptions").removeClass("displayBlock").addClass("displayNone");$("#col3 .resultFullwaitMessage").removeClass("resultFullHide")}else{$("#col3 .entryHeader, #col3 .copyright, #col3 .moreAnchor, #col3 .entryShareOptions").removeClass("displayNone");$("#col3 .moreAnchor").addClass("displayBlock")}var $col3html=$("#col3 #fullResults .resultFull");$col3html.removeClass("resultFullHide");if($col3html.hasClass("commentResult")){var titleheight=$(window).height()-$col3html.find(".content").height()-$col3html.find(".meta").height()-$("#fullResultsFooter").height()-33-15-50;if($col3html.find(".title").height()>titleheight){$col3html.find(".titleWrap").height(titleheight)}}var height=$(window).height()-$col3html.find(".title").height()-$col3html.find(".meta").height()-$("#fullResultsFooter").height()-68;if($col3html.find(".content").height()>height){$col3html.find(".content").height(height)}$("#col3 .moreAnchor").attr("href",$col3html.find(".entryAnchor").attr("href"))},store:function(id){if(id.search("waitMessage")!==-1){return}var item=Collecta.ResultsModel.get(id);if(!item){return}var faviconUrl;if(item.source){faviconUrl=Collecta.findSource(item.source)}var favIcon;if(faviconUrl){favIcon=Collecta.createFavIcon(faviconUrl)}var datetime=new Date();datetime.setTime(item.timesaved);if(!item.timesaved||datetime.toString()==="Invalid Date"){datetime=new Date()}var date;var time;if(datetime.toString()!=="Invalid Date"){date=datetime.getDate()+" "+datetime.getMonthName()+" "+datetime.getFullYear();var hour=datetime.getStandardTime();var minutes=datetime.getMinutes();if(minutes<10){minutes="0"+minutes}var seconds=datetime.getSeconds();if(seconds<10){seconds="0"+seconds}time=hour[0]+":"+minutes+":"+seconds+" "+hour[1]}else{date="";time=""}var published_item_html=$resultTemplate.clone();published_item_html.attr("id",item.id);published_item_html.addClass(item.category+"Result");published_item_html.find(".entryAnchor").attr("href",item.source);var title_text=Collecta.cleanJS(item.title);var updateImage=title_text.match(/http:\/\/(?:www\.)?(twitpic\.com|yfrog\.com)\/([A-Za-z0-9]+)/);var category=item.category;if((category!=="update"&&!updateImage)&&category!=="comment"){published_item_html.find(".title").attr("title",item.source)}if(category==="update"&&updateImage){category="photo"}var content_type=item.content_type;var content_text=item.content;if(!content_type){content_type="text"}var asearch_url="&q="+encodeURIComponent(item.search);switch(category){case"update":published_item_html.find(".title").html(content_text.replace(/<(.|\n)*?>/g,"").replace(/(http:\/\/[\-a-zA-Z0-9@:%_\+.~#?&\/=]+)/g," <a target='_blank' href='$1'>$1</a>").replace(/ (www.[\-a-zA-Z0-9@:%_\+.~#?&\/=]+)/g," <a target='_blank' href='http://$1'>$1</a>"));break;case"comment":published_item_html.find(".title").html(content_text.replace(/<(.|\n)*?>/g,"").replace(/&lt;(.|\n)*?&gt;/gi,""));var comment_original_post_byline_array=title_text.split(/by /);if(comment_original_post_byline_array.length>1){item.author=comment_original_post_byline_array.pop();title_text=comment_original_post_byline_array.join()}published_item_html.find(".bodyText").html(title_text.replace(/Comment on /,""));published_item_html.find(".commentHeader").text("this comment is in reply to:").removeClass("displayNone");break;case"photo":var col3_img_src="";if(updateImage){if(updateImage[1]==="twitpic.com"){col3_img_src="http://twitpic.com/show/large/"+updateImage[2]}else{if(updateImage[1]==="yfrog.com"){col3_img_src="http://yfrog.com/"+updateImage[2]+".th.jpg"}}published_item_html.find("#col3_img_link").attr("href",updateImage[0]);published_item_html.find(".title").html(title_text);published_item_html.find(".title").attr("title",updateImage[0])}else{var flickr_img=$("<div>"+content_text+"</div>").find("img").attr("src");var is_flickr=(item.source.search("flickr.com")!==-1);if(flickr_img&&is_flickr){flickr_img=flickr_img.replace(/_m.(\w{3})/,".$1");col3_img_src=flickr_img}else{col3_img_src=item.image}var published_title=published_item_html.find(".resultTitle");published_item_html.find("#col3_img_link").attr("href",item.source);published_title.css("background","");published_item_html.find(".title").html(title_text);published_item_html.find(".bodyText").html(content_text).show().find("img").hide()}if(col3_img_src!==""){var col3image=$("<img>");col3image.attr("src",col3_img_src);var load_image=function(){var $col3html=$("#col3 .resultFull");var height=$(window).height()-$col3html.find(".title").height()-$col3html.find(".meta").height()-$("#fullResultsFooter").height()-80;var body_height=$col3html.find(".bodyText").height();if(body_height>0){height-=(body_height+10)}var img_height=col3image.attr("height");var img_width=col3image.attr("width");var newdim=null;if(img_height>height){newdim=Math.floor((height*img_width)/img_height);col3image.attr("height",height);col3image.attr("width",newdim)}col3image.css({visibility:"visible"})};if(col3image.complete){load_image()}else{col3image.load(load_image)}}published_item_html.find("#col3_img_link").html(col3image);break;default:published_item_html.find(".title").html(title_text);published_item_html.find(".bodyText").html(content_text)}if(item.avatar){var avatarElement=published_item_html.find(".avatar");avatarElement.attr("src",item.avatar).removeClass("displayNone");published_item_html.find(".title").prepend(avatarElement)}if(item.author!==""){published_item_html.find(".author").text(item.author);if(item.author_url){published_item_html.find(".author").attr("href",item.author_url)}else{published_item_html.find(".author").removeClass("author")}}else{published_item_html.find(".byline").remove()}if(item.category.split("",2)[0].match(/[aeiou]/)){published_item_html.find(".type").text("an "+item.category)}else{published_item_html.find(".type").text("a "+item.category)}if(date!==""){published_item_html.find(".date").text(date)}else{published_item_html.find(".dateline").remove()}if(time!==""){published_item_html.find(".time").text(time)}else{published_item_html.find(".timeline").remove()}if(favIcon){var $favicon=published_item_html.find(".favicon").html(favIcon);published_item_html.find(".title").prepend($favicon.removeClass("displayNone"))}if(!item.archive){$col3.data("waitMessage","")}$col3.data(id,published_item_html)}};return obj}();Collecta.searchTimer=function(){return{init:function(time){Collecta.timer.init(time,Collecta.SearchModel.getActiveSearch())},elapsedTime:function(now){return Collecta.timer.elapsedTime(now,Collecta.SearchModel.getActiveSearch())},resetTimer:function(){Collecta.timer.resetTimer(Collecta.SearchModel.getActiveSearch());Collecta.Col2Results.hideTimer()},getStartTime:function(){return Collecta.timer.getStartTime(Collecta.SearchModel.getActiveSearch())},getElapsedTime:function(){return Collecta.timer.getElapsedTime(Collecta.SearchModel.getActiveSearch())}}}();Dispatch.subscribe("collecta.search.results.new",function(item){if(item.search===Collecta.SearchModel.getActiveSearch()&&(Collecta.Col2Results.displayResults||item.archive)){Collecta.Col2Results.show(item)}else{if(!item.archive||!Collecta.ResultsModel.initialLoadDone(item.search)){Collecta.Col2Results.updateSavedSearchCounts(item)}}});Dispatch.subscribe("collecta.results.cache.removed",function(id){Collecta.Col2Results.cacheDelete(id)});Dispatch.subscribe("paraphrase_results_done",function(item){Collecta.Col2Results.resetPagingButtons();if(Collecta.Col2Results.displayResults){Collecta.Col2Results.maybeSelectFirstResult()}});Dispatch.subscribe("collecta.xmpp.archive_error",function(stanza){var id=$(stanza).attr("id");var search=Collecta.SearchModel.getActiveSearch();Collecta.ResultsModel.setArchiveFinished(search);Collecta.ResultsModel.clearArchiveId(id,search);$("#archiveMessage .resultLayout .resultTitle").text(Collecta.Col2Results.archiveErrorText);$("#archiveMessage .resultLayout .resultContext").text("Click to try again.");$("#archiveMessage").css("cursor","pointer");$("#archiveMessage").show();console.log("ARCHIVE QUERY ERRORED ID "+id);if(!Collecta.searchTimer.elapsedTime()){Collecta.searchTimer.init($("#col2 .timesaved:last").attr("id"));Collecta.Col2Results.showCount()}});Dispatch.subscribe("collecta.search.results.archive.fetch",function(){Collecta.Col2Results.showArchiveMessage(Collecta.Col2Results.archiveMessageText)});Dispatch.subscribe("collecta.search.archive.fetch.finished",function(set_info){Collecta.Col2Results.resetPagingButtons();$("#archiveMessage").remove();var show_count=false;if(set_info.last_result){Collecta.Col2Results.showArchiveMessage("End of results.");show_count=true}else{if(!Collecta.Col2Results.resultsBelowFold()){Collecta.Col2Results.fetchNextResults()}else{show_count=true}}if(show_count){if(!Collecta.searchTimer.elapsedTime()){var $last_elem=$("#col2 li:last");var timestamp=$last_elem.find(".timesaved").attr("id");if($last_elem.attr("id")==="archiveMessage"){timestamp=$last_elem.prev().find(".timesaved").attr("id")}Collecta.searchTimer.init(timestamp);Collecta.Col2Results.showCount()}}Collecta.Col2Results.maybeSelectFirstResult()});Dispatch.subscribe("collecta.init",function(){if(Collecta.CLICK_THROUGH){Collecta.Col3Results.setClickThroughUrl(Collecta.CLICK_THROUGH)}});$(function(){Collecta.Col2Results.init();Collecta.Col3Results.init();$(document).bind("keydown","up",function(){var $nextEl=$("#col2 .results li.activeResult").prev();while($nextEl.length>0){if($nextEl.is(":visible")){$nextEl.click();break}else{$nextEl=$nextEl.prev()}}});$(document).bind("keydown","down",function(){var $nextEl=$("#col2 .results li.activeResult").next();while($nextEl.length>0){if($nextEl.is(":visible")){$nextEl.click();break}else{$nextEl=$nextEl.next()}}});$("#col2_results").click(function(e){var $this=$(e.target).closest("li");var id=$this.attr("id");if(id==="archiveMessage"){if($("#archiveMessage .resultLayout .resultTitle").text()===Collecta.Col2Results.archiveErrorText){Collecta.Client.disabledEvents=false;Collecta.Col2Results.fetchNextResults()}}else{if(id!=="waitMessage"){$("#col2 .results li").removeClass("activeResult");$this.addClass("activeResult");$("#col3 .straggler").remove();if(id.length===0){return false}Collecta.Col3Results.show(id,$this.hasClass("firstResult"))}}});$("#pageDown").click(function(){if(!Collecta.Client.disabledEvents){Collecta.Col2Results.displayResults=false;$("#pauseButton").attr("src","http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/play.gif");Collecta.Client.disabledEvents=true;Collecta.Col2Results.slideResults("down");if(!Collecta.Col2Results.resultsBelowFold()){Collecta.Col2Results.fetchNextResults()}}});$("#pageUp").click(function(){if(!Collecta.Client.disabledEvents){Collecta.Client.disabledEvents=true;Collecta.Col2Results.slideResults("up")}});$("#pauseButton").click(function(e){e.stopPropagation();var $this=$(this);if(Collecta.Col2Results.displayResults===true){Collecta.Col2Results.displayResults=false;$this.attr("src","http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/play.gif");$(".resultsCount .minorText").html("<strong>Paused</strong>. Click to resume.")}else{Collecta.Col2Results.displayResults=true;$this.attr("src","http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/pause.gif");$(".resultsCount .minorText").html("Click to pause.")}});$(".resultsCount").click(function(){$("#pauseButton").click()});$("#col3").live("mouseout",function(){$("#col3").find("a").each(function(){var $this=$(this);if($this.attr("href")){var new_url;var click_through_url=Collecta.Col3Results.getClickThroughUrl();var clrep=Collecta.escapeRegex(click_through_url);var clreq=new RegExp(clrep,"g");var rem_url=$this.attr("href").replace(clreq,"");rem_url=decodeURIComponent(rem_url);var rem_list=rem_url.split("http:");if(rem_list.length>2){rem_url=rem_list[rem_list.length-1]}var search_reg_r=new RegExp("&q=.*","g");new_url=rem_url.replace(search_reg_r,"");$this.attr("href",new_url)}})});$("#col3 .title").live("click",function(){var $this=$(this);var $parent_result_div=$this.closest(".resultFull");if($parent_result_div.hasClass("storyResult")||$parent_result_div.hasClass("photoResult")||$parent_result_div.hasClass("videoResult")){var click_through_url=Collecta.Col3Results.getClickThroughUrl();var asearch_url="&q="+encodeURIComponent(Collecta.SearchModel.getActiveSearch());window.open(click_through_url+encodeURIComponent($this.attr("title"))+asearch_url)}})});Collecta.Trending=function(){var $hot_topics=null;var $hot_topics_main_header=null;var $hot_topics_list=null;var $hot_topics_template=null;var $col1=null;var $document=$(document);var $window=$(window);var obj={init:function(){$hot_topics=$("#hot_topics");$col1=$("#col1");$hot_topics_main_header=$("#hot_topics_main_header_template_id");$hot_topics_list=$("#hot_topics_list_span");$hot_topics_template=$("#hot_topics_template_id")},create:function(topicList){$hot_topics.html($hot_topics_main_header).clone();$hot_topics_list.empty();jQuery.each(topicList,function(i,val){if($hot_topics_list.text()===""){$hot_topics_list.append(val.alias)}else{$hot_topics_list.append(", "+val.alias)}var $trendingtopic=$hot_topics_template.clone();$trendingtopic.removeAttr("id");$trendingtopic.find(".hot_topic_header").attr("searchid",val.title);if(val.alias){$trendingtopic.find(".hot_topic_header").prepend(val.alias)}else{$trendingtopic.find(".hot_topic_header").prepend(val.title)}$.each(val.items,function(i,item){var $hot_topics_section=$trendingtopic.find(".hot_topic_"+item.category);$hot_topics_section.attr("id",item.source);if(item.author){$hot_topics_section.find(".hot_topic_title").append(' by <span class="author">'+item.author+"</span>")}if(item.category!=="photo"){var content_text=item.body_content.replace(/<(.|\n)*?>/g,"");if(content_text===""&&item.category!=="story"){content_text=item.title.replace(/<(.|\n)*?>/g,"")}if(item.category==="update"){content_text=Collecta.urlwbr(content_text,13)}$hot_topics_section.find(".body_content").html(content_text.replace(/\s*$/,"")+"...")}if(item.category==="photo"){var $item_image=$(item.body_content).find("img");if($item_image.length>0){var image_src=$item_image.attr("src");var $hot_topics_photo_div=$hot_topics_section.find(".hot_topic_photo_img");var $image=$('<img class="displayNone">');$image.load(function(){var $this=$(this);if($this.width()<$this.height()){$hot_topics_photo_div.css("background","url("+image_src+") center center no-repeat")}else{$this.removeClass("displayNone")}});$image.attr("src",image_src);$image=Collecta.runFilter("trendingphoto",{data:$image,item:item});$hot_topics_photo_div.html($image)}}else{if(item.category==="story"){var $story_title=$hot_topics_section.find(".hot_topic_story_subtitle");var faviconUrl;if(item.source){faviconUrl=Collecta.findSource(item.source)}var favIcon;if(faviconUrl){favIcon=Collecta.createFavIcon(faviconUrl)}if(favIcon){$story_title.append(favIcon.addClass("favicon"))}$story_title.append(item.title.replace(/<\/?[^>]+>/g,""))}else{if(item.category==="update"){if(item.avatar){var $update_avatar=$("<img>");$update_avatar.attr("src",item.avatar);$hot_topics_section.find(".hot_topic_update_text").prepend($update_avatar)}}else{if(item.category==="comment"){$hot_topics_section.find(".hot_topic_comment_irt a").text(item.title.replace(/Comment on /,"").replace(/by.*/,""))}}}}});$hot_topics.append($trendingtopic)})},resize:function(){if($hot_topics.is(":visible")){$hot_topics.width($document.width()-$col1.width()-80);$hot_topics.height($window.height()-40)}}};return obj}();Dispatch.subscribe("collecta.init",Collecta.Trending.init);$(function(){$(".hot_topic").live("click",function(e){var $target=$(e.target);if($target.is(".hot_topic_result_follow")){var link=encodeURIComponent($target.closest(".hot_topic_element").attr("id"));var topic=encodeURIComponent($target.closest(".hot_topic_header").text());if(link){window.open(Collecta.CLICK_THROUGH+link+"&top="+topic)}return false}else{var currentForm="#searchForm";$(currentForm+" .searchTerm").val($(this).find(".hot_topic_header").attr("searchid"));$(currentForm).submit()}});Dispatch.subscribe("collecta.new.trend",function(){Collecta.Trending.create(Collecta.TrendingModel.get());$(".hot_topic:last").css("margin-bottom",40)});$(window).resize(Collecta.Trending.resize);$(".hot_topic").live("mouseover",function(e){if($(e.target).is(".hot_topic_result_follow, .hot_topic_result_follow a")){$(this).find(".hot_topic_header span").css("visibility","hidden")}else{$(this).find(".hot_topic_header span").css("visibility","visible")}});$(".hot_topic").live("mouseout",function(){$(this).find(".hot_topic_header span").css("visibility","hidden")});$(".hot_topic_element").live("mouseover",function(){$(this).find(".hot_topic_result_follow").css("visibility","visible")});$(".hot_topic_element").live("mouseout",function(){$(this).find(".hot_topic_result_follow").css("visibility","hidden")})});Collecta.TrendingModel=function(){var topics=[];var SHOW_TRENDING=true;var newTopics=function(stanza){var $stanza=$(stanza);if($stanza.find("TOPIC").length>0){topics=[];$stanza.find("item").find("TOPIC").each(function(i,val){var items=[];$(val).children().each(function(){var $item=$(this);var body_content="";body_content=$item.find("content").text();if(body_content===""){body_content=$item.find("summary").text()}var avatar="";avatar=$item.find("avatar").text();if(avatar===""){avatar=$item.find("link[rel='image']").attr("href")}var item_source=$item.find("link[rel='alternate']");if(item_source.length>0){item_source=item_source.attr("href")}else{item_source=$item.find("link").attr("href")}items.push({category:$item.find("category").text(),author:$item.find("author").find("name").text(),title:$item.find("title").text(),body_content:body_content,avatar:avatar,source:item_source})});topics.push({title:$(val).attr("title"),alias:$(val).attr("alias"),items:items})});if(topics.length>0&&SHOW_TRENDING===true){Dispatch.publish("collecta.new.trend")}}};var obj={init:function(){Dispatch.subscribe("collecta.xmpp.connection.connected",function(){Collecta.ClientModel.subscribeTrend(newTopics)});Dispatch.subscribe("collecta.xmpp.new_message",newTopics)},get:function(index){var retval=topics;if(index){retval=topics[index]}return retval}};return obj}();Dispatch.subscribe("collecta.init",function(){Collecta.TrendingModel.init()});Dispatch.subscribe("collecta.exit",function(){Collecta.ClientModel.unSubscribeTrend()});Collecta.SearchModel=function(){var searches={};var SAVED_SEARCH_MAX=10;var activesearch="";var connected=false;var search_stash="";var activesubids={};var subidHelper=function(subids){activesubids[activesearch].searchid=subids.searchid};var isTwitterSubscribe=function(search){var retval=true;var site_twitter_re=new RegExp("site:.*.*twitter.com","g");var min_site_twitter_re=new RegExp("-site:.*.*twitter.com","g");var testsearch=search.replace(min_site_twitter_re,"");if(testsearch.search(site_twitter_re)!==-1){retval=true}else{if(search.search(min_site_twitter_re)!==-1){retval=false}var testsite=search.replace("-site:","");if(testsite.search(site_twitter_re)===-1&&testsite.search(/site:.+/)!==-1){retval=false}}return retval};var subscribe=function(search){if(connected){activesearch=search;var old=false;if(!activesubids[search]){activesubids[search]={}}else{old=true}var val=searches[val];var savedSearch;if(val&&val!==" "){savedSearch=search+val}else{savedSearch=search}var search_twitter=isTwitterSubscribe(search);if(!Paraphrase._queries[search]&&search_twitter){Paraphrase.subscribe(search)}if(!old){Collecta.ClientModel.searchWoUnSubscribe(savedSearch,[],subidHelper)}Dispatch.publish("collecta.search.started",search)}else{if(search_stash!==""){Dispatch.publish("collecta.search.started.error")}search_stash=search}};var addInactive=function(searchTerm,options){var search=clean(searchTerm);if(!options){options=""}var added=false;if(searches[search]){delete searches[search]}else{added=true}searches[search]=" "+options;if(added){Dispatch.publish("collecta.search.added",search)}};var disconnected=function(){connected=false};var setConnected=function(){connected=true;if(search_stash!=""){var searchOptions=Collecta.SearchModel.get(search_stash);Collecta.SearchModel.search(search_stash,searchOptions)}};var clean=function(searchTerm){return $.trim(searchTerm)};var subscribed=function(){console.info("Subscribed")};var unsubscribed=function(){console.info("Unsubscribed")};Dispatch.subscribe("collecta.xmpp.unsubscribed",unsubscribed);Dispatch.subscribe("collecta.xmpp.subscribed",subscribed);Dispatch.subscribe("collecta.xmpp.connection.connected",setConnected);Dispatch.subscribe("collecta.xmpp.connection.disconnect",disconnected);Dispatch.subscribe("collecta.xmpp.connection.disconnecting",disconnected);Dispatch.subscribe("collecta.xmpp.connection.fail",disconnected);var obj={init:function(){this.empty();Collecta.Client.setShareURL(Collecta.shareURL);if($.cookies.test()){var savedSearches=$.cookies.get("savedSearches");if(savedSearches!==null&&savedSearches!==""&&savedSearches!=="undefined"){var savedSearchesArray=savedSearches.split(",").reverse();for(i=0;i<savedSearchesArray.length;i++){var searchWOptions=savedSearchesArray[i].split(" ");var search=searchWOptions[0].replace(/\+/g," ");searchWOptions.shift();var options=searchWOptions.join(" ");addInactive(search,options)}}}},empty:function(){for(var search in searches){if(Paraphrase._queries){Paraphrase.unsubscribe(search)}}activesearch="";searches={};activesubids={};if(connected){Collecta.ClientModel.searchUnSubscribe()}},save:function(){var savedSearchArray=[];var search;for(search in searches){var savedSearchString=search.replace(/\s/g,"+");if(searches[search]&&searches[search]!==" "){savedSearchString=savedSearchString+searches[search]}savedSearchArray.push(savedSearchString)}$.cookies.set("savedSearches",savedSearchArray.reverse().toString(),8760)},remove:function(searchTerm){var search=clean(searchTerm);delete searches[search];delete activesubids[search];var empty=true;for(var i in searches){if(i){empty=false;break}}if(empty){activesearch=""}if(Paraphrase._queries){Paraphrase.unsubscribe(search)}if(connected){Collecta.ClientModel.searchUnSubscribe()}},add:function(searchTerm,options){addInactive(searchTerm,options)},search:function(searchTerm,options){var search=clean(searchTerm);addInactive(search,options);subscribe(search)},reSubscribe:function(){$.each(searches,function(searchString,val){var savedSearch;if(val&&val!==" "){savedSearch=searchString+val}else{savedSearch=searchString}var activesub=false;if(!activesubids[searchString]){activesubids[searchString]={}}Collecta.ClientModel.searchWoUnSubscribe(savedSearch,[],subidHelper)})},getActiveSubids:function(){return activesubids},getActiveSearch:function(){return activesearch},getMax:function(){return SAVED_SEARCH_MAX},get:function(index){var retval=searches;if(index&&index!=""){retval=searches[index]}return retval},twitterSubscribe:function(search){return isTwitterSubscribe(search)}};return obj}();Dispatch.subscribe("collecta.xmpp.unsubscribed",function(stanza){Collecta.SearchModel.reSubscribe()});Dispatch.subscribe("collecta.init",function(){Collecta.SearchModel.init()});Collecta.Search=function(){var limitSavedSearches=function(){var searches=$("#searches > li");if(searches.length>Collecta.SearchModel.getMax()){var $last_elem=$(searches.get(searches.length-1));var searchTerm=$last_elem.attr("id");Collecta.SearchModel.remove(searchTerm);$last_elem.remove()}};var checkTime=function(i){if(i<10){i="0"+i}return i};var obj={show:function(searchTerm,active){if(!active){active=false}var search_id=$.trim(searchTerm);var $searches=$("#searches");if(active&&$(".activeSearch .searchTerm").text()!==searchTerm){$(".activeSearch").removeClass("activeSearch").addClass("inactiveSearch");$searches.find("#"+$.selectorEscape(search_id)).remove();$("#hot_topics_list").after(Collecta.Client.populateShareBoxes($("#searchTermTemplate").clone().find(".searchTerm").html(Collecta.urlwbr(searchTerm,16)).end().attr("id",search_id).removeClass("inactiveSearch").addClass("activeSearch"),searchTerm))}else{if(!active){$("#hot_topics_list").after(Collecta.Client.populateShareBoxes($("#searchTermTemplate").clone().find(".searchTerm").html(Collecta.urlwbr(searchTerm,16)).end().attr("id",search_id),searchTerm))}}var search_options=Collecta.SearchModel.get(search_id);var selector="#"+$.selectorEscape(search_id)+" .searchOptions :checkbox";$(selector).each(function(){var $this=$(this);var styleName=$this.attr("class");var categoryName=styleName.replace("Result","");if(search_options&&search_options.search(categoryName)!=-1){$this.attr("checked",false)}});limitSavedSearches()},toggleType:function(styleName,checked){$("link[rel=stylesheet][rev='alternate']").each(function(i,style){var thisStyleName=$(style).attr("href").split(/\//).pop().replace(/\..*/,"");var $styleName=$(styleName);if(thisStyleName==styleName){if(checked){style.disabled=false;$styleName.show()}else{style.disabled=true;$styleName.hide()}}});if(!checked){$("#fullResults ."+styleName).addClass("resultFullHide")}},checkInactiveSearch:function(searchTerm){$(".inactiveSearch").each(function(){var $this=$(this);if($this.attr("id").toLowerCase()===searchTerm.toLowerCase()){return false}});return true},startTime:function(){var today=new Date();var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();var ap="am";m=checkTime(m);s=checkTime(s);if(h>12){ap="pm";h=h-12}return h+":"+m+":"+s+" "+ap},buildFilterString:function(search){var filter=[];var selector="#"+$.selectorEscape(search)+" .searchOptions :checkbox";$(selector).each(function(){var $this=$(this);var styleName=$this.attr("class");var checked=$this.attr("checked");var categoryName=styleName.replace("Result","");if(!checked){filter.push("-category:"+categoryName)}});return filter.join(" ")}};return obj}();$(function(){var search_cue=$("#searchForm input").val();$(".searchOptionsToggle").live("click",function(){var $this=$(this);$this.parent().find(".shareOptions").addClass("displayNone").removeClass("displayBlock");$this.parent().find(".shareOptionsToggle").removeClass("searchOptionsToggleOn");$this.parent().find(".searchOptions").toggleClass("displayNone").toggleClass("displayBlock");$this.toggleClass("searchOptionsToggleOn")});$(".activeSearch .searchOptions :checkbox").live("click",function(){var $this=$(this);var styleName=$this.attr("class");var checked=$this.attr("checked");var $col2numresults=$("#col2 .numResults");Collecta.Search.toggleType(styleName,checked);if($col2numresults.is(":visible")){$col2numresults.text("0")}Collecta.Col2Results.maybeSelectFirstResult();var searchTerm=Collecta.SearchModel.getActiveSearch();if(searchTerm!==""){var searchOptions=Collecta.Search.buildFilterString(searchTerm);Collecta.SearchModel.add(searchTerm,searchOptions)}Collecta.Client.resetSearchUI();Collecta.Col2Results.resetPagingButtons();if(!Collecta.Col2Results.resultsBelowFold()){Collecta.Col2Results.fetchNextResults()}});$("label").live("click",function(){$(this).parent().find(":checkbox").click()});$("form").submit(function(ev){ev.preventDefault();var $searchfield=$(this).find(".searchTerm");var searchTerm=$.trim($searchfield.val());var $searchTermSelector=$("#col1 .activeSearch .searchTerm");if($searchTermSelector.text().toLowerCase()===searchTerm.toLowerCase()){$searchTermSelector.effect("highlight",{},1000)}else{var shouldsubmit=Collecta.Search.checkInactiveSearch(searchTerm);if(searchTerm!==""&&searchTerm.replace(/\s/g,"")!==""&&shouldsubmit){var searchOptions=Collecta.Search.buildFilterString(searchTerm);Collecta.SearchModel.search(searchTerm,searchOptions)}}return false});$("#searchForm .searchTerm").focus(function(){var $this=$(this);$this.val("");$this.parent().find("input[type=submit]").removeAttr("disabled");return true});$("#searchForm .searchTerm").blur(function(){var $this=$(this);if($this.val()===""){$this.val(search_cue);$this.parent().find("input[type=submit]").attr("disabled","disabled")}return true});$("#searchForm .searchTerm").keypress(function(key){var $this=$(this);if(key.keyCode===27){$this.val(search_cue);$this.parent().find("input[type=submit]").attr("disabled","disabled");return true}else{$this.parent().find("input[type=submit]").removeAttr("disabled")}});$(".inactiveSearch").live("click",function(e){$("#timeResults").empty();var $target=$(e.target);var $this=$(this);if($target.is(".closeSearch")){var search=$this.attr("id");Collecta.SearchModel.remove(search);$this.remove()}else{$(".activeSearch").removeClass("activeSearch").addClass("inactiveSearch");$this.removeClass("inactiveSearch").addClass("activeSearch").find(".numResults").hide().css("width",0);if($this.is("#hot_topics_list")){$("#hot_topics").show();Collecta.Trending.resize();$("#trends").attr("id","changingtrends");window.location.hash="trends";$("#changingtrends").attr("id","trends")}else{var searchTerm=$this.find(".searchTerm").text();if(searchTerm.length!==0){var searchOptions=Collecta.Search.buildFilterString(searchTerm);Collecta.SearchModel.search(searchTerm,searchOptions)}}}});$(".activeSearch").live("click",function(e){var $target=$(e.target);var $activeSearch=$(this);if($activeSearch.is("#hot_topics_list")){$("#hot_topics").fadeIn("slow")}else{if($target.is(".closeSearch")){if($activeSearch.hasClass("activeSearch")){var oldsearch=$activeSearch.attr("id");Collecta.SearchModel.remove(oldsearch);var $next=$activeSearch.next();var $prev=$activeSearch.prev();if($next.length!==0){$next.click()}else{if($prev.length!==0){$prev.click();if($prev.is("#hot_topics_list")){window.location.hash="trends"}}else{$("#col2 .results").children().remove();$("#fullResults").children().remove();$("#col2 .resultsCount").hide();$("#col3 .copyright, #col3 .moreAnchor,#col3 .entryShareOptions").removeClass("displayBlock").addClass("displayNone");$("#pageUp").hide();$("#pageDown").hide();$("#pauseButton").click();window.location.hash="trends";$("#col2 .numResults").empty()}}$activeSearch.remove()}}else{Collecta.Client.resetSearchUI()}}});$(".shareOptionsToggle").live("click",function(){var $this=$(this);$this.parent().find(".searchOptions").addClass("displayNone").removeClass("displayBlock");$this.parent().find(".searchOptionsToggle").removeClass("searchOptionsToggleOn");$this.parent().find(".shareOptions").toggleClass("displayNone").toggleClass("displayBlock");$this.toggleClass("searchOptionsToggleOn")})});Dispatch.subscribe("collecta.search.added",function(search){Collecta.Search.show(search)});Dispatch.subscribe("collecta.xmpp.connection.reconnect",function(){var active_search=$("#col1 .activeSearch .searchTerm").text();if(active_search&&active_search!==""){var searchOptions=Collecta.Search.buildFilterString(active_search);Collecta.SearchModel.search(active_search,searchOptions)}});Dispatch.subscribe("collecta_second_tick",function(){var search_from_url=Collecta.Client.getSearchFromURL();if(search_from_url&&search_from_url!==Collecta.SearchModel.getActiveSearch()){Collecta.SearchModel.search(search_from_url)}var topics=Collecta.Client.getTopicFromURL();if(topics!==""){$("#hot_topics_list").click()}});Dispatch.subscribe("collecta.search.started",function(searchTerm){if(Collecta.Client.getSearchFromURL()!==searchTerm){window.location.hash="q="+escape(searchTerm)}Collecta.Search.show(searchTerm,true);$("#col2 .results").children().remove();$("#fullResults").children().remove();$("#col3 .entryHeader, #col3 .copyright, #col3 .moreAnchor, #col3 .entryShareOptions").removeClass("displayBlock").addClass("displayNone");$("#col2 .numResults").empty();$("#timeResults").empty();$("#col2 .numResultsLabel").text("Getting Real-time Results...");$("#col2 .numResultsLabelSince").hide();$(".numResultsLabel").show();Collecta.Client.resetSearchUI();Collecta.Col2Results.fetchNextResults(true);var item=Collecta.ResultsModel.get("waitMessage"+searchTerm);if(!item&&Collecta.ResultsModel.getCount(searchTerm)===0){item={};item.id="waitMessage"+searchTerm;item.title="Search started at "+Collecta.Search.startTime();item.search=searchTerm;item.archive=true;item.category="story";var date=new Date();item.timesaved=date.getTime().toString()}Collecta.ResultsModel.add(item);$(".activeSearch .searchOptions :checkbox").each(function(){Collecta.Search.toggleType($(this).attr("class"),$(this).attr("checked"))})});Date.prototype.getStandardTime=function(){var hour=this.getHours();var tag="";if(hour>12){hour=hour-12;tag="PM"}return[hour,tag]};Date.prototype.getMonthName=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"][this.getMonth()]};Collecta.XMPP.DOMAIN="guest.collecta.com";Collecta.XMPP.DEFAULT_ROUTE="";Collecta.XMPP.PUBSUB_COMPONENT="pubsub.collecta.com";Collecta.XMPP.SEARCH_COMPONENT="search.collecta.com";Collecta.XMPP.ARCHIVE_COMPONENT="search.collecta.com";Collecta.XMPP.API_KEY="a8b03bfd1b87c4b7ad70551c43fd3d71";Collecta.TREND_NODE="/home/collecta.com/trend";Collecta.shareURL="http://collecta.com/s/";Collecta.CLICK_THROUGH="http://collecta.com/url/?src=web&o=";Collecta.FAVICON_MAP={"4ever3blog.com":"http://www.sbnation.com/http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/favicon.ico","abclocal.go.com":"http://abc.go.com/favicon.ico","acmepackingcompany.com":"http://www.sbnation.com/images/favicon.ico","addictedtoquack.com":"http://www.sbnation.com/images/favicon.ico","alligatorarmy.com":"http://www.sbnation.com/images/favicon.ico","amazinavenue.com":"http://www.sbnation.com/images/favicon.ico","andthevalleyshook.com":"http://www.sbnation.com/images/favicon.ico","arkansasexpats.com":"http://www.sbnation.com/images/favicon.ico","arrowheadpride.com":"http://www.sbnation.com/images/favicon.ico","aseaofblue.com":"http://www.sbnation.com/images/favicon.ico","athleticsnation.com":"http://www.sbnation.com/images/favicon.ico","atthehive.com":"http://www.sbnation.com/images/favicon.ico","azdesertswarm.com":"http://www.sbnation.com/images/favicon.ico","azsnakepit.com":"http://www.sbnation.com/images/favicon.ico","backingthepack.com":"http://www.sbnation.com/images/favicon.ico","backporch.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","badlefthook.com":"http://www.sbnation.com/images/favicon.ico","baltimorebeatdown.com":"http://www.sbnation.com/images/favicon.ico","battleofcali.com":"http://www.sbnation.com/images/favicon.ico","battleredblog.com":"http://www.sbnation.com/images/favicon.ico","bcinterruption.com":"http://www.sbnation.com/images/favicon.ico","behindthesteelcurtain.com":"http://www.sbnation.com/images/favicon.ico","beyondtheboxscore.com":"http://www.sbnation.com/images/favicon.ico","big12hardball.com":"http://www.sbnation.com/images/favicon.ico","big12hoops.com":"http://www.sbnation.com/images/favicon.ico","bigblueview.com":"http://www.sbnation.com/images/favicon.ico","bigcatcountry.com":"http://www.sbnation.com/images/favicon.ico","birdwatchersanonymous.com":"http://www.sbnation.com/images/favicon.ico","blackheartgoldpants.com":"http://www.sbnation.com/images/favicon.ico","blackshoediaries.com":"http://www.sbnation.com/images/favicon.ico","blazersedge.com":"http://www.sbnation.com/images/favicon.ico","bleedcubbieblue.com":"http://www.sbnation.com/images/favicon.ico","bleedinggreennation.com":"http://www.sbnation.com/images/favicon.ico","blessyouboys.com":"http://www.sbnation.com/images/favicon.ico","blocku.com":"http://www.sbnation.com/images/favicon.ico","blog.sbnation.com":"http://www.sbnation.com/images/favicon.ico","blogabull.com":"http://www.sbnation.com/images/favicon.ico","bloggersodear.com":"http://www.sbnation.com/images/favicon.ico","bloggingtheboys.com":"http://www.sbnation.com/images/favicon.ico","bloggingthebracket.com":"http://www.sbnation.com/images/favicon.ico","bloodyelbow.com":"http://www.sbnation.com/images/favicon.ico","bluebirdbanter.com":"http://www.sbnation.com/images/favicon.ico","blueshirtbanter.com":"http://www.sbnation.com/images/favicon.ico","boltsfromtheblue.com":"http://www.sbnation.com/images/favicon.ico","boxing.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","brewcrewball.com":"http://www.sbnation.com/images/favicon.ico","brewhoop.com":"http://www.sbnation.com/images/favicon.ico","brightsideofthesun.com":"http://www.sbnation.com/images/favicon.ico","bringonthecats.com":"http://www.sbnation.com/images/favicon.ico","broadstreethockey.com":"http://www.sbnation.com/images/favicon.ico","bruinsnation.com":"http://www.sbnation.com/images/favicon.ico","bucem.com":"http://www.sbnation.com/images/favicon.ico","buckys5thquarter.com":"http://www.sbnation.com/images/favicon.ico","bucsdugout.com":"http://www.sbnation.com/images/favicon.ico","buffalorumblings.com":"http://www.sbnation.com/images/favicon.ico","buildingthedam.com":"http://www.sbnation.com/images/favicon.ico","bulletsforever.com":"http://www.sbnation.com/images/favicon.ico","burntorangenation.com":"http://www.sbnation.com/images/favicon.ico","cagesideseats.com":"http://www.sbnation.com/images/favicon.ico","californiagoldenblogs.com":"http://www.sbnation.com/images/favicon.ico","camdenchat.com":"http://www.sbnation.com/images/favicon.ico","canalstreetchronicles.com":"http://www.sbnation.com/images/favicon.ico","canescountry.com":"http://www.sbnation.com/images/favicon.ico","canishoopus.com":"http://www.sbnation.com/images/favicon.ico","cardchronicle.com":"http://www.sbnation.com/images/favicon.ico","carolinamarch.com":"http://www.sbnation.com/images/favicon.ico","casualhoya.com":"http://www.sbnation.com/images/favicon.ico","catscratchreader.com":"http://www.sbnation.com/images/favicon.ico","celticsblog.com":"http://www.sbnation.com/images/favicon.ico","cincyjungle.com":"http://www.sbnation.com/images/favicon.ico","clipsnation.com":"http://www.sbnation.com/images/favicon.ico","clonechronicles.com":"http://www.sbnation.com/images/favicon.ico","conquestchronicles.com":"http://www.sbnation.com/images/favicon.ico","coppernblue.com":"http://www.sbnation.com/images/favicon.ico","cornnation.com":"http://www.sbnation.com/images/favicon.ico","cougcenter.com":"http://www.sbnation.com/images/favicon.ico","couriermail.news.com.au":"http://www.news.com.au/couriermail/images/headers/favicon.ico","crawfishboxes.com":"http://www.sbnation.com/images/favicon.ico","crimsonandcreammachine.com":"http://www.sbnation.com/images/favicon.ico","crimsonquarry.com":"http://www.sbnation.com/images/favicon.ico","dailynorseman.com":"http://www.sbnation.com/images/favicon.ico","dailysoccerfix.com":"http://www.sbnation.com/images/favicon.ico","dawgsbynature.com":"http://www.sbnation.com/images/favicon.ico","dawgsports.com":"http://www.sbnation.com/images/favicon.ico","defendingbigd.com":"http://www.sbnation.com/images/favicon.ico","denverstiffs.com":"http://www.sbnation.com/images/favicon.ico","diebytheblade.com":"http://www.sbnation.com/images/favicon.ico","doubletnation.com":"http://www.sbnation.com/images/favicon.ico","draysbay.com":"http://www.sbnation.com/images/favicon.ico","drivelinemechanics.com":"http://www.sbnation.com/images/favicon.ico","faketeams.com":"http://www.sbnation.com/images/favicon.ico","fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","fantasyfootball.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","fearthefin.com":"http://www.sbnation.com/images/favicon.ico","fearthesword.com":"http://www.sbnation.com/images/favicon.ico","federalbaseball.com":"http://www.sbnation.com/images/favicon.ico","feeds.autoblog.com":"http://www.autoblog.com/favicon.ico","feeds.bizjournals.com":"http://images.bizjournals.com/favicon.ico","feeds.bizjournals.com":"http://www.bizjournals.com/favicon.ico","feeds.boston.com":"http://www.boston.com/favicon.ico","feeds.chicagotribune.com":"http://www.chicagotribune.com/favicon.ico","feeds.digg.com":"http://digg.com/favicon.ico","feeds.gawker.com":"http://gawker.com/favicon.ico","feeds.latimes.com":"http://www.latimes.com/favicon.ico","feeds.news.com.au":"http://www.news.com.au/favicon.ico","feeds.newsweek.com":"http://www.newsweek.com/site/redesign/images/favicon.ico","feeds.nydailynews.com":"http://www.nydailynews.com/favicon.ico","feeds.nytimes.com":"http://www.nytimes.com/favicon.ico","feeds.sfgate.com":"http://imgs.sfgate.com/favicon.ico","fieldgulls.com":"http://www.sbnation.com/images/favicon.ico","fishstripes.com":"http://www.sbnation.com/images/favicon.ico","fiveforhowling.com":"http://www.sbnation.com/images/favicon.ico","forums.vwvortex.com":"http://www.vwvortex.com/favicon.ico","forwhomthecowbelltolls.com":"http://www.sbnation.com/images/favicon.ico","fox11online.com":"http://www.lininteractive.com/favicons/WLUK.ico","fromtherink.com":"http://www.sbnation.com/images/favicon.ico","fromtherumbleseat.com":"http://www.sbnation.com/images/favicon.ico","ganggreennation.com":"http://www.sbnation.com/images/favicon.ico","garnetandblackattack.com":"http://www.sbnation.com/images/favicon.ico","gaslampball.com":"http://www.sbnation.com/images/favicon.ico","globalfutbol.com":"http://www.sbnation.com/images/favicon.ico","gobblercountry.com":"http://www.sbnation.com/images/favicon.ico","goldenstateofmind.com":"http://www.sbnation.com/images/favicon.ico","golf.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","habseyesontheprize.com":"http://www.sbnation.com/images/favicon.ico","hailtotheorange.com":"http://www.sbnation.com/images/favicon.ico","halosheaven.com":"http://www.sbnation.com/images/favicon.ico","hammerandrails.com":"http://www.sbnation.com/images/favicon.ico","hockeywilderness.com":"http://www.sbnation.com/images/favicon.ico","hogshaven.com":"http://www.sbnation.com/images/favicon.ico","hounddoglpga.com":"http://www.sbnation.com/images/favicon.ico","houseofsparky.com":"http://www.sbnation.com/images/favicon.ico","iamthe12thman.com":"http://www.sbnation.com/images/favicon.ico","indycornrows.com":"http://www.sbnation.com/images/favicon.ico","inlouwetrust.com":"http://www.sbnation.com/images/favicon.ico","jacketscannon.com":"http://www.sbnation.com/images/favicon.ico","japersrink.com":"http://www.sbnation.com/images/favicon.ico","jay-mariotti.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","kevin-blackistone.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","letsgotribe.com":"http://www.sbnation.com/images/favicon.ico","libertyballers.com":"http://www.sbnation.com/images/favicon.ico","lighthousehockey.com":"http://www.sbnation.com/images/favicon.ico","lisa-olson.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","litterboxcats.com":"http://www.sbnation.com/images/favicon.ico","lonestarball.com":"http://www.sbnation.com/images/favicon.ico","lookoutlanding.com":"http://www.sbnation.com/images/favicon.ico","maizenbrew.com":"http://www.sbnation.com/images/favicon.ico","malepatternfitness.com":"http://www.sbnation.com/images/favicon.ico","matchsticksandgasoline.com":"http://www.sbnation.com/images/favicon.ico","mavsmoneyball.com":"http://www.sbnation.com/images/favicon.ico","mccoveychronicles.com":"http://www.sbnation.com/images/favicon.ico","mercurynews.com":"http://extras.mnginteractive.com/live/media/favIcon/mercury/favicon.ico","midmajormadness.com":"http://www.sbnation.com/images/favicon.ico","milehighhockey.com":"http://www.sbnation.com/images/favicon.ico","milehighreport.com":"http://www.sbnation.com/images/favicon.ico","minorleagueball.com":"http://www.sbnation.com/images/favicon.ico","mlb.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","mlbdailydish.com":"http://www.sbnation.com/images/favicon.ico","mma.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","mmaforreal.com":"http://www.sbnation.com/images/favicon.ico","mockingthedraft.com":"http://www.sbnation.com/images/favicon.ico","motorsports.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","motownstringmusic.com":"http://www.sbnation.com/images/favicon.ico","musiccitymiracles.com":"http://www.sbnation.com/images/favicon.ico","mwcconnection.com":"http://www.sbnation.com/images/favicon.ico","nationalpost.com":"http://www.nationalpost.com/_assets/images/favicon.ico","nba.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","nbcchicago.com":"http://media.nbcchicago.com/designimages/favicon.ico","nbcnewyork.com":"http://media.nbcnewyork.com/designimages/favicon.ico","ncaabasketball.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","ncaafootball.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","newsday.com":"http://www.newsday.com/img/newsday/favicon.ico","nfl.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","nhl.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","ninersnation.com":"http://www.sbnation.com/images/favicon.ico","nucksmisconduct.com":"http://www.sbnation.com/images/favicon.ico","nunesmagician.com":"http://www.sbnation.com/images/favicon.ico","obnug.com":"http://www.sbnation.com/images/favicon.ico","ontheforecheck.com":"http://www.sbnation.com/images/favicon.ico","overthemonster.com":"http://www.sbnation.com/images/favicon.ico","patspulpit.com":"http://www.sbnation.com/images/favicon.ico","peachtreehoops.com":"http://www.sbnation.com/images/favicon.ico","peninsulaismightier.com":"http://www.sbnation.com/images/favicon.ico","pensburgh.com":"http://www.sbnation.com/images/favicon.ico","pensionplanpuppets.com":"http://www.sbnation.com/images/favicon.ico","pinstripealley.com":"http://www.sbnation.com/images/favicon.ico","podiumcafe.com":"http://www.sbnation.com/images/favicon.ico","postingandtoasting.com":"http://www.sbnation.com/images/favicon.ico","poundingtherock.com":"http://www.sbnation.com/images/favicon.ico","prideofdetroit.com":"http://www.sbnation.com/images/favicon.ico","protectrturf.com":"http://www.sbnation.com/images/favicon.ico","purplerow.com":"http://www.sbnation.com/images/favicon.ico","rakesofmallow.com":"http://www.sbnation.com/images/favicon.ico","ralphiereport.com":"http://www.sbnation.com/images/favicon.ico","raptorshq.com":"http://www.sbnation.com/images/favicon.ico","rawcharge.com":"http://www.sbnation.com/images/favicon.ico","redandblackattack.com":"http://www.sbnation.com/images/favicon.ico","redcuprebellion.com":"http://www.sbnation.com/images/favicon.ico","redreporter.com":"http://www.sbnation.com/images/favicon.ico","revengeofthebirds.com":"http://www.sbnation.com/images/favicon.ico","ridiculousupside.com":"http://www.sbnation.com/images/favicon.ico","rivalryesq.com":"http://www.sbnation.com/images/favicon.ico","rockchalktalk.com":"http://www.sbnation.com/images/favicon.ico","rockmnation.com":"http://www.sbnation.com/images/favicon.ico","rockytoptalk.com":"http://www.sbnation.com/images/favicon.ico","rollbamaroll.com":"http://www.sbnation.com/images/favicon.ico","royalsreview.com":"http://www.sbnation.com/images/favicon.ico","rss.cnn.com":"http://www.cnn.com/favicon.ico","rufusonfire.com":"http://www.sbnation.com/images/favicon.ico","sactownroyalty.com":"http://www.sbnation.com/images/favicon.ico","sbnation.com":"http://www.sbnation.com/images/favicon.ico","searchingforbillyedelin.com":"http://www.sbnation.com/images/favicon.ico","secondcityhockey.com":"http://www.sbnation.com/images/favicon.ico","seventhfloorblog.com":"http://www.sbnation.com/images/favicon.ico","sfgate.com":"http://imgs.sfgate.com/favicon.ico","silverandblackpride.com":"http://www.sbnation.com/images/favicon.ico","silverscreenandroll.com":"http://www.sbnation.com/images/favicon.ico","silversevensens.com":"http://www.sbnation.com/images/favicon.ico","sippinonpurple.com":"http://www.sbnation.com/images/favicon.ico","slcdunk.com":"http://www.sbnation.com/images/favicon.ico","slipperstillfits.com":"http://www.sbnation.com/images/favicon.ico","smokingmusket.com":"http://www.sbnation.com/images/favicon.ico","soccer.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","social.msdn.microsoft.com":"http://social.msdn.microsoft.com/GlobalResources/images/Msdn/favicon.ico","southsidesox.com":"http://www.sbnation.com/images/favicon.ico","stampedeblue.com":"http://www.sbnation.com/images/favicon.ico","stanleycupofchowder.com":"http://www.sbnation.com/images/favicon.ico","stlouisgametime.com":"http://www.sbnation.com/images/favicon.ico","straightouttavancouver.com":"http://www.sbnation.com/images/favicon.ico","swishappeal.com":"http://www.sbnation.com/images/favicon.ico","talkingchop.com":"http://www.sbnation.com/images/favicon.ico","teamspeedkills.com":"http://www.sbnation.com/images/favicon.ico","techcrunch.com":"http://www.techcrunch.com/favicon.ico","tennis.fanhouse.com":"http://www.blogsmithmedia.com/www.fanhouse.com/media/fh_favicon.ico","testudotimes.com":"http://www.sbnation.com/images/favicon.ico","thedailyforehand.com":"http://www.sbnation.com/images/favicon.ico","thedailygopher.com":"http://www.sbnation.com/images/favicon.ico","thedreamshake.com":"http://www.sbnation.com/images/favicon.ico","thefalcoholic.com":"http://www.sbnation.com/images/favicon.ico","thegoodphight.com":"http://www.sbnation.com/images/favicon.ico","theonlycolors.com":"http://www.sbnation.com/images/favicon.ico","thephinsider.com":"http://www.sbnation.com/images/favicon.ico","thirdquartercollapse.com":"http://www.sbnation.com/images/favicon.ico","tomahawknation.com":"http://www.sbnation.com/images/favicon.ico","trackemtigers.com":"http://www.sbnation.com/images/favicon.ico","truebluela.com":"http://www.sbnation.com/images/favicon.ico","turfshowtimes.com":"http://www.sbnation.com/images/favicon.ico","twinkietown.com":"http://www.sbnation.com/images/favicon.ico","uncommonsportsman.com":"http://www.sbnation.com/images/favicon.ico","ustream.tv":"http://cdn1.ustream.tv/images/favicon.ico","uwdawgpound.com":"http://www.sbnation.com/images/favicon.ico","vanquishthefoe.com":"http://www.sbnation.com/images/favicon.ico","vivaelbirdos.com":"http://www.sbnation.com/images/favicon.ico","waggleroom.com":"http://www.sbnation.com/images/favicon.ico","watchkalibrun.com":"http://www.sbnation.com/images/favicon.ico","webpronews.com":"http://www.webpronews.com/misc/favicon.ico","welcometoloudcity.com":"http://www.sbnation.com/images/favicon.ico","westerncollegehockeyblog.com":"http://www.sbnation.com/images/favicon.ico","wewillalwayshavetempe.com":"http://www.sbnation.com/images/favicon.ico","windycitygridiron.com":"http://www.sbnation.com/images/favicon.ico","wingingitinmotown.com":"http://www.sbnation.com/images/favicon.ico","www2.nbc13.com":"http://static.mgnetwork.com/vtm/media_path/icons/favicon.ico","ap.org":"http://www.ap.org/media/images/favicon.ico","pcworld.com":"http://www.pcworld.com/favicon.ico","engrishfunny.com":"http://s1.wordpress.com/wp-content/themes/vip/cheezcommon/wp-verticals/engrishfunny/favicon.ico","news.com.au":[{couriermail:"http://www.news.com.au/couriermail/images/headers/favicon.ico",heraldsun:"http://resources.news.com.au/cs/heraldsun/images/favicon.ico",adelaidenow:"http://www.news.com.au/adelaidenow/images/headers/favicon.ico",perthnow:"http://resources.news.com.au/cs/newscomau/images/favicon.ico",dailytelegraph:"http://resources.news.com.au/cs/dailytelegraph/images/favicon.ico"}],"feedproxy.google.com":[null,{"usip-in-the-news":"http://www.usip.org/files/favicon.ico",SmallBusinessTrends:"http://smallbiztrends.com/favicon.ico",eonline:"http://www.eonline.com/favicon.ico",ProgrammableWeb:"http://www.programmableweb.com/favicon.ico",BrooklynVeganFeed:"http://www.brooklynvegan.com/favicon.ico",PitchforkLatestNews:"http://pitchfork.com/favicon.ico",DailyFillRss:"http://www.dailyfill.com/favicon.ico",paperblog:"http://www.paperblog.fr/favicon.ico",time:"http://img.timeinc.net/time/favicon.ico",venturebeat:"http://venturebeat.com/favicon.ico",Venturebeat:"http://venturebeat.com/favicon.ico",Webworkerdaily:"http://s1.wordpress.com/wp-content/themes/vip/webworkerdaily2/favicon.ico",ExtraTV:"http://extratv.warnerbros.com/images/favicon.ico",teknologik:"http://www.teknologik.fr/favicon.ico",oreilly:"http://oreilly.com/favicon.ico",PopphotoFlash:"http://6a.typepad.com/favicon.ico",japantimes_news:"http://search.japantimes.co.jp/favicon.ico",japantimes_features:"http://search.japantimes.co.jp/favicon.ico",webpronews:"http://www.webpronews.com/favicon.ico",japantimes_sports:"http://search.japantimes.co.jp/favicon.ico",webware:"http://news.cnet.com/favicon.ico",japantimes:"http://search.japantimes.co.jp/favicon.ico",TheNextWeb:"http://thenextweb.com/favicon.gif",thumpertalk:"http://www.thumpertalk.com/favicon.ico",AdvertisingAge:"http://adage.com/favicon.ico",morecowbell:"http://morecowbell.net/favicon.ico",linuxquestions:"http://www.linuxquestions.org/favicon.ico",bostonherald:"http://www.bostonherald.com/favicon.ico",stereogum:"http://stereogum.com/favicon.ico",MostlyPhotography:"http://www.mostlyphotography.com/favicon.ico",NP_Top_Stories:"http://www.nationalpost.com/_assets/http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/favicon.ico",Mashable:"http://mashable.com/favicon.ico",OmMalik:"http://s1.wordpress.com/wp-content/themes/vip/gigaomnetwork/img/favicons/gigaom.ico",nmecom:"http://www.nme.com/favicon.ico",variety:"http://a330.g.akamai.net/7/330/23382/20080720214316/www.variety.com/graphics/vicon.ico",fastcompany:"http://www.fastcompany.com/favicon.ico",euronews:"http://www.euronews.net/favicon.ico","BusinessNewsAmericas-TopStoriesEN":"http://www.bnamericas.com/favicon.ico",wwtdd:"http://www.wwtdd.com/favicon.ico",ZDNetBlogs:"http://blogs.zdnet.com/favicon.ico",celebuzz:"http://www.celebuzz.com/favicon.ico","wwtdd.com":"http://www.wwtdd.com/favicon.ico",businessinsider:"http://static.businessinsider.com/assets/images/faviconTBI.ico",Techcrunch:"http://www.techcrunch.com/favicon.ico",techzulu:"http://www.techzulu.com/favicon.ico",singletracks:"http://www.singletracks.com/favicon.ico"},{alleyinsider:"http://static.businessinsider.com/assets/images/faviconTBI.ico",pcmag:"http://www.pcmag.com/favicon.ico",tvsquad:"http://www.blogsmithmedia.com/www.tvsquad.com/media/favicon.ico"}],"blogs.cnn.com":"http://www.cnn.com/favicon.ico","usatoday.com":"http://www.usatoday.com/favicon.ico","boingboing.net":"http://www.boingboing.net/favicon.ico","technorati.com":"http://technorati.com/favicon.ico","whitehouse.gov":"http://www.whitehouse.gov/sites/default/themes/whitehouse/favicon.ico","time.com":"http://img.timeinc.net/time/favicon.ico","bellezzapura.wordpress.com":"http://www.gravatar.com/blavatar/d2a7455acf3b81a69e35d4cdad56844b?s=16&#038;d=http://s.wordpress.com/favicon.ico","wn.com":"http://cdn3.wn.com/st/favicon.ico","wwlp.com":"http://www.lininteractive.com/favicons/WWLP.ico","impeachobamacampaign.com":"http://www.impeachobamacampaign.com/wp-content/themes/corporate_10/images/favicon.ico","abcnews.com":"http://abcnews.go.com/favicon.ico","order-order.com":"http://s1.wordpress.com/wp-content/themes/vip/orderorder/images/gf_icon.ico","sonoranweeklyreview.com":"http://a323.yahoofs.com/coreid/4aff63f0i23b0zul3re3/ZauLSU40f6.FBc0sIuLo_ic-/1/tn48.jpg?ciAgMZLBCWSTRaww","woodtv.com":"http://media2.woodtv.com/favicon.ico","mylipstickonhercollar.com":"http://www.gravatar.com/blavatar/7cc0eecd177c8b86ca3d89b918dc20da?s=16&#038;d=http://s.wordpress.com/favicon.ico","wexfieifcp.com":"http://www.gravatar.com/blavatar/9b99ce12699c5ea90dafbbe5eaf2ad7d?s=16&#038;d=http://s.wordpress.com/favicon.ico","theglobeandmail.com":"http://beta.images.theglobeandmail.com/http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/gam/favicon.ico","jambonewspot.com":"http://www.gravatar.com/blavatar/9153cf5adfcbede2c6b07209bd107779?s=16&#038;d=http://s.wordpress.com/favicon.ico","pitchfork.com":"http://pitchfork.com/favicon.ico","wsbtv.com":"http://www.wsbtv.com/images/structures/searchform/site_search_icon.gif","komonews.com":"http://media.komonews.com/designhttp://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/komo_favicon.ico","the-american-catholic.com":"http://www.gravatar.com/blavatar/ebe91d56d30239c1ee43b2f125762e9f?s=16&#038;d=http://s.wordpress.com/favicon.ico","hillbuzz.org":"http://www.gravatar.com/blavatar/c9f46052782102372b9fcda470238081?s=16&#038;d=http://s.wordpress.com/favicon.ico","macleans.ca":"http://s3.wordpress.com/wp-content/themes/vip/macleans3/images/logo.png","247wallstreet.com":"http://s3.wordpress.com/wp-content/themes/vip/247wallst/favicon.ico","cbsnews.com":"http://www.cbsnews.com/favicon.ico","kxan.com":"http://media.lintvnews.com/photo/favicon.gif","betanews.com":"http://www.betanews.com/favicon.ico","disinfo.com":"http://d19lgcbwx11yiq.cloudfront.net/favicon.ico","adweek.com":"http://www.adweek.com/aw/http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/favicon.ico","financialpost.com":"http://www.financialpost.com/_assets/images/favicon.ico","foxnewsradio.com":"http://www.foxnewsradio.com/wp-content/themes/arthemia/images/favicon.ico","wishtv.com":"http://www.lininteractive.com/favicons/WISH.ico","voanews.com":"http://media.voanews.com/designimages/favicon.ico","icanhazcheezburger.com":"http://s1.wordpress.com/wp-content/themes/vip/cheezcommon/wp-verticals/icanhascheezburger/favicon.ico","northbayfixed.com":"http://www.gravatar.com/blavatar/780645f160969a85029285b5655eff83?s=16&#038;d=http://s.wordpress.com/favicon.ico","thetvchick.com":"http://www.gravatar.com/blavatar/00cb259f6e7e678b14785bb0cee24807?s=16&#038;d=http://s.wordpress.com/favicon.ico","technologizer.com":"http://s2.wordpress.com/wp-content/themes/vip/technologizer/favicon.ico","collecta.com":"http://www.collecta.com/favicon.ico","wktv.com":"http://media.wktv.com/designimages/WKTV_favicon-1.ico","kcrg.com":"http://media.kcrg.com/designimages/favicon4.ico","dailycamera.com":"http://extras.mnginteractive.com/live/media/favIcon/DailyCamera/dcicon.ico","posterous.com":"http://posterous.com/images/favicon.png","ew.com":"http://img2.timeinc.net/ew/static/favicon.ico","couldave.com":"http://www.cloudave.com/http://static.collecta.com/4ad11292dc5c863ff91d1e9afd6cf264/CA/CA.ico","dailyfinance.com":"http://o.aolcdn.com/art/pf/df_favicon.ico","techland.com":"http://s3.wordpress.com/wp-content/themes/vip/timenerdworld/images/favicon.ico?m=1247082919","nbcsports.com":"http://nbcsports.msnbc.com/favicon.ico","msnbc.msn.com":"http://www.msnbc.msn.com/favicon.ico","paidcontent.org":"http://paidcontent.org/images/site/favicon_pc.ico","dailycommonsense.com":"http://www.dailycommonsense.com/wp-content/themes/dcs30/images/favicon.ico","campaignoutsider.com":"http://www.gravatar.com/blavatar/e69397b4a87255400547e300168e353b?s=16&#038;d=http://s.wordpress.com/favicon.ico","wivb.com":"http://www.lininteractive.com/favicons/WIVB.ico","theaustralian.news.com.au":"http://wl.theaustralian.news.com.au/images/headers/aus-fav.ico","www.news.com.au":"http://resources.news.com.au/cs/newscomau/images/favicon.ico","australianit.com.au":"http://www.theaustralian.com.au/favicon.ico","news.smh.com.au":"http://www.smh.com.au/favicon.ico","crikey.com.au":"http://www.crikey.com.au/wp-content/uploads/favicons/favicon.ico","pigsarms.com.au":"http://www.gravatar.com/blavatar/4342586a24bee1e05045de9a085c4311?s=16&#038;d=http://s.wordpress.com/favicon.ico","pubapi.outside.in":"http://outside.in/images/oi_favicon.ico","foxnews.com":"http://www.foxnews.com/favicon.ico","itsgettinghotinhere.org":"http://s3.wordpress.com/wp-content/themes/vip/itsgettinghotinhere/images/favicon.ico","gizmodo.com.br":"http://www.gizmodo.com.br/misc/favicon.ico","foxtoledo.com":"http://www.lininteractive.com/favicons/WUPW.ico","blogs.fortune.cnn.com":"http://www.cnn.com/favicon.ico","cbssports.com":"http://sports.cbsimg.net/favicon.ico","webguild.org":"http://www.webguild.org/images/favicon.ico","failblog.org":"http://s1.wordpress.com/wp-content/themes/vip/cheezcommon/wp-verticals/failblog/favicon.ico","extratv.warnerbros.com":"http://extratv.warnerbros.com/images/favicon.ico","blog.isotoma.com":"http://blog.isotoma.com/wp-content/themes/k2/styles/isotoma/images/favicon.ico","thebostonchannel.com":"http://profile.ak.fbcdn.net/object3/533/29/q68174059444_4017.jpg"};$(function(){Paraphrase.init();Dispatch.publish("collecta.init");$.getScript("http://www.google-analytics.com/ga.js",function(){try{var GA_UA=Collecta.runFilter("gatracker",{data:"UA-7083397-1"});var pageTracker=window._gat._getTracker(GA_UA);pageTracker._trackPageview()}catch(err){}});$.getScript("http://static.chartbeat.com/js/chartbeat.js",function(){window._sf_endpt=(new Date()).getTime()})});