
function loadFLV (name, src, preview,  width, height, autostart, title, description, section, useLogo, testing) {
		document.getElementById(name).innerHTML = '';
//alert('loadFLV ('+ name +', '+ src +', '+ preview +', '+ title +', '+ width +', '+ height +', '+ autostart +', '+ description +')');
	loadFile (name, src, preview, width, height, autostart, section, 'video_player', useLogo, testing);
	if (typeof title != "undefined" && '' != title) {
		document.getElementById('video_title').innerHTML = title;
	}
	if (typeof description != "undefined" && '' != description) {
		document.getElementById('video_description').innerHTML = description;
	}
}
function loadFile(name, src, preview, width, height, autoplay, section, playerType, useLogo, testing) {
		var volumetype = '';
        var _width = width;
        var _height = height;
        var _name = name;
		if (_width > 350)
		{
			var plyId = 'myPLY_big';
		}
		else
		{
			var plyId = 'myPLY_small';
		}
		var fo = new SWFObject("/cms/thirdparty/NoFlvPlayer_v8.swf", plyId, _width, _height, "9","#000000", true);

        fo.addParam("quality", "high");
        fo.addParam("wmode", "transparent");
        fo.addParam("menu", "false");
		fo.addParam("allowfullscreen","true");
		fo.addParam("allowScriptAccess","always");

		if (useLogo == true) {
			fo.addVariable("logo", "/images/default/logo_milupa.png");
		}
        fo.addVariable("file",src);
        if(preview != "" && preview != null) {
                fo.addVariable("image", preview);
        }
        if(autoplay == "true") {
                fo.addVariable("autostart","false");
        } else {
                fo.addVariable("autostart","false");
		}
        if(volumetype != "" && volumetype != null) {
                fo.addVariable("volumetype", volumetype);
        }
		fo.addVariable("starttxt","Click aici...");
		fo.addVariable("buffer","Se incarca...");
		fo.addVariable("backcolor","0x8CAA46");
		fo.addVariable("frontcolor","0xFFFFFF");
		fo.addVariable("lightcolor","0xFFFFFF");
		fo.addVariable("width",_width);
		fo.addVariable("height",_height);
		//fo.addVariable("logo","/flv-logo.png");

		/* Player events */
		fo.addVariable("StartEvent", plyId + "_OnStart");
		fo.addVariable("StopEvent", plyId + "_OnStop");
		fo.addVariable("PauseEvent", plyId + "_OnPause");
		fo.addVariable("ContinueEvent", plyId + "_OnContinue");
		fo.addVariable("TimeEvent", plyId + "_OnTime");

		/* X1 Banner parameters */
		var category = document.location.pathname.replace(RegExp("(.+/)[^/]+"), "$1");

		var x1adparams = "";	
		if (undefined == category || '' == category) {
			x1adparams = "pub=632203491294404&site=csid&section=homepage&zone=rectangle_video&size=0x0";
		}
		else if ('undefined' != category && ('/health/' == category || '/health//' == category ) && _width > 350)
		{
			x1adparams = "pub=632203491294404&site=csid&section=csid_emisiunetv&zone=rectangle_video&size=0x0";
		}
		else if ('undefined' != category && ( '/family/miscarea-la-bebelusi/' == category || '/family/miscarea-la-bebelusi//' == category))
		{
			x1adparams = "pub=632203491294404&site=csid&section=csid_kids&zone=rectangle_video&size=0x0";
		}
		else {
			x1adparams = "pub=632203491294404&site=csid&section=site&zone=rectangle_video&size=0x0";
		}
		
		fo.addVariable("x1adparams", escape(x1adparams));
		fo.addVariable("x1adzones", "<root closeButton='2' showOverlayAgainAfterMiddleZone='1' displayModeWhenOverlaysIntersect='1'><zone type='preroll' key='ad_break_preroll' max='5'/><zone type='midroll' key='ad_break_midroll_01' per='30' max='5'/><zone type='midroll' key='ad_break_midroll_02' per='60' max='5'/><zone type='midroll' key='ad_break_midroll_03' per='80' max='5'/><zone type='postroll' key='ad_break_postroll' max='5'/></root>");		
	
		fo.addVariable("x1pgid",		window.X1_PgId);
		fo.addVariable("x1url",			escape(document.URL));
		fo.addVariable("x1referrer",	escape(document.referrer));

		if (playerType == 'audio_player' )
		{
			fo.addVariable("x1disabled",	"true");
		}else
		{
			fo.addVariable("x1disabled",	"false");
		}
		
		fo.addVariable("contextmenulink","#");
		fo.addVariable("contextmenuitem","Copyrighted by CSID");
 		fo.write(_name);
		
}	

