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 //$(this).addClass('selected').css('outline', 'none').blur();
\r
14 $('ul.stat_'+divs+' li a[href="#'+target+'"]').addClass('selected').css('outline', 'none').blur();
\r
18 // Activate main tab
\r
19 if (location.hash) {
\r
20 $('#tabs ul#headers li a[href="'+location.hash+'"]').click();
\r
22 $('#tabs ul#headers li a:first').click();
\r
25 // Activate first line graph
\r
26 $('#stats_lines li a:first').click();
\r
29 $('#historical_clicks li:odd').css('background', '#FFE3BB');
\r
31 // Toggle detail lists
\r
32 $('a.details').click(function(){
\r
33 var target = $(this).attr('id').replace('more_', 'details_');
\r
34 $('#'+target).toggle();
\r
38 // If an image src is erroneous (404 or anything) replace it with a transparent gif
\r
39 $('.fix_images').each(function(i,img) {
\r
40 $(img).error(function(){
\r
41 $(img).attr('src', 'images/blank.gif');
\r