// used to hide/show full bio text, adapted from fireunderthesnow.com
function MoreOrLess() {
	var eVis = document.getElementById('MLAbout');
	//var eTrans = document.getElementById('CurrentInfo');
	var mlBut = document.getElementById('MLButton');
	if (eVis.style.display == "none") {
		eVis.style.display = "";
		//eTrans.className = "ciFrame";
		//ciBut.className = "ciButton";
		mlBut.innerHTML = "Less...";
		//mlBut.title = "Click to hide this bio."
	}
	else {
		eVis.style.display = "none";
		//eTrans.className = "ciFrameOff";
		//ciBut.className = "ciButtonOff";
		mlBut.innerHTML = "More...";
		//mlBut.title = "Click to show more."

	}
}

// Used currently only for copyright year
monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
function showMonth(theDate) {
	var theMonth = monthNames[theDate.getMonth()];
	var theYear = theDate.getFullYear();
	return theMonth + " " + theYear;
}
function showYear(theDate) {
	var theYear = theDate.getFullYear();
	return theYear;
}

//used on old "2008" page
function PopupMap(URL) {
  popup_win = window.open(URL,'popmap','width=550,height=600,scrollbars=yes');
  popup_win.focus();
}

/*not currently used
==============================================================================================*/
// Batmosphere Embedded Media Player, version 2006-05-31 
// Written by David Battino, www.batmosphere.com
// OK to use if this notice is included
// Height and Width variables added by A.Mendez
// This function reads an MP3 URL and title from the referring page and generates embedding code to play back the audio file.
// Windows browsers (except for Internet Explorer) will play back the file with the Windows Media Player *plugin.* Internet Explorer will use Windows Media Player.
// Non-Windows browsers will play back the file with their standard audio handler for the MIME type audio/mpeg. On Macs, that handler will usually be QuickTime.

/* var audioFolder = "mp3/stream/"; */
var audioFolder = "mp3/";

function embedPlayer(MP3title,MP3URL) {

	var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
	if (isWin) {
		visitorOS="Windows";
		obWidth="100%"; // 280 Width is the WMP minimum. Height = 45 (WMP controls) + 24 (status bar)
		obHeight="69";
	} else {
		visitorOS="Other";
		obWidth="100%";
		obHeight="16";
	}

	var audioURL = audioFolder + MP3URL;
	var objTypeTag = "application/x-mplayer2";
	if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"};

	document.writeln("<object width='" + obWidth + "' height='" + obHeight + "'>");
	document.writeln("<param name='type' value='" + objTypeTag + "'>");
	document.writeln("<param name='src' value='" + audioURL + "'>");
	document.writeln("<param name='autostart' value='0'>");
	document.writeln("<param name='showcontrols' value='1'>");
	document.writeln("<param name='showstatusbar' value='1'>");
	document.writeln("<embed src ='" + audioURL + "' type='" + objTypeTag + "' autoplay='false' autostart='0' width='" + obWidth + "' height='" + obHeight + "' controller='1' showstatusbar='1'></embed>"); 
	
	// Firefox and Opera Win require both autostart and autoplay
	document.writeln("</object>");
	//document.writeln("<div class='mp3title'>*" + MP3title + "*</div>");
	document.close(); // Finalizes the document
}

// Put this in the HTML page:
// 
// 		<div class="musControl" align="center">
// 			<script language="JavaScript" type="text/javascript">
// 				embedPlayer("Postcard From Tokyo","PostcardFromTokyo.mp3");
// 			</script>
// 		</div>

/* function setupMusic() { */
/*  */
/* var bVers = navigator.appVersion.toLowerCase(); */
/*  */
/* 	if (bVers.indexOf("mac") >= 0) { */
/* 	 */
/* 		document.getElementById("musConMacEmbed").innerHTML = "<embed name=\"bgClipMac\" src=\"mp3\/stream\/stream_PostcardFromTokyo.mp3\" autostart=\"true\" loop=\"true\" width=\"0\" height=\"0\" hidden>"; */
/* 		document.getElementById("musConMacEmbed").style.display = "inline"; */
/* 		document.getElementById("musConMac").style.display = "inline"; */
/* 	} */
/* 	else { */
/* 		document.getElementById("musConWin").innerHTML = "<embed id=\"bgClipWin\" name=\"bgClipWin\" src=\"mp3\/stream\/stream_PostcardFromTokyo.mp3\" autostart=\"true\" loop=\"true\" width=\"180\" height=\"80\" controller=\"true\" style=\"margin-bottom:0px\">"; */
/* 		document.getElementById("musConWin").style.display = "inline"; */
/* 	} */
/* } */
