// Flash function for homepage feature panel

	function embedFlashMovie(getID,getPath,getWidth,getHeight,getTransparency) {
		// embed flash movie
		document.write("<object id='" + getID + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,29,0' width='" + getWidth + "' height='" + getHeight + "'>");
		document.write("<param name='movie' value='" + getPath + "'><param name='quality' value='high'>");
		if(getTransparency) document.write("<param name='wmode' value='transparent'>");
		document.write("<embed name='" + getID + "' src='" + getPath + "' ");
		if(getTransparency) document.write("wmode='transparent' ");
		document.write("quality='high' pluginspage='http:\/\/www.macromedia.com\/go\/getflashplayer' type='application\/x-shockwave-flash' width='" + getWidth + "' height='" + getHeight + "' \/>");
		document.write("<\/object>");
	}
	
	function doFlashImage() {
		if (flash.ver[8]) {
			//********** Get Image path **********
				getImage = document.getElementById("sigImage").getElementsByTagName('IMG').item(0);
				getSrc = getImage.src;
				//chop getSrc to start at images folder
				if(getSrc.indexOf("\/images\/") > 0) getSrc = getSrc.substring(getSrc.indexOf("\/images\/"));
			//********** Hide IMG + P elements **********
				document.getElementById("sigImage").getElementsByTagName('IMG').item(0).style.display = "none";
				document.getElementById("sigImage").getElementsByTagName('P').item(0).style.display = "none";
			//********** Embed flash **********
				embedFlashMovie("flashSigImage","\/flash\/ap_2009_sig_image.swf?imgsrc=" + getSrc,590,300,true);
		}
	}
	

// Flash interaction functions

	var headerLoaded = false;
	var loaderLoaded = false;

	function headerInit() {
		// header has loaded
		headerLoaded = true;
	}
	
	function loaderInit() {
		// loader has loaded
		loaderLoaded = true;
	}

	function flashHeaderReady() {
		// header has finished, okay for submovie to start
		if(loaderLoaded) {
			var flashObject;
			// Check whether the browser is IE. If so, flashVideoPlayer is window.videoPlayer. Otherwise, it's document.videoPlayer.
			// The videoPlayer is the ID assigned to the <object> and <embed> tags.
			var isIE = navigator.appName.indexOf("Microsoft") != -1;
			flashObject = (isIE) ? window['flashHomePanel'] : document['flashHomePanel'];
			// set video source in flash movie
			flashObject.loaderPlay();
		} else {
			setTimeout("flashHeaderReady();",500);
		}
	}