function FlashObject(Path,Width,Height,BgColor) {
	document.write('<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="'+ Width +'" height="'+ Height +'">' 
					+ '<param name="movie" value="'+ Path +'" />'
					+ '<param name="quality" value="high" />'
					+ '<param name="bgcolor" value="'+ BgColor +'" />'
					+ '<embed src="'+ Path +'" quality="high" bgcolor="'+ BgColor +'" width="'+ Width +'" height="'+ Height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
					+ '</object>');
}

function MediaObject(Path,Width,Height,uiMode,showControls,showdisplay,autoStart) {
	document.write('<object classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6 width="'+ Width +'" height="'+ Height +'">' 
					+ '<param name="url" value="'+ Path +'" />'
					+ '<PARAM NAME="playCount" VALUE="1">'
					+ '<PARAM NAME="autoStart" VALUE="'+ autoStart +'">'
					+ '<PARAM NAME="uiMode" VALUE="'+uiMode+'">'
					+ '<PARAM NAME="showControls" VALUE="'+showControls+'">'
					+ '<PARAM NAME="showdisplay" VALUE="'+showdisplay+'">'
					+ '<embed src="'+ Path +'" showdisplay="'+showdisplay+'" showControls="'+showControls+'" uiMode="'+uiMode+'" autoStart="'+ autoStart +'" width="'+ Width +'" height="'+ Height +'" TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" />'
					+ '</object>');
}


function flashPlayer(params,ret) {
	if(params.id==null || params.id=='undefined') params.id='';
	if(params.thumb==null || params.thumb=='undefined') params.thumb='';
	if(params.autoStart==null || params.autoStart=='undefined') params.autoStart=false;
	if(params.autoStart==0) params.autoStart=false;
	else params.autoStart=true;
	if(!params.playerUrl) params.playerUrl = location.protocol+'//'+location.host +'/images/player.swf';
	//params.autoStart=false;

	var str='<object id="'+params.id+'" name="'+params.id+'" width="'+params.width+'" height="'+params.height+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">'+
			'<param name="allowscriptaccess" value="always">'+
			'<param name="movie" value="'+params.playerUrl+'">'+
			'<param name="quality" value="high">'+
			'<param name="wmode" value="transparent">'+
			'<param name="FlashVars" value="backcolor=333333&frontcolor=0xFFFFFF&lightcolor=0xAAAAAA'+
									(params.id? '&enablejs=true&javascriptid='+ params.id : '') +
									'&overstretch=true'+
									'&usefullscreen=false'+
									'&image='+params.thumb+
									'&file='+params.url+
									'&width='+params.width+
									'&height='+params.height+
									'&displayheight='+params.height+
									'&autostart='+params.autoStart+'">'+
			'<embed id="'+params.id+'" name="'+params.id+'" allowscriptaccess="always"  src="'+params.playerUrl+'" width="'+params.width+'" height="'+params.height+'" '+
						'flashvars="backcolor=333333&frontcolor=0xFFFFFF&lightcolor=0xAAAAAA'+
									(params.id? '&enablejs=true&javascriptid='+ params.id : '')+
									'&overstretch=true'+
									'&usefullscreen=false'+
									'&image='+params.thumb+
									'&file='+params.url+
									'&width='+params.width+
									'&height='+params.height+
									'&displayheight='+params.height+
									'&autostart='+params.autoStart+'"'+
						' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">'+
			'</object>';
	if(ret) return str;
	else document.write(str);
}