//  chartswitch.js: -*- JavaScript -*- Not very scalable shizzle.
// 
//  AUTHOR: Curtis Taylor (info@icgsb.com)
//  DATE: Sat Feb 18 11:31:38 2006
//  
//  Copyright (c) 2006 Insource Consulting Group. The content presented herein
//  may not, under any circumstances, be reproduced in whole or in any part or
//  form without written permission from ICG.
//  
//  $Id:$
function switchChart() {

  var chartcell = document.getElementById("charts");
  var hrs = document.getElementById("hoursTab");
  var days = document.getElementById("daysTab");
  var ctry = document.getElementById("countryTab");
  var arry = new Array('hrs','days','ctry');

  hrs.onclick = function() {
    this.className = "selected";
    days.className = "";
    ctry.className = "";
    chartcell.className = "hourlyChart";
    // Force the browser to reload the image
    chartcell.style.background = "";
    chartcell.style.background = " #fff url('http://stats.denyhosts.net/hourly_abuse.png') no-repeat 50% 10%";
  }
  hrs.onmouseover = function() {
    this.style.cursor = "pointer";
    this.style.color = "#fc3";
  }
  hrs.onmouseout = function() {
    this.style.color = "#fff";
  }

  days.onclick = function() {
    this.className = "selected";
    hrs.className = "";
    ctry.className = "";
    chartcell.className = "dailyChart";
    chartcell.style.background = "";
    chartcell.style.background = " #fff url('http://stats.denyhosts.net/daily_abuse.png') no-repeat 50% 10%";
  }
  days.onmouseover = function() {
    this.style.cursor = "pointer";
    this.style.color = "#fc3";
  }
  days.onmouseout = function() {
    this.style.color = "#fff";
  }

  ctry.onclick = function() {
    this.className = "selected";
    hrs.className = "";
    days.className = "";
    chartcell.className = "countryChart";
    chartcell.style.background = "";
    chartcell.style.background = "#fff url('http://stats.denyhosts.net/country_abuse.png') no-repeat 50% 10%";
  }
  ctry.onmouseover = function() {
    this.style.cursor = "pointer";
    this.style.color = "#fc3";
  }
  ctry.onmouseout = function() {
    this.style.color = "#fff";
  }
}

window.onload = switchChart;
