/*
    ::::: incluir no head :::::::::::::::::::::::::::::::::::::::::::
    ::                                                             ::
    ::  <script src="addFlash.js" language="JavaScript"></script>  ::
    ::                                                             ::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ::::: trocar as tags do flash por ::::::::::::::::::::::::::::::::::
    ::                                                                ::
    ::    <script language="JavaScript">                              ::
    ::      addFlash('teste.swf',400,300, PARAMS[], FlashVars[]);     ::
    ::    </script>                                                   ::
    ::                                                                ::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/

function addFlash(_src,_w,_h,_params,_vars){
	var novoHtml = '';
 	novoHtml += '  <OBJECT height="'+_h+'" width="'+_w+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	novoHtml += '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
	novoHtml += '  wmode="transparent" ALIGN="">';
	novoHtml += '    <PARAM NAME="movie"   VALUE="'+_src+'">';
	novoHtml += '    <PARAM NAME="quality" VALUE="high">';
	novoHtml += '    <PARAM NAME="wmode"   VALUE="transparent">';
	novoHtml += '    <PARAM NAME="bgcolor" VALUE="#FFFFFF">';
	
	if(_params){
	  for(i=0; i < _params.length; i++){ novoHtml += _params[i]; }
	}
	
	if(_vars){
	  novoHtml += '    <PARAM NAME="FlashVars" VALUE="';
    for ( k in _vars ) {
       novoHtml += k+'='+_vars[k]+'&';
    }
    novoHtml += '">';
	}
	
	novoHtml += '    <EMBED src="'+_src+'" pluginspage="http://www.macromedia.com/go/getflashplayer" height="'+_h+'" width="'+_w+'"></EMBED>';
	novoHtml += '  </OBJECT>';
  document.write(novoHtml);
}
