preloadImages(
	"images/headers/huron.jpg",
	"images/headers/broadcasters",
	"images/headers/sunny_delhi.jpg",
	"images/headers/farmers.jpg",
	"images/headers/fenimore.jpg",
	"images/headers/folklore.jpg",
	"images/headers/unalam.jpg",
	"images/headers/bvr.jpg",
	"images/headers/shumaker.jpg",
	"images/headers/wightman.jpg",
	"images/headers/quartier.jpg",
	"images/headers/tieco.jpg",
	"images/headers/ecenter.jpg",
	"images/headers/ives.jpg",
	"images/headers/davidsonfox.jpg",
	"images/headers/byogon.jpg",
	"images/headers/springbrook.jpg");

$(function()
{
	$("#modal-layer, #modal a").live("click", function()
	{
		$("#modal-layer, #modal").fadeOut(300, function() { $(this).remove(); });
		return false;
	});
	$("#work a:not(#work a.video)").click(function()
	{
		$("#homepage-slides").append('<img style="display: none;" src="' + $(this).attr("href") + '" alt="' + $("img", $(this)).attr("alt") + '" />')
		$("#homepage-slides img:eq(0)").fadeOut(300, function() {
			$("#homepage-slides img:eq(1)").fadeIn(300, function() { $("#homepage-slides img:eq(0)").remove(); });
		});
		$("#work h2").text($("img", $(this)).attr("alt"));
		$("#work p").text($(this).attr("title"));
		scrollTo(0, 0);
		return false;
	});
	$("#work a.video").click(function()
	{
		scrollTo(0, 0);
		$("body").append('<div id="modal-layer"></div>');
		$("#sitewrapper").append('<div id="modal"><h2><a href="#">Close</a>Learn More About eni</h2><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/u7p4rEQp9Mk&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/u7p4rEQp9Mk&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></div>');
		$("#modal-layer, #modal").fadeIn(300, function() { $("#modal-layer").animate({ opacity: .8 }, 0) });
		return false;
	});
});

function preloadImages()
{
	for (i = 0; i < arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}