var contentVersion = 6; // change me to test for major version of Flash Player
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var pluginVersion = words[i]; 
	    }
	var flashCanPlay = pluginVersion >= contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<scr' + 'ipt language=VBScript\> \n'); // hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('flashCanPlay=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion)))\n');
	document.write('</scr' + 'ipt\> \n');
}
if (flashCanPlay) {
	// write .swf file
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
	document.write('id="swfLaunchpad" width="565" height="321" align="">');
	document.write('<param name="movie" value="flash/aramark.swf"><param name="wmode" value="transparent"><param name="loop" value="true"><param name="menu" value="false"><param name="quality" value="high">');
	document.write('<embed src="flash/aramark.swf" loop="true" menu="false" quality="high" flashvars=""');
	document.write('swLiveConnect="false" width="565" height="321" name="aramark" align=""');
	document.write('type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">');
	document.write('</embed>');
	document.write('</object>');
	
} else {
	// write alternate image with href, etc
	var altImgArray = new Array (4);
	
	altImgArray[0] = '<a href="ContentTemplate.aspx?PostingID=403&ChannelID=23"><img src="images/college.jpg" alt="" width="565" height="321" border="0"></a>';
	altImgArray[1] = '<a href="ContentTemplate.aspx?PostingID=393&ChannelID=224"><img src="images/garden.jpg" alt="" width="565" height="321" border="0"></a>';
	altImgArray[2] = '<a href="Careers.aspx?PostingID=365&ChannelID=192"><img src="images/cafe.jpg" alt="" width="565" height="321" border="0"></a>';
	altImgArray[3] = '<a href="ContentTemplate.aspx?PostingID=398&ChannelID=228"><img src="images/sushi.jpg" alt="" width="565" height="321" border="0"></a>';
	
	var randomImage = Math.floor(4 * Math.random());
	
	try {
		if (typeof(altImgArray[parseInt(randomImage)]) != "undefined"){
			document.write(altImgArray[parseInt(randomImage)]);
		}
		else {
			throw "error"
		}
	}
	
	catch (er) {
		if (er=="error"){
			document.write('<a href="ContentTemplate.aspx?PostingID=403&ChannelID=23"><img src="images/college.jpg" alt="" width="565" height="321" border="0"></a>');	
		}
	}
	
}

