$(function()
{

	// Add hover effect for 'product_blok' and make
	// it clickable
	$('.product_blok').clicky();
	
	// Make images in content clickable by Shadowbox
	$('#content p > img').each(function() {
		// Get the correct information of the current item
		var url = $(this).attr('src');
		var title = $(this).attr('alt') || null;
		
		// Build object for Shadowbox
		var obj = {
			link: this,
			content: url,
			title: title,
			player: 'img',
			gallery: 'gallery'
		};
		
		// Set cursor as hand for the current object
		$(this).css('cursor', 'pointer');
		
		// Open shadowbox if the object is clicked
		$(this).click(function() {
			Shadowbox.open(obj);
			return false;
		});
	});
	
	// Make images in content clickable by Shadowbox
	$('#content p a > img').each(function() {
		// Skip links with a target _blank or with a rel shadowbox
		if ($(this).parent().attr('target') == '_blank') return;
		if ($(this).parent().attr('rel') == 'shadowbox') return;
		
		// Get the correct information of the current item
		var url = $(this).parent().attr('href');
		var title = $(this).parent().attr('title') || null;
		
		// Build object for Shadowbox
		var obj = {
			link: this,
			content: url,
			title: title,
			player: 'img',
			gallery: 'gallery'
		};
		
		// Open shadowbox if the object is clicked
		$(this).parent().click(function() {
			Shadowbox.open(obj);
			return false;
		});
	});

});

