 
function getFlashStr (url,id,w,h,bgcolor, wmode, scale){

if (document.all){

	bgcolor=bgcolor ? '<param name="bgColor" value="'+bgcolor+'" />' : "";
	wmode=wmode ? '<param name="wmode" value="'+wmode+'" />' : "";
	scale=scale ? '<param name="scale" value="'+scale+'" />' : "";
	w =!isNaN(w) ? w +"px" : w;
	h =!isNaN(h) ? h +"px" : h;

	str = '<object type="application/x-shockwave-flash" \
		classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \
		name="' + id + '" id="' + id + '" ' + scale + ' \
		style="width:'+w+';height:'+h+'">\
		<param name="movie" value="'+url+'" />\
		'+bgcolor+'\
		'+wmode+'\
		</object>';

}else{
	scale=scale? 'scale="'+scale+'" ' : "";	
	wmode=wmode ? 'wmode="'+wmode+'" ' : "";
	
	str = '<embed swLiveConnect="true" quality=best type="application/x-shockwave-flash" menu=false  ' +
		' name="' + id + '" id="' + id + '" ' +
		' src="' + url + '" ' +
		scale +
		wmode +
		' bgcolor="' + bgcolor + '" ' +
		' width=' + w + ' height=' + h +
		' swLiveConnect=true ' +
		' allowScriptAccess="sameDomain" ' +
		' type="application/x-shockwave-flash" ' +
		' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ></embed>';


	}
	
	return str;
}

function addFlashInside (containerId, url,id,w,h,bgcolor, wmode, scale){
	var str = getFlashStr(url,id,w,h,bgcolor, wmode, scale);	
	$(containerId).innerHTML = str;

}


function addFlash(url,id,w,h,bgcolor, wmode, scale){
	var str = getFlashStr(url,id,w,h,bgcolor, wmode, scale);
	document.write (str);
}
