var slideShow = null;
var msie = false;

$(function() {
  //CAL-15
  //temporary workaround - this causes a problem in IE8 and probably older versions too so
  //I'm disabling it'
  if ($.browser.msie != null) msie = true;
  
  if (!msie) {
    slideShow = $('.slideContainer').slideShow({
      interval: 3
    });
  }

  $('#icons a').hover(function() {
    var panel = $(this).attr('rel');
    if (!msie && slideShow != null) {
      var slideNum = parseInt(panel.replace('#panel', '')) - 1;
      slideShow.gotoSlide(slideNum);
      slideShow.mouse.over = true;
      slideShow.stopAuto();
      return false;
    } else {
      $('#icons a').removeClass('current');
      $(this).addClass('current');
      $('.hero .panel').hide();
      $(panel).show();
      return false;
    }
  }, function() {
     if (!msie && slideShow != null) {
        slideShow.mouse.over = false;
        slideShow.auto();
     }
  });
});
