function genmenu(){
// Check to see if the version meets the requirements for playback
if (DetectFlashVer('6')) {
menuitem = new Array(
"Home",
"Diary",
"LYSO",
"LSSO",
"People",
"Sponsors",
"Past members",
"Archive",
"About us",
"Links");
menulink = new Array(
"index.html",
"diary.html",
"lyso.html",
"lsso.html",
"people.html",
"sponsors.html",
"where.html" ,
"archive.html",
"about.html", 
"links.html"); 
document.write('<div class="menu">');
document.write('<object  type="application/x-shockwave-flash" data="http://flsso.org.uk/banneranim.swf" width="1000" height="100">');
document.write('<param name="movie" value="http://flsso.org.uk/banneranim.swf" />');
document.write('<param name="quality" value="high" />');
document.write('</object><br />');

var menulist='';
for (i=0;i<menuitem.length;i++)
 {menulist += (i>0 ? ' - ' :'') + '<a href="http://flsso.org.uk/'+menulink[i]+'" target="_top" >'+menuitem[i]+'</a>';
 }
document.write(menulist);
//if (browser() != "ff")
// {document.write('<div><small><strong>This site is best viewed in Firefox</strong></small></div>');
// }
document.write('<hr /></div>');
}

 else {  // flash is too old or we can't detect the plugin
	var alternateContent = '<iframe src="navigate.html" width="1008" height="140" scrolling="no" frameborder="0" ></iframe>';
	document.write(alternateContent);  // insert non-flash content
} //end if
} //end function genmenu

function browser()
{
	var b = navigator.userAgent;
	if (b.indexOf("Opera")!= -1)   		    b = "op";
	else if (b.indexOf("Firefox")!= -1) 	b = "ff";
	else if (b.indexOf("Chrome")!= -1) 	  b = "ch";
	else if (b.indexOf("MSIE")!= -1)   		b = "ie";
	else if (b.indexOf("Netscape")!= -1)	b = "ns";
	else if (b.indexOf("Safari")!= -1)		b = "sa";
	else 	  ;  //	Not known, return userAgent string and ENDIF
	return b;
} // end function detect_browser()






function load(media,desc)
{  
document.write('<hr /><div id="playerdiv" name="playerdiv" height="150" width="300" style="align:center"></div>');
var player = document.getElementById('playerdiv'); 

var mimetype = ( ( browser()=="ie" || browser()=="op") ?  'audio/x-ms-wma' : 'audio/mpeg');
player.innerHTML = '<object type="'+mimetype+'" data="'+media+'" width="300" height="46">'
+ '<param name="src" value="'+media+'">'
+ '<param name="autoplay" value="false">'
+ '<param name="volume" value="100">'
+ '<param name="autoStart" value="0">'
+ '<small>Javascript turned off or Quicktime not installed</small><br /> <a href="'+media+'">'+media+'</a>'
+ '</object>'
+ '<div style="align:center; font-style:italic">' +desc +'</div>';
} // end function load(media)



// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = 7 ;  //with no error just assume version 7 (at least!)
	  } catch (e) {}
	if (!version)
	{
	  try {
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");		
		version = 6 ;
		} catch (e) {}
	}
	if (!version)
	{
		version = -1;
	}
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var flashVer = tempArrayMajor[0] ;			
		}
	}
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer returns true if that version or greater is available
function DetectFlashVer(reqMajorVer)
{
	versionStr = GetSwfVer();
	      	
		if (versionStr > parseFloat(reqMajorVer)) 
		{
			return true;
		} 
		else
		{
		  return false;
	  }
}
