function na(a)
{
	var t = a.substr(a.lastIndexOf('/')+1);
	return t.substr(0,t.lastIndexOf('.')-1);
}

function ext(a)
{
 return a.substr(a.lastIndexOf('.'));
}

var diri='';

function EFlash(id,movie,ancho,alto,vars,bgcolor,wmode,fit)
{
	var sw = ext(movie).toLowerCase()=='.dcr';
	if (bgcolor==null||bgcolor=='') bgcolor='FFFFFF';
	if (wmode==null||wmode=='') wmode='transparent';
	if (fit==null||fit=='') fit='exactfit';
	if (vars==null) vars='';

	document.write('<OBJECT id='+id+' WIDTH='+ancho+' HEIGHT='+alto);
	if (!sw) document.write(' classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">');  else document.write(' classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codeBase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0">');
	document.write('<PARAM NAME=movie VALUE=\"'+diri+movie+'\">');
	document.write('<PARAM NAME=src VALUE=\"'+diri+movie+'\">');
	document.write('<PARAM NAME=FlashVars VALUE=\"'+vars+'\">');
	document.write('<PARAM NAME=bgcolor VALUE=#'+bgcolor+'>');
	document.write('<PARAM NAME=wmode VALUE='+wmode+'>');
	if (sw) document.write('<PARAM NAME="swRemote" VALUE="swContextMenu=\'false\' ">');
	document.write('<PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=Scale VALUE='+ fit +'>');
	document.write('<embed id='+id+' name='+id);
	document.write(' src=\"'+diri+movie+'\" FlashVars=\"'+vars+'\" ');
	if (sw) document.write(' swRemote="swContextMenu=\'false\'"');
	if (!sw) document.write(' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" '); else document.write(' pluginspage="http://www.macromedia.com/shockwave/download/" ');
	document.write(' WIDTH='+ancho+' HEIGHT='+alto+' bgcolor=#'+bgcolor+' wmode='+wmode+' TYPE=\'application/x-shockwave-flash\' loop=false menu=false swLiveConnect=true quality=high></OBJECT>');
	if (!sw) document.write('<'+'script>var V_'+na(movie)+'=new Array();function '+id+'_DoFSCommand(command,args) {if (args==null) args=\'\';setTimeout(\'CF(\"'+na(movie)+'\",\"\'+command+\'\",\"\'+args+\'\")\',0);}'+'</'+'script>\n'+'<'+'script language=VBScript>\nSub '+id+'_FSCommand(ByVal command,ByVal args)\ncall CF("'+na(movie)+'",command,args)\n end sub\n'+'</'+'script>\n');
}
