/*!	
	Dynamic theme changer script for use on the Gerardo's Italian Bakery website
	Written by Guy Leonard
	
	This script retrieves the current date/month and loads corrosponding css files:
		- Sep. to Nov. - Autumn theme (gerardosBakery_autumn.css) 
		
	Banner script information is included here incase custom banners are created
	and need to be dynamically loaded with themes
*/

var currentDate = new Date();

function loadcssfile(filename){
  var fileref = document.createElement("link")  
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
  
  if (typeof fileref!="undefined"){
	document.getElementsByTagName("head")[0].appendChild(fileref)
  }	
}


if ((currentDate.getMonth() >= 8) && (currentDate.getMonth() <= 10)){
	loadcssfile("css/gerardosBakery_autumn.css")
}
else{
	loadcssfile("css/gerardosBakery.css")
}

// Load flash banner information
var flashvars = {};
var params = {};
params.quality = "high";
params.allowfullscreen = "false";
var attributes = {};
swfobject.embedSWF("flash/banner.swf", "myAlternativeContent", "900", "197", "9.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
