/*  File: basic.js          */
/*  By:   Jeremy Tredway    */
/*  Ver:  2008-02-17        */

/********************************
  the following routines require 
    jquery.js
*********************************/


// synchronize height function
(function($){$.fn.syncHeight=function(settings){var max=0;var browser_id=0;var property=[['min-height','0px'],['height','1%']];if($.browser.msie&&$.browser.version<7){browser_id=1;}
$(this).each(function(){$(this).css(property[browser_id][0],property[browser_id][1]);var val=$(this).height();if(val>max){max=val;}});$(this).each(function(){$(this).css(property[browser_id][0],max+'px');});return this;};})(jQuery);


function mycarousel_initCallback(carousel) {
	// disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});
	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});
	// pause autoscrolling if the user moves the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};


// onload routines
$(function(){

	// initialize home page rotation
	$("#home_highlight").jcarousel({
		auto: 6,
		scroll: 1,
		wrap: 'last',
		initCallback: mycarousel_initCallback
	});

	// sync home page columns
	$("#main_home .home_column").syncHeight();

});


