function toggleTranscript() {
   var transcriptBody = document.getElementById('transcriptBody');
   var showTranscript = '';

   if (transcriptBody.style.display == 'none') {
	   transcriptBody.style.display = 'block';
	   showTranscript = 'true';
   } else {
	   transcriptBody.style.display = 'none';
	   showTranscript = 'false';
   }

   createCookie('showTranscript', showTranscript, 3650);
}

function setInitialTranscriptState() {
   // Show the transcript expander; it's hidden by default
   // unless we know the user has javascript. (If they don't,
   // then the transcript body will never be hidden and
   // will always appear.)
   var transcriptExpander = document.getElementById('transcriptExpander');
   transcriptExpander.style.display = 'inline';

   var showTranscript = readCookie('showTranscript');
   var transcriptBody = document.getElementById('transcriptBody');
   if (showTranscript == 'true') {
	transcriptBody.style.display = 'block';
   } else {
	transcriptBody.style.display = 'none';
   }
}

if (document.getElementById) {
	// Hack to prevent flickering on load.
	document.write('<style type="text/css">#transcriptBody { display: none; }</style>');
	document.write('<style type="text/css">#transcriptExpander { display: inline; }</style>');

	window.onload = function() {
       		setInitialTranscriptState();
   	}
}
