	jQuery.preloadImages = function()
	{
		for(var i = 0; i<arguments.length; i++)
		{
			jQuery("<img>").attr("src", arguments[i]);
		}
	}
	
	$(window).bind('load', function() {
		$('.rollover img').each(function(elm) { 
			$.preloadImages($(this).attr("src").replace(".jpg", "_on.jpg"));
			$.preloadImages($(this).attr("src").replace(".gif", "_on.gif"));
		});
	});

	$(document).ready(function() {
	    $(".rollover").hover(
			function() {
			    if($(this).attr("src") && $(this).attr("src").indexOf("_on") == -1) {
			        var newSrc = $(this).attr("src").replace(".jpg", "_on.jpg");
			        $(this).attr("src", newSrc);
					var newSrcGif = $(this).attr("src").replace(".gif", "_on.gif");
			        $(this).attr("src", newSrcGif);
			    }
				else if($(this).css("background-image").indexOf("_on") == -1) {
					 var newSrc = $(this).css("background-image").replace(".jpg", "_on.jpg");
			        $(this).css("background-image", newSrc);
				}
			},
			function() {
			    if ($(this).attr("src") && $(this).attr("src").indexOf("_on") != -1) {
			        var oldSrc = $(this).attr("src").replace("_on.jpg", ".jpg");
			        $(this).attr("src", oldSrc);
					var oldSrcGif = $(this).attr("src").replace("_on.gif", ".gif");
			        $(this).attr("src", oldSrcGif);
			    }
				else if($(this).css("background-image").indexOf("_on") != -1) {
					 var oldSrc = $(this).css("background-image").replace("_on.jpg", ".jpg");
			        $(this).css("background-image", oldSrc);
				}
			}
		);
	});