jQuery(function () {
  
});

jQuery(window).load(function(){
  initImageRotator();
  levelOutLayoutCols();
});

/*
Starts the Nivo Slider image gallery.
For more information about the plugin:
http://nivo.dev7studios.com
http://nivo.dev7studios.com/support/jquery-plugin-usage/
*/
function initImageRotator() {
  var nivoSlider = jQuery('.nivoSlider');
  if(nivoSlider.children().length > 1){
    nivoSlider.nivoSlider({effect:'fade'});
  }
}

/*
Will assure that all content columns are the same height.
A small hax for the greater good.
*/
function levelOutLayoutCols(){
  var cols = jQuery('#left, #main, #right');
  if(cols[0]){
    var height = 0;
    cols.each(function(){
      var tmpHeight = jQuery(this).height();
      if(tmpHeight > height){
        height = tmpHeight;
      }
    });
    
    cols.height(height);
  }
}
