$(document).ready(function() {
var index = 0, hash = window.location.hash;
	if (hash) {
		index = /\d+/.exec(hash)[0];
		index = (parseInt(index) || 1) - 1; // slides are zero-based
	}
	$('#slideshow').cycle({
		prev:		'#prev',
		next:		'#next',
		speed:	300,
		timeout:	0,
		startingSlide: index,
		after: function(curr,next,opts) {
			window.location.hash = opts.currSlide + 1;
		}		
		});
});

