//var dHeight = '187';
//var dWidth  = '250';
var dHeight = '384';
var dWidth  = '466';

function fWriteFlash(ID,file) {
//alert('ll');
	var html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "
	html = html + " width=" + dWidth + " height=" + dHeight + " ";
	html = html + "align='top'>";
	html = html + "<param name='scale' value='scale' />";
	html = html + "<param name='base' value='/' />"
	html = html + "<param name='movie' value='" + file + "' />"
	html = html + "<param name='quality' value='high' />";
	html = html + "<param name='autoPlay' value='true' />"

	html = html + "<embed src='" + file + "' quality='high' "
	html = html + "scale='scale ";
	html = html + "width=" + dWidth + " height=" + dHeight + " ";
	html = html + "align='top' ";
	html = html + "name='Flashfile' "
	html = html + "autoPlay='true' "
	html = html + "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	html = html + "</object>";
//alert(html);
	document.getElementById("FLASHMOVIE"+ID).innerHTML = html;
//	alert(html);
//	alert(document.getElementById("FLASHID"+ID).innerHTML);
}

function fWriteVideoFlash(file) {
	var so = new SWFObject("flvplayer.swf?theFile="+file+"&defaultImage=graphic.jpg&theVolume=100&startPlayingOnload=yes&popUpHelp=no&bufferSeconds=2&videoSmoothing=yes","flvplayer","425","355","8","#000000");
	so.addParam("movie","include/flvplayer.swf?theFile="+file+"&defaultImage=graphic.jpg&theVolume=100&startPlayingOnload=yes&popUpHelp=no&bufferSeconds=2&videoSmoothing=yes");
	so.addParam("bgcolor","#000000");
	so.write("FLASHMOVIE");

//	document.getElementById("FLASHMOVIE").innerHTML = html;

}

function f_play_flash(dFile) {
	var attributes = {  };
	var params = {  allowFullScreen: "true", menu: "false", movie: "/include/player_flv_maxi.swf"};
//	var flashvars = {  buffer: "5", title: "Post'tun Sesi", autoplay: "1", autoload: "1",  showstop: "1", showvolume: "1", showfullscreen: "1", showloading: "autohide", loadonstop: "0", showplayer: "autohide", showtime: "1", buffershowbg: "1", onclick: "none", ondoubleclick: "fullscreen", showmouse: "autohide", width: dWidth, height: dHeight, flv: dFile};
//	swfobject.embedSWF("/include/player_flv.swf", "myContent", dWidth, dHeight, "9.0.124", "include/expressInstall.swf", flashvars, params, false);

	var flashvars = { title:"Post'tun Sesi", autostart: "true",  showstop: "true", width:dWidth, height:dHeight, file: dFile};
	swfobject.embedSWF("include/mediaplayer.swf", "myContent", dWidth, dHeight, "9.0.115", "include/expressInstall.swf", flashvars, params, attributes);
}

function f_play_live() {
	var attributes = {  };
	var params = {  allowFullScreen: "true" ,menu: "false" };
	var flashvars = { id:"TGRT", title:"Test", autostart: "true",  showstop: "true", width:dWidth, height:dHeight, file: "rtmp://live.tgrt.de/live"};
//	var flashvars = { id:"TGRT", title:"Test", autostart: "true",  showstop: "true", width:dWidth, height:dHeight, file: "rtmp://10.21.100.1/rtplive/myStream.sdp"};

	swfobject.embedSWF("include/mediaplayer.swf", "myContent", dWidth, dHeight, "9.0.115", "include/expressInstall.swf", flashvars, params, attributes);
}

function f_play_test(id,streamid,streamfile,height,width) {
	var _divid="";
	var _streamid="";
	var _streamfile="";
	var _width=dWidth;
	var _height=dHeight;

	if ((id==null) && (id==undefined) )	{ _divid="myContent"; } else {_divid=id;}
	if ((streamid==null) && (streamid==undefined) )	{ _streamid="iha.sdp"; } else {_streamid=streamid}
	if ((streamfile==null) && (streamfile==undefined) )	{ _streamfile="rtmp://live.tgrt.de/rtplive"; } else { _streamfile=streamfile;}
	if ((width!=null) && (width!=undefined) )	{ _width=width; }
	if ((height!=null) && (height!=undefined) )	{ _height=height; }

	var attributes = {  };
	var params = {  allowscriptaccess: "always", wmode: "transparent", allowFullScreen: "true" ,menu: "false" };
	var flashvars = { stretching:"fill", mute:"true", file:_streamid, title:"Test", image:"test.png", volume:"100", autostart: "false",  showstop: "true", width:_width, height:_height, streamer: _streamfile, skin: "http://www.tgrt.de/iha/beelden.zip"};
//	var flashvars = { id:_streamid, title:"Test", autostart: "false",  showstop: "true", width:_width, height:_height, file: _streamfile};

	swfobject.embedSWF("/include/player5.swf", _divid, _width, _height, "9.0.115", "include/expressInstall.swf", flashvars, params, attributes);
//	swfobject.embedSWF("include/mediaplayer.swf", _divid, _width, _height, "9.0.115", "include/expressInstall.swf", flashvars, params, attributes);
}

function f_play_flash2(ID,file) {
		var so = new SWFObject("/include/flvplayer.swf", "flv-viewer",dWidth,dHeight, "9", "#000000");
		so.addParam( "allowFullScreen", "true");
		so.addParam("scale", "noscale"); 
		so.addParam("salign", "TL");				
		so.addVariable("flashvideo", file);
		so.addVariable("autoplay", "true");
		so.addVariable("loop", "false");			
		so.addVariable("skinfile", "/include/video-flash-de-skin2.swf");		
		so.addVariable("captionsfile", getQueryParamValue("captionsfile"));					
		so.write("FLASHMOVIE"+ID);
}

function f_play_flash3(ID,file) {
var mediaPlayer = new SWFObject('/include/flvplayer.swf', 'mediaplayerFlash', '485', '340', 9, '#ffffff');
//mediaPlayer.addParam('base', '/movies/');
//mediaPlayer.addParam('wmode','transparent');
//mediaPlayer.addParam('allowScriptAccess','always');
mediaPlayer.addParam('allowFullScreen','true');
mediaPlayer.addVariable("MediaItemID",file);

mediaPlayer.write('FLASHMOVIE');
}