//Flash object writer
//written by rich cooke
//version 1.0
//This is dynamically included in the page when you include ASP_Library gb-standard-func.asp and call the function in asp as below
//<%=GetFlashEmbedHTML("main",gcstrROOTSWFPATH & "Profile.swf?v=" & gcflo_VERSION & "&marketid=" & intMARKETID,"#FFFFFF","996","100%",strFlashVars)%>

function createFlashEmbed2(id, src, bgcolor, width, height, strflashvars) { 

var strflash = '<obj' + 'ect classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '"" height="' + height + '"" id="' + id + '" align="middle" VIEWASTEXT><param name="flashvars" value="' + strflashvars + '" /><param name="allowScriptAccess" value="sameDomain" /><param name="salign" value="TL" /><param name="scale" value="noscale" /><param name="menu" value="false" /><param name="movie" value="' + src + '" /><param name="quality" value="high" /><param name="wmode" value="Window" /><param name="bgcolor" value="' + bgcolor + '" /><embed src="' + src + '" flashvars="' + strflashvars + '" menu="false" quality="high" wmode="Opaque" bgcolor="' + bgcolor + '" width="' + width + '"" height="' + height + '"" id="' + id + '" salign="TL" align="middle" scale="noscale" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></obj' + 'ect>'; 
document.write(strflash); 
} 

// CC - This the new function to standardise the way flash is requested.
var swfQueryString = "";
function WriteFlash (nsid,fstring)
{
	if(fstring.indexOf(".swf?")==-1)
	{
		fstring = fstring.replace(/.swf/,".swf?"+swfQueryString);
	} else {
		fstring = fstring.replace(/.swf\?/,".swf&");
		fstring = fstring.replace(/.swf/,".swf?"+swfQueryString);
	}
	nsTag = document.getElementById(nsid);
	nsTag.outerHTML = "<object "+fstring+"</object";
}


