$(document).ready(function(){
	jQuery.preloadimages = function() {
		for(var i = 0; i<arguments.length; i++) {
			jQuery("<img>").attr("src", arguments[i]);
		}
	}
	
	$.preloadimages("images/nav-liz-over.png", "images/nav-books-over.png",
					"images/nav-events-over.png", "images/nav-blog-over.png",
					"images/nav-contact-over.png", "images/top-blog-over.gif", "images/top-contact-over.gif", "images/top-liz1-over.gif",
					"images/top-liz2-over.gif", "images/top-love-over.gif", "images/tweet-over.png", "images/top-events-over.gif", "images/top-home-over.gif", "images/top-books-over.gif");

	$('#liz').hover(function() {
		$(this).attr("src","images/nav-liz-over.png"), $('#topliz1').attr("src","images/top-liz1-over.gif"), $('#topliz2').attr("src","images/top-liz2-over.gif");
			}, function() {
		$(this).attr("src","images/nav-liz.png"), $('#topliz1').attr("src","images/top-liz1.gif"), $('#topliz2').attr("src","images/top-liz2.gif");
	});
	
	$('#books').hover(function() {
		$(this).attr("src","images/nav-books-over.png"), $('#topbooks').attr("src","images/top-books-over.gif");
			}, function() {
		$(this).attr("src","images/nav-books.png"), $('#topbooks').attr("src","images/top-books.gif");
	
	});
	
	$('#events').hover(function() {
		$(this).attr("src","images/nav-events-over.png"), $('#topevents').attr("src","images/top-events-over.gif");
			}, function() {
		$(this).attr("src","images/nav-events.png"), $('#topevents').attr("src","images/top-events.gif");
	});
	
	$('#blog').hover(function() {
		$(this).attr("src","images/nav-blog-over.png"), $('#topblog').attr("src","images/top-blog-over.gif");
			}, function() {
		$(this).attr("src","images/nav-blog.png"), $('#topblog').attr("src","images/top-blog.gif");
	});
	
	$('#contact').hover(function() {
		$(this).attr("src","images/nav-contact-over.png"), $('#topcontact').attr("src","images/top-contact-over.gif");
			}, function() {
		$(this).attr("src","images/nav-contact.png"), $('#topcontact').attr("src","images/top-contact.gif");
	});
		$('#twitter').hover(function() {
		$(this).attr("src","images/tweet-over.png");
			}, function() {
		$(this).attr("src","images/tweet.png");
	});
	
	$('#toplove').hover(function() {
		$(this).attr("src","images/top-love-over.gif");
			}, function() {
		$(this).attr("src","images/top-love.gif");
	});
	
	$('#welcome').hover(function() {
		$(this).attr("src","images/top-home-over.gif");
			}, function() {
		$(this).attr("src","images/top-home.gif");
	});
	
	$('#topliz1').hover(function() {
		$(this).attr("src","images/top-liz1-over.gif"), $('#liz').attr("src","images/nav-liz-over.png"), $('#topliz2').attr("src","images/top-liz2-over.gif");
			}, function() {
		$(this).attr("src","images/top-liz1.gif"), $('#liz').attr("src","images/nav-liz.png"), $('#topliz2').attr("src","images/top-liz2.gif");
	
	});
	
	$('#topliz2').hover(function() {
		$(this).attr("src","images/top-liz2-over.gif"), $('#liz').attr("src","images/nav-liz-over.png"), $('#topliz1').attr("src","images/top-liz1-over.gif");
			}, function() {
		$(this).attr("src","images/top-liz2.gif"), $('#liz').attr("src","images/nav-liz.png"), $('#topliz1').attr("src","images/top-liz1.gif");
	
	});
	
	$('#topbooks').hover(function() {
		$(this).attr("src","images/top-books-over.gif"), $('#books').attr("src","images/nav-books-over.png");
			}, function() {
		$(this).attr("src","images/top-books.gif"), $('#books').attr("src","images/nav-books.png");
	
	});
	
	$('#topevents').hover(function() {
		$(this).attr("src","images/top-events-over.gif"), $('#events').attr("src","images/nav-events-over.png");
			}, function() {
		$(this).attr("src","images/top-events.gif"), $('#events').attr("src","images/nav-events.png");
	});
	
	$('#topblog').hover(function() {
		$(this).attr("src","images/top-blog-over.gif"), $('#blog').attr("src","images/nav-blog-over.png");
			}, function() {
		$(this).attr("src","images/top-blog.gif"), $('#blog').attr("src","images/nav-blog.png");
	});
	
	$('#topcontact').hover(function() {
		$(this).attr("src","images/top-contact-over.gif"), $('#contact').attr("src","images/nav-contact-over.png");
			}, function() {
		$(this).attr("src","images/top-contact.gif"), $('#contact').attr("src","images/nav-contact.png");
	});
});
