jQuery(document).ready(function() {
	// hide search background image on click
	$(".googlesearch").bind("click", function() {
		$(this).css("background-image", "none");
	});
	
	$(".jcarousel").jcarousel({
		scroll: 1,
		visible: 1,
		initCallback: jCinitCallback,
		// do not autobuild prev/next buttons
		buttonNextHTML: null,
		buttonPrevHTML: null
	});
	
	$(".jcarousel-control a").bind("click", function() { 
		// add active class
		$(".jcarousel-control a").removeClass("active");
		$(this).toggleClass("active");
	});
	
});

function jCinitCallback(carousel) {
	$(".jcarousel-control a").bind("click", function() {
		// remove hidden class just in case
		$(".jcarousel-clip").removeClass("hidden");
		// tweaked to use id's instead of numbers
		carousel.scroll(jQuery.jcarousel.intval(getNumById(this.id)));
		return false;
	});
}