﻿function flashshow2(src, cfg, obj_id, container_id){
	var config = {'width':200,'height':200, 'quality':'best', 'transparent':'transparent', 'bgcolor':'#fff'};
	var object_id = obj_id || 'ShockwaveFlashObject';
	
	if(cfg.width)
		config.width = cfg.width;
	
	if(cfg.height)
		config.height = cfg.height;
	
	if(cfg.quality)
		config.quality = cfg.quality;
	
	if(cfg.transparent)
		config.transparent = cfg.transparent
	
	if(cfg.bgcolor)
		config.bgcolor = cfg.bgcolor;
	
	var container = typeof(container_id) === 'string' ? document.getElementById(container_id) : container_id;
	
	var html_source = '';
	html_source+= '<OBJECT id="' + object_id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
	html_source+='type="application/x-shockwave-flash" ';
	html_source+='data="' + src + '" ';
	html_source+='codebase="' + src +'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ';
	html_source+='WIDTH="' + config.width + '" HEIGHT="' + config.height + '">';
	html_source+='<PARAM NAME=menu value=always>';
	html_source+='<PARAM NAME=allowScriptAccess value=always>';
	html_source+='<PARAM NAME=wmode value="'+ config.transparent +'">';
	html_source+='<PARAM NAME=movie VALUE="'+ src +'">';
	html_source+='<PARAM NAME=quality VALUE="'+ config.quality +'">';
	html_source+='<PARAM NAME=bgcolor VALUE="'+ config.bgcolor +'">';
	html_source+='<embed allowScriptAccess="always" swLiveConnect="true" src="' + src + '" menu="false" quality="' + config.quality + '" wmode=transparent bgcolor="' + config.bgcolor + '" width="' + config.width + '" height="' + config.height + '" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">';
	html_source+='</OBJECT>';
	
	//alert('loading' + html_source);
	if(container)
		container.innerHTML += html_source;
	else
		document.write(html_source);
}