 function escreveSwf(url, width, height, type, urlRoot){

	
	var strSWF = '';
	
	if( type == 'streaming' ){
		strSWF = strSWF + " <object width='" + width + "' height='" + height + "' align='left' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902' standby='Carregando o filme...' type='application/x-oleobject'>";
			strSWF = strSWF + " <param name='fileName' value='" + url + "'>";
			srtSWF = strSWF + " <param name='animationatStart' value='1'>";
			srtSWF = strSWF + " <param name='transparentatStart' value='1'>";
			strSWF = strSWF + " <param name='transparentatStop' value='1'>";
			strSWF = strSWF + " <param name='autoStart' value='0'>";
			strSWF = strSWF + " <param name='ShowControls' value='1'>";
			strSWF = strSWF + " <param name='ShowDisplay' value='0'>";
			strSWF = strSWF + " <param name='ShowTracker' value='0'>";
			strSWF = strSWF + " <param name='ShowStatusBar' value='1'>";
			strSWF = strSWF + " <param name='loop' value='0'>";


			strSWF = strSWF + " <embed";
				strSWF = strSWF + " width='" + width + "'";
				strSWF = strSWF + " height='" + height + "'";
				strSWF = strSWF + " src='" + url + "'";
				strSWF = strSWF + " type='application/x-mplayer2'";
				strSWF = strSWF + " animationatstart='1'";
				strSWF = strSWF + " transparentatStart='1'";
				strSWF = strSWF + " transparentatStop='1'";
				strSWF = strSWF + " autoStart='0'";
				strSWF = strSWF + " showcontrols='1'";
				strSWF = strSWF + " showdisplay='0'";
				strSWF = strSWF + " showstatusbar='1'";
				strSWF = strSWF + " showtracker='0'";
				strSWF = strSWF + " name='streame_" + url + "'";
				strSWF = strSWF + " id='stream_id_" + url + "'>";
			strSWF = strSWF + " </embed>";

		strSWF = strSWF + " </object>";
	}
	else if( type == 'tvmec' ){
		
		var displaywidth = width - 20;
		
		strSWF = strSWF + " <embed"; 
		strSWF = strSWF + " width='" + width + "'";
		strSWF = strSWF + " height='" + height + "'";
		strSWF = strSWF + " wmode='opaque'";
		strSWF = strSWF + " flashvars='file=" + url + "&width=" + width + "&height=" + height + "&displaywidth=" + width + "&displayheight=" + displaywidth + "&overstretch=true&autostart=true&showfsbutton=false'";
		strSWF = strSWF + " allowfullscreen='true'";
		strSWF = strSWF + " name='theMediaPlayer'";
		strSWF = strSWF + " bgcolor='#FFFFFF'"; 
		strSWF = strSWF + " pluginspage='http://www.macromedia.com/go/getflashplayer'"; 
		strSWF = strSWF + " type='application/x-shockwave-flash'";
		strSWF = strSWF + " src='plugins/content/denvideo/jwplayer.swf'/>";

	}
	else if( type == 'denvideo' ){
		
		
		if( url.search('http://') == 0 ){
			
			strSWF = strSWF + " <object ";
				strSWF = strSWF + " type=\"application/x-shockwave-flash\"";
				strSWF = strSWF + " style=\"width:"+width+"px;height:"+height+"px;\"";
				strSWF = strSWF + " data=\"plugins/content/jw_allvideos/players/mediaplayer_4.0.46.swf\">";
				strSWF = strSWF + " <param name=\"movie\" value=\"plugins/content/denvideo/jwplayer.swf\" />";
				strSWF = strSWF + " <param name=\"quality\" value=\"high\" />";
				strSWF = strSWF + " <param name=\"wmode\" value=\"opaque\" />";
				strSWF = strSWF + " <param name=\"autoplay\" value=\"true\" />";
				strSWF = strSWF + " <param name=\"allowfullscreen\" value=\"true\" />";
				strSWF = strSWF + " <param name=\"allowscriptaccess\" value=\"always\" />";
				strSWF = strSWF + " <param name=\"flashvars\" value=\"file="+url+"&autostart=false&controllbar=true&fullscreen=true&streamer=lighttpd&stretching=fill\" />";
			strSWF = strSWF + " </object>";
			
		}
		else if( url.search('mms://') == 0 ){
			strSWF = strSWF + " <object width='" + width + "' height='" + height + "' align='left' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902' standby='Carregando o filme...' type='application/x-oleobject'>";
			strSWF = strSWF + " <param name='fileName' value='" + url + "'>";
			srtSWF = strSWF + " <param name='animationatStart' value='1'>";
			srtSWF = strSWF + " <param name='transparentatStart' value='1'>";
			strSWF = strSWF + " <param name='transparentatStop' value='1'>";
			strSWF = strSWF + " <param name='autoStart' value='1'>";
			strSWF = strSWF + " <param name='ShowControls' value='1'>";
			strSWF = strSWF + " <param name='ShowDisplay' value='0'>";
			strSWF = strSWF + " <param name='ShowTracker' value='0'>";
			strSWF = strSWF + " <param name='ShowStatusBar' value='1'>";
			strSWF = strSWF + " <param name='loop' value='0'>";


			strSWF = strSWF + " <embed";
				strSWF = strSWF + " width='" + width + "'";
				strSWF = strSWF + " height='" + height + "'";
				strSWF = strSWF + " src='" + url + "'";
				strSWF = strSWF + " type='application/x-mplayer2'";
				strSWF = strSWF + " animationatstart='1'";
				strSWF = strSWF + " transparentatStart='1'";
				strSWF = strSWF + " transparentatStop='1'";
				strSWF = strSWF + " autoStart='1'";
				strSWF = strSWF + " showcontrols='1'";
				strSWF = strSWF + " showdisplay='0'";
				strSWF = strSWF + " showstatusbar='1'";
				strSWF = strSWF + " showtracker='0'";
				strSWF = strSWF + " name='streame_" + url + "'";
				strSWF = strSWF + " id='stream_id_" + url + "'>";
			strSWF = strSWF + " </embed>";

		strSWF = strSWF + " </object>";
		}
		else if( url.search( 'google' ) != 0, url.search( 'yahoo' ) != 0, url.search( 'youtube' ) != 0 ){
			
			strSWF = strSWF + " <embed"; 
			strSWF = strSWF + " width='" + width + "'";
			strSWF = strSWF + " height='" + height + "'";
			strSWF = strSWF + " wmode='opaque'";
			strSWF = strSWF + " flashvars='file=" + url + "&width=" + width + "&height=" + height + "&displaywidth=" + width + "&displayheight=" + height + "&overstretch=true&autostart=false&showfsbutton=false&fullscreen=true&streamer=lighttpd&stretching=fill'";
			strSWF = strSWF + " allowfullscreen='true'";
			strSWF = strSWF + " name='theMediaPlayer'";
			strSWF = strSWF + " bgcolor='#FFFFFF'"; 
			strSWF = strSWF + " pluginspage='http://www.macromedia.com/go/getflashplayer'"; 
			strSWF = strSWF + " type='application/x-shockwave-flash'";
			strSWF = strSWF + " src='plugins/content/jw_allvideos/players/mediaplayer_4.0.46.swf'/>";
			
		}
		else if ( url.search('.flv') == 0 ){
			
			strSWF = strSWF + " <object width='" + width + "' height='" + height + "' align='left' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,0902' standby='Carregando o filme...' type='application/x-oleobject'>";
				strSWF = strSWF + " <param name='fileName' value='" + url + "'>";
				srtSWF = strSWF + " <param name='animationatStart' value='1'>";
				srtSWF = strSWF + " <param name='transparentatStart' value='1'>";
				strSWF = strSWF + " <param name='transparentatStop' value='1'>";
				strSWF = strSWF + " <param name='autoStart' value='1'>";
				strSWF = strSWF + " <param name='ShowControls' value='1'>";
				strSWF = strSWF + " <param name='ShowDisplay' value='0'>";
				strSWF = strSWF + " <param name='ShowTracker' value='0'>";
				strSWF = strSWF + " <param name='ShowStatusBar' value='1'>";
				strSWF = strSWF + " <param name='loop' value='0'>";
	
	
				strSWF = strSWF + " <embed";
					strSWF = strSWF + " width='" + width + "'";
					strSWF = strSWF + " height='" + height + "'";
					strSWF = strSWF + " src='" + url + "'";
					strSWF = strSWF + " type='application/x-mplayer2'";
					strSWF = strSWF + " animationatstart='1'";
					strSWF = strSWF + " transparentatStart='1'";
					strSWF = strSWF + " transparentatStop='1'";
					strSWF = strSWF + " autoStart='1'";
					strSWF = strSWF + " showcontrols='1'";
					strSWF = strSWF + " showdisplay='0'";
					strSWF = strSWF + " showstatusbar='1'";
					strSWF = strSWF + " showtracker='0'";
					strSWF = strSWF + " name='streame_" + url + "'";
					strSWF = strSWF + " id='stream_id_" + url + "'>";
				strSWF = strSWF + " </embed>";
	
			strSWF = strSWF + " </object>";
			
		}
		else{
			
			strSWF = strSWF + " <embed"; 
			strSWF = strSWF + " width='" + width + "'";
			strSWF = strSWF + " height='" + height + "'";
			strSWF = strSWF + " wmode='opaque'";
			strSWF = strSWF + " flashvars='file=" + url + "&width=" + width + "&height=" + height + "&displaywidth=" + width + "&displayheight=" + height + "&overstretch=true&autostart=false&showfsbutton=false&fullscreen=true&streamer=lighttpd&stretching=fill'";
			strSWF = strSWF + " allowfullscreen='true'";
			strSWF = strSWF + " name='theMediaPlayer'";
			strSWF = strSWF + " bgcolor='#FFFFFF'"; 
			strSWF = strSWF + " pluginspage='http://www.macromedia.com/go/getflashplayer'"; 
			strSWF = strSWF + " type='application/x-shockwave-flash'";
			strSWF = strSWF + " src='plugins/content/jw_allvideos/players/mediaplayer_4.0.46.swf'/>";
			
		}
		
	}
	else{

		strSWF = strSWF + ' <object data="plugins/content/jw_allvideos/players/mediaplayer_4.0.46.swf" style="width: ' + width + ' height: '+ height + '" type="application/x-shockwave-flash">';
			strSWF = strSWF + '	<param name=\'movie\' value=\'plugins/content/denvideo/player.swf\' />';
			strSWF = strSWF + ' <param value=\'file=' + url + '&autostart=false&fullscreen=true\' name=\'flashvars\'/>';
			strSWF = strSWF + '	<param value="true" name="allowfullscreen"/>';
			strSWF = strSWF + '	<param value="always" name="allowscriptaccess"/>';
			strSWF = strSWF + '	<param name="quality" value="high" />';
			strSWF = strSWF + '	<param value="" name="bgcolor"/>';
			strSWF = strSWF + '	<param value="false" name="autoplay"/>';
			strSWF = strSWF + '	<param name="wmode" value="opaque" />';
		strSWF = strSWF + ' </object>';

	}
	document.write(strSWF);
}
