//	Work around for IE active content bug, creates flash object/embed tags and
//	writes them to a named div, or if no div was specified, writes them to the
//	document where the function call was made. Only required variables are id,
//	file, w(idth), and h(eight).
function insertFlashTag(id, file, w, h, div, bgcolor, windowMode, vars){
	if (windowMode==null) {
		windowMode="transparent";
	}
	//alert("loading flash:"+holder);
	var objTag = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\""+id+"\" width=\""+w+"\" height=\""+h+"\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\">\n" +
		"<param name=\"movie\" value=\""+file+"\" /><param name=\"FlashVars\" value=\""+parseFlashVarsToString(vars)+"\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\""+windowMode+"\" /><param name=\"salign\" value=\"t\" /><param name=\"scale\" value=\"noscale\" />"+(bgcolor?"<param name=\"bgcolor\" value=\""+bgcolor+"\" />":"")+"\n" +
		"<embed src=\""+file+"\" FlashVars=\""+parseFlashVarsToString(vars)+"\" quality=\"high\" wmode=\""+windowMode+"\" salign=\"t\" "+(bgcolor?"bgcolor=\""+bgcolor+"\"":"")+"width=\""+w+"\" height=\""+h+"\" name=\""+id+"\" align=\"top\" play=\"true\" loop=\"false\" scale=\"noscale\" quality=\"high\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">\n" +
		"</embed></object>";
	var flashDiv = document.getElementById(div);
	if(flashDiv) {
		flashDiv.style.width = w+"px";
		flashDiv.style.height = h+"px";
		flashDiv.innerHTML = objTag;
    	}
    else document.write(objTag);
}
function parseFlashVarsToString(vars){
	if(!vars)return "";
	var retStr = "";
	var first = true;
	for(item in vars){
		retStr+="&"+item+"="+vars[item];
		}
	return retStr;
}
function jAlert(alrt) {
	alert(alrt);
	}

//  after finding the flash movie on the page, sends message to that movie
function callExternalInterface(file, functionName) {
	//alert(file+", "+functionName);
	flashMovie=thisMovie(file);
    if(flashMovie&&flashMovie[functionName]){flashMovie[functionName]();}
}