// create the array of images

function showImage(){
 return "http://booksurgepages.com/amznwebstore/logos/bks_csp3.jpg";
}

$(document).ready(function(){
// set the dynamic background image for the logo

var menuContainer = document.createElement('div');
menuContainer.innerHTML = ("<center><ul><li><a href=\"/category/1227567741/1/Self-Publishing.htm\">For Authors</a></li><li><a href=\"/category/1227569001/1/Publisher-Services.htm\">For Publishers</a></li><li><a href=\"/category/1313793801/1/Shop-at-BookSurge.htm\">Bookstore</a></li><li><a href=\"/category/1227573561/1/Author-Resources.htm\">Author Resources</a></li><li><a href=\"\/category/1227600621/1/FAQs.htm\">Author FAQs</a></li><li style=\"border:0px\"><a href=\"http://www.booksurge.com/content/GPS_Login.htm\" style=color:#C00>GPS Login</a></li></ul></center>");
$('#menuContainer').append(menuContainer);
 
// set the logo image from the array above
var thistestvar = showImage();
  $(".logo").css({height:"275px", backgroundRepeat: "no-repeat", backgroundPosition: "0px -14px", margin: "0px", backgroundImage: "url("+thistestvar+")", marginBottom:"5px"});
// hide the search box and buttons
//  $("img").each(function() { if (this.alt == "Search" ) { $(this).hide();}});
//  $("input").each(function() { if (this.name == "keyword" ) { $(this).hide(); }});

//$("img").each(function() { if (this.atrr("class") == "wba_search_btn" ) { alert('ping');//$(this).attr("src") == "/images/search_bookstore_btn.gif";}});


$(".wba_search_btn").attr("src","http://booksurgepages.com/amznwebstore/search_bookstore_btn.gif");

$("#wba_footer_2 td").removeClass("footer").addClass("copyright").html("Copyright &copy; "+formatDate(new Date(), 'yyyy')+" BookSurge, a DBA of On-Demand Publishing LLC, part of the Amazon group of companies");
$("#wba_poweredby_table tr td").html("<img border=\"0\" id=\"wba_poweredby\" src=\"/images/an_amazon_company_whbg.gif\" title=\"An Amazon.com Company\">");

// modify the text of the amazon cart links
  $("a").each(function() { if (this.href == "http://www.booksurge.com/cart.htm" ) { $(this).html("Your Cart"); }});
  $("a").each(function() { if (this.href == "http://www.booksurge.com/myAccount.htm" ) { $(this).hide(); }});
  $("a").each(function() { if (this.href == "http://www.booksurge.com/orderStatus.htm" ) { $(this).html("Amazon Order Status"); }});
  $("a").each(function() { if (this.href == "http://www.booksurge.com/info/Privacy_Policy" ) { $(this).hide(); }});
  $("a").each(function() { if (this.href == "http://www.booksurge.com/info/Contact_Us" ) { $(this).hide(); }});

// make the container table bigger
  $("table").each(function() { if (this.width == "760" ) {$(this).addClass("tableContainer");}});


$(".topNav").css({ display: "none"});
//$("#wba_logo_bg").css({ clear:"both", display: "block", float:"left", width:"760px"});





});
