$(document).ready(function() {
	// card list hover with zindex fix
	$("ul#cardlist li a").hover(function() {
		$(this).children("img").show();
		$(this).css("z-index", 100);
	}, function() {
		$(this).children("img").hide();
		$(this).css("z-index", 1);
	});

	// add hover color to input buttons in IE6
	$("div.buttons input").hover(function() {
		$(this).addClass("hover");
	}, function() {
		$(this).removeClass("hover");
	});

	// main nav rollovers
	var preLoadArray = new Array();
	$("div#nav a img").each(function(i) {
		// get our current image path info
		var imgSrc = $(this).attr("src");
		var imgParts = imgSrc.split("/");
		var imgFile = imgParts.pop();
		var imgPath = imgParts.join("/");

		// get our rollover image info and image id
		var imgFileExt = imgFile.split(".").pop();
		var imgFileNum = imgFile.split(".")[0].split("_").pop();
		var imgRollOver = imgPath + "/rollovers/" + "nav_roll_" + imgFileNum + "." + imgFileExt;

		// preload the rollover images
		preLoadArray[i] = new Image();
		preLoadArray[i].src = imgRollOver;

		// bind the hover action to this image to give us the rollover effect
		$(this).hover(function() {
			$(this).attr("src", preLoadArray[i].src);
		},function() {
			$(this).attr("src", imgSrc);
		});
	});
});
