
// When the document is ready
$(document).ready(function() {
	// Create lightbox interface out of all links that carry the 
	// "lightbox" class:
	$("a[href$=.jpg]").attr('rel','knalgoed');
	
	$("a[href$=.jpg]").fancybox({
		'titlePosition' : 'outside',
		'overlayColor'	: '#000000'
	});
	
	$("a[href^='http://www.youtube.com']").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'overlayColor'	: '#000000',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
				 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

		return false;
	});
	
	$('.product-overview input[type=text]').hide();
	$('.product-overview ul li').each(function() {
		$(this).hover(function() {
			$('input[type=image]', $(this)).attr('src', 'img/button-add-to-cart-on.gif');
			$('input[type=text]', $(this)).fadeIn(400);
		}, function() {
			$('input[type=image]', $(this)).attr('src', 'img/button-add-to-cart-off.gif');
			$('input[type=text]', $(this)).hide();
		});
	});
});
