
var cats = [["ge","30px,75px"],["partnerships","30px,75px"],["push","35px,38px"],["media","31px,5px"],["policy","22px,21px"]];
var cat_index = 0;
var timer;

function m_over(id) {
  window.clearInterval(timer);
  flip_main(id);
}

function flip_main(id) {
  var main_area;
  var img;
  var pad;
  if (document.getElementById) {
    main_area = document.getElementById('main_area');
    img = document.getElementById(id);
  } else if (document.all) {
    main_area = document.all['main_area'];
    img = document.all[id];
  }
  if (main_area) {
    main_area.style.backgroundImage = 'url(http://i.leadersinlearningawards.org/clla_'+id+'.jpg)';
    for (var x=0;x<cats.length;x++) {
      if (document.getElementById) {
        document.getElementById(cats[x][0]).src = 'http://i.leadersinlearningawards.org/clla_'+cats[x][0]+'.gif';
      }
      if (id == cats[x][0]) {
        pad = cats[x][1];
      }
    }
    main_area.style.padding = pad;
    img.src ='http://i.leadersinlearningawards.org/clla_'+id+'_on.gif';
  }
}

function cycle_cats() {
  if (cats[cat_index+1]) {
    cat_index++;
  } else {
    cat_index = 0;
  }
  flip_main(cats[cat_index][0]);
}

function start_cycle () {
  timer = window.setInterval('cycle_cats()',4000);
  flip_main(cats[cat_index][0]);
}
