jQuery(document).ready(function() {
	jQuery('#categories li').each(function() {
		var cat = jQuery(this);
		var slide = cat.find('.slide');
		slide.css('left', cat.width());

		cat.hover(
			function() {
				slide.stop();

				slide.animate({
					left:Math.ceil(cat.width() / 2)
				}, 'slow');
			},
			function () {
				slide.stop();

				slide.animate({
					left:cat.width()
				}, 'slow');
			}
		);

	});

	// Make any part of category image clickable
	jQuery('#categories li').click(function() {
		window.location = jQuery(this).find('a:first').attr('href');
	});
});
