$(function(){function getStats(){$.getJSON("http://demo.firerift.com/api/blog/blog_entries/count?user_id="+$.session.user.id,function(data){$("#you-stats-body b.blog_entry_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/galleries/count?user_id="+$.session.user.id,function(data){$("#you-stats-body b.gallery_count").text(data);});$.getJSON("http://demo.firerift.com/api/dashboard/media_items/count?type=jpg,png,gif&user_id="+$.session.user.id,function(data){$("#you-stats-body b.image_count").text(data);});$.getJSON("http://demo.firerift.com/api/dashboard/media_items/count?type=mov,mpg,mpeg,avi,wmv,embed&user_id="+$.session.user.id,function(data){$("#you-stats-body b.video_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/media_item_comments/count?parent_user_id="+$.session.user.id,function(data){var comments=data;$.getJSON("http://demo.firerift.com/api/blog/blog_entry_comments/count?parent_user_id="+$.session.user.id,function(data){$("#you-stats-body b.comment_count").text((comments+data));});});}
getStats();$("#everyone-stats").click(function(){if(!$("#everyone-stats-body").attr("class")||deleteHappenedA=="TRUE"){$("#stats-body .dash-sidebar").clone().attr("id","everyone-stats-body").hide().prependTo("#stats-body");$.getJSON("http://demo.firerift.com/api/blog/blog_entries/count",function(data){$("#everyone-stats-body b.blog_entry_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/galleries/count",function(data){$("#everyone-stats-body b.gallery_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/media_items/count?type[0]=jpg&type[1]=png&type[2]=gif",function(data){$("#everyone-stats-body b.image_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/media_items/count?type[0]=mov&type[1]=mpg&type[2]=mpeg&type[3]=wmv&type[4]=avi&type[5]=embed",function(data){$("#everyone-stats-body b.video_count").text(data);});$.getJSON("http://demo.firerift.com/api/gallery/media_item_comments/count",function(data){var comments=data;$.getJSON("http://demo.firerift.com/api/blog/blog_entry_comments/count",function(data){$("#everyone-stats-body b.comment_count").text((comments+data));});});deleteHappenedA="FALSE";}
$(this).addClass("active");$("#you-stats").removeClass("active");$("#you-stats-body").hide();$("#everyone-stats-body").show();return false;});$("#you-stats").click(function(){$(this).addClass("active");$("#everyone-stats").removeClass("active");$("#everyone-stats-body").hide();$("#you-stats-body").show();if(deleteHappenedB=="TRUE"){getStats();deleteHappenedB="FALSE";}
return false;});});