$(document).ready(function() {
	$('.bookListItem:even')
		.css({
			'clear' : 'left'
		});
		
	var url = window.location.href;
	url = url.split('/');
	
	if (url.length > 4 && url[4] != '') 
	{
		$('#navigatie .current').removeClass('current');
	}
	
	$('.bookSearchForm').submit(function() 
	{
		var searchUrl = $(this).attr('action'); 
		searchUrl += '/' + $('#type').val() + '/' + $('#q').val();
		
		window.location = searchUrl;
		
		return false;
	});	
	
	var hWindow = $(window).height(),
		hContentWrapper = $('#contentWrapper').height(),
		hWrapper = $('#wrapper').height();
	
	if (hWrapper < hWindow) 
	{
		hContentWrapper = hWindow - (hWrapper - hContentWrapper);
		
		$('#contentWrapper').css({
			height : hContentWrapper + 'px'
		});
	}
});
