function writeHomepage(forceday){
	var days = "sat-sun mon tues weds thurs fri sat-sun".split(" ");
	var day  = forceday? forceday : days[new Date().getDay()]; 
        // Transform the days to the appropriate format
		if(day.indexOf("mon") > -1)//incase it's passed 'homepage-mon.xml'
		{
			day="mon";
		}
        if(day.indexOf("tue") > -1)
        {
          day = "tues";
        }
        else if(day.indexOf("wed") > -1)
        {
          day = "weds";
        }
        else if(day.indexOf("thu") > -1)
        {
          day = "thurs";
        }
        else if(day.indexOf("sat") > -1 || day.indexOf("sun") > -1)
        {
          day = "sat-sun";
        }

	var path = "_content/homepage.swf?xml_src=homepage-"+day+".xml";
	var fla  = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\
	 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"\
	 width="586" height="430">\
	 <param name="movie" value="'+path+'">\
	 <param name="quality" value="high">\
	 <embed src="'+path+'" quality="high" \
	 pluginspage="http://www.macromedia.com/go/getflashplayer" \
	 type="application/x-shockwave-flash" width="586" height="430"></embed></object>';
	 document.write(fla);
	 days=path=fla=forceday=null;
}

var flash2Installed = false;    
var flash3Installed = false;    
var flash4Installed = false;    
var flash5Installed = false;    
var flash6Installed = false;    
var flash7Installed = false;
var maxVersion = 7;             
var actualVersion = 0;          
var hasRightVersion = false;    
var jsVersion = 1.0;            

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; 

jsVersion = 1.1;

if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
        document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('</SCR' + 'IPT\> \n'); 
}

function detectFlash() {  
	if(navigator.plugins) {
		if(typeof(navigator.plugins.refresh)=="function")
			navigator.plugins.refresh();
		if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      		var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;    
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion >= 6;
		}
  }
	for(i=2;i<=maxVersion;i++) if(eval("flash" + i + "Installed") == true)actualVersion=i;

  	if(navigator.userAgent.indexOf("WebTV")!=-1)actualVersion=3;  
	if(actualVersion < requiredVersion && !(isIE && isWin)){
		if(location.href.indexOf(upgradePage)==-1)
			location.href=upgradePage;
		return;
	}else{
		void(0);//nothing because they have it. just want to display the dang page
	}
		
}

detectFlash();  



