// rollover images 
// must be ordered in alternating states (up then over, up then over, ...):
var rollover_images = new Array(
  'images/footer_icon_gimp_up.gif',
  'images/footer_icon_gimp_over.gif',
  'images/footer_icon_inkscape_up.gif',
  'images/footer_icon_inkscape_over.gif',
  'images/footer_icon_geany_up.gif',
  'images/footer_icon_geany_over.gif'
);

// preload rollover images:
jQuery.preloadImages = function(){
  for(var i = 0; i<arguments.length; i++){
    jQuery('<img>').attr('src', arguments[i]);
  }
}
for(i=0; i<rollover_images.length; i++){
  $.preloadImages(rollover_images[i]);
}

$(document).ready(function(){
  
  // mouseovers:
  $('.rollover').mouseover(function(){
    for(i=0; i<rollover_images.length; i++){
      if($(this).attr('src') == rollover_images[i]){
        $(this).attr('src', rollover_images[i+1]);
        break;
      }
    }
  });
  // mouseouts:
  $('.rollover').mouseout(function(){
    for(i=0; i<rollover_images.length; i++){
      if($(this).attr('src') == rollover_images[i]){
        $(this).attr('src', rollover_images[i-1]);
        break;
      }
    }
  });
  
  // IE6 :hover fix:
  $('#windowsDownload').hover(function(){
     $(this).addClass('windowsDownloadHover');
  }, function() {
    $(this).removeClass('windowsDownloadHover');
  });

});



