$(document).ready(function(){
	jQuery.preloadimages = function() {
		for(var i = 0; i<arguments.length; i++) {
			jQuery("<img>").attr("src", arguments[i]);
		}
	}
	
	$.preloadimages("images/nav_sophie_over.gif", "images/nav_books_over.gif",
					"images/nav_appearances_over.gif", "images/nav_contact_over.gif", "images/nav_news_over.gif");

	$('#sophie').hover(function() {
		$(this).attr("src","images/nav_sophie_over.gif");
			}, function() {
		$(this).attr("src","images/nav_sophie.gif");
	});
	
	$('#books').hover(function() {
		$(this).attr("src","images/nav_books_over.gif");
			}, function() {
		$(this).attr("src","images/nav_books.gif");
	});
	
	$('#appearances').hover(function() {
		$(this).attr("src","images/nav_appearances_over.gif");
			}, function() {
		$(this).attr("src","images/nav_appearances.gif");
	});
	
	$('#contact').hover(function() {
		$(this).attr("src","images/nav_contact_over.gif");
			}, function() {
		$(this).attr("src","images/nav_contact.gif");
	});
	
	$('#news').hover(function() {
		$(this).attr("src","images/nav_news_over.gif");
			}, function() {
		$(this).attr("src","images/nav_news.gif");
	});
	
});