$(document).ready(function()
{
	$(".rollover").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover").toggle();
	},
	function()
	{
		$(this).children(".rollover").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});



$(document).ready(function()
{
	$(".rollover2").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover2").toggle();
	},
	function()
	{
		$(this).children(".rollover2").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});

$(document).ready(function()
{
	$(".rollover3").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover3").toggle();
	},
	function()
	{
		$(this).children(".rollover3").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});

$(document).ready(function()
{
	$(".rollover4").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover4").toggle();
	},
	function()
	{
		$(this).children(".rollover4").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});







$(document).ready(function()
{
	$(".rollover5").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover5").toggle();
	},
	function()
	{
		$(this).children(".rollover5").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});



$(document).ready(function()
{
	$(".rollover6").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover6").toggle();
	},
	function()
	{
		$(this).children(".rollover6").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});
$(document).ready(function()
{
	$(".rollover7").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover7").toggle();
	},
	function()
	{
		$(this).children(".rollover7").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});
$(document).ready(function()
{
	$(".rollover8").hide().each(function()
	{
		$(this).height($(this).parent().height());
		var $a = $("a", this);
		$a.parent().html($a.text());
		$(this).click(function() { window.location.href = $a.attr("href"); });
	});
	
	$(".project").hover(function()
	{
		$(this).children(".rollover8").toggle();
	},
	function()
	{
		$(this).children(".rollover8").toggle();
	});
	
	$("#series li").hover(function()
	{
		$("img", this).eq(0).toggle();
	},
	function()
	{
		$("img", this).eq(0).toggle();
	});
});








$(window).load(function()
{
	var index = 0, hash = window.location.hash;
	if(hash)
	{
		hash = hash.split('#');
		index = Number(hash[1])-1;
		if(isNaN(index))
		{
			index = 0;
		}
		else if(index<0)
		{
			index = 0;
		}
	}
	
	$('#cycle').cycle(
	{ 
		fx:				'fade', 
		timeout:		0, 
		startingSlide:	index, // zero-based
		next:			$('#cycle img, #cyclespace a:eq(1)'),
		prev:			$('#cyclespace a:eq(0)'),
		after:			onAfter
	});
	
	function onAfter($in, $out, $options)
	{
		window.location.hash = $options.currSlide+1;
	}
});
