var superfly={flash_cbacks:new Array(),subscribe_hash:new Array(),subscribe_ani:new Array(),last_data:new Array(),avail_feeds:{pages:{url:"/api/pages/",interval:2},stats:{url:"/dashapi/stats/",interval:0}},data:null,interval:33,paused:false,apikey:"",shareLink:"",tzoffset_set:false,setDomain:function(A){this.domain=A},numSubscribers:function(A){if(this.subscribe_hash[A]&&this.subscribe_hash[A].objs.length){return this.subscribe_hash[A].objs.length}return 0},lastCallTime:function(A){if(this.avail_feeds[A]){return this.avail_feeds[A].last_call_time}},subscribeToDataFeed:function(C,D,A){var B=this.subscribe_hash[C];if(!$chk(B)){B=new Object();B.objs=new Array();B.args=new Array()}B.objs.push(D);B.args.push(A);this.subscribe_hash[C]=B},unsubscribeFromDataFeed:function(C,D){var B=this.subscribe_hash[C];if($chk(B)){for(var A=0;A<B.objs.length;++A){if(B.objs[A]==D){B.objs.splice(A,1);B.args.splice(A,1)}}}},addNewDataFeed:function(D,B,A,E){if(this.avail_feeds[D]){return false}var C=new Object();C.url=B;C.interval=A;C.modify_args=E;C.second_count=0;this.avail_feeds[D]=C;return true},removeDataFeed:function(A){if(this.avail_feeds[A]){delete (this.avail_feeds[A])}},modifyDataFeed:function(C,B,A,D){if(!this.avail_feeds[C]){return false}if(B){this.avail_feeds[C].url=B}if(A){this.avail_feeds[C].interval=A}this.avail_feeds[C].modify_args=D;return true},refreshDataFeed:function(A){if(!this.avail_feeds[A]){return false}this.avail_feeds[A].second_count=0;this.avail_feeds[A].refresh_data=true},pauseFeed:function(A){if(this.avail_feeds[A]){this.avail_feeds[A].paused=true}},resumeFeed:function(A){if(this.avail_feeds[A]){this.avail_feeds[A].paused=false}},pauseFeeds:function(A){superfly.paused=true;if(!$("pausebox")&&A){var B=new Element("div",{id:"pausebox","class":"pausebox",html:"paused.  click to resume."});B.setStyle("opacity",0.6);var C=document.documentElement.scrollTop;if(C==0&&document.body.scrollTop){C=document.body.scrollTop}B.setStyle("top",C);$(document.body).adopt(B)}},resumeFeeds:function(){superfly.paused=false;if($("pausebox")){$("pausebox").dispose()}},subscribeToAnimation:function(A){this.subscribe_ani.push(A)},animator:function(){for(var A=0;A<superfly.subscribe_ani.length;++A){superfly.subscribe_ani[A].animate()}superfly.setAnimatorTimeout()},queryFeeds:function(){if(!$chk(superfly.domain)||superfly.paused){superfly.setQueryTimeout();return }for(var feedid in superfly.avail_feeds){if(superfly.avail_feeds[feedid].refresh_data){superfly.avail_feeds[feedid].refresh_data=false}else{if(superfly.avail_feeds[feedid].paused){continue}}if(!superfly.avail_feeds[feedid].second_count){superfly.avail_feeds[feedid].second_count=0}if(superfly.avail_feeds[feedid].processing||superfly.avail_feeds[feedid].run_once){continue}else{if(superfly.avail_feeds[feedid].interval&&superfly.avail_feeds[feedid].second_count%superfly.avail_feeds[feedid].interval!=0){superfly.avail_feeds[feedid].second_count++;continue}}if(superfly.avail_feeds[feedid].interval==0){superfly.avail_feeds[feedid].run_once=true}superfly.avail_feeds[feedid].processing=true;var cback=function(jsonret,fid){if(typeof (jsonret)=="string"){eval("ret = "+jsonret)}else{ret=jsonret}superfly.dashboard.show();if(this.options){var feedid=this.options.headers.feedid}else{feedid=fid}if(!superfly.avail_feeds[feedid]){return }superfly.last_data[feedid]=ret;var subs=superfly.subscribe_hash[feedid];if(!$chk(subs)){return }for(var x=0;x<subs.objs.length;++x){subs.objs[x].draw(ret,subs.args[x])}superfly.avail_feeds[feedid].second_count++;superfly.avail_feeds[feedid].processing=false;if(historical.series){superfly.historical.beginPlayback(historical.series);historical.series=false}};var reqargs={host:superfly.domain,rnd:Math.random(),sessionid:Cookie.read("sessionid")};if(superfly.avail_feeds[feedid].modify_args){reqargs=superfly.avail_feeds[feedid].modify_args(superfly.avail_feeds[feedid],reqargs)}superfly.avail_feeds[feedid].last_call_time=new Date();superfly.getFeedData(feedid,superfly.avail_feeds[feedid].url,cback,{feedid:feedid},reqargs);if(!$chk(superfly.avail_feeds[feedid].count)){superfly.avail_feeds[feedid].count=0}else{superfly.avail_feeds[feedid].count++}}superfly.setQueryTimeout()},onChartbeat:function(){var A=false;if(location.host.match(/chartbeat\.com$/)){A=true}return A},getFeedData:function(feedid,url,cback,headers,reqargs){var onCB=superfly.onChartbeat();var httpmatch=url.match(/^http:/);if(superfly.apikey!=""){reqargs.apikey=superfly.apikey;reqargs.sessionid=""}if(!onCB||httpmatch){if(!httpmatch){url="http://chartbeat.com"+url}var jsonp=feedid+"_cback";var jsid=feedid+"_jsid";eval(jsonp+"= function(data) { cback(data, feedid); }");var args="?";for(var arg in reqargs){args+=arg+"="+reqargs[arg]+"&"}args+="jsonp="+jsonp;if($(jsid)){$(jsid).erase()}var el=new Element("script",{type:"text/javascript",src:url+args,id:jsid});$$("head").adopt(el)}else{new Request({url:url,onComplete:cback,headers:headers}).GET(reqargs)}},runFrequency:function(B,C,A){if(A){return true}if(!$chk(this.avail_feeds[B])){return false}return(this.avail_feeds[B].count%C==0)},title:function(J,H,D){if(!D){D="pages"}if(!$chk(this.last_data[D])){return J}var G=this.last_data[D].titles[J];if(!$chk(G)){return J}if(H){var C=new Array();var F=0;for(var I in this.last_data[D].titles){++F;if(F>5){break}C.push(this.last_data[D].titles[I])}if(!C.length){return utf8.decode(G)}var A=false;var B=0;for(var F=0;F<G.length;++F){if(!G[F]){break}if(G[F].match(/^[^A-Za-z0-9]/)){B=F}for(var E=0;E<C.length;++E){if(C[E]&&G[F]!=C[E][F]){A=true;break}}if(A){break}}if(F<5||F>=G.length){return utf8.decode(G)}return utf8.decode(G.substr(B).replace(/^[^A-Za-z0-9]*/g,""))}return utf8.decode(G)},url:function(A){return"http://"+this.domain+A},timestampdate:function(E,B){if(!B){var G=new Date(E*1000)}else{var G=B}var D=G.getMonth()+1;var A=G.getDate();var C=G.getFullYear();var F=G.getDay();switch(F){case 0:F="sun";break;case 1:F="mon";break;case 2:F="tue";break;case 3:F="wed";break;case 4:F="thu";break;case 5:F="fri";break;case 6:F="sat";break}return F+" "+D+"/"+A+"/"+C+" "+this.prettyclocktime(E,false,B)},timestampjustdate:function(E,B){if(!B){var F=new Date(E*1000)}else{var F=B}var D=F.getMonth()+1;var A=F.getDate();var C=F.getFullYear();return D+"/"+A+"/"+C},prettyclocktime:function(F,H,C){if(!C){var G=new Date(F*1000)}else{var G=C}var A=G.getHours();var D=G.getMinutes();var E=G.getSeconds();var B="am";if(A>11){if(A>12){A=A-12}B="pm"}else{if(A==0){A=12}}if(D<10){D="0"+D}if(E<10){E="0"+E}return A+":"+D+((H)?":"+E:"")+" "+B},prettytime:function(A){if(A<60){t=A;return t+" second"+((t==1)?"":"s")}else{if(A<3600){t=Math.round(A/60);return t+" minute"+((t==1)?"":"s")}else{if(A<86400){t=Math.round(A/3600);return t+" hour"+((t==1)?"":"s")}else{if(A<2592000){t=Math.round(A/86400);return t+" day"+((t==1)?"":"s")}else{if(A<31536000){t=Math.round(A/2592000);return t+" month"+((t==1)?"":"s")}else{t=Math.round(A/31536000);return t+" year"+((t==1)?"":"s")}}}}}},decimal:function(A,B){dd=Math.pow(10,B);return Math.round(A*dd)/dd},truncate:function(B,A){if(!B||B.length<=A){return B}return B.substr(B,A-3)+"..."},split:function(D,C){var B="";for(var A=0;A<D.length;A+=C){B+=D.slice(A,A+C)+" "}return B},add_commas:function(B){if(B<1000){return B}B+="";x=B.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var A=/(\d+)(\d{3})/;while(A.test(x1)){x1=x1.replace(A,"$1,$2")}return x1+x2},hasFlash:function(){return deconcept.SWFObjectUtil.getPlayerVersion().major},flashPath:function(){var B=this.onChartbeat();if(!B){var A="http://chartbeat.com/flash/"}else{var A="/flash/"}return A},addSwf:function(G,I,K,B,J,F,C,H){var A=this.flashPath();this.hasFlash();var D=new SWFObject(A+G,K,B,J,"8","#FFFFFF");D.useExpressInstall(A+"expressInstall.swf");for(var E in F){D.addVariable(E,escape(F[E]))}D.addParam("wmode","transparent");D.write(I);if(C){this.flash_cbacks[K]={cbackobj:C,cbackfunc:H}}return $(K)},setQueryTimeout:function(){setTimeout(superfly.queryFeeds,1000)},setAnimatorTimeout:function(){setTimeout(superfly.animator,superfly.interval)},addFocusHandlers:function(){if(Browser.Engine.trident){document.onfocusin=superfly.resumeFeeds;document.onfocusout=superfly.pauseFeeds}else{window.onfocus=superfly.resumeFeeds;window.onblur=superfly.pauseFeeds}},removeFocusHandlers:function(){if(Browser.Engine.trident){document.onfocusin=function(){};document.onfocusout=function(){}}else{window.onfocus=undefined;window.onblur=undefined}},init:function(){superfly.setQueryTimeout();superfly.setAnimatorTimeout();superfly.addFocusHandlers()},historicalStarted:false,dashboardStarted:false,swapRT:function(B){if(superfly.loader){superfly.loader.dispose()}if(superfly.historical.turnOffReplay){superfly.historical.turnOffReplay()}var A=$("realtime").dispose();if(B){$("allhistorical").adopt(A);A.setStyle("display","none");$("historypicker").setStyle("display","block")}else{$("allrealtime").adopt(A);A.setStyle("display","block");$("historypicker").setStyle("display","none")}},startOtherTab:function(){if(superfly.loader){superfly.loader.dispose()}if(superfly.historical.turnOffReplay){superfly.historical.turnOffReplay()}superfly.pauseFeeds();superfly.removeFocusHandlers()},startHistorical:function(A,B){if(B){superfly.apikey=B}superfly.pauseFeeds();superfly.removeFocusHandlers();if(superfly.historicalStarted){return }superfly.setDomain(A);superfly.historicalStarted=true;historical.display(A);function C(D){if(!D||!D.length){$("twitterterms").set("value",superfly.domain)}else{$("twitterterms").set("value",D.join(", "))}}superfly.getTwitterWords(C);superfly.setTwitterUpdate($("twitterterms"),$("twittertermsupdate"))},startExternal:function(A,B){superfly.apikey=B;superfly.resumeFeeds();superfly.addFocusHandlers();if(superfly.dashboardStarted){return }superfly.dashboardStarted=true;superfly.init();superfly.setDomain(A);superfly.dashboard.visible=true},startDashboard:function(A,B){if(B){superfly.apikey=B}superfly.resumeFeeds();superfly.addFocusHandlers();if(superfly.dashboardStarted){return }superfly.dashboardStarted=true;superfly.init();superfly.dashboard.init(A);superfly.widgetManager.getLayout()},getTwitterWords:function(A){if(superfly.onChartbeat()){new Request.JSON({url:"/dashapi/twitterwords/",onComplete:A}).get({host:superfly.domain,apikey:superfly.apikey})}else{A()}},setTwitterUpdate:function(A,C){function B(){function D(F){if(C){if(F[0]){alert("Twitter search terms updated.  Refresh this page in about 5 minutes for charts to update.")}else{alert("An error occurred when trying to set the new search terms.")}}}if(typeof (A)=="string"){var E=A}else{var E=A.get("value")}if(superfly.onChartbeat()){new Request.JSON({url:"/dashapi/twitterwords/",onComplete:D}).get({keywords:E,host:superfly.domain})}}if(C){C.addEvent("click",B)}else{B()}},bitlyShareLink:function(A){if(!$("sharelink")){return }if(A==""){$("sharelink").set("value","make an apikey for all")}else{superfly.shareLink="http://chartbeat.com/dashboard/?url="+superfly.domain+"&k="+A;var C="http://api.bit.ly/shorten?version=2.0.1&longUrl="+encodeURIComponent(superfly.shareLink)+"&login=chartbeat&apiKey=R_66816b76d632af6eb203d5bcda47fb91&callback=superfly.bitlyShareLinkCback";var B=new Element("script",{type:"text/javascript",src:C});$$("head").adopt(B)}},bitlyShareLinkCback:function(A){if(A.errorCode!=0){$("sharelink").set("value",superfly.shareLink)}else{$("sharelink").set("value",A.results[superfly.shareLink].shortUrl)}},DSTdatesUS:function(D){if(D<1987){return }var E=(D<2007)?38:14;var C=(D<2007)?31:38;var B=new Date(D,2,E,2);var A=new Date(D,9,C,2);B.setDate(B.getDate()-B.getDay());A.setDate(A.getDate()-A.getDay());return[B,A]},IsDST:function(A){if(A==null){return false}var B=A.getFullYear();var C=this.DSTdatesUS(B);if(A>C[0]&&A<C[1]){return true}else{return false}},tzoffset:function(){if(this.tzoffset_set){return this.tzoffset_set}if(this.IsDST(new Date())){this.tzoffset_set=" -0400"}else{this.tzoffset_set=" -0500"}return this.tzoffset_set}};function amChartInited(B){if(superfly.flash_cbacks[B]){var A=superfly.flash_cbacks[B];A.cbackobj[A.cbackfunc]()}}function StringBuffer(){this.buffer=[]}StringBuffer.prototype.append=function append(A){this.buffer.push(A);return this};StringBuffer.prototype.toString=function toString(){return this.buffer.join("")};var CanvasTextFunctions={};CanvasTextFunctions.letters={"0":{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},"1":{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},"2":{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},"3":{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"4":{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},"5":{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"6":{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},"7":{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},"8":{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},"9":{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]}};CanvasTextFunctions.letter=function(A){return CanvasTextFunctions.letters[A]};CanvasTextFunctions.ascent=function(A,B){return B};CanvasTextFunctions.descent=function(A,B){return 7*B/25};CanvasTextFunctions.measure=function(B,C,E){var D=0;var A=E.length;for(i=0;i<A;i++){var F=CanvasTextFunctions.letter(E.charAt(i));if(F){D+=F.width*C/25}}return D};CanvasTextFunctions.draw=function(L,A,M,K,I,G){var H=0;var E=G.length;var C=M/25;L.save();L.lineCap="round";L.lineWidth=2*C;for(i=0;i<E;i++){var F=CanvasTextFunctions.letter(G.charAt(i));if(!F){continue}L.beginPath();var B=1;var D=0;for(j=0;j<F.points.length;j++){var J=F.points[j];if(J[0]==-1&&J[1]==-1){B=1;continue}if(B){L.moveTo(K+J[0]*C,I-J[1]*C);B=false}else{L.lineTo(K+J[0]*C,I-J[1]*C)}}L.stroke();K+=F.width*C}L.restore();return H};CanvasTextFunctions.enable=function(A){A.drawText=function(C,D,B,F,E){return CanvasTextFunctions.draw(A,C,D,B,F,E)};A.measureText=function(B,C,D){return CanvasTextFunctions.measure(B,C,D)};A.fontAscent=function(B,C){return CanvasTextFunctions.ascent(B,C)};A.fontDescent=function(B,C){return CanvasTextFunctions.descent(B,C)};A.drawTextRight=function(D,E,B,G,F){var C=CanvasTextFunctions.measure(D,E,F);return CanvasTextFunctions.draw(A,D,E,B-C,G,F)};A.drawTextCenter=function(D,E,B,G,F){var C=CanvasTextFunctions.measure(D,E,F);return CanvasTextFunctions.draw(A,D,E,B-C/2,G,F)}};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.sitemap=function(A){this.container=A;superfly.historical.allowHistory(this)};superfly.charts.sitemap.prototype.draw=function(B,A){if(!$chk(B)||!$chk(B.active)||B.active.length==0||this.deleted){return }this.historical=B.historical;if(superfly.runFrequency("pages",10,this.historical)||!this.inited){this.__setData(B.active);if(!this.width){this.width=A.width}if(!this.height){this.height=A.height}if(!this.maindiv){this.maindiv=new Element("div");$(this.container).adopt(this.maindiv)}this.maindiv.set("html",this.__buildSiteMap(B.active,this.width-5,this.height-5,0,0,B.active[B.active.length-1].total,B.active[0].total)+'<div id="sitemapdetails"></div>');superfly.dashboard.hideNoResults(this.container);this.inited=true}else{this.update(B.active)}};superfly.charts.sitemap.prototype.update=function(E){if(!$chk(E)||!$chk(this.mapdata)){return }for(var A=0;A<E.length;++A){var G=escape(E[A].path);var D=this.mapdata[G];if(!$chk(D)){return }if(D.read!=E[A].read||D.write!=E[A].write||D.idle!=E[A].idle||D.total!=E[A].total){if(!$chk($(G))){return }$(G).set("html",E[A].total);if($chk($("r"+G))){$("r"+G).getChildren("div")[0].set("html",E[A].read);$("w"+G).getChildren("div")[0].set("html",E[A].write);$("i"+G).getChildren("div")[0].set("html",E[A].idle);var F=Math.floor((E[A].read/E[A].total)*100);var C=Math.floor((E[A].write/E[A].total)*100);var B=(100-F-C);if(!Browser.Engine.trident){this.heatMap("heatmap"+G,E[A].position)}$("r"+G).setStyle("width",F+"%");$("w"+G).setStyle("width",C+"%");$("i"+G).setStyle("width",B+"%")}if(D.total<E[A].total){$(G).getParent().highlight("#c3fec1")}else{if(D.total>E[A].total){$(G).getParent().highlight("#fec1c6")}}this.mapdata[G]=E[A]}}};superfly.charts.sitemap.prototype.__sort=function(B,A){return(A.total-B.total)};superfly.charts.sitemap.prototype.__setData=function(B){if(!$chk(B)){return }if(!$chk(this.mapdata)){this.mapdata=new Array()}for(var A=0;A<B.length;++A){this.mapdata[escape(B[A].path)]=B[A]}};superfly.charts.sitemap.prototype.__buildSiteMap=function(R,I,Q,S,E,J,K){var G="";if(!$chk(S)||S==0){G='<div class="sitemap" style="width: '+I+"px; height: "+Q+'px;">'}if(R.length>1){var P,M;if(R.length>2){P=R.slice(0,Math.ceil(R.length/2)-1);M=R.slice(Math.ceil(R.length/2)-1,R.length)}else{P=R.slice(0,1);M=R.slice(1,2)}var H=0;for(var F=0;F<P.length;++F){H+=P[F].total}var A=0;for(var F=0;F<R.length;++F){A+=R[F].total}apercent=H/A;bpercent=1-apercent;var B,O,C,D;if(S%2==E){B=Math.ceil(I*apercent);O=I-B;C=Q;D=Q}else{C=Math.ceil(Q*apercent);D=Q-C;B=I;O=I}var N="width: "+B+"px; height: "+C+"px;";var L="width: "+O+"px; height: "+D+"px;";G+='<div class="node" style="'+N+'">';G+=this.__buildSiteMap(P,B,C,S+1,0,J,K);G+="</div>";G+='<div class="node" style="'+L+'">';G+=this.__buildSiteMap(M,O,D,S+1,0,J,K);G+="</div>"}else{G+=this.__siteCell(this.container,R[0],I,Q,J,K)}if(!$chk(S)||S==0){G+="</div>"}return G};superfly.charts.sitemap.prototype.__siteCell=function(E,D,B,J,C,G){var I=superfly.title(D.path,true,"pages");var K=Math.max(15*(D.total/((G+C)/2)),10);var H='style="font-size: '+K+'px;"';var A=escape(D.path);var F=" onMouseOver=\"superfly.dashboard.getObj('"+E+"').showDetails('"+A+"', this)\" onMouseOut=\"superfly.dashboard.getObj('"+E+"').hideDetails('"+A+"', this)\"";return'<a href="'+superfly.url(D.path)+'" target="_blank" class="sitemapnode" '+H+F+' id="a'+A+'">'+I+'<br><div id="'+A+'" class="sitemapnodenum" '+H+">"+D.total+"</div></a>"};superfly.charts.sitemap.prototype.showDetails=function(G,C){var E=this.mapdata[G];if(!$chk(E)){return }var F=Math.floor((E.read/E.total)*100);var B=Math.floor((E.write/E.total)*100);var A=(100-F-B);var D='<table border="0" cellspacing="0" cellpadding="0"><tr><td class="sitemaphover1">Scroll Heatmap<br><canvas id="heatmap'+G+'" width="90" height="110"></canvas></td><td valign="top" class="sitemaphover2">Activity<br><div class="sitemaprwi"><div class="readwidth" id="r'+G+'" style="width:'+F+'%">r<br><div class="graphtxt">'+E.read+'</div></div><div class="writewidth" id="w'+G+'" style="width:'+B+'%">w<br><div class="graphtxt">'+E.write+'</div></div><div class="idlewidth" id="i'+G+'" style="width:'+A+'%">i<br><div class="graphtxt">'+E.idle+'</div></div></div></td></tr></table><br><div class="hoverbottom">url: '+superfly.url(E.path)+"</div>";$("sitemapdetails").set("html",'<table border="0" cellpadding="0" cellspacing="0" class="sitemaphover" style="padding-bottom:0px"><tr><td class="sitemaphovertopleft"></td><td class="sitemaphovertop">&nbsp;</td><td class="sitemaphovertopright"></td></tr></table><table border="0" cellpadding="0" cellspacing="0" class="sitemaphover" style="padding-top:0px; padding-bottom:0px;"><tr><td class="sitemaphovermiddle" colspan="3" align="center">'+D+'</td></tr></table><table border="0" cellpadding="0" cellspacing="0" class="sitemaphover" style="padding-top:0px"><tr><td class="sitemaphoverbottomleft"></td><td class="sitemaphoverbottom">&nbsp;</td><td class="sitemaphoverbottomright"></td></tr></table>');this.heatMap("heatmap"+G,E.position);$("sitemapdetails").setStyle("top",$("a"+G).getCoordinates().top-20);$("sitemapdetails").setStyle("left",$("a"+G).getCoordinates().left-$("sitemapdetails").getCoordinates().width);$("a"+G).setStyle("background-color","#c5c1bc")};superfly.charts.sitemap.prototype.heatMap=function(F,D){if(!$chk(D)||!D.length){return }var A=10;var M=new Object();var H=1;for(var I=0;I<=A;++I){M[I/A]=0}for(var I=0;I<D.length;++I){var E=Math.round(D[I]*A)/A;if(!$chk(M[E])){M[E]=1}else{M[E]++;if(M[E]>H){H=M[E]}}}if(Browser.Engine.trident){G_vmlCanvasManager.initElement($(F))}var L=$(F).getContext("2d");var J=L.createLinearGradient(0,0,0,100);var K=0;for(var I in M){var B=Math.round((M[I]/H)*255);if(B<16){B="0"+B.toString(16)}else{B=B.toString(16)}var C=B+"1919";var G=Number(I)+(1/A);if(G>1){G=1}J.addColorStop(G,"#"+C);K=I}L.fillStyle=J;L.beginPath();L.arc(10,10,5,(Math.PI/180)*180,(Math.PI/180)*270,false);L.lineTo(80,5);L.arc(80,10,5,(Math.PI/180)*270,(Math.PI/180)*360,false);L.lineTo(85,100);L.arc(80,100,5,(Math.PI/180)*0,(Math.PI/180)*90,false);L.lineTo(10,105);L.arc(10,100,5,(Math.PI/180)*90,(Math.PI/180)*180,false);L.fill()};superfly.charts.sitemap.prototype.hideDetails=function(B,A){A.setStyle("background-color","#e5e0db");$("sitemapdetails").set("html","")};superfly.charts.sitemap.prototype.unload=function(){this.deleted=true};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.geomap=function(A){this.container=A;this.suspended=false;superfly.historical.disableHistory(this);this.draw()};superfly.charts.geomap.prototype.draw=function(F,A){var C=450;var E=280;if(this.suspended||this.deleted){return }if(!this.suspended){superfly.dashboard.hideNoResults(this.container);if(!this.inited){$(this.container).setStyle("width",C);$(this.container).setStyle("height",E);var B="<settings><reload_data_interval>10</reload_data_interval><projection>mercator</projection><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><color_change_time_start>0</color_change_time_start><color_change_time_hover>0.1</color_change_time_hover><background><file>bg_dots.gif</file></background><zoom><enabled>false</enabled><arrows_enabled>false</arrows_enabled><home_link_enabled>false</home_link_enabled><background_zooms_to_top>1</background_zooms_to_top></zoom><small_map><enabled>false</enabled></small_map><area><balloon_text><![CDATA[<b>{title}</b>]]></balloon_text><color_light>#B2AFA7</color_light><color_hover>#F24444</color_hover><color_selected>#A5B6B8</color_selected><disable_when_clicked>true</disable_when_clicked></area><movie><balloon_text><![CDATA[{title}]]></balloon_text></movie><label><balloon_text><![CDATA[]]></balloon_text></label><balloon><max_width>50%</max_width></balloon></settings>";var D=this.container+"_flash";this.flashobj=superfly.addSwf("ammap.swf",this.container,D,C,E,{path:superfly.flashPath()+"ammap/",map_settings:B,data_file:"http://chartbeat.com/dashapi/maps/?file=all&host="+superfly.domain+"&apikey="+superfly.apikey,chart_id:D},this,"activate");this.inited=true}}};superfly.charts.geomap.prototype.unload=function(){this.deleted=true};superfly.charts.geomap.prototype.suspend=function(){this.suspended=true};superfly.charts.geomap.prototype.activate=function(){this.suspended=false};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.livefeed=function(A){this.container=A;this.count=0;this.shown=new Array();superfly.historical.allowHistory(this)};superfly.charts.livefeed.prototype.draw=function(G,E){if(!$chk(G)||!$chk(G.recent)||G.recent.length==0||this.deleted||this.suspended){return }this.historical=G.historical;if(!this.inited){if(!this.width){this.width=E.width}if(!this.limit){this.limit=E.limit}$(this.container).setStyle("width",this.width);superfly.historical.addSparkline(this.container,this);superfly.dashboard.addPause(this.container,this);superfly.dashboard.hideNoResults(this.container)}G.recent.sort(this.__sort);var D="";var B=0;for(var A=0;A<G.recent.length;++A){if(G.recent[A].count==0&&!this.shown[G.recent[A].id]){B++;var F=new Element("div",{html:this.__item(G.recent[A]),"class":"livefeed"});$(this.container).grab(F,"top");F.fade("hide");F.fade("in");this.shown[G.recent[A].id]=true;this.count++;if(this.count>this.limit){$(this.container).getLast("div.livefeed").dispose()}}}if(G.historical){var C='<chart><series><value xid="'+this.datacount+'">'+G.pages_timestamp+'</value></series><graphs><graph gid="1" color="#302e48" fill_color="#302e48" fill_alpha="10" color_hover="#302e48" balloon_text="{value} hits"><value xid="'+this.datacount+'">'+B+"</value></graph></graphs></chart>";superfly.historical.sendToSparkline(this,C)}this.inited=true};superfly.charts.livefeed.prototype.historyChange=function(){while(dd=$(this.container).getLast("div.livefeed")){dd.dispose()}this.count=0;this.shown=new Array()};superfly.charts.livefeed.prototype.historyClose=superfly.charts.livefeed.prototype.historyChange;superfly.charts.livefeed.prototype.historyOpen=superfly.charts.livefeed.prototype.historyChange;superfly.charts.livefeed.prototype.unload=function(){this.deleted=true};superfly.charts.livefeed.prototype.__item=function(C){var B=C.referer;var A=C.referer;if(B==""){B="direct";A=superfly.url("")}return'<div class="livefeedtitle"><a href="'+superfly.url(C.path)+'" target="_blank">'+superfly.truncate(superfly.title(C.path,true,"pages"),100)+'</a></div>&nbsp;coming from <div class="livefeedurl"><a href="'+A+'" target="_blank">'+superfly.truncate(B,100)+"</a></div> at "+superfly.prettyclocktime(C.utc,true)};superfly.charts.livefeed.prototype.__sort=function(B,A){return(A.utc-B.utc)};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.refpie=function(A){this.container=A;superfly.historical.allowHistory(this)};superfly.charts.refpie.prototype.draw=function(C,D){if(!$chk(C)||!$chk(C.referers)||this.suspended||this.deleted){return }if(!this.suspended){var E=0;for(var B in C.referers){E++}if(E==0){return }superfly.dashboard.hideNoResults(this.container);var H="";for(var B in C.referers){if(B==superfly.domain||B=="www."+superfly.domain){continue}var F=((B=="")?"direct":B);var E=0;for(var J in C.referers[B]){E+=C.referers[B][J]}H+='<slice title="'+F+'">'+E+"</slice>"}var G="<pie>"+H+"</pie>";if(!this.inited){$(this.container).setStyle("width",D.width);var A="<settings><text_color>#333333</text_color><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><pie><colors>#c62b2f,#eda170,#e5cc7e,#6c353a,#7c9182,#f5f2c4,#bccf9f,#3fb094,#87244c,#30162b,#7d596d,#fbf8fe,#dedef8,#95c5eb,#69308c</colors><radius>50%</radius><inner_radius>35</inner_radius><height>20</height><angle>30</angle><gradient>radial</gradient><gradient_ratio>-50,0,0,-50</gradient_ratio></pie><animation><start_time>1</start_time><start_effect>strong</start_effect><pull_out_on_click>false</pull_out_on_click></animation><data_labels><max_width>100</max_width><show><![CDATA[{title}]]></show><line_color>#000000</line_color><line_alpha>15</line_alpha><hide_labels_percent>2</hide_labels_percent></data_labels><balloon><show><![CDATA[{title}: {value} people. ({percents}%)]]></show></balloon><legend><enabled>false</enabled></legend><error_messages><enabled>false</enabled></error_messages></settings>";var I=this.container+"_flash";this.flashobj=superfly.addSwf("ampie.swf",this.container,I,D.width,D.height,{chart_settings:A,chart_data:G,chart_id:I},this,"activate");superfly.dashboard.addPause(this.container,this);this.suspended=true;this.inited=true}else{if(this.flashobj.setData&&superfly.runFrequency("pages",2,C.historical)){this.flashobj.setSettings("<settings><animation><start_time>0</start_time></animation></settings>");this.flashobj.setData(G)}}}};superfly.charts.refpie.prototype.activate=function(){this.suspended=false};superfly.charts.refpie.prototype.unload=function(){this.deleted=true};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.refdetails=function(A){this.container=A;superfly.historical.allowHistory(this)};superfly.charts.refdetails.prototype.draw=function(R,J){if(!$chk(R)||!$chk(R.referers)||this.suspended||this.deleted){return }if(!this.inited){$(this.container).setStyle("width",J.width);$(this.container).setStyle("text-align","left");$(this.container).setStyle("overflow","hidden");superfly.dashboard.addPause(this.container,this);this.frame1=new Element("div");this.frame2=new Element("div");this.frame1.fade("hide");this.frame2.fade("hide");this.current_frame=this.frame1;$(this.container).adopt(this.frame1);$(this.container).adopt(this.frame2);$(this.container).setStyle("position","relative");this.frame1.setStyle("position","absolute");this.frame2.setStyle("position","absolute");this.frame1.setStyle("width",J.width);this.frame2.setStyle("width",J.width)}if(superfly.runFrequency("pages",2,R.historical)){var C,B;if(this.current_frame==this.frame1){C=this.frame1;B=this.frame2;this.current_frame=this.frame2}else{C=this.frame2;B=this.frame1;this.current_frame=this.frame1}B.empty();domainarr=new Array();var M='<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2" class="refhead"># of people / referring link</td></tr>';for(var N in R.referers){if(N==superfly.domain||N=="www."+superfly.domain){continue}superfly.dashboard.hideNoResults(this.container);for(var P in R.referers[N]){var H=R.referers[N][P];var I=new Object();I.count=H;I.path=P;I.domain=N;domainarr.push(I)}}domainarr.sort(this.__sort);for(var L=0;L<domainarr.length;++L){var F="people";if(domainarr[L].count==1){F="person"}var D="";if(domainarr[L].domain==""){D=superfly.url(domainarr[L].path)}else{D="http://"+domainarr[L].domain+domainarr[L].path}var P=domainarr[L].path;if(P==""){P="direct"}else{var Q=domainarr[L].domain.replace(/^www\./i,"");var O=["q","p","query","search"];for(var K=0;K<O.length;++K){var E=new RegExp(O[K]+"=([^&]+)");var A=P.match(E);if(A){P=" search: "+utf8.decode(unescape(A[1]).replace(/\+/g," "));break}}P='<div class="refdomain">'+Q+"</div>"+superfly.truncate(P,50)}M+='<tr><td class="refdnum" align="right">'+domainarr[L].count+'</div></td><td class="refdetails" nowrap><a href="'+D+'" target="_blank" class="refdetailslink">'+P+"</a></td></tr>"}M+="</table>";B.set("html",M);var G=new Fx.Tween($(this.container));G.start("height",B.getSize().y);B.fade("in");C.fade("out")}this.inited=true};superfly.charts.refdetails.prototype.unload=function(){this.deleted=true};superfly.charts.refdetails.prototype.__sort=function(B,A){return(A.count-B.count)};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.gauge=function(A){this.container=A;this.oldval=0.01;this.count=0;this.duration=1500;this.animating=false};superfly.charts.gauge.prototype.draw=function(data,options){if(!$chk(data)||!$chk(data.summary)||this.deleted){return }this.width=110;this.height=70;if(!this.inited){var label=new Element("div",{"class":"gaugelabel",html:options.label});$(this.container).adopt(label);this.canvas=new Element("canvas",{width:this.width,height:this.height});$(this.container).adopt(this.canvas);this.num_display=new Element("div",{"class":"gauge"});$(this.container).adopt(this.num_display);this.val_avg=options.val_avg;this.val_min=options.val_min;this.val_max=options.val_max;this.minval=options.allval_min;this.maxval=options.allval_max;if(this.maxval==0){this.maxval=10}if(Browser.Engine.trident){this.delay=1;this.canvas=G_vmlCanvasManager.initElement(this.canvas)}superfly.subscribeToAnimation(this)}if(!this.animating){this.newval=eval(options.data_source);if(options.data_mod){this.newval=options.data_mod(this.newval)}}this.inited=true};superfly.charts.gauge.prototype.unload=function(){this.deleted=true};superfly.charts.gauge.prototype.animate=function(){if(this.delay&&this.delay==1){this.delay++;return }if(!$chk(this.canvas.getContext)||this.deleted||!this.inited){return }if(!this.animating&&(this.oldval==this.newval||!$chk(this.newval))){return }if(this.count>(this.duration/superfly.interval)){this.oldval=this.newval;this.count=0;this.animating=false;return }this.animating=true;this.count++;var C=this.canvas.getContext("2d");C.clearRect(0,0,this.width,this.height);C.save();C.strokeStyle="#4f474b";C.fillStyle="#4f474b";C.lineWidth=1;C.lineCap="butt";var E=this.maxval/6;CanvasTextFunctions.enable(C);C.drawTextCenter("sans",7,22,41,Math.round(E).toString());C.drawTextCenter("sans",7,36,26,Math.round(E*2).toString());C.drawTextCenter("sans",7,55,20,Math.round(E*3).toString());C.drawTextCenter("sans",7,74,26,Math.round(E*4).toString());C.drawTextCenter("sans",7,88,41,Math.round(E*5).toString());C.beginPath();C.arc(55,55,52,0,Math.PI,true);C.stroke();C.beginPath();C.arc(55,55,50,0,Math.PI,true);C.stroke();C.strokeStyle="#8e8087";C.beginPath();C.moveTo(3,54.5);C.lineTo(107,54.5);C.stroke();C.strokeStyle="#4f474b";C.beginPath();C.arc(55,55,30,0,Math.PI,true);C.stroke();C.save();C.translate(55,55);for(var B=0;B<5;B++){C.beginPath();C.rotate(-Math.PI/6);C.moveTo(42,0);C.lineTo(50,0);C.stroke()}C.restore();C.save();C.translate(55,55);for(var B=0;B<59;B++){C.beginPath();C.rotate(-Math.PI/60);C.moveTo(46,0);C.lineTo(50,0);C.stroke()}C.restore();C.save();C.translate(55,54);C.strokeStyle="#1a7eaa";C.lineWidth=2;C.beginPath();C.rotate(Math.PI*((this.val_max/this.maxval)+1));C.moveTo(30,0.5);C.lineTo(50,0.5);C.stroke();C.restore();C.save();C.translate(55,54);C.strokeStyle="#aa571a";C.lineWidth=2;C.beginPath();C.rotate(Math.PI*((this.val_min/this.maxval)+1));C.moveTo(30,0.5);C.lineTo(50,0.5);C.stroke();C.restore();C.save();C.translate(55,54);C.strokeStyle="#28aa1a";C.lineWidth=2;C.beginPath();C.rotate(Math.PI*((this.val_avg/this.maxval)+1));C.moveTo(30,0.5);C.lineTo(50,0.5);C.stroke();C.restore();C.lineWidth=3;C.lineCap="round";C.translate(55,55);var F=new Fx.Transition(Fx.Transitions.Back,2);var G=F.easeInOut((this.count*superfly.interval)/this.duration);var A=(Fx.compute(this.oldval,this.newval,G)/this.maxval)+1;if(A>2){A=2}var D=new Fx.Transition(Fx.Transitions.Quint);G=D.easeInOut((this.count*superfly.interval)/this.duration);this.num_display.set("html",superfly.add_commas(Math.round(Fx.compute(this.oldval,this.newval,G))));C.beginPath();C.rotate(Math.PI*A);C.moveTo(-10,0.5);C.lineTo(30,0.5);C.stroke();C.lineWidth=1;C.beginPath();C.arc(0.5,0.5,4,0,Math.PI*2,true);C.fill();C.save();C.beginPath();C.strokeStyle="#d6c7cd";C.arc(0.5,0.5,2,0,Math.PI*2,true);C.stroke();C.restore();C.beginPath();C.moveTo(30,0.5);C.bezierCurveTo(25,1,36,2,40,0.5);C.moveTo(40,0.5);C.bezierCurveTo(40,0,35,-1,30,-0.5);C.stroke();C.restore()};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.readwriteidle=function(A){this.container=A;superfly.historical.allowHistory(this)};superfly.charts.readwriteidle.prototype.draw=function(C,B){if(this.deleted||!$chk(C)){return }if(!this.inited){if(!superfly.last_data.stats||!superfly.last_data.stats.people_max){return }$(this.container).set("html",'<table border="0" cellpadding="0" cellspacing="0" class="gaugetable"><tr><td><div id="readgauge"></div></td><td><div id="writegauge"></div></td><td><div id="idlegauge"></div></td></tr></table>');this.read_max=superfly.last_data.stats.read_max;this.read_min=superfly.last_data.stats.read_min;this.read_avg=Math.round(superfly.last_data.stats.read_avg);this.write_max=superfly.last_data.stats.write_max;this.write_min=superfly.last_data.stats.write_min;this.write_avg=Math.round(superfly.last_data.stats.write_avg);this.idle_max=superfly.last_data.stats.idle_max;this.idle_min=superfly.last_data.stats.idle_min;this.idle_avg=Math.round(superfly.last_data.stats.idle_avg);this.maxval=Math.max(Math.max(this.read_max,this.write_max),this.idle_max);this.minval=Math.min(Math.min(this.read_min,this.write_min),this.idle_min);if(this.maxval<10){this.maxval=10}else{this.maxval=this.maxval+Math.round(this.maxval*0.1)}superfly.dashboard.readgauge=new superfly.charts.gauge("readgauge");superfly.dashboard.writegauge=new superfly.charts.gauge("writegauge");superfly.dashboard.idlegauge=new superfly.charts.gauge("idlegauge");superfly.historical.addSparkline(this.container,this);superfly.dashboard.hideNoResults(this.container);this.inited=true}else{superfly.dashboard.readgauge.draw(C,{data_source:"data.summary.read",label:"people reading",val_max:this.read_max,val_min:this.read_min,val_avg:this.read_avg,allval_min:this.minval,allval_max:this.maxval});superfly.dashboard.writegauge.draw(C,{data_source:"data.summary.write",label:"people writing",val_max:this.write_max,val_min:this.write_min,val_avg:this.write_avg,allval_min:this.minval,allval_max:this.maxval});superfly.dashboard.idlegauge.draw(C,{data_source:"data.summary.idle",label:"people idle",val_max:this.idle_max,val_min:this.idle_min,val_avg:this.idle_avg,allval_min:this.minval,allval_max:this.maxval});if(C.historical){var A='<chart><series><value xid="'+this.datacount+'">'+C.pages_timestamp+'</value></series><graphs><graph gid="1" color="#302e48" color_hover="#302e48" fill_color="#302e48" fill_alpha="10" balloon_text="{value} reading"><value xid="'+this.datacount+'">'+C.summary.read+'</value></graph><graph gid="2" color="#cc2a42" color_hover="#cc2a42" fill_color="#cc2a42" fill_alpha="20" balloon_text="{value} writing"><value xid="'+this.datacount+'">'+C.summary.write+'</value></graph><graph gid="3" color="#bfa29c" color_hover="#bfa29c" fill_color="#bfa29c" fill_alpha="5" balloon_text="{value} idle"><value xid="'+this.datacount+'">'+C.summary.idle+"</value></graph></graphs></chart>";superfly.historical.sendToSparkline(this,A)}}};superfly.charts.readwriteidle.prototype.unload=function(){this.deleted=true};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.domload=function(A){this.container=A;this.count=0;this.shown=new Array();superfly.historical.allowHistory(this)};superfly.charts.domload.prototype.draw=function(E,C){if(!$chk(E)||!$chk(E.recent)||E.recent.length==0||this.deleted||this.suspended){return }if(!this.inited){if(!superfly.last_data.stats||!superfly.last_data.stats.people_max){return }$(this.container).setStyle("width",C.width);if(!this.limit){this.limit=C.limit}$(this.container).set("html",'<table width="100%" border="0" cellpadding="0" cellspacing="0" class="gaugetable"><tr><td valign="top" width="115"><div id="domloadgauge"></div></td><td valign="top" style="font-size:14px;">Recent user page load times:<br><div id="domloadrecent" style="padding-top: 10px"></div></td></tr></table>');this.domload_max=Math.round(superfly.last_data.stats.domload_max/1000);this.domload_min=Math.round(superfly.last_data.stats.domload_min/1000);this.domload_avg=Math.round(superfly.last_data.stats.domload_avg/1000);this.maxval=this.domload_max;this.minval=this.domload_min;if(this.maxval<10){this.maxval=10}else{this.maxval=this.maxval+Math.round(this.maxval*0.1)}superfly.dashboard.domloadgauge=new superfly.charts.gauge("domloadgauge");superfly.dashboard.addPause(this.container,this);superfly.dashboard.hideNoResults(this.container);this.inited=true}else{superfly.dashboard.domloadgauge.draw(E,{data_source:"data.summary.domload",label:"average time",val_max:this.domload_max,val_min:this.domload_min,val_avg:this.domload_avg,allval_min:this.minval,allval_max:this.maxval,data_mod:function(F){return F/1000}})}E.recent.sort(this.__sort);var B="";for(var A=0;A<E.recent.length;++A){if(E.recent[A].count==0&&!this.shown[E.recent[A].id]){var D=new Element("div",{html:this.__item(E.recent[A]),"class":"livefeed"});$("domloadrecent").grab(D,"top");D.fade("hide");D.fade("in");this.shown[E.recent[A].id]=true;this.count++;if(this.count>this.limit){$("domloadrecent").getLast("div.livefeed").dispose()}}}};superfly.charts.domload.prototype.unload=function(){this.deleted=true};superfly.charts.domload.prototype.__item=function(C){var B=C.referer;var A=C.referer;if(B==""){B="direct";A=superfly.url("")}return'<div class="livefeedtitle"><a href="'+superfly.url(C.path)+'" target="_blank">'+superfly.truncate(superfly.title(C.path,true,"pages"),100)+"</a></div>&nbsp;"+Math.round(C.domload/1000*100)/100+" second load time</div>"};superfly.charts.domload.prototype.__sort=function(B,A){return(A.utc-B.utc)};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.sitetotal=function(A){this.container=A;this.count=0;this.duration=1500;this.animating=false;this.sizeold=0;this.oldpeople=0.01;this.oldnew=0.01;this.oldret=0.01;superfly.historical.allowHistory(this)};superfly.charts.sitetotal.prototype.draw=function(C,B){if(!$chk(C)||!$chk(C.summary)||this.deleted){return }this.width=125;this.height=11;this.rectwidth=115;if(!this.inited){if(!superfly.last_data.stats||!superfly.last_data.stats.people_max){return }$(this.container).set("class","sitetotal");this.grandtotal=new Element("div",{"class":"sitetotalgrand"});$(this.container).adopt(this.grandtotal);this.stats=new Element("div",{"class":"sitetotalstatsfoot",html:'<center><table border="0" cellpadding="0" cellspacing="0"><tr><td>monthly max:</td><td><div class="sitetotalsmax">'+superfly.add_commas(superfly.last_data.stats.people_max)+'</div></td></tr><tr><td>monthly min:</td><td><div class="sitetotalsmin">'+superfly.add_commas(superfly.last_data.stats.people_min)+"</div></td></tr></table></center>"});$(this.container).adopt(this.stats);this.newlabel=new Element("div",{"class":"sitetotalcounts"});$(this.container).adopt(this.newlabel);this.canvas=new Element("canvas",{width:this.width,height:this.height});$(this.container).adopt(this.canvas);this.retlabel=new Element("div",{"class":"sitetotalcounts2"});$(this.container).adopt(this.retlabel);superfly.historical.addSparkline(this.container,this);superfly.dashboard.hideNoResults(this.container);if(Browser.Engine.trident){this.delay=1;this.canvas=G_vmlCanvasManager.initElement(this.canvas)}superfly.subscribeToAnimation(this)}if(!this.animating){this.newpeople=C.summary.people;this.newnew=C.summary["new"];this.newret=C.summary["return"];this.sizenew=Math.floor((this.newnew/this.newpeople)*this.rectwidth);if(!$chk(this.sizenew)){this.sizenew=0}}if(C.historical){var A='<chart><series><value xid="'+this.datacount+'">'+C.pages_timestamp+'</value></series><graphs><graph gid="1" color="#F24444" fill_color="#f28e8e" color_hover="#f24444" fill_alpha="20" balloon_text="{value} total"><value xid="'+this.datacount+'">'+C.summary.people+'</value></graph><graph gid="2" color="#5ea3c2" fill_color="#a9d4e7" color_hover="#5ea3c2" fill_alpha="50" balloon_text="{value} returning"><value xid="'+this.datacount+'">'+C.summary["return"]+"</value></graph></graphs></chart>";superfly.historical.sendToSparkline(this,A)}this.inited=true};superfly.charts.sitetotal.prototype.animate=function(){if(this.delay&&this.delay==1){this.delay++;return }if(!$chk(this.canvas.getContext)||this.deleted||!this.inited){return }if(!this.animating&&((this.newpeople==this.oldpeople&&this.newnew==this.oldnew&&this.newret==this.oldret)||(!$chk(this.newpeople)||!$chk(this.newnew)||!$chk(this.newret)))){return }if(this.count>(this.duration/superfly.interval)){this.oldpeople=this.newpeople;this.oldnew=this.newnew;this.oldret=this.newret;this.sizeold=this.sizenew;this.count=0;this.animating=false;return }this.animating=true;this.count++;var C=this.canvas.getContext("2d");C.clearRect(0,0,this.width,this.height);C.save();var E=new Fx.Transition(Fx.Transitions.Quint);delta=E.easeInOut((this.count*superfly.interval)/this.duration);this.newlabel.set("html","<h3>"+superfly.add_commas(Math.round(Fx.compute(this.oldnew,this.newnew,delta)))+"</h3> new");this.retlabel.set("html","<h3>"+superfly.add_commas(Math.round(Fx.compute(this.oldret,this.newret,delta)))+"</h3> returning");var D=Math.round(Fx.compute(this.oldpeople,this.newpeople,delta));(D==1)?pc="person":pc="people";this.grandtotal.set("html","<h3>"+superfly.add_commas(D)+"</h3>&nbsp;"+pc+" on "+superfly.domain);var B=Math.round(Fx.compute(this.sizeold,this.sizenew,delta));var A=this.rectwidth-B;C.fillStyle="#F24444";if(B){C.fillRect(5,0,B,this.height)}C.fillStyle="#6cbbde";if(A){C.fillRect(B+6,0,A-1,this.height)}C.strokeStyle="#8a9aa5";C.lineWidth=1;C.lineCap="butt";C.strokeStyle="#96484f";C.beginPath();C.moveTo(0,5.5);C.lineTo(5,5.5);C.moveTo(5.5,0);C.lineTo(5.5,this.height);C.moveTo(5.5,0.5);C.lineTo(9,0.5);C.moveTo(5.5,this.height-0.5);C.lineTo(9,this.height-0.5);C.stroke();C.strokeStyle="#5d8194";C.beginPath();C.moveTo(this.width-5,5.5);C.lineTo(this.width,5.5);C.moveTo(this.width-5.5,0);C.lineTo(this.width-5.5,this.height);C.moveTo(this.width-9,0.5);C.lineTo(this.width-5,0.5);C.moveTo(this.width-9,this.height-0.5);C.lineTo(this.width-5,this.height-0.5);C.stroke();C.restore()};superfly.charts.sitetotal.prototype.unload=function(){this.deleted=true};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.sitetime=function(A){this.container=A;superfly.historical.allowHistory(this)};superfly.charts.sitetime.prototype.draw=function(C,E){if(!$chk(C)||!$chk(C.visitlength)||this.suspended||this.deleted){return }if(!this.suspended){if(C.visitlength.length==0){return }superfly.dashboard.hideNoResults(this.container);var I="";var D="";var A="";for(var F=0;F<C.visitlength.length;++F){I+='<value xid="'+F+'">'+C.visitlength[F].read+"</value>";D+='<value xid="'+F+'">'+C.visitlength[F].write+"</value>";A+='<value xid="'+F+'">'+C.visitlength[F].idle+"</value>"}var G='<chart><series><value xid="0">0-1</value><value xid="1">1-2</value><value xid="2">2-3</value><value xid="3">3-4</value><value xid="4">4-5</value><value xid="5">5-6</value><value xid="6">6-10</value><value xid="7">10-15</value><value xid="8">15-30</value><value xid="9">30-60</value></series><graphs><graph gid="1" title="people reading" color="#302e48">'+I+'</graph><graph gid="2" title="people writing" color="#cc2a42">'+D+'</graph><graph gid="3" title="people idle" color="#e8c5be" balloon_text_color="#333333">'+A+"</graph></chart>";if(!this.inited){$(this.container).setStyle("width",E.width);var B="<settings><text_color>#333333</text_color><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><depth>10</depth><angle>30</angle><column><width>60</width><grow_effect>strong</grow_effect><grow_time>2</grow_time><type>stacked</type><alpha>70</alpha><data_labels_text_color>#FFFFFF</data_labels_text_color><data_labels_text_size>9</data_labels_text_size><balloon_text><![CDATA[{value} {title}]]></balloon_text></column><plot_area><margins><left>50</left><top>10</top><right>70</right><bottom>35</bottom></margins></plot_area><legend><enabled>true</enabled><x>!59</x><y>50</y><width>70</width><spacing>5</spacing></legend><axes><value><color>#AAAAAA</color></value><category><color>#AAAAAA</color></category></axes><labels><label><x>45%</x><y>!15</y><text>minutes</text><text_color>#AAAAAA</text_color></label><label><x>0</x><y>150</y><rotate>true</rotate><text>number of people</text><text_color>#AAAAAA</text_color></label></labels></settings>";var H=this.container+"_flash";this.flashobj=superfly.addSwf("amcolumn.swf",this.container,H,E.width,E.height,{chart_settings:B,chart_data:G,chart_id:H},this,"activate");superfly.dashboard.addPause(this.container,this);this.suspended=true;this.inited=true}else{if(this.flashobj.setData&&superfly.runFrequency("pages",2,C.historical)){this.flashobj.setSettings("<settings><column><grow_time>0</grow_time></column></settings>");this.flashobj.setData(G)}}}};superfly.charts.sitetime.prototype.__sort=function(B,A){return(B.count-A.count)};superfly.charts.sitetime.prototype.activate=function(){this.suspended=false};superfly.charts.sitetime.prototype.unload=function(){this.deleted=true};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.conversation=function(B){this.container=B;var A=this;function C(D){if(!D||!D.length){A.keyword=superfly.domain}else{A.keyword=D.join(", ")}superfly.addNewDataFeed("conversation","/dashapi/conversation/?q="+A.keyword+"&host="+superfly.domain,60);superfly.subscribeToDataFeed("conversation",A,{width:600})}superfly.getTwitterWords(C);this.at_a_time=3;superfly.historical.disableHistory(this)};superfly.charts.conversation.prototype.draw=function(E,C){if(this.override_suspension){this.override_suspension=false;$("convloading").setStyle("display","none")}else{if(!$chk(E)||this.suspended||this.deleted){return }}if(!this.inited){$(this.container).setStyle("width",C.width);superfly.dashboard.addPause(this.container,this);superfly.dashboard.hideNoResults(this.container)}$(this.container).set("html","");this.linktweets=new Array();this.tweets=new Array();this.tweetpage=1;this.linktweetpage=1;$(this.container).adopt(new Element("div",{html:'Search terms (separate with commas):<br><div id="convloading"><img src="http://static.chartbeat.com/images/loading.gif" width="31" height="31" border="0"></div><input type="text" style="width:350px" class="text" value="'+this.keyword.replace(/\"/g,"&quot;")+'" id="conversationkeyword" onkeypress="if (event && event.keyCode == 13) superfly.dashboard.getObj(\''+this.container+'\').updateKeyword()"> <input type="button" value="Update" onClick="superfly.dashboard.getObj(\''+this.container+"').updateKeyword()\">"}));$(this.container).adopt(new Element("div",{html:"Tweets",id:"tweetshead"}));this.tweetsdiv=new Element("div",{id:"tweetsdiv"});$(this.container).adopt(this.tweetsdiv);for(var A=0;A<E.twitter.length;++A){var D=new Element("div",{html:this.__twititem(E.twitter[A]),"class":"conversation"});this.tweets.push(D);this.tweetsdiv.adopt(D)}if(this.tweets.length>=this.at_a_time){var F=this.tweets[this.at_a_time-1].getCoordinates().bottom-$("tweetshead").getCoordinates().bottom;this.tweetsdiv.setStyle("height",F)}if(this.tweets.length==0){this.tweetsdiv.adopt(new Element("div",{html:"No tweets found."}))}else{$(this.container).adopt(new Element("div",{id:"moretweets",html:'<a href="javascript:void(0)" onClick="superfly.dashboard.getObj(\''+this.container+'\').expand(\'tweets\')"><img src="http://static.chartbeat.com/images/more.png" border="0" width="9" height="10"> more</a>'}))}$(this.container).adopt(new Element("div",{html:"Links to "+superfly.domain,id:"linktweetshead"}));this.linktweetsdiv=new Element("div",{id:"linktweetsdiv"});$(this.container).adopt(this.linktweetsdiv);for(var A=0;A<E.linktweets.length;++A){var D=new Element("div",{html:this.__twititem(E.linktweets[A],"tweet_"),"class":"conversation"});this.linktweets.push(D);this.linktweetsdiv.adopt(D)}if(this.linktweets.length>=this.at_a_time){var B=this.linktweets[this.at_a_time-1].getCoordinates().bottom-$("linktweetshead").getCoordinates().bottom;this.linktweetsdiv.setStyle("height",B)}if(this.linktweets.length==0){this.linktweetsdiv.adopt(new Element("div",{html:"No links found in twitter."}))}else{$(this.container).adopt(new Element("div",{id:"morelinktweets",html:'<a href="javascript:void(0)" onClick="superfly.dashboard.getObj(\''+this.container+'\').expand(\'linktweets\')"><img src="http://static.chartbeat.com/images/more.png" border="0" width="9" height="10"> more</a>'}))}this.inited=true};superfly.charts.conversation.prototype.expand=function(A){if(A=="linktweets"){if(this.linktweets.length>this.at_a_time*this.linktweetpage){if(this.linktweetpage==1){$("morelinktweets").set("html",$("morelinktweets").get("html")+'<div id="collapselinktweets">&nbsp;&bull;&nbsp;<a href="javascript:void(0)" onClick="superfly.dashboard.getObj(\''+this.container+"').collapse('linktweets')\">collapse</a></div>")}this.linktweetpage++;var C=this.linktweetpage*this.at_a_time;if(this.linktweets.length<C){C=this.linktweets.length}var B=new Fx.Tween(this.linktweetsdiv);B.start("height",this.linktweets[C-1].getCoordinates().bottom-$("linktweetshead").getCoordinates().bottom)}}else{if(A=="tweets"){if(this.tweets.length>this.at_a_time*this.tweetpage){if(this.tweetpage==1){$("moretweets").set("html",$("moretweets").get("html")+'<div id="collapsetweets">&nbsp;&bull;&nbsp;<a href="javascript:void(0)" onClick="superfly.dashboard.getObj(\''+this.container+"').collapse('tweets')\">collapse</a></div>")}this.tweetpage++;var C=this.tweetpage*this.at_a_time;if(this.tweets.length<C){C=this.tweets.length}var B=new Fx.Tween(this.tweetsdiv);B.start("height",this.tweets[C-1].getCoordinates().bottom-$("tweetshead").getCoordinates().bottom)}}}};superfly.charts.conversation.prototype.collapse=function(A){if(A=="linktweets"){if(this.linktweets.length>=this.at_a_time){var B=new Fx.Tween(this.linktweetsdiv);B.start("height",this.linktweets[this.at_a_time-1].getCoordinates().bottom-$("linktweetshead").getCoordinates().bottom);this.linktweetpage=1;$("collapselinktweets").dispose()}}else{if(A=="tweets"){if(this.tweets.length>=this.at_a_time){var B=new Fx.Tween(this.tweetsdiv);B.start("height",this.tweets[this.at_a_time-1].getCoordinates().bottom-$("tweetshead").getCoordinates().bottom);this.tweetpage=1;$("collapsetweets").dispose()}}}};superfly.charts.conversation.prototype.updateKeyword=function(){var A=$("conversationkeyword").value;if(!$chk(A)||A==this.keyword){return }this.keyword=A;superfly.modifyDataFeed("conversation","/dashapi/conversation/?q="+this.keyword);superfly.refreshDataFeed("conversation");this.override_suspension=true;superfly.setTwitterUpdate(this.keyword);$("convloading").setStyle("display","block")};superfly.charts.conversation.prototype.__item=function(A){var E=this.highlight(A.comment.content);var C=new Date(A.comment.date.replace(/(\d{4})-(\d{2})-(\d{2})/,"$2/$3/$1")+" +0000");var D=new Date();var B=Math.round((D.getTime()-C.getTime())/1000);return'<div class="conversationtitle">'+E+'</div><div class="conversationurl">&nbsp; via <a href="'+A.blog.url+'" target="_blank">'+A.blog.title+"</a>, "+superfly.prettytime(B)+' ago | <a href="'+A.comment.url+'" target="_blank">reply</a></div>'};superfly.charts.conversation.prototype.__twititem=function(data,prefix){if(!prefix){prefix="";var comment=this.highlight(eval("data."+prefix+"text"))}else{var comment=eval("data."+prefix+"text")}if(prefix){var d=new Date(data.tweet_created_at.replace(/(\d{4})-(\d{2})-(\d{2})/,"$2/$3/$1")+" +0000")}else{var d=new Date(eval("data."+prefix+"created_at"))}var n=new Date();var seconds=Math.round((n.getTime()-d.getTime())/1000);return'<table border="0" cellpadding="0" cellspacing="0"><tr><td><a href="http://twitter.com/'+eval("data."+prefix+"from_user")+'" target="_blank"><img src="'+eval("data."+prefix+"profile_image_url")+'" border="0" width="48" height="48"></a></td><td class="conversationtweet">'+comment+'</td></tr></table><div class="conversationurl">from <a href="http://twitter.com/'+eval("data."+prefix+"from_user")+'" target="_blank">'+eval("data."+prefix+"from_user")+"</a>, "+superfly.prettytime(seconds)+' ago | <a href="http://twitter.com/'+eval("data."+prefix+"from_user")+"/status/"+eval("data."+prefix+"id")+'" target="_blank">reply</a></div>'};superfly.charts.conversation.prototype.highlight=function(E){if(!E){return E}var B=this.keyword.split(",");for(var A=0;A<B.length;++A){var D=B[A].replace(/^\s+|\s+$/g,"");D=D.replace(/\"|\'/g,"");if(D!=""){var C=new RegExp("("+D+")","gi");E=E.replace(C,'<div class="conversationhighlight">$1</div>')}}return E};superfly.charts.conversation.prototype.unload=function(){this.deleted=true};superfly.charts.conversation.prototype.historyClose=function(){superfly.refreshDataFeed("conversation")};if(!superfly){var superfly={}}if(!superfly.charts){superfly.charts={}}superfly.charts.sparkline=function(A){this.container=A};superfly.charts.sparkline.prototype.draw=function(D,A){if(!this.suspended){chart_data=D;if(!this.inited){$(this.container).setStyle("width",A.width);var B="<settings><plot_area><margins><left>15</left><right>15</right><top>20</top><bottom>25</bottom></margins></plot_area><values><x><enabled>false</enabled></x><y_left><enabled>false</enabled></y_left><y_right><enabled>false</enabled></y_right></values><legend><enabled>false</enabled></legend><axes><x><color>#cccccc</color><width>1</width></x><y_left><color>#cccccc</color><width>1</width></y_left><y_right><color>#cccccc</color><width>1</width></y_right></axes><indicator><color>#666666</color><x_balloon_text_color>#ffffff</x_balloon_text_color></indicator><balloon><text_size>10</text_size></balloon><error_messages><enabled>false</enabled></error_messages></settings>";var C=this.container+"_flash";this.flashobj=superfly.addSwf("amline.swf",this.container,C,A.width,A.height,{chart_settings:B,chart_data:chart_data,chart_id:C},this,"activate");this.suspended=true;this.inited=true;this.append_count=0}else{if(this.flashobj.appendData){if(this.doReset){this.flashobj.setData(chart_data);this.doReset=false}else{var E="0";if(this.append_count>=100){E="1"}else{this.append_count++}this.flashobj.appendData(chart_data,E)}}}}};superfly.charts.sparkline.prototype.reset=function(){this.doReset=true;this.append_count=0};superfly.charts.sparkline.prototype.activate=function(){this.suspended=false};superfly.charts.sparkline.prototype.unload=function(){this.deleted=true};superfly.dashboard={visible:false,obj_map:new Array(),hide_res_map:new Array(),init:function(A){superfly.setDomain(A);$("realtime").fade("hide");superfly.loader=new Element("div",{"class":"loader",html:this.getLoader()});$(document.body).adopt(superfly.loader);this.sortable=new Sortables("#column1, #column2, #column3",{revert:{duration:500,transition:"elastic:out"},onStart:function(){this.clone.setStyle("z-index",1000);$("column1").setStyle("border","2px dashed #61a1f8");$("column2").setStyle("border","2px dashed #61a1f8");$("column3").setStyle("border","2px dashed #61a1f8")},onComplete:function(){superfly.widgetManager.saveLayout(new Array(this.serialize(0),this.serialize(1),this.serialize(2)));$("column1").setStyle("border","none");$("column2").setStyle("border","none");$("column3").setStyle("border","none")}});this.sortable.detach();superfly.historical.historyPicker()},show:function(){if(!this.visible){$("realtime").fade("in");superfly.loader.dispose();this.visible=true}},loadWidget:function(name,feedid,column,addl_options,title,extra_help,bare_bones,bare_bones_div){if($chk(eval("superfly.charts."+name))){var divid=name+Math.round(Math.random()*100000);var liid=name;if(!bare_bones){if(!$chk($("column"+column))){return }var htmlcontent=this.dressWidget(title,extra_help,liid,divid)}else{var htmlcontent=this.bareBones(liid,divid)}var outer=new Element("div",{html:htmlcontent});if(!bare_bones){var li=new Element("li",{id:liid});li.adopt(outer);$("column"+column).adopt(li);$(divid+"_info").store("tip:title",extra_help);new Tips($(divid+"_info"),{fixed:true,hideDelay:1000})}else{$(bare_bones_div).adopt(outer)}var chart=eval("new superfly.charts."+name+"('"+divid+"')");this.obj_map[divid]=chart;if(feedid){superfly.subscribeToDataFeed(feedid,chart,addl_options)}}},bareBones:function(A,B){return'<table border="0" cellpadding="0" cellspacing="0" class="widget" id="'+B+'_whole"><tr><td><div class="widgetfix" id="'+B+'_tfix">&nbsp;</div><div class="widgetpause" id="'+B+'_pause">widget paused (move mouse off to unpause)</div></td></tr><tr><td><div id="nores'+B+'" class="nores">Awaiting data...</div><div id="'+B+'" class="widgetcontainer"></div></td></tr></table>'},dressWidget:function(D,C,B,E){var A="";if($chk(D)){A="<h3>"+D+"</h3>"}return'<table border="0" cellpadding="0" cellspacing="0" class="widget" id="'+E+'_whole"><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="widgettopleft" id="'+E+'_tl"></td><td class="widgettop" id="'+E+'_t"><div class="widgetfix" id="'+E+'_tfix">&nbsp;</div><div class="widgetpause" id="'+E+'_pause">widget paused (move mouse off to unpause)</div></td><td class="widgettopright" id="'+E+'_tr"><a href="javascript:void(0)" class="info" id="'+E+'_info"></a><a href="javascript:void(0)" onMouseOver="superfly.dashboard.moveOn()" onMouseOut="superfly.dashboard.moveOff()" class="move" id="'+E+'_move"></a><a href="javascript:void(0)" onClick="superfly.dashboard.closeWidget(\''+B+'\')" class="close" id="'+E+'_close"></a></td></tr></table></td></tr><tr><td class="widgetmiddle" id="'+E+'_m" align="center">'+A+'<div id="nores'+E+'" class="nores">Awaiting data...</div><div id="'+E+'" class="widgetcontainer"></div></td></tr><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="widgetbottomleft" id="'+E+'_bl"></td><td class="widgetbottom" id="'+E+'_b">&nbsp;</td><td class="widgetbottomright" id="'+E+'_br"></td></tr></table></td></tr></table>'},addPause:function(B,A){$(B).obj=A;$(B).containerid=B;$(B).addEvents({mouseover:function(){this.obj.suspended=true;superfly.dashboard.showPause(this.containerid)},mouseout:function(){this.obj.suspended=false;superfly.dashboard.hidePause(this.containerid)}})},showPause:function(A){$(A+"_tfix").setStyle("display","none");$(A+"_pause").setStyle("display","block")},hidePause:function(A){$(A+"_tfix").setStyle("display","block");$(A+"_pause").setStyle("display","none")},showNoResults:function(A){if(!this.hide_res_map[A]){return }$("nores"+A).setStyle("display","block");this.hide_res_map[A]=false},hideNoResults:function(A){if(this.hide_res_map[A]){return }$("nores"+A).setStyle("display","none");this.hide_res_map[A]=true},getObj:function(A){return this.obj_map[A]},getLoader:function(){return'<img src="http://static.chartbeat.com/images/loading.gif" border="0"><br>loading widgets...'},moveOn:function(){this.sortable.attach()},moveOff:function(){this.sortable.detach()},closeWidget:function(A){if($chk($(A).chart)&&$chk($(A).chart.unload)){$(A).chart.unload()}new Fx.Slide(A).slideOut().chain(function(){$(A).dispose();superfly.widgetManager.saveLayout(superfly.dashboard.sortable.serialize())})}};superfly.historical={hpdivs:[],showing_invalid:false,last_mod_time:false,objs:[],disabled_objs:[],history_time:"",playing:false,draw:function(B,A){if(B&&B.historical){if(this.hpdiv&&B.pages_timestamp){if(superfly.lastCallTime("pages")>=this.last_mod_time){this.hpdiv.value=B.pages_timestamp;this.history_time=new Date(B.pages_timestamp)}}}else{if(!this.showing_invalid){blinkNotify("notify","No more historical data could be found.",false,2000);this.showing_invalid=true}}},callDisabledObjects:function(){for(var A=0;A<this.disabled_objs.length;++A){var C=this.disabled_objs[A];var B=this.disabled_objs[A].container;if(B&&$(B+"_whole")){if(this.playing){$(B+"_whole").setStyle("display","none");if(C.historyOpen){C.historyOpen()}}else{$(B+"_whole").setStyle("display","block");if(C.historyClose){C.historyClose()}}}}},callOnObjects:function(C){for(var A=0;A<this.objs.length;++A){var B=this.objs[A].container;if(B){if(C=="historyClose"){$(B+"_tl").removeClass("widgettopleft_h");$(B+"_tr").removeClass("widgettopright_h");$(B+"_bl").removeClass("widgetbottomleft_h");$(B+"_br").removeClass("widgetbottomright_h");$(B+"_t").removeClass("widgettop_h");$(B+"_b").removeClass("widgetbottom_h");$(B+"_m").removeClass("widgetmiddle_h");$(B+"_move").removeClass("move_h");$(B+"_close").removeClass("close_h");$(B+"_info").removeClass("info_h")}else{if(C="historyOpen"){$(B+"_tl").addClass("widgettopleft_h");$(B+"_tr").addClass("widgettopright_h");$(B+"_bl").addClass("widgetbottomleft_h");$(B+"_br").addClass("widgetbottomright_h");$(B+"_t").addClass("widgettop_h");$(B+"_b").addClass("widgetbottom_h");$(B+"_m").addClass("widgetmiddle_h");$(B+"_move").addClass("move_h");$(B+"_close").addClass("close_h");$(B+"_info").addClass("info_h")}}}if(this.objs[A][C]){this.objs[A][C]()}}},disableHistory:function(A){this.disabled_objs.push(A);this.callDisabledObjects()},allowHistory:function(A){this.objs.push(A);if(A.historyChange){A.historyChange_old=A.historyChange}A.historyChange=function(){for(x=0;x<superfly.historical.objs.length;++x){if(superfly.historical.objs[x].sparkline){superfly.historical.objs[x].sparkline.reset()}if(superfly.historical.objs[x].historyChange_old){superfly.historical.objs[x].historyChange_old()}}};return false},historyPicker:function(){var id="historypicker_id";var container="historypicker";var fmt="m/d/Y";var api="pages";var msgdiv=new Element("div",{"class":"replaymsg",html:"REPLAY - NOT REAL-TIME"});$(container).adopt(msgdiv);var hpdiv=new Element("input",{id:id,name:id,"class":"historypicker",type:"text"});hpdiv.addEvent("focus",function(){superfly.pauseFeed(api)});hpdiv.addEvent("blur",function(){superfly.resumeFeed(api)});this.hpdiv=hpdiv;var cdiv=new Element("div",{"class":"caldiv"});cdiv.adopt(hpdiv);$(container).adopt(cdiv);function timeModifier(feed,args){var dateparts=hpdiv.value.match(/([0-9]{1,2}) *. *([0-9]{1,2}) *. *([0-9]{2,4}) *([0-9]{1,2}) *: *([0-9]{1,2}) *([a-zA-Z]{0,2})/);if(dateparts){var thedate=dateparts[3];if(thedate<100){thedate="20"+thedate}var ampm="";if(dateparts[6]){ampm=dateparts[6].toLowerCase();if(ampm!="am"&&ampm!="pm"){ampm="pm"}}var datestring=dateparts[1]+"/"+dateparts[2]+"/"+thedate+" "+dateparts[4]+":"+dateparts[5]+" "+ampm;var d=new Date(datestring);var ts=d.getTime()/1000;ts+=(60*5);args.timestamp=ts;return args}}superfly.historical.turnOffReplay=function(){if(!superfly.historical.playing){return }superfly.historical.playing=false;superfly.modifyDataFeed(api,"/api/pages/",2,null);superfly.unsubscribeFromDataFeed(api,thisobj);$(id).setStyle("display","none");$(id).setStyle("right","40px");$("closebtn").setStyle("display","none");superfly.historical.callOnObjects("historyClose");superfly.historical.callDisabledObjects();$("realtime").setStyle("display","none");$("mainhistorical").setStyle("display","block");superfly.startHistorical()};var thisobj=this;function cback(){superfly.historical.playing=true;superfly.historical.showing_invalid=false;superfly.historical.last_mod_time=new Date();if($(id).getStyle("display")=="none"){superfly.modifyDataFeed(api,"/dashapi/snapshots/?api="+api,1,timeModifier);superfly.subscribeToDataFeed(api,thisobj);$(id).setStyle("display","inline");if(!$("closebtn")){var closebtn=new Element("button",{id:"closebtn",type:"button","class":"calendar_off",events:{click:superfly.historical.turnOffReplay}});$(id).getParent().adopt(closebtn)}else{$("closebtn").setStyle("display","inline")}$(id).setStyle("right","80px");superfly.historical.callOnObjects("historyOpen")}superfly.historical.callOnObjects("historyChange");superfly.historical.callDisabledObjects()}this.historyCback=cback;hpdiv.addEvent("keypress",function(evt){if(evt.key=="enter"){this.blur();cback()}});eval("new Calendar({ '"+id+"': '"+fmt+"' }, { 'classes': ['calendar'], 'direction': -1, 'onChange': cback });");return cdiv},beginPlayback:function(A){$("historypicker_id").value=A;this.historyCback()},addSparkline:function(A,B){if(B.historyOpen){B.historyOpen_old=B.historyOpen}if(B.historyClose){B.historyClose_old=B.historyClose}B.historyOpen=function(){if(!B.sparkline){var C=B.container+"_sparkline";B.sparklinediv=new Element("div",{id:C});$(B.container).adopt(B.sparklinediv);B.sparkline=new superfly.charts.sparkline(C)}B.sparklinediv.setStyle("display","block");if(B.historyOpen_old){B.historyOpen_old()}};B.historyClose=function(){if(B.sparkline){B.sparkline.reset()}if(B.sparklinediv){B.sparklinediv.setStyle("display","none")}if(B.historyClose_old){B.historyClose_old()}};if(!B.datacount){B.datacount=0}},sendToSparkline:function(B,A){if(!B.sparkline){return }B.datacount++;B.sparkline.draw(A,{width:350,height:100})}};superfly.widgetManager={widget_list:{sitetotal:{feedid:"pages",title:"Site total",hide_title:true},readwriteidle:{feedid:"pages",title:"Read/Write/Idle",hide_title:true},domload:{feedid:"pages",title:"Page load time",options:{limit:5,width:450}},geomap:{title:"Geolocations"},sitetime:{feedid:"pages",options:{width:450,height:200},title:"Visit length"},refpie:{feedid:"pages",options:{width:450,height:200},title:"Where they're coming from"},refdetails:{feedid:"pages",options:{width:450},title:"Referrer details"},sitemap:{feedid:"pages",options:{width:600,height:250},title:"Page density",default_col:2},livefeed:{feedid:"pages",options:{width:600,limit:10},title:"Raw hits",default_col:2},conversation:{title:"Conversations",default_col:2}},widget_help:{sitetotal:"The total number of people on an entire domain, including new vs. returning.",readwriteidle:"Visitor activity gauges, displaying who is reading, writing and idle.",domload:"Show actual visitor page load times and averages.",geomap:"Real world locations displayed for all current visitors.",sitetime:"How long people have been on the site, including a breakdown of read/write/idle.",refpie:"Pie chart displaying how people are getting to the site.",refdetails:"Detailed information regarding how people are getting to the site.",sitemap:"A density map of where people are located within the entire website.",livefeed:"Live feed of incoming new traffic to the site.",conversation:"The latest gossip about your website."},widget_extra_help:{sitetotal:"The topmost number is the number of people on your site right now.  Below it are the monthly maximum and minimum values of that value.<br><br>The next graph breaks down how many of those people have been to your site before versus how many are new.",readwriteidle:"This breaks down what your visitors are doing right now.<ul><li>Reading - A user is actively moving around the page.</li><li>Writing - A user is actively typing something.</li><li>Idle - There has been no detected activity for a few minutes.</li></ul> The orange, green, and blue markings signify the minimum, average, and maximum values this month.",domload:"This widget shows the average time it is taking your users to load your website.  Also included is a running list of page load times as they happen.",geomap:"Displays where in the world your current users are located.<br><br>You can click any country or state for a zoomed in view.  When you hover over the dots, you will be given information about that user.  Clicking on the dot brings you to that page.",sitetime:"This displays how long people have been on your site.  It is broken down into read/write/idle.  Hover over for exact numbers.",refpie:"This chart shows how your current users got to your site.  Hover over for exact numbers.",refdetails:"This list is a detailed view of the referrer pie chart.  It shows every link users followed to get to your site.  It is ordered by links that sent the most traffic.  Clicking on a link brings you to that page.",sitemap:"The density map shows your top 50 most popular pages right now.  The size of each block represents how many users are on that page.<br><br>By hovering over a page, you can also see a heatmap of how far they scrolled down the page, as well as a reading/writing/idle breakdown.<br><br>A page flashes green when the number goes up, and red when it goes down.",livefeed:"This is a running list of traffic coming into your website or moving around your website.",conversation:'This widget focuses on twitter activity.  Change the search terms to search through twitter for specific keywords.<br><br>The second part of this widget shows people that have linked to your website and posted it on twitter (powered by <a href="http://backtype.com" target="_blank">backtype</a>).'},default_layout:[["sitetotal","readwriteidle","domload","geomap","sitetime","refpie","refdetails"],["sitemap","livefeed","conversation"]],getLayout:function(){if(Browser.Engine.trident){if(Browser.Engine.version<=4){var A=new Element("li",{html:'chartbeat is not compatible with Internet Explorer 6.  Please <a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">upgrade</a>.  Or, you can use <a href="http://firefox.com">Firefox</a> or <a href="http://www.google.com/chrome">Google Chrome</a> browsers (chartbeat functions smoother with either)',id:"error"});$("column1").adopt(A);showAlert("error","error");return }else{if(!Silverlight.isInstalled("2.0")){var A=new Element("li",{html:'You need to install <a href="http://www.microsoft.com/silverlight/resources/install.aspx">Microsoft Silverlight</a> if you want to use chartbeat with Internet Explorer.  Or, you can use <a href="http://firefox.com">Firefox</a> or <a href="http://www.google.com/chrome">Google Chrome</a> browsers (chartbeat functions smoother with either)',id:"error"});$("column1").adopt(A);showAlert("error","error");return }else{blinkNotify("notify",'Note: chartbeat will run faster and smoother with <a href="http://firefox.com">Firefox</a> or <a href="http://www.google.com/chrome">Google Chrome</a> browsers',false,2000)}}}else{if(Browser.Platform.mac&&Browser.Engine.gecko&&Browser.Engine.version<=18){blinkNotify("notify",'Note: chartbeat will run faster and smoother if you upgrade <a href="http://firefox.com">Firefox</a> or use Safari',false,2000)}else{if(!superfly.hasFlash()){var A=new Element("li",{html:'You need flash to view chartbeat.  Please go <a href="http://get.adobe.com/flashplayer/">here</a> to install it.',id:"error"});$("column1").adopt(A);showAlert("error","error");return }}}if(!Cookie.read("columns")){this.__defaultLayout()}else{this.__cookiesToLayout()}},loadSpecificWidget:function(C,B){var A=this.widget_list[C];if(A){superfly.dashboard.loadWidget(C,A.feedid,0,A.options,"","",true,B)}},saveLayout:function(A){this.__writeCookie(JSON.encode(A))},listWidgets:function(){if(!this.columns){this.__cookiesToColumns()}var C=new Array();for(var A=0;A<this.columns.length;++A){for(var E=0;E<this.columns[A].length;++E){C[this.columns[A][E]]=true}}var D=new Array();for(var B in this.widget_list){D.push({name:B,title:this.widget_list[B].title,help:this.widget_help[B],installed:C[B]})}return D},saveWidgets:function(C){var B=$$("#"+C+" input.widget_cb");for(var A=0;A<B.length;++A){this.__modifyColumns(B[A].id,B[A].checked)}this.__writeCookie(JSON.encode(this.columns));blinkNotify("notify","Widgets saved.",false)},createWidgetTable:function(F){var E=this.listWidgets();for(var A=0;A<E.length;++A){var D=new Element("tbody");var G=new Element("tr",{"class":"widget_list_tr"});var B=new Element("td",{"class":"widget_list_td",html:'<input type="checkbox" class="widget_cb" id="'+E[A].name+'"'+((E[A].installed)?" checked":"")+">"});var H=new Element("td",{"class":"widget_list_td_title",html:E[A].title});var C=new Element("td",{"class":"widget_list_td",html:E[A].help});D.adopt(G);G.adopt(B);G.adopt(H);G.adopt(C);$(F).adopt(D)}},__modifyColumns:function(F,D){var C=false;for(var B=0;B<this.columns.length;++B){for(var E=0;E<this.columns[B].length;++E){if(this.columns[B][E]==F){if(!D){this.columns[B][E]=null;return }else{C=true;break}}}if(C){break}}if(D&&!C){var A=this.widget_list[F].default_col;if(!A){A=0}else{A=A-1}this.columns[A].push(F)}},__writeCookie:function(A){Cookie.write("columns",A,{duration:365,domain:".chartbeat.com",path:"/"})},__cookiesToColumns:function(){var A=Cookie.read("columns");this.__writeCookie(A);if(A){A=JSON.decode(A);if(A){this.columns=A;return }}this.columns=this.default_layout},__cookiesToLayout:function(){if(!this.columns){this.__cookiesToColumns()}for(var B=0;B<this.columns.length;++B){for(var D=0;D<this.columns[B].length;++D){if(this.columns[B][D]){var C=this.columns[B][D];var A=this.widget_list[C];if(A){superfly.dashboard.loadWidget(C,A.feedid,B+1,A.options,((A.hide_title)?"":A.title),this.widget_extra_help[C])}}}}},__defaultLayout:function(){this.columns=this.default_layout;for(var B=0;B<this.columns.length;++B){for(var D=0;D<this.columns[B].length;++D){var C=this.columns[B][D];var A=this.widget_list[C];superfly.dashboard.loadWidget(C,A.feedid,B+1,A.options,((A.hide_title)?"":A.title),this.widget_extra_help[C])}}this.__writeCookie(JSON.encode(this.columns))}};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(L,B,K,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(L){this.setAttribute("swf",L)}if(B){this.setAttribute("id",B)}if(K){this.setAttribute("width",K)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();if(!(navigator.plugins&&navigator.mimeTypes.length)){window[this.getAttribute("id")]=document.getElementById(this.getAttribute("id"))}return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var Calendar=new Class({options:{blocked:[],classes:[],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],direction:0,draggable:true,months:["January","February","March","April","May","June","July","August","September","October","November","December"],navigation:1,offset:0,onHideStart:Class.empty,onHideComplete:Class.empty,onShowStart:Class.empty,onShowComplete:Class.empty,onChange:Class.empty,pad:1,tweak:{x:0,y:0}},initialize:function(F,B){if(!F){return false}this.setOptions(B);var D=["calendar","prev","next","month","year","today","invalid","valid","inactive","active","hover","hilite"];var C=D.map(function(J,I){if(this.options.classes[I]){if(this.options.classes[I].length){J=this.options.classes[I]}}return J},this);this.classes=C.associate(D);this.calendar=new Element("div",{styles:{left:"-1000px",opacity:0,position:"absolute",top:"-1000px",zIndex:1000}}).addClass(this.classes.calendar).injectInside(document.body);if(window.ie6){this.iframe=new Element("iframe",{styles:{left:"-1000px",position:"absolute",top:"-1000px",zIndex:999}}).injectInside(document.body);this.iframe.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"}this.fx=new Fx.Tween(this.calendar,{onStart:function(){if(this.calendar.getStyle("opacity")==0){if(window.ie6){this.iframe.setStyle("display","block")}this.calendar.setStyle("display","block");this.fireEvent("onShowStart",this.element)}else{this.fireEvent("onHideStart",this.element)}}.bind(this),onComplete:function(){if(this.calendar.getStyle("opacity")==0){this.calendar.setStyle("display","none");if(window.ie6){this.iframe.setStyle("display","none")}this.fireEvent("onHideComplete",this.element)}else{this.fireEvent("onShowComplete",this.element)}}.bind(this)});if(window.Drag&&this.options.draggable){this.drag=new Drag.Move(this.calendar,{onDrag:function(){if(window.ie6){this.iframe.setStyles({left:this.calendar.style.left,top:this.calendar.style.top})}}.bind(this)})}this.calendars=[];var H=0;var G=new Date();G.setDate(G.getDate()+this.options.direction.toInt());for(var A in F){var E={button:new Element("button",{type:"button"}),el:$(A),els:[],id:H++,month:G.getMonth(),visible:false,year:G.getFullYear()};if(!this.element(A,F[A],E)){continue}E.el.addClass(this.classes.calendar);E.button.addClass(this.classes.calendar).addEvent("click",function(I){this.toggle(I)}.pass(E,this)).injectAfter(E.el);E.val=this.read(E);$extend(E,this.bounds(E));$extend(E,this.values(E));this.rebuild(E);this.calendars.push(E)}},blocked:function(C){var A=[];var D=new Date(C.year,C.month,1).getDay();var B=new Date(C.year,C.month+1,0).getDate();this.options.blocked.each(function(H){var J=H.split(" ");for(var I=0;I<=3;I++){if(!J[I]){J[I]=(I==3)?"":"*"}J[I]=J[I].contains(",")?J[I].split(","):new Array(J[I]);var K=J[I].length-1;for(var G=K;G>=0;G--){if(J[I][G].contains("-")){var L=J[I][G].split("-");for(var F=L[0];F<=L[1];F++){if(!J[I].contains(F)){J[I].push(F+"")}}J[I].splice(G,1)}}}if(J[2].contains(C.year+"")||J[2].contains("*")){if(J[1].contains(C.month+1+"")||J[1].contains("*")){J[0].each(function(M){if(M>0){A.push(M.toInt())}});if(J[3]){for(var I=0;I<B;I++){var E=(I+D)%7;if(J[3].contains(E+"")){A.push(I+1)}}}}}},this);return A},bounds:function(C){var D=new Date(1000,0,1);var A=new Date(2999,11,31);var B=new Date().getDate()+this.options.direction.toInt();if(this.options.direction>0){D=new Date();D.setDate(B+this.options.pad*C.id)}if(this.options.direction<0){A=new Date();A.setDate(B-this.options.pad*(this.calendars.length-C.id-1))}C.els.each(function(F){if(F.get("tag")=="select"){if(F.format.test("(y|Y)")){var E=[];F.getChildren().each(function(I){var J=this.unformat(I.value,F.format);if(!E.contains(J[0])){E.push(J[0])}},this);E.sort(this.sort);if(E[0]>D.getFullYear()){d=new Date(E[0],D.getMonth()+1,0);if(D.getDate()>d.getDate()){D.setDate(d.getDate())}D.setYear(E[0])}if(E.getLast()<A.getFullYear()){d=new Date(E.getLast(),A.getMonth()+1,0);if(A.getDate()>d.getDate()){A.setDate(d.getDate())}A.setYear(E.getLast())}}if(F.format.test("(F|m|M|n)")){var H=[];var G=[];F.getChildren().each(function(I){var J=this.unformat(I.value,F.format);if($type(J[0])!="number"||J[0]==E[0]){if(!H.contains(J[1])){H.push(J[1])}}if($type(J[0])!="number"||J[0]==E.getLast()){if(!G.contains(J[1])){G.push(J[1])}}},this);H.sort(this.sort);G.sort(this.sort);if(H[0]>D.getMonth()){d=new Date(D.getFullYear(),H[0]+1,0);if(D.getDate()>d.getDate()){D.setDate(d.getDate())}D.setMonth(H[0])}if(G.getLast()<A.getMonth()){d=new Date(D.getFullYear(),G.getLast()+1,0);if(A.getDate()>d.getDate()){A.setDate(d.getDate())}A.setMonth(G.getLast())}}}},this);return{start:D,end:A}},caption:function(G){var A={prev:{month:true,year:true},next:{month:true,year:true}};if(G.year==G.start.getFullYear()){A.prev.year=false;if(G.month==G.start.getMonth()&&this.options.navigation==1){A.prev.month=false}}if(G.year==G.end.getFullYear()){A.next.year=false;if(G.month==G.end.getMonth()&&this.options.navigation==1){A.next.month=false}}if($type(G.months)=="array"){if(G.months.length==1&&this.options.navigation==2){A.prev.month=A.next.month=false}}var B=new Element("caption");var E=new Element("a").addClass(this.classes.prev).appendText("\x3c");var D=new Element("a").addClass(this.classes.next).appendText("\x3e");if(this.options.navigation==2){var F=new Element("span").addClass(this.classes.month).injectInside(B);if(A.prev.month){E.clone().addEvent("click",function(H){this.navigate(H,"m",-1)}.pass(G,this)).injectInside(F)}F.adopt(new Element("span").appendText(this.options.months[G.month]));if(A.next.month){D.clone().addEvent("click",function(H){this.navigate(H,"m",1)}.pass(G,this)).injectInside(F)}var C=new Element("span").addClass(this.classes.year).injectInside(B);if(A.prev.year){E.clone().addEvent("click",function(H){this.navigate(H,"y",-1)}.pass(G,this)).injectInside(C)}C.adopt(new Element("span").appendText(G.year));if(A.next.year){D.clone().addEvent("click",function(H){this.navigate(H,"y",1)}.pass(G,this)).injectInside(C)}}else{if(A.prev.month&&this.options.navigation){E.clone().addEvent("click",function(H){this.navigate(H,"m",-1)}.pass(G,this)).injectInside(B)}B.adopt(new Element("span").addClass(this.classes.month).appendText(this.options.months[G.month]));B.adopt(new Element("span").addClass(this.classes.year).appendText(G.year));if(A.next.month&&this.options.navigation){D.clone().addEvent("click",function(H){this.navigate(H,"m",1)}.pass(G,this)).injectInside(B)}}return B},changed:function(A){A.val=this.read(A);$extend(A,this.values(A));this.rebuild(A);if(!A.val){return }if(A.val.getDate()<A.days[0]){A.val.setDate(A.days[0])}if(A.val.getDate()>A.days.getLast()){A.val.setDate(A.days.getLast())}A.els.each(function(B){B.value=this.format(A.val,B.format)},this);this.check(A);this.calendars.each(function(B){if(B.visible){this.display(B)}},this)},check:function(A){this.calendars.each(function(E,B){if(E.val){var D=false;if(B<A.id){var C=new Date(Date.parse(A.val));C.setDate(C.getDate()-(this.options.pad*(A.id-B)));if(C<E.val){D=true}}if(B>A.id){var C=new Date(Date.parse(A.val));C.setDate(C.getDate()+(this.options.pad*(B-A.id)));if(C>E.val){D=true}}if(D){if(E.start>C){C=E.start}if(E.end<C){C=E.end}E.month=C.getMonth();E.year=C.getFullYear();$extend(E,this.values(E));E.val=E.days.contains(C.getDate())?C:null;this.write(E);if(E.visible){this.display(E)}}}else{E.month=A.month;E.year=A.year}},this)},clicked:function(C,A,B){B.val=new Date(B.year,B.month,A);this.write(B);if(!B.val){B.val=this.read(B)}if(B.val){this.check(B);this.toggle(B)}else{C.addClass(this.classes.valid);C.removeClass(this.classes.active)}},display:function(J){this.calendar.empty();this.calendar.className=this.classes.calendar+" "+this.options.months[J.month].toLowerCase();var K=new Element("div").injectInside(this.calendar);var R=new Element("table").injectInside(K).adopt(this.caption(J));var Q=new Element("thead").injectInside(R);var B=new Element("tr").injectInside(Q);for(var P=0;P<=6;P++){var E=this.options.days[(P+this.options.offset)%7];B.adopt(new Element("th",{title:E}).appendText(E.substr(0,1)))}var A=new Element("tbody").injectInside(R);var B=new Element("tr").injectInside(A);var S=new Date(J.year,J.month,1);var F=((S.getDay()-this.options.offset)+7)%7;var I=new Date(J.year,J.month+1,0).getDate();var N=new Date(J.year,J.month,0).getDate();var D=this.value(J);var L=J.days;var M=[];var G=[];this.calendars.each(function(X,W){if(X!=J&&X.val){if(J.year==X.val.getFullYear()&&J.month==X.val.getMonth()){M.push(X.val.getDate())}if(J.val){for(var V=1;V<=I;V++){S.setDate(V);if((W<J.id&&S>X.val&&S<J.val)||(W>J.id&&S>J.val&&S<X.val)){if(!G.contains(V)){G.push(V)}}}}}},this);var S=new Date();var T=new Date(S.getFullYear(),S.getMonth(),S.getDate()).getTime();for(var P=1;P<43;P++){if((P-1)%7==0){B=new Element("tr").injectInside(A)}var H=new Element("td").injectInside(B);var O=P-F;var U=new Date(J.year,J.month,O);var C="";if(O===D){C=this.classes.active}else{if(M.contains(O)){C=this.classes.inactive}else{if(L.contains(O)){C=this.classes.valid}else{if(O>=1&&O<=I){C=this.classes.invalid}}}}if(U.getTime()==T){C=C+" "+this.classes.today}if(G.contains(O)){C=C+" "+this.classes.hilite}H.addClass(C);if(L.contains(O)){H.setProperty("title",this.format(U,"D M jS Y"));H.addEvents({click:function(X,V,W){this.clicked(X,V,W)}.pass([H,O,J],this),mouseover:function(W,V){W.addClass(V)}.pass([H,this.classes.hover]),mouseout:function(W,V){W.removeClass(V)}.pass([H,this.classes.hover])})}if(O<1){O=N+O}else{if(O>I){O=O-I}}H.appendText(O)}},element:function(B,C,D){if($type(C)=="object"){for(var A in C){if(!this.element(A,C[A],D)){return false}}return true}B=$(B);if(!B){return false}B.format=C;if(B.get("tag")=="select"){B.addEvent("change",function(E){this.changed(E)}.pass(D,this))}else{}D.els.push(B);return true},format:function(C,L){var I="";if(C){var E=C.getDate();var K=C.getDay();var D=this.options.days[K];var B=C.getMonth()+1;var H=this.options.months[B-1];var J=C.getFullYear()+"";for(var F=0,G=L.length;F<G;F++){var A=L.charAt(F);switch(A){case"y":J=J.substr(2);case"Y":I+=J;break;case"m":if(B<10){B="0"+B}case"n":I+=B;break;case"M":H=H.substr(0,3);case"F":I+=H;break;case"d":if(E<10){E="0"+E}case"j":I+=E;break;case"D":D=D.substr(0,3);case"l":I+=D;break;case"N":K+=1;case"w":I+=K;break;case"S":if(E%10==1&&E!="11"){I+="st"}else{if(E%10==2&&E!="12"){I+="nd"}else{if(E%10==3&&E!="13"){I+="rd"}else{I+="th"}}}break;default:I+=A}}}return I},navigate:function(C,B,D){switch(B){case"m":if($type(C.months)=="array"){var A=C.months.indexOf(C.month)+D;if(A<0||A==C.months.length){if(this.options.navigation==1){this.navigate(C,"y",D)}A=(A<0)?C.months.length-1:0}C.month=C.months[A]}else{var A=C.month+D;if(A<0||A==12){if(this.options.navigation==1){this.navigate(C,"y",D)}A=(A<0)?11:0}C.month=A}break;case"y":if($type(C.years)=="array"){var A=C.years.indexOf(C.year)+D;C.year=C.years[A]}else{C.year+=D}break}$extend(C,this.values(C));if($type(C.months)=="array"){var A=C.months.indexOf(C.month);if(A<0){C.month=C.months[0]}}this.display(C)},read:function(C){var A=[null,null,null];C.els.each(function(F){var E=this.unformat(F.value,F.format);E.each(function(H,G){if($type(H)=="number"){A[G]=H}})},this);if($type(A[0])=="number"){C.year=A[0]}if($type(A[1])=="number"){C.month=A[1]}var D=null;if(A.every(function(E){return $type(E)=="number"})){var B=new Date(A[0],A[1]+1,0).getDate();if(A[2]>B){A[2]=B}D=new Date(A[0],A[1],A[2])}return(C.val==D)?null:D},rebuild:function(A){A.els.each(function(B){if(B.get("tag")=="select"&&B.format.test("^(d|j)$")){var C=this.value(A);if(!C){C=B.value.toInt()}B.empty();A.days.each(function(E){var D=new Element("option",{selected:(C==E),value:((B.format=="d"&&E<10)?"0"+E:E)}).appendText(E).injectInside(B)},this)}},this)},sort:function(B,A){return B-A},toggle:function(C){document.removeEvent("mousedown",this.fn);if(C.visible){C.visible=false;C.button.removeClass(this.classes.active);this.fx.start("opacity",1,0)}else{this.fn=function(I,H){var I=new Event(I);var G=I.target;var F=false;while(G!=document.body&&G.nodeType==1){if(G==this.calendar){F=true}this.calendars.each(function(J){if(J.button==G||J.els.contains(G)){F=true}});if(F){I.stop();return false}else{G=G.parentNode}}this.toggle(H)}.create({"arguments":C,bind:this,event:true});document.addEvent("mousedown",this.fn);this.calendars.each(function(F){if(F==C){F.visible=true;F.button.addClass(this.classes.active)}else{F.visible=false;F.button.removeClass(this.classes.active)}},this);var B=window.getScrollSize();var E=C.button.getCoordinates();var A=E.right+this.options.tweak.x;var D=E.top+this.options.tweak.y;if(!this.calendar.coord){this.calendar.coord=this.calendar.getCoordinates()}if(A+this.calendar.coord.width>B.x){A-=(A+this.calendar.coord.width-B.x)}if(D+this.calendar.coord.height>B.y){D-=(D+this.calendar.coord.height-B.y)}this.calendar.setStyles({left:A+"px",top:D+"px"});if(window.ie6){this.iframe.setStyles({height:this.calendar.coord.height+"px",left:A+"px",top:D+"px",width:this.calendar.coord.width+"px"})}this.display(C);this.fx.start("opacity",0,1)}},unformat:function(B,G){G=G.escapeRegExp();var I={d:"([0-9]{2})",j:"([0-9]{1,2})",D:"("+this.options.days.map(function(J){return J.substr(0,3)}).join("|")+")",l:"("+this.options.days.join("|")+")",S:"(st|nd|rd|th)",F:"("+this.options.months.join("|")+")",m:"([0-9]{2})",M:"("+this.options.months.map(function(J){return J.substr(0,3)}).join("|")+")",n:"([0-9]{1,2})",Y:"([0-9]{4})",y:"([0-9]{2})"};var D=[];var F="";for(var C=0;C<G.length;C++){var H=G.charAt(C);if(I[H]){D.push(H);F+=I[H]}else{F+=H}}var E=B.match("^"+F+"$");var A=new Array(3);if(E){E=E.slice(1);D.each(function(K,J){J=E[J];switch(K){case"y":J="19"+J;case"Y":A[0]=J.toInt();break;case"F":J=J.substr(0,3);case"M":J=this.options.months.map(function(L){return L.substr(0,3)}).indexOf(J)+1;case"m":case"n":A[1]=J.toInt()-1;break;case"d":case"j":A[2]=J.toInt();break}},this)}return A},value:function(B){var A=null;if(B.val){if(B.year==B.val.getFullYear()&&B.month==B.val.getMonth()){A=B.val.getDate()}}return A},values:function(F){var C,E,H;F.els.each(function(I){if(I.get("tag")=="select"){if(I.format.test("(y|Y)")){C=[];I.getChildren().each(function(J){var K=this.unformat(J.value,I.format);if(!C.contains(K[0])){C.push(K[0])}},this);C.sort(this.sort)}if(I.format.test("(F|m|M|n)")){E=[];I.getChildren().each(function(J){var K=this.unformat(J.value,I.format);if($type(K[0])!="number"||K[0]==F.year){if(!E.contains(K[1])){E.push(K[1])}}},this);E.sort(this.sort)}if(I.format.test("(d|j)")&&!I.format.test("^(d|j)$")){H=[];I.getChildren().each(function(J){var K=this.unformat(J.value,I.format);if(K[0]==F.year&&K[1]==F.month){if(!H.contains(K[2])){H.push(K[2])}}},this)}}},this);var G=1;var D=new Date(F.year,F.month+1,0).getDate();if(F.year==F.start.getFullYear()){if(E==null&&this.options.navigation==2){E=[];for(var B=0;B<12;B++){if(B>=F.start.getMonth()){E.push(B)}}}if(F.month==F.start.getMonth()){G=F.start.getDate()}}if(F.year==F.end.getFullYear()){if(E==null&&this.options.navigation==2){E=[];for(var B=0;B<12;B++){if(B<=F.end.getMonth()){E.push(B)}}}if(F.month==F.end.getMonth()){D=F.end.getDate()}}var A=this.blocked(F);if($type(H)=="array"){H=H.filter(function(I){if(I>=G&&I<=D&&!A.contains(I)){return I}})}else{H=[];for(var B=G;B<=D;B++){if(!A.contains(B)){H.push(B)}}}H.sort(this.sort);return{days:H,months:E,years:C}},write:function(A){this.rebuild(A);A.els.each(function(B){if(A.val){nowtime=new Date();newval=this.format(A.val,B.format)+" "+this.currentTime();oldval=B.value;B.value=newval;if(newval!=oldval){this.fireEvent("onChange",this.element)}}},this)},currentTime:function(){var B="";var C=new Date();var D=C.getHours();if(D<12){B="am"}else{B="PM"}if(D==0){D=12}else{if(D>12){D=D-12}}var A=C.getMinutes();A=A+"";if(A.length==1){A="0"+A}return D+":"+A+" "+B}});Calendar.implement(new Events,new Options);var historical={series:false,step_day:5,step_week:10,step_month:20,show_more_points:function(){historical.step_day=1;historical.step_week=5;historical.step_month=10;historical.main_cback();historical.uptime_display();historical.twitter_display()},show_less_points:function(){historical.step_day=5;historical.step_week=10;historical.step_month=20;historical.main_cback();historical.uptime_display()},display:function(url){if(!superfly.hasFlash()){var error=new Element("li",{html:'You need flash to view chartbeat.  Please go <a href="http://get.adobe.com/flashplayer/">here</a> to install it.',id:"error"});$("mainhistorical").setStyle("display","none");$("allhistorical").adopt(error);showAlert("error","error");return }historical.main_cback=function(){var alerts=historical.split_data(historical.alerts_data);var data=historical.snapdays_data;var days=new Array();for(var day in data){var obj=new Object();obj.date=day;obj.data=data[day];days.push(obj)}if(!days.length||(days.length==1&&!days[0].data["return"].length)){$("allhistorical").innerHTML="<h1>Not enough data yet.  Please refresh this page in about 5 minutes.</h1>";return }historical.today_snapdata=historical.pull_data(days,1,historical.step_day,30);historical.week_snapdata=historical.pull_data(days,7,historical.step_week,30);historical.month_snapdata=historical.pull_data(days,30,historical.step_month,30);historical.ran_main_cback=true;historical.newret_chart("nr_today_chart",historical.today_snapdata,alerts.today,850,300,"time_only",true);historical.newret_chart("nr_week_chart",historical.week_snapdata,alerts.week,425,200,"day_time",false);historical.newret_chart("nr_month_chart",historical.month_snapdata,alerts.month,425,200,"day_time",false);historical.rwi_chart("rwi_today_chart",historical.today_snapdata,alerts.today,850,300,"time_only",true);historical.rwi_chart("rwi_week_chart",historical.week_snapdata,alerts.week,425,200,"day_time",false);historical.rwi_chart("rwi_month_chart",historical.month_snapdata,alerts.month,425,200,"day_time",false)};function snapdays_cback(data){eval("historical.snapdays_data = "+data)}function alerts_cback(data){eval("historical.alerts_data = "+data)}function uptime_cback(data){eval("historical.uptime_data = "+data)}historical.uptime_main_cback=function(){historical.uptime_display()};function twitter_cback(data){eval("historical.twitter_data = "+data);historical.twitter_display()}historical.twitter_display=function(){var data=historical.twitter_data;var keywords=new Array();for(var keyword in data){var days=new Array();for(var day in data[keyword]){var obj=new Object();obj.date=day;obj.data=data[keyword][day];days.push(obj)}keywords[keyword]=days}var today_data=historical.pull_twitter_data(keywords,1,historical.step_day,30);var week_data=historical.pull_twitter_data(keywords,7,historical.step_week*3,30);var month_data=historical.pull_twitter_data(keywords,30,historical.step_month*3,30);historical.twitter_chart("twitter_today_chart",today_data,850,300,"time_only",true);historical.twitter_chart("twitter_week_chart",week_data,425,200,"day_time",false);historical.twitter_chart("twitter_month_chart",month_data,425,200,"day_time",false)};historical.uptime_display=function(){var data=historical.uptime_data;var days=new Array();for(var day in data){var obj=new Object();obj.date=day;obj.data=data[day];days.push(obj)}var today_data=historical.pull_data(days,1,historical.step_day,30);var week_data=historical.pull_data(days,7,historical.step_week,30);var month_data=historical.pull_data(days,30,historical.step_month,30);historical.uptime_chart("uptime_today_chart",today_data,historical.today_snapdata,850,300,"time_only",true);historical.uptime_chart("uptime_week_chart",week_data,historical.week_snapdata,425,200,"day_time",false);historical.uptime_chart("uptime_month_chart",month_data,historical.month_snapdata,425,200,"day_time",false)};var d=new Date();var reqargs={host:url,api:"pages",since:Math.round(d.getTime()/1000)-(60*60*24*30),apikey:superfly.apikey};new Request({url:"/dashapi/snapdays/",onComplete:snapdays_cback}).GET(reqargs);new Request({url:"/dashapi/uptime/",onComplete:uptime_cback}).GET(reqargs);new Request({url:"/dashapi/alerts/",onComplete:alerts_cback}).GET(reqargs);new Request({url:"/dashapi/twitterstats/",onComplete:twitter_cback}).GET(reqargs);var interv=null;function check_ready(){if(historical.alerts_data&&historical.snapdays_data){clearInterval(interv);historical.main_cback();$("morepoints").setStyle("display","block")}}function check_ready_uptime(){if(historical.uptime_data&&historical.ran_main_cback){clearInterval(interv2);historical.uptime_main_cback()}}interv=setInterval(check_ready,50);interv2=setInterval(check_ready_uptime,50)},split_data:function(C){var A=new Date();var H=new Date(A.getMonth()+1+"/"+A.getDate()+"/"+A.getFullYear());var B=new Date(H.getTime()-(1000*60*60*24*7));var E=new Array();var D=new Array();var F=new Array();for(var I=0;I<C.length;++I){var G=new Date(C[I].time.replace(/-/g,"/"));F.push(C[I]);if(G>=B){D.push(C[I])}if(G>=H){E.push(C[I])}}return{today:E,week:D,month:F}},generate_all_count_times:function(I,C){var A=new Array();var H=new Date(I.replace(/-/g,"/"));var B=new Date((new Date()).getTime()-((C>5)?C/3:C)*60*1000);if(H.getDate()==B.getDate()&&H.getDay()==B.getDay()&&H.getFullYear()==B.getFullYear()){var G=B.getHours();var J=B.getMinutes()}for(var D=0;D<24;D++){for(var E=0;E<60;E+=C){if(D>G){return A}if(D==G&&E>=J){return A}rhour=D;if(D<10){rhour="0"+D}rmin=E;if(E<10){rmin="0"+E}var F=new Object();F.time=rhour+":"+rmin;F.date=I+" "+F.time;F.count=0;A.push(F)}}return A},pull_twitter_data:function(G,S,F,U){if(!F){F=1}var A=new Array();var B=(new Date()).getTime();for(var J=S-1;J>=0;--J){var C=60*60*24*1000;var N=new Date(B-(C*J));var R=N.getFullYear();var Q=N.getMonth()+1;var L=N.getDate();if(Q<10){Q="0"+Q}if(L<10){L="0"+L}A.push(R+"-"+Q+"-"+L)}var K=new Array();for(var O in G){if(!O||!G[O]||typeof (G[O])!="object"||!G[O].length){continue}var T=new Array();for(var J=0;J<A.length;++J){for(var I=0;I<G[O].length;++I){var E=false;if(A[J]==G[O][I].date){E=true;var P=this.generate_all_count_times(G[O][I].date,F);var M=this.bucketize_twitter_data(G[O][I].data.counts,F);for(var H=0;H<P.length;++H){var D=M[P[H].time];if(D){P[H].count=D}}T=T.concat(P)}if(E){break}}if(!E){var P=this.generate_all_count_times(A[J],F);T=T.concat(P)}}K[O]=T}return K},pull_data:function(N,M,F,J){if(!F){F=1}var B=N.length-M;if(B<0){B=0}var I=new Array();var A=new Object();var G=0;var E=0;for(var L=B;L<N.length;++L){for(var H in N[L].data){if(!I[H]){I[H]=new Array()}for(var K=0;K<N[L].data[H].length;K++){if(H=="valid"){if(N[L].data[H][K]){G++}E++}if(K%F!=0){continue}var D=N[L].data[H][K];I[H].push(D);if(H=="new"||H=="return"||H=="people"||H=="read"||H=="write"||H=="idle"||H=="domload"||H=="loadtime"){if(!A[H+"_sma"]){A[H+"_sma"]=new Array()}A[H+"_sma"].push(D);if(A[H+"_sma"].length<J){if(!I[H+"_sma"]){I[H+"_sma"]=new Array()}}else{A[H+"_sma"].shift()}I[H+"_sma"].push(historical.calc_sma(A[H+"_sma"]))}}}}if(E){var C=G/E*100;C=Math.round(C*10000)/10000;I.uptime=C}return I},calc_sma:function(C){var B=0;for(var A=0;A<C.length;++A){B+=C[A]}return Math.round(B/C.length*1000)/1000},bucketize_twitter_data:function(B,A){var D=new Array();for(var C in B){p=C.split(":");ntime=p[1]-(p[1]%A);if(ntime<10){ntime="0"+ntime}ttime=p[0]+":"+ntime;if(!D[ttime]){D[ttime]=B[C]}else{D[ttime]+=B[C]}}return D},twitter_chart:function(C,T,L,S,N,A){var H=new Array();var U=new StringBuffer();var I=false;for(var K in T){if(typeof (T[K])!="object"||!T[K].length){continue}var B=new StringBuffer();var V="";for(var J=0;J<T[K].length;++J){if(!I){var Q=new Date(T[K][J].date.replace(/-/g,"/"));if(N=="time_only"){var G=superfly.prettyclocktime(0,false,Q)}else{if(N=="day_time"){var G=superfly.timestampdate(0,Q)}else{var G=superfly.timestampjustdate(0,Q)}}U.append('<value xid="'+J+'">'+G+"</value>")}V=T[K][J].count;B.append('<value xid="'+J+'">'+V+"</value>")}I=true;var O=new Object();O.data=B;O.keyword=K;O.lastval=V;H.push(O)}if(H.length){function D(X,W){if(X.lastval>W.lastval){return -1}if(X.lastval<W.lastval){return 1}return 0}H.sort(D);var E=["#53777A","#542437","#C02942","#D95B43","#ECD078"];var R=new StringBuffer();for(var J=0;J<H.length;++J){if(E[J]){var M=E[J]}else{var M=""}var P=H[J].keyword.replace(/\"/g,"");R.append('<graph title="'+P+'" gid="'+J+'" vertical_lines="true" line_alpha="0" color="'+M+'" color_hover="'+M+'" balloon_text="'+P+' - {value} tweets">'+H[J].data+"</graph>")}var F="<chart><series>"+U+"</series><graphs>"+R+"</graphs></chart>";historical.barchart(C,F,L,S,A)}else{this.not_enough_data(C)}},not_enough_data:function(A){$(A).innerHTML="Not enough data yet.  Please try back later.";$(A).setStyle("height","50px")},uptime_chart:function(B,X,F,O,W,U,A){var Y=new StringBuffer();var N=new StringBuffer();var S=new StringBuffer();var R=new StringBuffer();var P=new StringBuffer();var L=new StringBuffer();var Q="";if(X.snaptime.length>1){var K=0;var I=0;var C=0;for(var H=0;H<X.snaptime.length;++H){var V=new Date(X.snaptime[H].replace(/-/g,"/")+superfly.tzoffset());if(U=="time_only"){var E=superfly.prettyclocktime(0,false,V)}else{if(U=="day_time"){var E=superfly.timestampdate(0,V)}else{var E=superfly.timestampjustdate(0,V)}}Y.append('<value xid="'+H+'">'+E+"</value>");var Z=X.loadtime[H]/1000;S.append('<value xid="'+H+'">'+Z+"</value>");var M=X.loadtime_sma[H]/1000;N.append('<value xid="'+H+'">'+M+"</value>");if(F.snaptime[K]==X.snaptime[H]){var J=F.domload[K]/1000;P.append('<value xid="'+H+'">'+J+"</value>");var T=F.domload_sma[K]/1000;L.append('<value xid="'+H+'">'+T+"</value>");K++;I=J;C=T}else{if(F.snaptime[K]&&new Date(F.snaptime[K].replace(/-/g,"/")+superfly.tzoffset())<V){K++;P.append('<value xid="'+H+'">'+I+"</value>");L.append('<value xid="'+H+'">'+C+"</value>")}else{P.append('<value xid="'+H+'">'+I+"</value>");L.append('<value xid="'+H+'">'+C+"</value>")}}if(!X.valid[H]){var G=X.errmsg[H];if(!G){G="Page did not load or timed out."}R.append('<value xid="'+H+'" description="'+G+'">0</value>')}}if(X.uptime){Q="<labels><label><x>!142</x><y>0</y><text><![CDATA[Uptime: "+X.uptime+"%]]></text><text_size>14</text_size><text_color>#028c16</text_color></label></labels>"}var D="<chart><series>"+Y+'</series><graphs><graph gid="1" color="#d6b852" color_hover="#d6b852" fill_color="#d6b852" fill_alpha="10" balloon_text="{value} user load time" title="User load time">'+P+'</graph><graph gid="2" color="#947f39" color_hover="#947f39" balloon_text="{value} user load time avg" title="User load time avg">'+L+'</graph><graph gid="3" title="Server load time" color="#028c16" color_hover="#028c16" fill_color="#028c16" fill_alpha="10" balloon_text="{value} server load time">'+S+'</graph><graph gid="4" color="#ff0000" bullet="/flash/downtime.swf" bullet_size="16" bullet_color="#ff0000" vertical_lines="true" balloon_text="{description}" visible_in_legend="false">'+R+'</graph><graph gid="5" color="#01460b" color_hover="#01460b" balloon_text="{value} server load time avg" title="Server load time avg">'+N+"</graph></graphs>"+Q+"</chart>";historical.sparkline(B,D,O,W,A)}else{this.not_enough_data(B)}},rwi_chart:function(J,E,B,A,L,I,M){var O=new StringBuffer();var N=new StringBuffer();var F=new StringBuffer();var C=new StringBuffer();var P=new StringBuffer();historical.iterate_alert();if(E.snaptime.length>1){for(var K=0;K<E.snaptime.length;++K){var H=new Date(E.snaptime[K].replace(/-/g,"/")+superfly.tzoffset());if(I=="time_only"){var G=superfly.prettyclocktime(0,false,H)}else{if(I=="day_time"){var G=superfly.timestampdate(0,H)}else{var G=superfly.timestampjustdate(0,H)}}O.append('<value xid="'+K+'">'+G+"</value>");N.append('<value xid="'+K+'">'+E.read[K]+"</value>");F.append('<value xid="'+K+'">'+E.write[K]+"</value>");C.append('<value xid="'+K+'">'+E.idle[K]+"</value>");P.append(historical.iterate_alert(B,["read","write","idle"],K,H))}var D="<chart><series>"+O+'</series><graphs><graph gid="3" title="Idle" vertical_lines="true" line_alpha="0" color="#bfa29c" color_hover="#bfa29c" balloon_text="{value} idle">'+C+'</graph><graph gid="4" color="#405797" bullet="/flash/alert.swf" bullet_size="7" bullet_color="#0000ff" vertical_lines="true" balloon_text_color="#ffffff" balloon_text="{description}" visible_in_legend="false">'+P+'</graph><graph gid="1" title="Reading" vertical_lines="true" line_alpha="0" color="#302e48" color_hover="#302e48" balloon_text="{value} reading">'+N+'</graph><graph gid="2" title="Writing" vertical_lines="true" line_alpha="0" color="#cc2a42" color_hover="#cc2a42" balloon_text="{value} writing">'+F+"</graph></graphs></chart>";historical.barchart(J,D,A,L,M)}else{this.not_enough_data(J)}},alert_phrase:function(D){var C={people:"total visitors","new":"new visitors","return":"returning visitors",read:"people reading",write:"people writing",idle:"people idle"};var B={above:"goes above",below:"goes below"};var A={max:"monthly max",min:"monthly min",avg:"monthly avg",oth:"other amount"};return C[D.metric]+" "+B[D.direction]+" "+((D.dynthreshold)?A[D.dynthreshold]:D.threshold+" "+((D.threshold==1)?"person":"people"))},iterate_alert:function(F,D,C,B){if(!F){historical.curalert=false;historical.alertpos=0;historical.found_alert=false;return }if(!historical.found_alert&&(!historical.curalert||(F.length&&historical.alertpos<F.length))){for(var A=historical.alertpos;A<F.length;++A){for(var G=0;G<D.length;++G){if(F[A].metric==D[G]){historical.curalert=F[historical.alertpos];historical.found_alert=true;break}}historical.alertpos++;if(historical.found_alert){break}}}alertdata="";if(historical.found_alert&&historical.curalert){var E=new Date(historical.curalert.time.replace(/-/g,"/")+superfly.tzoffset());if(E<=B){alertdata='<value xid="'+C+'" description="'+historical.alert_phrase(historical.curalert)+'">0</value>';historical.found_alert=false}}return alertdata},newret_chart:function(K,E,B,A,M,J,N){var O=new StringBuffer();var C=new StringBuffer();var Q=new StringBuffer();var H=new StringBuffer();var F=new StringBuffer();var P=new StringBuffer();historical.iterate_alert();if(E.snaptime.length>1){for(var L=0;L<E.snaptime.length;++L){var I=new Date(E.snaptime[L].replace(/-/g,"/")+superfly.tzoffset());if(J=="time_only"){var G=superfly.prettyclocktime(0,false,I)}else{if(J=="day_time"){var G=superfly.timestampdate(0,I)}else{var G=superfly.timestampjustdate(0,I)}}O.append('<value xid="'+L+'">'+G+"</value>");C.append('<value xid="'+L+'">'+E.people[L]+"</value>");Q.append('<value xid="'+L+'">'+E["return"][L]+"</value>");H.append('<value xid="'+L+'">'+E.people_sma[L]+"</value>");F.append('<value xid="'+L+'">'+E.return_sma[L]+"</value>");P.append(historical.iterate_alert(B,["people","new","return"],L,I))}var D="<chart><series>"+O+'</series><graphs><graph gid="1" vertical_lines="true" line_alpha="0"color="#F24444" color_hover="#f24444" title="Total people" balloon_text="{value} total">'+C+'</graph><graph gid="2" vertical_lines="true" line_alpha="0" color="#5ea3c2" color_hover="#5ea3c2" balloon_text="{value} returning" title="Returning people">'+Q+'</graph><graph gid="3" title="Total people avg" color="#a92f2f" color_hover="#a92f2f" balloon_text="" balloon_alpha="0" title="Average">'+H+'</graph><graph gid="4" title="Returning avg" color="#3f6e83" color_hover="#3f6e83" balloon_text="" balloon_alpha="0" title="Average">'+F+'</graph><graph gid="5" color="#405797" bullet="/flash/alert.swf" bullet_size="7" bullet_color="#0000ff" vertical_lines="true" balloon_text_color="#ffffff" balloon_text="{description}" visible_in_legend="false">'+P+"</graph></graphs></chart>";historical.barchart(K,D,A,M,N)}else{this.not_enough_data(K)}},sparkline:function(E,D,A,G,H){if(!H){var F="<values><x><enabled>false</enabled></x></values>"}else{var F="<values><x><enabled>true</enabled><frequency>2</frequency></x></values>"}var C="<settings><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><text_color>#333333</text_color><plot_area><margins><left>40</left><right>25</right><top>20</top><bottom>50</bottom></margins></plot_area><axes><x><color>#cccccc</color><width>1</width></x><y_left><color>#cccccc</color><width>1</width></y_left><y_right><color>#cccccc</color><width>1</width></y_right></axes><indicator><color>#666666</color><x_balloon_text_color>#ffffff</x_balloon_text_color></indicator><balloon><text_size>10</text_size></balloon><grid><x><approx_count>15</approx_count></x></grid><error_messages><enabled>false</enabled></error_messages><legend><text_size>12</text_size><enabled>true</enabled></legend>"+F+"</settings>";var I=E+"_flash";var B=superfly.addSwf("amline.swf",E,I,A,G,{chart_settings:C,chart_data:D,chart_id:I});return B},barchart:function(E,D,A,G,H){if(!H){var F="<values><x><enabled>false</enabled></x></values>"}else{var F="<values><x><enabled>true</enabled><frequency>2</frequency></x></values>"}var C="<settings><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><text_color>#333333</text_color><plot_area><margins><left>40</left><right>25</right><top>20</top><bottom>50</bottom></margins></plot_area><axes><x><color>#cccccc</color><width>1</width></x><y_left><color>#cccccc</color><width>1</width></y_left><y_right><color>#cccccc</color><width>1</width></y_right></axes><indicator><color>#666666</color><x_balloon_text_color>#ffffff</x_balloon_text_color></indicator><balloon><text_size>10</text_size></balloon><grid><x><approx_count>15</approx_count></x></grid><error_messages><enabled>false</enabled></error_messages><legend><text_size>12</text_size><enabled>true</enabled></legend><vertical_lines><width>80</width></vertical_lines>"+F+"</settings>";var I=E+"_flash";var B=superfly.addSwf("amline.swf",E,I,A,G,{chart_settings:C,chart_data:D,chart_id:I});return B}};var last_click=false;function amClickedOnSeries(A){var C=new Date();var B=C.getTime()/1000;if(last_click&&B-last_click<0.4){$("realtime").setStyle("display","block");$("mainhistorical").setStyle("display","none");if(A.indexOf("/")==-1){A=superfly.timestampjustdate(0,new Date())+" "+A}historical.series=A;superfly.startDashboard(main_url)}last_click=B}function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:"tab",activeclass:"active",callback:null,leavecallback:null};this.activebackup=null;for(var C in arguments[0]){this.defaults[C]=arguments[0][C]}this.getTabs=function(){var E=[];var G=document.getElementById(this.defaults.id).getElementsByTagName("*");var D=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var F=0;F<G.length;F++){if(D.test(G[F].className)){E.push(G[F])}}return E};this.links=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("a");this.listitems=document.getElementById(this.defaults.id+"-nav").getElementsByTagName("li");this.show=function(D){for(var E=0;E<this.tabs.length;E++){this.tabs[E].style.display=((E+1)==D)?"block":"none";if((E+1)==D){this.addClass(this.links[E],this.defaults.activeclass);this.addClass(this.listitems[E],this.defaults.activeclass)}else{this.removeClass(this.links[E],this.defaults.activeclass);this.removeClass(this.listitems[E],this.defaults.activeclass)}}if(this.defaults.leavecallback&&(D!=this.activebackup)){this.defaults.leavecallback(this.defaults.active)}this.activebackup=D;this.defaults.active=D;if(this.defaults.callback){this.defaults.callback(D)}};this.rotate=function(E){this.show(this.defaults.active);this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}var D=this;if(this.defaults.wait){clearTimeout(this.timer2)}this.timer1=setTimeout(function(){D.rotate(E)},E*1000)};this.next=function(){this.defaults.active++;if(this.defaults.active>this.tabs.length){this.defaults.active=1}this.show(this.defaults.active)};this.previous=function(){this.defaults.active--;if(!this.defaults.active){this.defaults.active=this.tabs.length}this.show(this.defaults.active)};this.gup=function(D){D=D.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var F="[\\?&]"+D+"=([^&#]*)";var G=new RegExp(F);var E=G.exec(window.location.href);if(E==null){return null}else{return E[1]}};this.parseurl=function(F){var E=this.gup(F);if(E==null){return null}if(parseInt(E)){return parseInt(E)}if(document.getElementById(E)){for(var D=0;D<this.tabs.length;D++){if(this.tabs[D].id==E){return(D+1)}}}return null};this.createCookie=function(E,G,H){if(H){var D=new Date();D.setTime(D.getTime()+(H*24*60*60*1000));var F="; expires="+D.toGMTString()}else{var F=""}document.cookie=E+"="+G+F+"; path=/"};this.readCookie=function(E){var H=E+"=";var D=document.cookie.split(";");for(var F=0;F<D.length;F++){var G=D[F];while(G.charAt(0)==" "){G=G.substring(1,G.length)}if(G.indexOf(H)==0){return G.substring(H.length,G.length)}}return null};this.contains=function(D,E,F){return D.indexOf(E,F)!=-1};this.hasClass=function(E,D){return this.contains(E.className,D," ")};this.addClass=function(E,D){if(!this.hasClass(E,D)){E.className=(E.className+" "+D).replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")}};this.removeClass=function(E,D){E.className=E.className.replace(new RegExp("(^|\\s)"+D+"(?:\\s|$)"),"$1");E.className.replace(/\s{2,}/g," ").replace(/^\s+|\s+$/g,"")};this.tabs=this.getTabs();this.defaults.active=(this.parseurl(this.defaults.id))?this.parseurl(this.defaults.id):this.defaults.active;if(this.defaults.persist&&this.readCookie(this.defaults.id)){this.defaults.active=this.readCookie(this.defaults.id)}this.activebackup=this.defaults.active;this.show(this.defaults.active);var A=this;for(var B=0;B<this.links.length;B++){this.links[B].customindex=B+1;this.links[B].onclick=function(){if(A.timer1){clearTimeout(A.timer1)}if(A.timer2){clearTimeout(A.timer2)}A.show(this.customindex);if(A.defaults.persist){A.createCookie(A.defaults.id,this.customindex,0)}if(A.defaults.wait){A.timer2=setTimeout(function(){A.rotate(A.defaults.interval)},A.defaults.wait*1000)}return false}}if(this.defaults.interval){this.rotate(this.defaults.interval)}}var utf8={encode:function(A){return unescape(encodeURIComponent(A))},decode:function(B){try{return decodeURIComponent(escape(B))}catch(A){return B}}};