var oldsearchcontent; var current_cat_id = 0; var current_start = 0; var current_book_id = 0; function setPartnerActive(select) { location.href = "/master/index.php?partner_id=" + select.value; } 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"+current_book_id); var contentbgimage = document.getElementById("contentbgimage"); var contbottom = document.getElementById("bottomcontent"); var booksidebar = document.getElementById("book_sidebar"+bookid); var booksidebarcurrent = document.getElementById("book_sidebar"+current_book_id); if(contentbgimage) contentbgimage.style.visibility = 'hidden'; if(contbottom) contbottom.style.visibility = 'hidden'; if(booksidebar) booksidebar.style.visibility = 'visible'; if(booksidebarcurrent && bookid != current_book_id) booksidebarcurrent.style.visibility = 'hidden'; if(bookcontainer) bookcontainer.className = 'bookcontainer_visible'; if(bookcontainercurrent && bookid != current_book_id) bookcontainercurrent.className = 'bookcontainer_hidden'; } function hideBookContainer(bookid, currentbookid) { var bookcontainer = document.getElementById("bookviewcontainer"+bookid); var bookcontainercurrent = document.getElementById("bookviewcontainer"+current_book_id); var contentbgimage = document.getElementById("contentbgimage"); var contbottom = document.getElementById("bottomcontent"); var booksidebar = document.getElementById("book_sidebar"+bookid); var booksidebarcurrent = document.getElementById("book_sidebar"+current_book_id); //if(contentbgimage) contentbgimage.style.visibility = 'visible'; if(contbottom) contbottom.style.visibility = 'visible'; if(booksidebar) booksidebar.style.visibility = 'hidden'; if(booksidebarcurrent) booksidebarcurrent.style.visibility = 'visible'; if(bookcontainer) bookcontainer.className = 'bookcontainer_hidden'; if(bookcontainercurrent) bookcontainercurrent.className = 'bookcontainer_visible'; } function getNavigation() { var randomnumber=Math.floor(Math.random()*110); $.get("/script/navigation.php?"+randomnumber, { cat_id: current_cat_id, book_id: current_book_id, current_start: current_start }, function(data){ $(".navi").html(data); if(current_book_id > 0) setBookActive(current_book_id); } ); } function loadLastSite() { current_start = current_start - 22; if(current_start < 0) current_start = 0; getNavigation(); } function loadNextSite() { current_start = current_start + 22; getNavigation(); } function getNavigationOfCat(cat_id) { current_cat_id = cat_id; getNavigation(); } function loadDistribution(book_id) { //var obj = swfobject.getObjectById("bottom"); $("#bottom").externalInterface({ method:'loadCountriesfromHTML', args:book_id }); } function setBookActive(book_id) { $(".subactive").addClass("sub"); $(".subactive").removeClass("subactive"); var booklink = document.getElementById("subnav"+book_id); booklink.className = "subactive"; $(".navihead").html(' CLICK ANY COVER'); current_book_id = book_id; loadDistribution(book_id); } $(document).ready(function(){ //swfobject.registerObject("bottom", "9.0.0"); getNavigation(); });