var oldsearchcontent;
	
	function searchFieldClear() {
		
		oldsearchcontent = document.getElementById("searchfield").value;
		document.getElementById("searchfield").value = "";
		
	}
	
	function searchFieldRestore() {
		document.getElementById("searchfield").value = oldsearchcontent;
	}
		
function showTitle(bookid) {
		
		var bookimage = document.getElementById("cover"+bookid);
		var booktitle = document.getElementById("title"+bookid);
		var bookdetail = document.getElementById("bookdetail"+bookid);
		
		if(bookimage) bookimage.className = 'bookimageactive';
		if(booktitle) booktitle.className = 'booktitlehover';
		if(bookdetail) bookdetail.className = 'bookpagelinkactive';
		
	}
	
	function hideTitle(bookid) {
		
		var bookimage = document.getElementById("cover"+bookid);
		var booktitle = document.getElementById("title"+bookid);
		var bookdetail = document.getElementById("bookdetail"+bookid);
		
		if(bookimage) bookimage.className = 'bookimage';
		if(booktitle) booktitle.className = 'booktitle';
		if(bookdetail) bookdetail.className = 'bookpagelink';
		
	}

	function showBookContainer(bookid, currentbookid) {

		var bookcontainer = document.getElementById("bookviewcontainer"+bookid);
		var bookcontainercurrent = document.getElementById("bookviewcontainer"+currentbookid);
		var contentbgimage = document.getElementById("contentbgimage");
		var contbottom = document.getElementById("bottomcontent");
		var booksidebar = document.getElementById("book_sidebar"+currentbookid);
			
		if(contentbgimage) contentbgimage.style.visibility = 'hidden';
		if(contbottom) contbottom.style.visibility = 'hidden';
		
		if(booksidebar) booksidebar.style.visibility = 'hidden';
		if(bookcontainer) bookcontainer.className = 'bookcontainer_visible';
		if(bookcontainercurrent) bookcontainercurrent.className = 'bookcontainer_hidden';
	}
	
	function hideBookContainer(bookid, currentbookid) {
	
		var bookcontainer = document.getElementById("bookviewcontainer"+bookid);
		var bookcontainercurrent = document.getElementById("bookviewcontainer"+currentbookid);
		var contentbgimage = document.getElementById("contentbgimage");
		var contbottom = document.getElementById("bottomcontent");
		var booksidebar = document.getElementById("book_sidebar"+currentbookid);

		if(contentbgimage) contentbgimage.style.visibility = 'visible';
		if(contbottom) contbottom.style.visibility = 'visible';

		if(booksidebar) booksidebar.style.visibility = 'visible';
		if(bookcontainer) bookcontainer.className = 'bookcontainer_hidden';
		if(bookcontainercurrent) bookcontainercurrent.className = 'bookcontainer_visible';
	}
	
	function showAuthor(letter, currentletter) {
		
		if(letter != currentletter) {
			var authors = document.getElementById("author"+letter);
			var authorcurrent = document.getElementById("author"+currentletter);
			authors.className = 'authorlist_visible';
			authorcurrent.className = 'authorlist_hidden';
		}
		
	}
	
	function hideAuthor(letter, currentletter) {

		if(letter != currentletter) {
			
		var authors = document.getElementById("author"+letter);
		var authorcurrent = document.getElementById("author"+currentletter);
		authors.className = 'authorlist_hidden';
		authorcurrent.className = 'authorlist_visible';
		
		}
	}
		