$(document).ready(function() {
	
	var options = {
		padding: 0,
		margin: 0,
		overlayOpacity: 0.5,
		overlayColor: '#000000'
	}
	
	// Display product details in a popup box
	$('#product_list > ul > li > a').fancybox(options);

	// Check the window hash for a product id. Try to find that product on the
	// page. If the product exists fire the fancybox for that product, otherwise
	// just ignore it.
	if (window.location.hash) {
		var fb_id;
		$('#product_list > ul > li > a').each(function() {
			var temp_id = $(this).find('.product_image').attr('id').substr(14);
			if (temp_id == window.location.hash.substr(1)) {
				$(this).trigger('click');
			}
		});
	}
});
