$(document).ready(function() {

	// slide carousel for home page
	// test for existence, as the required script is linked only from home page
	if (jQuery.isFunction(jQuery.fn.jcarousel)) {
			$('#mycarousel').jcarousel();
	}

	// Preload all rollovers
	$("#logo h1 img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace('_off', '_on');
		newImg = new Image(); 				// create new image obj
		$(newImg).attr("src", rollON);	// set new obj's src
	});


	// Navigation rollovers
	$("#logo h1 a[href]").mouseover(function(){
		imgsrc = $(this).children("img").attr("src");

		if (typeof(imgsrc) != 'undefined') {
			imgsrcON = imgsrc.replace('_off', '_on');
			$(this).children("img").attr("src", imgsrcON);
		}

	});

	// Handle mouseout
	$("#logo h1 a[href]").mouseout(function(){
			if (typeof(imgsrc) != 'undefined') {
			$(this).children("img").attr("src", imgsrc);
		}
	});

});
