var temp =null; var startPos=0; var endPos = 4; var startDir=""; var authorJSON2=[{"a_id":"53","last_name":"Anderson", "first_name":"Sherwood"},{"a_id":"1","last_name":"Baker Jr. ", "first_name":"Richard M. "},{"a_id":"21","last_name":"Baum", "first_name":"L. Frank"},{"a_id":"50","last_name":"Bellerive", "first_name":"Paul"},{"a_id":"51","last_name":"Bellus", "first_name":"Stewart J."},{"a_id":"22","last_name":"Brand", "first_name":"Max"},{"a_id":"8","last_name":"Buchan", "first_name":"John"},{"a_id":"9","last_name":"Conrad", "first_name":"Joseph"},{"a_id":"32","last_name":"Cummings", "first_name":"E. E."},{"a_id":"6","last_name":"Curtis", "first_name":"Colin"},{"a_id":"20","last_name":"Defoe", "first_name":"Daniel"},{"a_id":"24","last_name":"Doyle", "first_name":"E. J."},{"a_id":"61","last_name":"Dreiser", "first_name":"Theodore"},{"a_id":"62","last_name":"Druce", "first_name":"Stephen Philip"},{"a_id":"65","last_name":"Dumas, pere", "first_name":"Alexandre"},{"a_id":"19","last_name":"Eliot", "first_name":"George"},{"a_id":"41","last_name":"Fitzgerald", "first_name":"F. Scott"},{"a_id":"37","last_name":"Forster", "first_name":"E. M. "},{"a_id":"44","last_name":"Goethe", "first_name":"J. W. von"},{"a_id":"33","last_name":"Gogol", "first_name":"Nikolai"},{"a_id":"40","last_name":"Gorky", "first_name":"Maksim"},{"a_id":"31","last_name":"Grey", "first_name":"Zane"},{"a_id":"28","last_name":"Hamsun", "first_name":"Knut"},{"a_id":"18","last_name":"Healy", "first_name":"T. R. "},{"a_id":"58","last_name":"Hesse", "first_name":"Hermann"},{"a_id":"26","last_name":"Hugo", "first_name":"Victor"},{"a_id":"23","last_name":"Huxley", "first_name":"Aldous"},{"a_id":"11","last_name":"James", "first_name":"Henry"},{"a_id":"30","last_name":"Joyce", "first_name":"James"},{"a_id":"17","last_name":"Kafka", "first_name":"Franz"},{"a_id":"15","last_name":"Killion", "first_name":"Neil"},{"a_id":"55","last_name":"Knox", "first_name":"Robert"},{"a_id":"54","last_name":"Kolankiewicz", "first_name":"Sandra"},{"a_id":"45","last_name":"Lardner", "first_name":"Ring W."},{"a_id":"38","last_name":"Lawrence", "first_name":"D. H. "},{"a_id":"49","last_name":"Luebke", "first_name":"Steven R. "},{"a_id":"39","last_name":"Maugham", "first_name":"W. Somerset"},{"a_id":"52","last_name":"Orange", "first_name":"David"},{"a_id":"67","last_name":"Preti", "first_name":"Rick"},{"a_id":"60","last_name":"Price", "first_name":"Bruce Deitrick"},{"a_id":"34","last_name":"Rohmer", "first_name":"Sax"},{"a_id":"64","last_name":"Sammon", "first_name":"John"},{"a_id":"25","last_name":"Shelley", "first_name":"Mary"},{"a_id":"36","last_name":"Sinclair", "first_name":"Upton"},{"a_id":"48","last_name":"Solensten", "first_name":"John"},{"a_id":"27","last_name":"Stevenson", "first_name":"Robert Louis"},{"a_id":"29","last_name":"Stevenson", "first_name":"Burton E."},{"a_id":"68","last_name":"Stewart", "first_name":"Margareth"},{"a_id":"56","last_name":"Trollope", "first_name":"Anthony"},{"a_id":"13","last_name":"Wells", "first_name":"H.G."},{"a_id":"47","last_name":"Wharton", "first_name":"Edith"},{"a_id":"63","last_name":"White", "first_name":"Grace Miller"},{"a_id":"35","last_name":"Wilde", "first_name":"Oscar"},{"a_id":"14","last_name":"Zola", "first_name":"Emile"}]; var activeDir=""; $(document).ready(function(){ if(jHash.val("type")!=null){ //alert("hash"); if(jHash.val("type")=="mine"){ getBookshelf(); }else{ loadCarasol(jHash.val("product"), jHash.val("type")); } }else{ callData(); } $("#dv_right_arrow").css("cursor","pointer").click(function() { loadBooks(startPos+1); }); $("#dv_left_arrow").css("cursor","pointer").click(function() { loadBooks(startPos-1); }); }); function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); } function callData(_sender, _arg){ if(_sender=="author"){ try{ for(mm=0; mm®"); //alert(authorJSON2[mm].first_name+" " + authorJSON2[mm].last_name); } } }catch(e){} }else{ $("#dv_author_message").html("Bold, Enduring Literature
Where Reality & Fiction Collide"); } $.getJSON("/media/js/JSON_Book_Carousel.php", {"type":_sender,"arg":_arg, "ord":2710136407}, function(data) { //alert(data); temp = data; loadBooks(0); updateItems(0); //alert(_sender + " -- " + _arg); }); } function loadCarasol(_arg, _sender){ callData(_sender, _arg); $('.dv_tabs_on').hide(); $('.dv_tabs').show(); } function loadBooks(startNum){ currentPos=startNum; startPos=startNum; if(startPos>(temp.books.length-1)){ startPos=0; } if(startPos<0){ startPos=(temp.books.length-1); } var dv_count=0; var activeBinder=0; for(i=0;i<=5;i++){ var dv_hold="#dv_binder_" +(i); $(dv_hold).html("
"); } for(i=0;i<=((temp.books.length-1)>4?4:(temp.books.length-1));i++){ if(currentPos>(temp.books.length-1)){ currentPos=0; } if(currentPos<0){ currentPos=(temp.books.length-1); } dv_count++; var dv_hold="#dv_binder_" +(dv_count); $(dv_hold).html("
" + "\""+temp.books[currentPos].name+"\"/
" + "
" + "
"); if(activeDir==temp.books[currentPos].directory){ activeBinder = (dv_count); } currentPos++; } highLight(activeBinder); $("#sp_count").html(temp.books.length); } function updateItems(i){ var _3d_html=""; if(temp.books[i].dd=="1"){ var _3d_html='
  • '+temp.books[i].dd_data.data[0].author_name+'

    '+temp.books[i].dd_data.data[0].author_year+'

    '+temp.books[i].dd_data.data[0].bio+'

'; } activeDir = temp.books[i].directory; if(temp.books[i].singletype=="0"){ if(temp.books[i].dd=="1" && runFancy){ $("#dv_book_cover").html(_3d_html); }else{ $("#dv_book_cover").html(""); } $("#dv_lnk_add_cart").html("(user agreement applies)"); }else{ if(temp.books[i].singletype!="1"){ if(temp.books[i].dd=="1" && runFancy){ $("#dv_book_cover").html(_3d_html); }else{ $("#dv_book_cover").html(""); } }else{ if(temp.books[i].dd=="1" && runFancy){ $("#dv_book_cover").html(_3d_html); }else{ $("#dv_book_cover").html(""); } } $("#dv_lnk_add_cart").html("Add to Cart"); } $("#dv_book_type").html(temp.books[i].booktype); $("#dv_synops").html(temp.books[i].headline); $("#dv_sample_text").html(temp.books[i].synopsis); if(temp.books[i].singletype=="0"){ $("#dv_bttn_more").html(""); }else{ if(temp.books[i].singletype!="1"){ $("#dv_bttn_more").html(""); }else{ $("#dv_bttn_more").html("") } } startDir=temp.books[i].directory; } function highLight(dv){ for(x=1;x<=5;x++){ $("#dv_binder_"+x).css("background-color", "#EAE2C0"); } $("#dv_binder_"+dv).css("background-color", "#abd37b"); }