// JavaScript Document

var scrOfY = 0;

function changeViewerPos()
{
	
}

function showMedia(selectMedia)
{
	//set position of 'pop-up'
	if( typeof( window.pageYOffset ) == 'number' ) {
	    //Netscape compliant
	    scrOfY = window.pageYOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
	    //DOM compliant
	    scrOfY = document.body.scrollTop;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	    //IE6 standards compliant mode
	    scrOfY = document.documentElement.scrollTop;
  	}
	
	//show most of the html in the page, but set the media part here with innerHTML
	
	var html1 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/davis-5675ss.jpg' alt='Lincoln-Douglas Debate Podcast' width='200px' height='200px' /></div>";
	html1 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html1 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/alton.swf' />";
	html1 += "<param name='quality' value='high' />";
	html1 += "<param name='allowFullScreen' value='true' />";
	html1 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/alton.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html1 += "</object>";
	
	var html2 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/debates-book-ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html2 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html2 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/charleston.swf' />";
	html2 += "<param name='quality' value='high' />";
	html2 += "<param name='allowFullScreen' value='true' />";
	html2 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/charleston.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html2 += "</object>";
	
	var html3 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/lincoln-plaque-2832ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html3 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html3 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/conclusion.swf' />";
	html3 += "<param name='quality' value='high' />";
	html3 += "<param name='allowFullScreen' value='true' />";
	html3 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/conclusion.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html3 += "</object>";
	
	var html4 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/wilson-davis-93ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html4 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html4 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/freeport.swf' />";
	html4 += "<param name='quality' value='high' />";
	html4 += "<param name='allowFullScreen' value='true' />";
	html4 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/freeport.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html4 += "</object>";
	
	var html5 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/old-main-2268ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html5 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html5 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/galesburg.swf' />";
	html5 += "<param name='quality' value='high' />";
	html5 += "<param name='allowFullScreen' value='true' />";
	html5 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/galesburg.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html5 += "</object>";
	
	var html6 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/wilson-davis-48853ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html6 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html6 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/jonesboro.swf' />";
	html6 += "<param name='quality' value='high' />";
	html6 += "<param name='allowFullScreen' value='true' />";
	html6 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/jonesboro.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html6 += "</object>";
	
	var html7 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/wilson-davis-ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html7 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html7 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/ottawa.swf' />";
	html7 += "<param name='quality' value='high' />";
	html7 += "<param name='allowFullScreen' value='true' />";
	html7 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/ottawa.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html7 += "</object>";
	
	var html8 = "<div style='margin: 0px auto 10px auto;'><img src='http://www.knox.edu/listen/lincoln-douglas/wilson-douglas-5ss.jpg' alt='Lincoln-Douglas Debate Podcast' /></div>";
	html8 += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='313' height='130'>";
	html8 += "<param name='movie' value='http://www.knox.edu/listen/lincoln-douglas/quincy.swf' />";
	html8 += "<param name='quality' value='high' />";
	html8 += "<param name='allowFullScreen' value='true' />";
	html8 += "<embed src='http://www.knox.edu/listen/lincoln-douglas/quincy.swf' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='313' height='130'  allowFullScreen='true'></embed>";
	html8 += "</object>";
	
	if (selectMedia == "alton")
	{
		document.getElementById('mediaHolder').innerHTML = html1;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Alton</span>";
	}		
	if (selectMedia == "charleston") 
	{
		document.getElementById('mediaHolder').innerHTML = html2;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Charleston</span>";
	}
	if (selectMedia == "conclusion")
	{
		document.getElementById('mediaHolder').innerHTML = html3;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Conclusion</span>";
	}
	if (selectMedia == "freeport")
	{
		document.getElementById('mediaHolder').innerHTML = html4;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Freeport</span>";
	}
	if (selectMedia == "galesburg")
	{
		document.getElementById('mediaHolder').innerHTML = html5;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Galesburg</span>";
	}
	if (selectMedia == "jonesboro")
	{
		document.getElementById('mediaHolder').innerHTML = html6;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Jonesboro</span>";
	}
	if (selectMedia == "ottawa")
	{
		document.getElementById('mediaHolder').innerHTML = html7;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Ottawa</span>";
	}
	if (selectMedia == "quincy")
	{
		document.getElementById('mediaHolder').innerHTML = html8;
		document.getElementById('subtitle').innerHTML = "Lincoln-Douglas Debates<br /><span style='font-size=11px;'>Quincy</span>";
	}
	
	if(navigator.userAgent.indexOf('Safari') == -1)
	{
		document.getElementById('mediaViewer').style.top = 40 + scrOfY + "px";
		document.getElementById('mediaViewerBox').style.top = 50 + scrOfY + "px";
	}
	else
	{
		document.getElementById('mediaViewer').style.top = 40 + scrOfY + "px";
		document.getElementById('mediaViewerBox').style.top = 50 + scrOfY + "px";		
	}
	document.getElementById('mediaViewer').style.marginLeft = "-" + 250 + "px";
	document.getElementById('mediaViewerBox').style.marginLeft = "-" + 240 + "px";
	document.getElementById('mediaViewer').style.display = "block";
	document.getElementById('mediaViewerBox').style.display = "block";
	
}

function hideViewer()
{
	document.getElementById('mediaHolder').innerHTML = "<span style=\"color: #999999;\">Media loading...</span>";
	document.getElementById('mediaViewer').style.display = "none";
	document.getElementById('mediaViewerBox').style.display = "none";
}