$j(function()
{
	// Search
	$j('#search-input').focus(function()
	{
		if($j(this).val() === 'Zoeken')
		{
			$j(this).val('');
		}
	}).blur(function()
	{
		if($j(this).val() === '')
		{
			$j(this).val('Zoeken');
		}
	});
	
	
	// Print
	$j('.print').click(function()
	{
		var category = $j('#category-title span').html();
		var css = '<link rel="stylesheet" type="text/css" href="/Websites/vanrooy/css/Reset.css" />' +
				'<link rel="stylesheet" type="text/css" href="/Websites/vanrooy/css/Forms.css" />' +
				'<link rel="stylesheet" type="text/css" href="/Websites/vanrooy/css/Layout.css" />' +
				'<link rel="stylesheet" type="text/css" href="/Websites/vanrooy/css/Text.css" />' +
				'<link rel="stylesheet" type="text/css" href="/Websites/vanrooy/Layouts/producten/Style.css" />';
		var doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
		var header = '<html><head><title>Product overzicht van ' + category + ' printen</title>' + css + '</head><body><div id="print-popup">';
		var content = $j('#products-container').html();
		var footer = '</div></body></html>';
		
		var printWindow = window.open('', 'print', 'scrollbars=1, fullscreen');
		printWindow.document.open('text/html');
		printWindow.document.write(doctype, header, content, footer);
		printWindow.document.close();
		printWindow.print();
		
		return false;
	})
	
	$j(".fancybox").fancybox({
		'hideOnContentClick': true
	});
});
