function bookSwap(author, book) {
	$.ajax({
		url:		'/xml/books.xml',
		dataType:	'xml',
		cache:		false,
		success:	function(data) {
			var author_node = $(data).find('#'+author);
			var book_node = $(author_node).find('#'+book);

			var count = author_node.find('book').length;
			if (count > 1) {
				var prev = parseInt(book) == 1 ? count : parseInt(book)-1;
				var next = parseInt(book) == count ? 1 : parseInt(book)+1;
			
				$('#arrow_prev').attr('name', prev);
				$('#arrow_next').attr('name', next);
			} else {
				$('#arrow_prev, #arrow_next').hide();
			}
			
			var author_name = $(author_node).attr('name');
			var img = '/img/books/'+$(book_node).find('photo').text();
			var title = $(book_node).find('title').text();
			var publisher = $(book_node).find('publisher').text();
			var agent = $(book_node).find('agent').text();
			var text = $(book_node).find('text').text();
			
			var html = '';
			if (text) {
				html += text;
			} else {
				if (title) {
					html += '<strong>Title</strong><br />';
					html += title+'<br /><br />';
				}
				html += '<strong>Author</strong><br />';
				html += author_name+'<br /><br />';
				if (publisher) {
					html += '<strong>Publisher</strong><br />';
					html += publisher+'<br /><br />';
				}
				if (agent) {
					html += '<strong>Agent</strong><br />';
					html += agent;
				}
			}
			
			$('#book_cover img').attr('src', img);
			$('#book_cover img').css({'visibility':'visible', 'display':'block'});
			$('#portfolio_details').html(html);
			$('#book_cover img').click(tb_remove);
		}
	});
	
	return false;
}