// JavaScript Document

// Determine the viewer's screen size of the viewer and reset the page parameters accordingly
  var chapterPage = document.getElementById("chapterPage");
  var chapterPageBottomBar = document.getElementById("chapterPageBottomBar");

reformatPage();

function reformatPage() {
	
//	alert ("For Best results, maximize your brower and reload the page. If your page is already maximized ignore this message");
	
  	
  //the size of the viewport in which the HTML document is displayed
  var windowViewPort;  
  
  /*if .. else if ... else if block finds and initializes viewport for different browser types. 
  Note the viewport for firefox can be captured with both the if and the first else if (when the 
  first if block is commented out). */
  if (window.innerHeight)
  {
  	   windowViewPort = window.innerHeight;	    
  } 
  
  else if (document.documentElement && document.documentElement.clientHeight)
  {
	  windowViewPort = document.documentElement.clientHeight;
  }
  
  else if (document.body.clientHeight)
  {
	  windowViewPort = document.body.clientHeight;
  }	  
  
  //subtract 25 pixels to ensure no scroll bars appear
  windowViewPort -= 25; 
  
   
  //since windowViewPort is type number convert it to a string and concatenate "px"
  var viewPortString = windowViewPort.toString() + 'px';  
    
  chapterPage.style.height = viewPortString;
  
  windowViewPort -= 50;
  viewPortString = windowViewPort.toString() + 'px';
  chapterPageBottomBar.style.top = viewPortString;
}
