// Google Analytics tracking code
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10269883-3']);
_gaq.push(['_trackPageview']);
(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

function resize()
{  
	var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

	var rightarea = document.getElementById("rightarea"); 
	var contentarea = document.getElementById("contentarea");
	var footer = document.getElementById("footer");
	var toparea = document.getElementById("toparea");  
	var leftarea = document.getElementById("leftarea"); 
	var bookmark = document.getElementById("bookmark");

	// Determine the new height of everything below the header
	var new_height = myHeight - 100;

	// Set the height of the left and right areas to this new height
	leftarea.style.height = new_height + "px";
	rightarea.style.height = new_height + "px";

	// Set the height of the contentarea to the new height minus the footer height
	contentarea.style.height = new_height - 25 + "px";

  // Show/hide button 1 according to available size of window
  var button1 = document.getElementById("button1"); 
	button1.style.display = (myHeight > 214) ? "block" : "none";

  // Show/hide button 2 according to available size of window
  var button2 = document.getElementById("button2"); 
	button2.style.display = (myHeight > 300) ? "block" : "none";

  // Show/hide button 3 according to available size of window
  var button3 = document.getElementById("button3"); 
  button3.style.display = (myHeight > 387) ? "block" : "none";

  // Show/hide button 4 according to available size of window
  var button4 = document.getElementById("button4"); 
  button4.style.display = (myHeight > 461) ? "block" : "none";

	// Show/hide button 5 according to available size of window
  var button5 = document.getElementById("button5"); 
  button5.style.display = (myHeight > 548) ? "block" : "none";
} 

function CreateBookmarkLink() 
{
  title = document.title; 
  url = location.href;
	
  if (window.sidebar) { // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url,"");
  } else if( window.external ) { // IE Favorite
    window.external.AddFavorite( url, title); 
  } else if(window.opera && window.print) { // Opera Hotlist
    return true; 
  }
 }

function WriteBookmarkLink()
{
  if (window.external) {
    document.write('<a href="javascript:CreateBookmarkLink()");">Add to Favorites</a>'); 
  } else  if (window.sidebar) {
    document.write('<a href="javascript:CreateBookmarkLink()");">Bookmark Page</a>'); 
  } else if (window.opera && window.print) {	
    document.write('<a href="javascript:CreateBookmarkLink()");">Add Bookmark</a>');
  } 
}

function WriteContentTop()
{
  document.write('		<div class="content_bookmark">');
  WriteBookmarkLink();
  document.write('		</div>');
  document.write('		<div class="content_share">');
  document.write('			<!-- AddThis Button BEGIN -->');
  document.write('			<div class="addthis_toolbox addthis_default_style">');
  document.write('			<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=mrferrier" class="addthis_button_compact">Share</a>');
  document.write('			<span class="addthis_separator">|</span>');
  document.write('			<a class="addthis_button_facebook"></a>');
  document.write('			<a class="addthis_button_myspace"></a>');
  document.write('			<a class="addthis_button_google"></a>');
  document.write('			<a class="addthis_button_twitter"></a>');
  document.write('			</div>');
  document.write('			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=mrferrier"></script>');
  document.write('			<!-- AddThis Button END -->');
  document.write('		</div>');
}

function WriteContentBottom($_page_type)
{
  if ($_page_type == 'archive')
  {
    document.write('	    <br/><br/>');
    document.write('		<a href="index_archive.htm">Back to Archive</a><br/>');
    document.write('		<br/><br/>');
    document.write('		<A HREF="http://www.amazon.com/exec/obidos/redirect-home/tuesmorn3am-20" target="_top">');
    document.write('		<IMG SRC="images/amzn-fcd.gif" BORDER="0" alt="In Association with Amazon.com" width="100" height="70" /></A><br/>');
		document.write('		<br/>');
	}
	else
	{
    document.write('		<br/><br/>');
    document.write('		<A HREF="http://www.amazon.com/exec/obidos/redirect-home/tuesmorn3am-20" target="_top">');
    document.write('		<IMG SRC="images/amzn-fcd.gif" BORDER="0" alt="In Association with Amazon.com" width="100" height="70" /></A><br/>');
		document.write('		<br/>');
	}
}

function WriteFooter()
{
}
