//Query 
new function(d){var c=d.separator||"&";var b=d.spaces===false?false:true;var a=d.suffix===false?"":"[]";jQuery.query=new function(){var e=function(f){var g=this;g.keys={};if(f.queryObject){jQuery.each(f.keys,function(i,j){g.destructiveSet(i,j)})}else{var h=""+f;h=h.replace(/^\?/,"");h=h.replace(/[;&]$/,"");if(b){h=h.replace("+"," ")}jQuery.each(h.split(/[&;]/),function(){var j=this.split("=")[0];var m=this.split("=")[1];var i,l=null,k=null;if(/^-?[0-9]+\.[0-9]+$/.test(m)){m=parseFloat(m)}else{if(/^-?[0-9]+$/.test(m)){m=parseInt(m)}}if(/\[([^\] ]+)\]$/.test(j)){k=Object,hashkey=j.replace(/^.+\[([^\] ]+)\]$/,"$1"),j=j.replace(/\[([^\] ]+)\]$/,"")}else{if(/\[\]$/.test(j)){k=Array,j=j.replace(/\[\]$/,"")}}m=m||true;if(!k&&g.has(j)){k=Array,g.destructiveSet(j,g.has(j,Array)?g.keys[j]:[g.keys[j]])}if(!k){g.destructiveSet(j,m)}else{if(k==Object){i=g.keys[j]||{},i[hashkey]=m,g.destructiveSet(j,i)}else{if(k==Array){i=g.keys[j]||[],i.push(m),g.destructiveSet(j,i)}}}})}return g};e.prototype={queryObject:true,has:function(f,g){var h=this.keys;return !!g?h[f]!=undefined&&h[f]!==null&&h[f].constructor==g:h[f]!=undefined&&h[f]!==null},get:function(f){var g=(f==undefined)?this.keys:this.keys[f];if(g.constructor==Array){return g.slice(0)}else{if(g.constructor==Object){return jQuery.extend({},g)}else{return g}}},destructiveSet:function(f,g){if(g==undefined||g===null){this.destructiveRemove(f)}else{this.keys[f]=g}return this},set:function(f,g){return this.copy().destructiveSet(f,g)},destructiveRemove:function(f){if(typeof this.keys[f]!="undefined"){delete this.keys[f]}return this},remove:function(f){return this.copy().destructiveRemove(f)},destructiveEmpty:function(){var f=this;jQuery.each(f.keys,function(g,h){delete f.keys[g]});return f},copy:function(){return new e(this)},empty:function(f){return this.copy().destructiveEmpty()},toString:function(){var h=0,j=[],g=this,f=function(l,i,k){l.push(i);if(k!==true){l.push("=");l.push(encodeURIComponent(k))}};jQuery.each(this.keys,function(k,l){var m=[];if(l!==false){if(h++==0){m.push("?")}if(g.has(k,Object)){var i=[];jQuery.each(l,function(o,n){var p=[];f(p,k+"["+o+"]",n);i.push(p.join(""))});m.push(i.join(c))}else{if(g.has(k,Array)){var i=[];jQuery.each(l,function(o,n){var p=[];f(p,k+a,n);i.push(p.join(""))});m.push(i.join(c))}else{f(m,k,l)}}}j.push(m.join(""))});return j.join(c)}};return new e(location.search)}}(jQuery.query||{});
//UI
(function(c){c.fn.colorInput=function(d){d=jQuery.extend(c.colorInput.defaults,d);this.each(function(){c(this).data("colorControl",new c.colorInput(this,d))});return this};c.fn.colorSelected=function(d){if(d){this.bind("colorSelected",d);return this}else{this.trigger("colorSelected")}};c.fn.colorAccept=function(d){if(d){this.bind("colorAccept",d);return this}else{this.trigger("colorAccept")}};c.fn.colorCancel=function(d){if(d){this.bind("colorCancel",d);return this}else{this.trigger("colorCancel")}};c.colorInput=function(u,n){var g=c(u);if(g.data("colorControl")!=null){return this}var q=this,t=n.cells*n.cellSize,l=n.cells*n.cellSize+n.hueWidth;var C="<button ".concat("class='colorButton' style='position:relative;width:",n.hueWidth,"px;height:",n.hueWidth,"px;margin:0;padding:0;border:none 0;line-height:",n.hueWidth-2,"px'>&nbsp;</button>");var o=c(C),v,F,E;g.after(o);o.click(function(K){if(c.colorInput.current==q){m()}else{if(c.colorInput.current){c.colorInput.current.cancel()}else{H()}}K.stopPropagation();return false});var h=c("#".concat(n.dropdownId));if(h.length==1){if(n.acceptCancelButtons){v=h.find(".colorButtons");F=v.find(":eq(0)");E=v.find(":eq(1)")}}else{h=c("<div ".concat("id='",n.dropdownId,"' class='colorDropdown' style='display:none;position:absolute;overflow:visible;height:0;margin:0;padding:0;cursor:pointer'></div>")).append(c("<div ".concat("style='float:left;width:",t,"px;height:",t,"px;margin:0;padding:0'></div>")).append(a(n)).append(b(n)));if(n.acceptCancelButtons){F=c(C).text(n.textAccept).css({width:Math.round(t/2)});E=c(C).text(n.textCancel).css({width:Math.round(t/2)});v=c("<div ".concat("class='colorButtons' style='position:absolute;z-index:0;left:0;width=",t,"px;height:",n.hueHeight,"px'></div>")).append(F).append(E);h.prepend(v)}c(document.body).append(h)}var J=h.find(".saturationBrightnessMap"),f=h.find(".hueMap"),x=new c.colorInput.color(),D,z,d=false;if(n.hideInput){g.hide()}var w;var r=function(M){if(w){clearTimeout(w);w=null}if(M){w=setTimeout(r,M);return}var O=x.hue*t-Math.round(x.hue*t);var L=new c.colorInput.color(0,1,1);B(null);f.find("div").each(function(){L.hue=O/t;this.hue=L.hue;this.color=L.toHex();this.style.backgroundColor=this.color;if(this.hue==x.hue){B(this)}O++});var N=0,K=0;L=new c.colorInput.color(x.hue,0,0);j(null);J.find("div").each(function(){L.saturation=1-N/(n.cells-1);L.brightness=1-K/(n.cells-1);this.saturation=L.saturation;this.brightness=L.brightness;this.color=L.toHex();this.style.backgroundColor=this.color;if(this.color==D){j(this)}N++;if(N==n.cells){N=0;K++}})};var e=function(){var K=g.val();if(K!=D){x.fromHex(K);I(K,d)}};var I=function(L,K){D=L;g.val(L);q.isChanged=z&&D!=z;o.css({backgroundColor:L,color:x.brightnessContrast().toHex()});if(n.acceptCancelButtons){F.css({backgroundColor:L,color:x.brightnessContrast().toHex()})}if(K){r(n.hoverSelect?50:0)}};var m=function(){if(z!=D){g.change()}z=null;s()};var k=function(){if(q.isChanged){g.val(z);e();g.colorSelected()}z=null;s()};var s=function(){c.each(n.cancelOnClick,function(){c(this).unbind("click.color")});f.find("div").unbind("mousedown").unbind("mousemove").unbind("mouseup").unbind("click");J.find("div").unbind("mousedown").unbind("mousemove").unbind("mouseup").unbind("click");J.unbind("dblclick");h.unbind("click");if(n.acceptCancelButtons){v.animate({marginTop:0},{duration:125});F.unbind("click");E.unbind("click")}f.animate({marginLeft:t-n.hueWidth},{duration:125,complete:function(){f.css({display:"none"});h.animate({height:0,width:0},{duration:250,complete:function(){h.css({display:"none"})}})}});c.colorInput.current=null;q.isChanged=false;d=false};var H=function(){z=D;if(n.acceptCancelButtons){F.add(E).css({backgroundColor:D,color:x.brightnessContrast().toHex()})}r();c.each(n.cancelOnClick,function(){c(this).bind("click.color",k)});if(n.hoverSelect){f.find("div").mousemove(function(L){p(this);g.colorSelected()});J.find("div").mousemove(function(L){i(this);g.colorSelected()});J.dblclick(function(L){m();L.stopPropagation();return false});J.click(function(L){m();L.stopPropagation();return false})}else{f.find("div").mousedown(function(L){return y(L,f)}).mousemove(function(L){if(G(L,f)){p(this);g.colorSelected()}}).mouseup(function(L){A(L,f)}).click(function(L){p(this);g.colorSelected()});J.find("div").mousedown(function(L){return y(L,J)}).mousemove(function(L){if(G(L,J)){i(this);g.colorSelected()}}).mouseup(function(L){A(L,J)}).click(function(L){i(this);g.colorSelected()});J.dblclick(function(L){m();L.stopPropagation();return false})}h.click(function(L){L.stopPropagation();return false});var K=o.offset();h.css({display:"",top:K.top+o.height()+"px",left:K.left+(n.showLeft?-t:0)+"px"}).animate({height:t,width:t},{duration:500,complete:function(){f.css({display:""}).animate({marginLeft:t},{duration:250});if(n.acceptCancelButtons){v.animate({marginTop:-n.hueWidth},{duration:250});F.click(function(L){m();L.stopPropagation();return false});E.click(function(L){k();L.stopPropagation();return false})}}});c.colorInput.current=q;d=true};if(c.browser.msie){h.attr("unselectable","on");h.find("div").attr("unselectable","on")}var y=function(L,K){if(K.data("drag")){A(L,K)}K.data("drag",true);return false};var A=function(L,K){K.data("drag",false)};var G=function(L,K){if(!K.data("drag")){return false}if(c.browser.msie&&!L.button){A(L,K);return false}return true};var B=function(K){var L=f.data("selected");if(L){L.style.zIndex=0;L.style.width=n.hueWidth+"px";L.style.margin="0";L.style.border="none 0"}f.data("selected",K);if(K){K.style.zIndex=1;K.style.width=(n.hueWidth-2)+"px";K.style.margin="-1px 0";K.style.border="solid 1px #000"}};var p=function(K){x.hue=K.hue;I(x.toHex(),d)};var j=function(K){var L=J.data("selected");if(L){L.style.width=n.cellSize+"px";L.style.height=n.cellSize+"px";L.style.border="none 0"}J.data("selected",K);if(K){K.style.width=(n.cellSize-2)+"px";K.style.height=(n.cellSize-2)+"px";K.style.border="solid 1px ".concat(x.brightnessContrast().toHex())}};var i=function(K){x.saturation=K.saturation;x.brightness=K.brightness;I(x.toHex(),false);j(K)};g.bind("change",e);g.bind("colorAccept",m);g.bind("colorCancel",k);if(n.change){g.change(n.change)}if(n.colorCancel){g.colorCancel(n.colorCancel)}if(n.colorSelected){g.colorSelected(n.colorSelected)}this.accept=m;this.cancel=k;this.isChanged=false;e();return this};function b(e){var f=["<div class='saturationBrightnessMap' style='position:absolute;z-index:1;overflow:hidden;width:",e.cells*e.cellSize,"px;height:",e.cells*e.cellSize,"px'>"];for(var d=0;d<e.cells;d++){for(var g=0;g<e.cells;g++){f.push("<div ".concat("style='float:left;overflow:hidden;width:",e.cellSize,"px;height:",e.cellSize,"px;border:none 0'></div>"))}}f.push("</div>");return f.join("")}function a(e){var d=["<div class='hueMap' style='position:absolute;z-index:0;width:",e.hueWidth,"px;height:",e.cells*e.cellSize,"px'>"];for(var f=0;f<e.cells*e.cellSize;f++){d.push("<div style='float:left;position:relative;overflow:hidden;width:",e.hueWidth,"px;height:1px;border:none 0'>&nbsp;</div>")}d.push("</div>");return d.join("")}c.colorInput.defaults={acceptCancelButtons:true,cancelOnClick:[document],cells:15,cellSize:10,change:null,colorSelected:null,dropdownId:"ColorDropdown",hideInput:true,hoverSelect:false,hueWidth:20,noHash:false,showLeft:false,textAccept:"Save",textCancel:"Cancel",colorCancel:null};c.colorInput.current=null;c.colorInput.color=function(d,e,f){if(arguments.length==1&&d.constructor==String){this.fromHex(d)}else{this.hue=parseFloat(d)||0;this.saturation=parseFloat(e)||0;this.brightness=parseFloat(f)||0}this.isValid=function(){if(isNaN(this.hue)){return false}while(this.hue>1){this.hue-=1}while(this.hue<0){this.hue+=1}if(isNaN(this.saturation)){return false}if(this.saturation>1){this.saturation=1}else{if(this.saturation<0){this.saturation=0}}if(isNaN(this.brightness)){return false}if(this.brightness>1){this.brightness=1}else{if(this.brightness<0){this.brightness=0}}return true};this.isValid();this.brightnessContrast=function(){return new c.colorInput.color(0,0,this.brightness>=0.75?0:1)};this.valueToHex=function(h){var g=Math.round(h*255).toString(16);return g.length==1?"0"+g:g};this.hexToValue=function(g){return parseInt(g,16)/255};this.fromHex=function(i){if(i.slice(0,1)=="#"){i=i.slice(1)}if(i.length==3){i=i.split("");i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]}if(i.length!=6){this.brightness=NaN;return}var k=this.hexToValue(i.substr(0,2));var j=this.hexToValue(i.substr(2,2));var g=this.hexToValue(i.substr(4,2));this.brightness=Math.max(Math.max(k,j),g);var h=Math.min(Math.min(k,j),g);if(h==this.brightness){this.hue=0;this.saturation=0}else{var l=this.brightness-h;this.saturation=l/this.brightness;if(k==this.brightness){this.hue=(j-g)/l}else{if(j==this.brightness){this.hue=2+((g-k)/l)}else{this.hue=4+((k-j)/l)}}this.hue/=6;if(this.hue<0){this.hue+=1}if(this.hue>1){this.hue-=1}}return this};this.toHex=function(o){if(!this.isValid()){return"Transparent"}var j,k,n;var l=Math.floor(this.hue*6);var m=(this.hue*6)-l;var h=this.brightness*(1-this.saturation);var g=this.brightness*(1-(this.saturation*m));var r=this.brightness*(1-(this.saturation*(1-m)));switch(l){case 1:j=g;k=this.brightness;n=h;break;case 2:j=h;k=this.brightness;n=r;break;case 3:j=h;k=g;n=this.brightness;break;case 4:j=r;k=h;n=this.brightness;break;case 5:j=this.brightness;k=h;n=g;break;case 6:case 0:j=this.brightness;k=r;n=h;break}return o?"":"#"+this.valueToHex(j)+this.valueToHex(k)+this.valueToHex(n)}}})(jQuery);
//Meteor
Meteor={callbacks:{process:function(){},reset:function(){},eof:function(){},statuschanged:function(){},changemode:function(){}},channelcount:0,channels:{},debugmode:false,frameref:null,host:null,hostid:null,maxpollfreq:60000,minpollfreq:2000,mode:"stream",pingtimeout:20000,pingtimer:null,pollfreq:3000,port:80,pollaborted:false,pollhost:null,pollnum:0,polltimeout:30000,polltimer:null,recvtimes:[],lastrequest:null,status:0,updatepollfreqtimer:null,isSupportedBrowser:function(){var a;if(a=navigator.userAgent.match(/compatible\; MSIE\ ([0-9\.]+)\;/i)){if(parseFloat(a[1])<=5.5){return false}}else{if(a=navigator.userAgent.match(/Gecko\/([0-9]+)/i)){if(parseInt(a[1])<=20051015){return false}}else{if(a=navigator.userAgent.match(/WebKit\/([0-9\.]+)/i)){if(parseFloat(a[1])<400){return false}}}}return true},register:function(a){a.p=Meteor.process;a.r=Meteor.reset;a.eof=Meteor.eof;a.ch=Meteor.channelInfo;clearTimeout(Meteor.frameloadtimer);Meteor.setstatus(4);Meteor.log("Frame registered")},joinChannel:function(a,b){if(typeof(Meteor.channels[a])!="undefined"){throw"Cannot join channel "+a+": already subscribed"}Meteor.channels[a]={backtrack:b};Meteor.log("Joined channel "+a);Meteor.channelcount++;if(Meteor.status!=0&&Meteor.status!=6){Meteor.connect()}},leaveChannel:function(a){if(typeof(Meteor.channels[a])=="undefined"){throw"Cannot leave channel "+a+": not subscribed"}delete Meteor.channels[a];Meteor.log("Left channel "+a);Meteor.channelcount--;if(Meteor.channelcount&&Meteor.status!=0&&Meteor.status!=6){Meteor.connect()}else{Meteor.disconnect()}},connect:function(){if(!Meteor.host){throw"Meteor host not specified"}if(isNaN(Meteor.port)){throw"Meteor port not specified"}if(!Meteor.channelcount){throw"No channels specified"}if(Meteor.status){Meteor.disconnect()}Meteor.log("Connecting");Meteor.setstatus(1);if(!Meteor.hostid){Meteor.hostid=Meteor.time()+""+Math.floor(Math.random()*1000000)}if(Meteor.mode=="stream"){Meteor.mode=Meteor.selectStreamTransport()}Meteor.log("Selected "+Meteor.mode+" transport");if(Meteor.mode=="xhrinteractive"||Meteor.mode=="iframe"||Meteor.mode=="serversent"){if(Meteor.mode=="iframe"){Meteor.loadFrame(Meteor.getSubsUrl())}else{Meteor.loadFrame(document.location.protocol+"//"+Meteor.host+((Meteor.port==80)?"":":"+Meteor.port)+"/stream.html")}clearTimeout(Meteor.pingtimer);Meteor.pingtimer=setTimeout(Meteor.pollmode,Meteor.pingtimeout)}else{Meteor.recvtimes[0]=Meteor.time();if(Meteor.updatepollfreqtimer){clearTimeout(Meteor.updatepollfreqtimer)}if(Meteor.mode=="smartpoll"){Meteor.updatepollfreqtimer=setInterval(Meteor.updatepollfreq,10000)}if(Meteor.mode=="longpoll"){Meteor.pollfreq=Meteor.minpollfreq}Meteor.poll()}},disconnect:function(){if(Meteor.status){if(Meteor.status!=6){Meteor.setstatus(0)}Meteor.clearpoll();clearTimeout(Meteor.pingtimer);clearTimeout(Meteor.updatepollfreqtimer);clearTimeout(Meteor.frameloadtimer);if(typeof CollectGarbage=="function"){CollectGarbage()}Meteor.log("Disconnected");try{Meteor.frameref.parentNode.removeChild(Meteor.frameref);delete Meteor.frameref;return true}catch(a){}try{Meteor.frameref.open();Meteor.frameref.close();return true}catch(a){}}},selectStreamTransport:function(){try{var b=ActiveXObject;return"iframe"}catch(a){}if((typeof window.addEventStream)=="function"){return"iframe"}return"xhrinteractive"},getSubsUrl:function(){var a=((Meteor.mode=="simplepoll"||Meteor.mode=="smartpoll"||Meteor.mode=="longpoll")&&Meteor.pollhost)?Meteor.pollhost:Meteor.host;var d=document.location.protocol+"//"+a+((Meteor.port==80)?"":":"+Meteor.port)+"/push/"+Meteor.hostid+"/"+Meteor.mode;for(var b in Meteor.channels){d+="/"+b;if(typeof Meteor.channels[b].lastmsgreceived!="undefined"){d+=".r"+(Meteor.channels[b].lastmsgreceived+1)}else{if(Meteor.channels[b].backtrack>0){d+=".b"+Meteor.channels[b].backtrack}else{if(Meteor.channels[b].backtrack!=undefined){d+=".h"}}}}d+="?nc="+Meteor.time();return d},loadFrame:function(a){try{if(!Meteor.frameref){var b=new ActiveXObject("htmlfile");Meteor.frameref=b}Meteor.frameref.open();Meteor.frameref.parentWindow.Meteor=Meteor;Meteor.frameref.close();var d=Meteor.frameref.createElement("div");Meteor.frameref.appendChild(d);d.innerHTML='<iframe src="'+a+'"></iframe>'}catch(c){if(!Meteor.frameref){var f=document.createElement("IFRAME");f.style.width="10px";f.style.height="10px";f.style.border="none";f.style.position="absolute";f.style.top="-10px";f.style.marginTop="-10px";f.style.zIndex="-20";f.Meteor=Meteor;document.body.appendChild(f);Meteor.frameref=f}Meteor.frameref.setAttribute("src",a)}Meteor.log("Loading URL '"+a+"' into frame...");Meteor.frameloadtimer=setTimeout(Meteor.frameloadtimeout,5000)},pollmode:function(){Meteor.log("Ping timeout");if(Meteor.mode!="smartpoll"){Meteor.mode="smartpoll";Meteor.callbacks.changemode("poll");clearTimeout(Meteor.pingtimer);Meteor.lastpingtime=false}Meteor.connect()},process:function(c,a,b){if(c==-1){Meteor.log("Ping");Meteor.ping()}else{if(typeof(Meteor.channels[a])!="undefined"){Meteor.log("Message "+c+" received on channel "+a+" (last id on channel: "+Meteor.channels[a].lastmsgreceived+")\n"+b);Meteor.callbacks.process(b);Meteor.channels[a].lastmsgreceived=c;if(Meteor.mode=="smartpoll"){Meteor.recvtimes[Meteor.recvtimes.length]=Meteor.time();while(Meteor.recvtimes.length>5){Meteor.recvtimes.shift()}}}}Meteor.setstatus(5)},ping:function(){if(Meteor.pingtimer){clearTimeout(Meteor.pingtimer);Meteor.pingtimer=setTimeout(Meteor.pollmode,Meteor.pingtimeout);Meteor.lastpingtime=Meteor.time()}Meteor.setstatus(5)},reset:function(){if(Meteor.status!=6&&Meteor.status!=0){Meteor.log("Stream reset");Meteor.ping();Meteor.callbacks.reset();var a=Meteor.pollfreq-(Meteor.time()-Meteor.lastrequest);if(a<10){a=10}setTimeout(Meteor.connect,a)}},eof:function(){Meteor.log("Received end of stream, will not reconnect");Meteor.callbacks.eof();Meteor.setstatus(6);Meteor.disconnect()},channelInfo:function(a,b){Meteor.channels[a].lastmsgreceived=b;Meteor.log("Received channel info for channel "+a+": resume from "+b)},updatepollfreq:function(){var c=0;for(var a=1;a<Meteor.recvtimes.length;a++){c+=(Meteor.recvtimes[a]-Meteor.recvtimes[a-1])}c+=(Meteor.time()-Meteor.recvtimes[Meteor.recvtimes.length-1]);c/=Meteor.recvtimes.length;var b=c/2;if(b<Meteor.pollfreq&&Meteor.pollfreq>Meteor.minpollfreq){Meteor.pollfreq=Math.ceil(Meteor.pollfreq*0.9)}if(b>Meteor.pollfreq&&Meteor.pollfreq<Meteor.maxpollfreq){Meteor.pollfreq=Math.floor(Meteor.pollfreq*1.05)}},registerEventCallback:function(a,b){Function.prototype.andThen=function(d){var e=this;var c=Meteor.arguments;return function(f){e(c);d(f)}};if(typeof Meteor.callbacks[a]=="function"){Meteor.callbacks[a]=(Meteor.callbacks[a]).andThen(b)}else{Meteor.callbacks[a]=b}},frameloadtimeout:function(){Meteor.log("Frame load timeout");if(Meteor.frameloadtimer){clearTimeout(Meteor.frameloadtimer)}Meteor.setstatus(3);Meteor.pollmode()},extract_xss_domain:function(a){domain_pieces=a.split(".");return domain_pieces.slice(1,domain_pieces.length).join(".")},setstatus:function(a){if(Meteor.status!=a){Meteor.status=a;Meteor.callbacks.statuschanged(a)}},log:function(a){if(Meteor.debugmode){if(window.console){window.console.log(a)}else{if(document.getElementById("meteorlogoutput")){document.getElementById("meteorlogoutput").innerHTML+=a+"<br/>"}}}},poll:function(){Meteor.pollaborted=0;try{clearTimeout(Meteor.polltimer)}catch(a){}Meteor.lastrequest=Meteor.time();if(Meteor.polltimeout){Meteor.polltimer=setTimeout(Meteor.clearpoll,Meteor.polltimeout)}var b=document.createElement("SCRIPT");b.type="text/javascript";b.src=Meteor.getSubsUrl();b.id="meteorpoll"+(++Meteor.pollnum);b.className="meteorpoll";document.getElementsByTagName("HEAD")[0].appendChild(b)},clearpoll:function(){if(document.getElementById("meteorpoll"+Meteor.pollnum)){var b=document.getElementById("meteorpoll"+Meteor.pollnum);b.parentNode.removeChild(b)}if(Meteor.status==5){var a=parent.Meteor.pollfreq-(Meteor.time()-Meteor.lastrequest);if(a<10){a=10}setTimeout(Meteor.poll,a)}},time:function(){var a=new Date();return a.getTime()}};var oldonunload=window.onunload;if(typeof window.onunload!="function"){window.onunload=Meteor.disconnect}else{window.onunload=function(){if(oldonunload){oldonunload()}Meteor.disconnect()}};
//json
if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();
//Cookie
$.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
//Timeago
(function(e){e.timeago=function(h){if(h instanceof Date){return b(h)}else{if(typeof h=="string"){return b(e.timeago.parse(h))}else{return b(e.timeago.datetime(h))}}};var g=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:60000,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",ago:null,fromNow:null,seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years"}},inWords:function(l){var m=this.settings.strings;var i=m.prefixAgo;var q=m.suffixAgo||m.ago;if(this.settings.allowFuture){if(l<0){i=m.prefixFromNow;q=m.suffixFromNow||m.fromNow}l=Math.abs(l)}var o=l/1000;var h=o/60;var n=h/60;var p=n/24;var j=p/365;var k=o<45&&a(m.seconds,Math.round(o))||o<90&&a(m.minute,1)||h<45&&a(m.minutes,Math.round(h))||h<90&&a(m.hour,1)||n<24&&a(m.hours,Math.round(n))||n<48&&a(m.day,1)||p<30&&a(m.days,Math.floor(p))||p<60&&a(m.month,1)||p<365&&a(m.months,Math.floor(p/30))||j<2&&a(m.year,1)||a(m.years,Math.floor(j));return e.trim([i,k,q].join(" "))},parse:function(i){var h=e.trim(i);h=h.replace(/-/,"/").replace(/-/,"/");h=h.replace(/T/," ").replace(/Z/," UTC");h=h.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2");return new Date(h)},datetime:function(i){var j=e(i).get(0).tagName.toLowerCase()=="time";var h=j?e(i).attr("datetime"):e(i).attr("title");return g.parse(h)}});e.fn.timeago=function(){var i=this;i.each(d);var h=g.settings;if(h.refreshMillis>0){setInterval(function(){i.each(d)},h.refreshMillis)}return i};function d(){var h=c(this);if(!isNaN(h.datetime)){e(this).text(b(h.datetime))}return this}function c(h){h=e(h);if(!h.data("timeago")){h.data("timeago",{datetime:g.datetime(h)});var i=e.trim(h.text());if(i.length>0){h.attr("title",i)}}return h.data("timeago")}function b(h){return g.inWords(f(h))}function f(h){return(new Date().getTime()-h.getTime())}function a(h,j){var i=e.isFunction(h)?h(j):h;return i.replace(/%d/i,j)}document.createElement("abbr");document.createElement("time")})(jQuery);
//localStorage
(function(b){var a={};a.supported=true;if(typeof localStorage=="undefined"||typeof JSON=="undefined"){a.supported=false}else{a.ls=localStorage}a.setItem=function(c,d){if(!a.supported){return false}a.ls.setItem(c,JSON.stringify(d))};a.getItem=function(c){if(!a.supported){return false}if(a.ls.getItem(c)==null){return false}return JSON.parse(a.ls.getItem(c))};a.removeItem=function(c){if(!a.supported){return false}a.ls.removeItem(c);return true};a.clear=function(){if(!a.supported){return false}a.ls.clear();return true};b.localStorage=a})(jQuery);
//location
var bb_successCallback;var bb_errorCallback;function handleBlackBerryLocation(){if(bb_successCallback&&bb_errorCallback){if(blackberry.location.latitude==0&&blackberry.location.longitude==0){bb_errorCallback({message:"Position unavailable",code:2})}else{var a=null;if(blackberry.location.timestamp){a=new Date(blackberry.location.timestamp)}bb_successCallback({timestamp:a,coords:{latitude:blackberry.location.latitude,longitude:blackberry.location.longitude}})}if(parseFloat(navigator.appVersion)>=4.6){blackberry.location.removeLocationUpdate(handleBlackBerryLocation)}bb_successCallback=null;bb_errorCallback=null}}var geo_position_js=function(){var a={};var b=null;a.getCurrentPosition=function(c,d,e){b.getCurrentPosition(c,d,e)};a.init=function(){try{if(typeof(geo_position_js_simulator)!="undefined"){b=geo_position_js_simulator}else{if(typeof(bondi)!="undefined"&&typeof(bondi.geolocation)!="undefined"){b=bondi.geolocation}else{if(typeof(window.google)!="undefined"&&typeof(window.google.gears)!="undefined"){b=google.gears.factory.create("beta.geolocation");a.getCurrentPosition=function(d,f,g){try{function h(e){if(typeof(e.latitude)!="undefined"){d({timestamp:e.timestamp,coords:{latitude:e.latitude,longitude:e.longitude}})}else{d(e)}}b.getCurrentPosition(h,f,g)}catch(i){f({message:i,code:1})}}}else{if(typeof(navigator.geolocation)!="undefined"){b=navigator.geolocation;a.getCurrentPosition=function(d,e,f){function g(h){if(typeof(h.latitude)!="undefined"){d({timestamp:h.timestamp,coords:{latitude:h.latitude,longitude:h.longitude}})}else{d(h)}}b.getCurrentPosition(g,e,f)};a.watchPosition=function(d,f,g){try{b.watchPosition(d,f,g);a.clearWatch=function(e){if(typeof(b.clearWatch)!="undefined"){b.clearWatch(e)}}}catch(h){f({message:h,code:1})}}}else{if(typeof(Mojo)!="undefined"&&typeof(Mojo.Service)!="undefined"&&typeof(Mojo.Service.Request)!="Mojo.Service.Request"){b=true;a.getCurrentPosition=function(d,e,f){parameters={};if(f){if(f.enableHighAccuracy&&f.enableHighAccuracy==true){parameters.accuracy=1}if(f.maximumAge){parameters.maximumAge=f.maximumAge}if(f.responseTime){if(f.responseTime<5){parameters.responseTime=1}else{if(f.responseTime<20){parameters.responseTime=2}else{parameters.timeout=3}}}}r=new Mojo.Service.Request("palm://com.palm.location",{method:"getCurrentPosition",parameters:parameters,onSuccess:function(g){d({timestamp:g.timestamp,coords:{latitude:g.latitude,longitude:g.longitude,heading:g.heading}})},onFailure:function(g){if(g.errorCode==1){e({code:3,message:"Timeout"})}else{if(g.errorCode==2){e({code:2,message:"Position Unavailable"})}else{e({code:0,message:"Unknown Error: webOS-code"+errorCode})}}}})}}else{if(typeof(device)!="undefined"&&typeof(device.getServiceObject)!="undefined"){b=device.getServiceObject("Service.Location","ILocation");a.getCurrentPosition=function(d,e,f){function h(k,j,i){if(j==4){e({message:"Position unavailable",code:2})}else{d({timestamp:null,coords:{latitude:i.ReturnValue.Latitude,longitude:i.ReturnValue.Longitude,altitude:i.ReturnValue.Altitude,heading:i.ReturnValue.Heading}})}}var g=new Object();g.LocationInformationClass="BasicLocationInformation";b.ILocation.GetLocation(g,h)}}else{if(typeof(window.blackberry)!="undefined"&&blackberry.location.GPSSupported){blackberry.location.setAidMode(2);a.getCurrentPosition=function(d,e,f){bb_successCallback=d;bb_errorCallback=e;if(parseFloat(navigator.appVersion)>=4.6){blackberry.location.onLocationUpdate(handleBlackBerryLocation)}else{blackberry.location.onLocationUpdate("handleBlackBerryLocation()")}blackberry.location.refreshLocation()};b=blackberry.location}}}}}}}}catch(c){if(typeof(console)!="undefined"){console.log(c)}}return b!=null};return a}();
//x5315 Testing Suite
x5UserData={url:"http://x5315.com/stats/",testMode:false,sendStat:function(a,b){if(this.testMode){a="test"+a}$.getJSON(this.url+"statMonitor.php?callback=?",{stat:encodeURIComponent(a),value:encodeURIComponent(b)},function(c){return true})},timer:{timings:{},createTimer:function(c,b,d,a){if(!this.timings[c]){this.timings[c]={threshold:1000*b,larger:d,smaller:a,mid:false,start:0}}else{return false}},startTimer:function(a){if(this.timings[a]){if(!this.timings[a].mid){this.timings[a].mid=true;this.timings[a].start=(new Date).getTime()}}},endTimer:function(b){if(this.timings[b]){if(this.timings[b].mid){var a=(new Date).getTime();var c=this.timings[b].start;this.timings[b].mid=false;if((a-c)<this.timings[b].threshold){x5UserData.sendStat(b,this.timings[b].smaller)}else{x5UserData.sendStat(b,this.timings[b].larger)}}}}},features:{features:{},createFeature:function(a){if(!this.features[a]){this.features[a]=false}},useFeature:function(a){this.features[a]=true},sendFeatures:function(){for(i in this.features){x5UserData.sendStat(i,this.features[i])}}}};