
$(init);

function init(){

  $("#generalSummary").remove();

  $("#DocumentSelector").before('<div id="JournalListSummary" class="summary"><h2>Journals</h2><p>This series will publish all diaries and journals, both those Joseph Smith wrote personally and those written for him by his clerks. These will appear in three volumes: Journals 1, 1832&ndash;1839; Journals 2, 1841&ndash;1843; and Journals 3, 1843&ndash;1844.</p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div><div id="DocumentsListSummary" class="summary"><h2>Documents</h2><p>This series will comprise about a dozen volumes covering the years 1828 to 1844. These volumes will publish in chronological order all Joseph Smith correspondence, revelations, reports of discourses, and other documents (notices, notes, editorials) for which Joseph Smith is author or assumed author. Selected documents from other series may be included if they are closely related to these documents and record Joseph Smith’s activities—for example: minutes. The full Kirtland and Missouri minute books will be published in the Administrative Series, but minutes of important councils convened by Joseph Smith to conduct general church business will also be included in the Documents Series.</p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div><div id="RevelationsListSummary" class="summary"><h2>Revelations &amp; Translations</h2><p>This series will present the earliest manuscript texts of Joseph Smith revelations, manuscript revelation books, the printed revelations as published during Joseph Smith’s lifetime, and the Book of Mormon and the printer’s manuscript from which it was produced. The series will provide scholars easy access, in some cases for the first time and certainly for the first time in one place, to accurate and complete texts of these foundational documents. </p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div><div id="HistoryListSummary" class="summary"><h2>History</h2><p>The first volume in this series presents early efforts of Joseph Smith or others under his direction (or inspired by his commission) to prepare histories. The most important early effort was in 1832, but the volume presents historical materials produced throughout the 1830s. Learning from these early efforts, Smith and his clerks settled by 1838-1839 on a documents-based format that presented the history chronologically. The eventual result was the manuscript history of the Church. Begun under Joseph Smith&rsquo;s direction and with his dictation, the history was not completed until more than a decade after his death. But during the last five years of his life, he was involved in supplying documents and information to the compilers and in reviewing what they produced. The History Series will reproduce from original manuscripts that extensive history</p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div><div id="LegalListSummary" class="summary"><h2>Legal & Business</h2><p>Between these volumes and related web content, scholars will have access for the first time to all known surviving records from judicial proceedings in which Joseph Smith was involved as plaintiff, defendant, or material witness. Unlike most &ldquo;legal papers&rdquo; in other American documentary editions, these are not the records of a legal practice but records of the court cases involving a participant in the legal system. A case summary and legal clarifications will allow non-lawyers to follow sometimes complex proceedings. Together these documents will shed light in surprising ways on Joseph Smith’s activities, challenges, and decisions. Contractual and business documents (for example, those relating to the Kirtland Bank, land transactions, merchandising, and the steamboat <em>Maid of Iowa</em>) are included whether or not they are related to the court cases. Three volumes make up this series: New York/Ohio Cases, Missouri Cases, and Illinois Cases.</p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div><div id="AdminListSummary" class="summary"><h2>Administrative</h2><p>This series will publish records pertaining to church institutions that were under Joseph Smith’s direction or that reflect his personal instruction and involvement. These records, many of which were kept by his clerks and ended up in his office, document the breadth of his involvements. The most essential such materials (others may be considered) are minute books and letterbooks.</p><p><em>Click on the tabs below to view sample documents from the six series of <em>The Joseph Smith Papers</em>. Additional documents will be added to this website as other volumes are produced.</em></p></div>');

  
  var strHref = window.location.href;

  var address = strHref.split("#");

  if ( address[1] == '' || address[1] == undefined ){//show default

    address[1] = "JournalList";

  }

  var summaryArray = $(".summary");

  $.each(summaryArray,hide);

  var listArray = $(".documentList");

  $.each(listArray,hide);

  var summaryId = address[1] + "Summary";

  var anchorID = address[1] + "Link";

  $("#"+anchorID).addClass("CurrentTab");

  $("#"+summaryId).css({display: "block"});

  $("#"+address[1]+"Thumbnail").animate({opacity: 'show'}, 1300 );

  var jumpLinksArray = $(".jumpLinks");

  $.each(jumpLinksArray, attachClickEvent );

  //displayPageNumber();
}

function attachClickEvent(){

  $(this).click(function(){return false;});

  $(this).click(showList);

}

function showList(){

  var summaryList = $(".summary");

  $.each(summaryList, hide);

  var jumpLinksArray = $(".jumpLinks");

  $.each(jumpLinksArray, detachClickEvent );

  $(this).addClass("CurrentTab");

  var listArray = $(".documentList");

  $.each(listArray,hide);

  var idName = $(this).attr("href");

  var summaryName =idName + "Summary";
  
  idName+="Thumbnail";

  $(summaryName).css({display: 'block'});
  
  $(idName).animate({opacity: 'show'},1300, restore);

  return false;

}

function restore(){

  var jumpLinksArray = $(".jumpLinks");

  $.each(jumpLinksArray, attachClickEvent);
}

function detachClickEvent(){

  $(this).removeClass("CurrentTab");

  $(this).unbind(showList);

}


function hide(){

  $(this).css({display: "none"});
}

function displayPageNumber(){

   var imageArray = $(".documentList > dd > a > img");

	$.each(imageArray, display);

}

function display(){

	$(this).hover(showAlt, hideAlt);

}


function showAlt(){

	var alt = $(this).attr("alt");
	
	$(this).before('<span id="PageNumber">'+alt+'</span>');
	
}

function hideAlt(){
 $("#PageNumber").remove();


}
