// Flash functions

	function embedFlashMovie(getID,getPath,getWidth,getHeight,getTransparency,getReturn) {
		// embed flash movie
		flashString = "<object id='" + getID + "' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0' width='" + getWidth + "' height='" + getHeight + "'>";
		flashString += "<param name='movie' value='" + getPath + "'><param name='quality' value='high'>";
		if(getTransparency) flashString += "<param name='wmode' value='transparent'>";
		flashString += "<embed name='" + getID + "' src='" + getPath + "' ";
		if(getTransparency) flashString += "wmode='transparent' ";
		flashString += "quality='high' pluginspage='http:\/\/www.macromedia.com\/go\/getflashplayer' type='application\/x-shockwave-flash' width='" + getWidth + "' height='" + getHeight + "' \/>";
		flashString += "<\/object>";
		if(getReturn) {
			return flashString;
		} else {
			document.write(flashString);
		}
	}

	function writeFlashSigImage() {
		//********** 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\/"));
			
		if (flash.ver[8]) {
			//embedFlashMovie(getPath,getWidth,getHeight,getTransparency)
			document.write ("<div id='flashSigImage'>" + embedFlashMovie("flashSignatureImage","\/flash\/signature_images.swf?imgsrc=" + getSrc,610,260,true,true) + "<\/div>");
		} else {
			// make IMG visible
			document.getElementById("hiddenIMG").className = "restored";
		}
	}
	
	var flashReady = false;
	var flashInit = false;

	function setFlashReady() {
		flashReady = true;
	}

	function setFlashInit() {
		flashInit = true;
	}
	
	function doHomeFlashVideo() {
		if(!flashReady) {
			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
			if(flashInit && flashObject) flashObject.setReady();
			if(!flashReady) setTimeout("doHomeFlashVideo();",500);
		}
		
	}