$(function()
{
	$("a.modal").click(function()
	{
		link = $(this);
		$(".page").append('<div id="modal-layer"></div><div id="modal"></div>');
		scrollTo(0, 0);
		$("#modal").load(link.attr("href"), function()
		{
			$("#modal").prepend('<h2><a class="close" href="#">close</a>' + link.attr("title") + '</h2>');
			$("#modal-layer, #modal").fadeIn(500, function()
			{
				$("#modal-layer").animate({ opacity: .8 }, 0);
			});
		});
		return false;
	});
	$("#modal-layer, #modal a.close").live("click", function()
	{
		$("#modal-layer, #modal").fadeOut(500, function() { $(this).remove(); });
		return false;
	});
	
	$("#slide img:first").show();
	$("#thumbnail-lists").cycle(
	{
		fx: "scrollHorz",
		speed: 500,
		timeout: 0,
		next: $("#slideshow a.btn_next"),
		prev: $("#slideshow a.btn_prev")
	});
	$("#thumbnail-lists a").click(function()
	{
		index = $("#thumbnail-lists a").index(this);
		$("#slide div.photo").fadeOut(800);
		$("#slide div.photo:eq(" + index + ")").animate({ opacity: 1 }, 0).fadeIn(800);
		return false;
	});
	$("#slideshow a.btn_next, #slideshow a.btn_prev").click(function() { return false; });
	/*
	$("#hdr_play_movie").ceebox({
		videoWidth:300,
		videoRatio:"4:3",
		videoJSON: "struct/data/steph-nor.json"
	});
	*/
	
	$("#sponsor_rotator").cycle();
});

/* flashvars: { 
			file: "stephanopoulos-norville/stephanopoulos-norville.flv",
			screencolor: "#000000",
			skin: "video/yt.swf"
		} */
