cnnva=function(A){this.barchart=this.barchart("cnnva","",600,250);this.datacount=0;this.inited=false;this.lastashton=0;this.lastcnn=0;this.curashton=0;this.curcnn=0};cnnva.prototype.barchart=function(E,H,C,G){var B="<values><x><enabled>true</enabled><frequency>2</frequency></x><y_left><min>1100000</min><max>2000000</max></y_left></values>";var A="<settings><decimals_separator>.</decimals_separator><thousands_separator>,</thousands_separator><text_color>#333333</text_color><plot_area><margins><left>100</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>"+B+"</settings>";var D=E+"_flash";var F=superfly.addSwf("amline.swf",E,D,C,G,{chart_settings:A,chart_data:"<chart></chart>",chart_id:D});return F};cnnva.prototype.draw=function(H){var C=new StringBuffer();var D=new StringBuffer();var B=new StringBuffer();for(var A=0;A<H.length;++A){if(H[A]["time"]){var G=new Date(H[A]["time"]*1000)}else{var G=new Date()}var F=superfly.prettyclocktime(0,false,G);C.append('<value xid="'+this.datacount+'">'+H[A]["ashton"]+"</value>");D.append('<value xid="'+this.datacount+'">'+H[A]["cnn"]+"</value>");B.append('<value xid="'+this.datacount+'">'+F+"</value>");this.datacount++}var E="<chart><series>"+B+'</series><graphs><graph gid="1" line_width="2" color="#ca0002" color_hover="#ca0002" balloon_text="{value} followers" title="CNN\'s Followers">'+D+'</graph><graph gid="2" line_width="2" color="#00c5ea" color_hover="#00c5ea" title="Ashton\'s Followers" balloon_text="{value} followers">'+C+"</graph></graphs></chart>";if(!this.inited){this.barchart.setData(E);this.inited=true}else{this.barchart.appendData(E)}if(H.length==1){this.lastashton=H[0]["ashton"];this.lastcnn=H[0]["cnn"];setTimeout(func,60000)}else{this.lastashton=H[H.length-1]["ashton"];this.lastcnn=H[H.length-1]["cnn"];this.curashton=H[H.length-2]["ashton"];this.curcnn=H[H.length-2]["cnn"];$("ashtoncnt").set("html",superfly.add_commas(this.curashton));$("cnncnt").set("html",superfly.add_commas(this.curcnn))}};cnnva.prototype.upt=function(){if(this.curashton==0||this.curcnn==0){return }var B=this.getinc(this.curashton,this.lastashton);if(B){this.curashton+=B;$("ashtoncnt").set("html",superfly.add_commas(this.curashton));$("ashtoncnt").highlight()}var A=this.getinc(this.curcnn,this.lastcnn);if(A){this.curcnn+=A;$("cnncnt").set("html",superfly.add_commas(this.curcnn));$("cnncnt").highlight()}};cnnva.prototype.getinc=function(E,B){if(E<B){var D=B-E;var A=Math.floor(Math.random()*3);var C=Math.ceil(D/60)*A;if(E+C>B){C=B-E}return C}else{if(E>B){var D=E-B;var A=Math.floor(Math.random()*3);var F=Math.ceil(D/60)*A;if(E-F<B){F=E-B}return -1*F}}return 0};cnnva.prototype.request=function(A){var B={rnd:Math.random()};if(A){B.all=true}new Request.JSON({url:"/dashapi/cnnvsashton/",onComplete:data_cback}).GET(B)};