 
var isie=(/msie/i).test(navigator.userAgent);

//write flash
function writeflash(containerid,swfid,src,w,h,flashvars,winmode,bgcolor){
	var container=(typeof(containerid)=='string')? document.getElementById(containerid) : containerid;
	var savehtml=container.innerHTML;
	if(!winmode) winmode='transparent';
	if(!bgcolor) bgcolor='none';
	if(!flashvars) flashvars='';
	var html='';
	if(isie){
	html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="'+swfid+'">';
	}else{
	html+='<object type="application/x-shockwave-flash" data="'+src+'" width="'+w+'" height="'+h+'" id="'+swfid+'">';
	}
	html+='<param name="allowScriptAccess" value="always" />';
	html+='<param name="allowFullScreen" value="true" />';
	html+='<param name="quality" value="high">';
	html+='<param name="base" value="." />';
	html+='<param name="movie" value="'+src+'" />';
	html+='<param name="wmode" value="'+winmode+'">';
	html+='<param name="bgcolor" value="'+bgcolor+'" />';
	html+='<param name="flashVars" value="'+flashvars+'">';
	html+=savehtml;
	html+='</object>';
	container.innerHTML=html;
}
