2 $(document).ready(function(){
\r
3 $('ul.toggle_display').css('display', 'block');
\r
4 $('.tab h2').css('display','none');
\r
7 $('ul.toggle_display li a').click(function(){
\r
8 var target = $(this).attr('href').replace('#', ''); // 'stat_tab_location'
\r
9 var divs = target.split('_')[1]; // 'tab'
\r
10 $('div.'+divs).css('display', 'none');
\r
11 $('div#'+target).css('display', 'block');
\r
12 $('ul.stat_'+divs+' li a').removeClass('selected');
\r
13 $('ul.stat_'+divs+' li a[href="#'+target+'"]').addClass('selected').css('outline', 'none').blur();
\r
17 // Activate main tab
\r
18 if (location.hash) {
\r
19 $('#tabs ul#headers li a[href="'+location.hash+'"]').click();
\r
21 $('#tabs ul#headers li a:first').click();
\r
24 // Activate first line graph
\r
25 $('#stats_lines li a:first').click();
\r
28 $('#historical_clicks li:odd').css('background', '#E3F3FF');
\r
30 // Toggle detail lists
\r
31 $('a.details').click(function(){
\r
32 var target = $(this).attr('id').replace('more_', 'details_');
\r
33 $('#'+target).toggle();
\r
37 // If an image src is erroneous (404 or anything) replace it with a transparent gif
\r
38 $('.fix_images').each(function(i,img) {
\r
39 $(img).error(function(){
\r
40 $(img).attr('src', 'images/blank.gif');
\r
44 // If we have the zeroclipboard thing, init it when Share Tab is displayed
\r
45 $('#tabs ul#headers li a[href="#stat_tab_share"]').click(function(){
\r