$('head').append( '<link rel="stylesheet" type="text/css" href="css/screen_books.css" media="screen" />' );
$('head').append( '<link rel="stylesheet" type="text/css" href="css/print_books.css" media="print" />' );

$( document ).ready ( function () {
	$( "tr" ).hover ( function () {
		$( this ).addClass ( "onOver" );
	}, function () {
		$( this ).removeClass ( "onOver" );
	});

	$( "tr" ).click ( function () {
		id = ( $( this ).attr ( "id" )).slice ( 3 );
		oForm = document.getElementById( 'listForm' );
		oForm.action = "index.php?pg=book&id=" + id;
		oForm.submit();
	});
});

$( document ).ready ( function () {
	$( "a#alphaSpan" ).click ( function () {
		location.search = "?pg=books&part=photographers";
	});

	$( "a#keywordSpan" ).click ( function () {
		location.search = "?pg=books&part=keywords";
	});

	$( "a#listSpan" ).click ( function () {
		location.search = "?pg=books&part=list";
	});

	switch ( $( "#part" ).val()) {
		case "photographers":
			$( "#alphaSpan" ).addClass ( "noAnchor" );
			$( "#keywordSpan" ).removeClass ( "noAnchor" );
			$( "#listSpan" ).removeClass ( "noAnchor" );
			break;
		case "keywords":
			$( "#alphaSpan" ).removeClass ( "noAnchor" );
			$( "#keywordSpan" ).addClass ( "noAnchor" );
			$( "#listSpan" ).removeClass ( "noAnchor" );
			$( ".checkboxes" ).attr ( "checked", "" );
			break;
		case "list":
			$( "#alphaSpan" ).removeClass ( "noAnchor" );
			$( "#keywordSpan" ).removeClass ( "noAnchor" );
			$( "#listSpan" ).addClass ( "noAnchor" );
			break;
	}
});

function _countBooks () {
	xajax_countBooks ( xajax.getFormValues ( 'keywordForm', false, 'cb_' ));
}
