/******************************************************************/
/*ARD Blankplayer Version 1.19.5							*/
/******************************************************************/
/* (C)  DMC 01 Consulting & Development GmbH - gerald.urbas@dmc01.at */
/******************************************************************/
/* Flashmedia Frontend Code Plugin                          */
/******************************************************************/
/* Object generates Flashmedia HTML code                          */
/* can get evolved for styled buttons. able to provide            */
/* Flashmedia-Interface player plugin                             */
/******************************************************************/
//if (detected_plugin_versions['flashmedia']>=9) {

function flashmedia_Playercode(pt,vf) {
	this.name = "Flash"; // player frontend name
	this.shortname = "Flash"; // player frontend name
	this.typ = "flashmedia"; // Type
	this.detectionplugin = "Shockwave Flash"; // detection plugin string
	this.debugflash = flashdebug;
	this.objid="FLASHCONTENT"+Math.round(Math.random()*10000); // Object ID 4 HTML
	this.playertype = pt; // home or extended or simple
	this.videoformat = vf; // home or extended or simple
	this.connurls = false; // initially there are no urls
	this.swfobjectversion = SWFOBJECTVERSION;
	this.previewimage = false;
	try {
        if (!this.player_world) {
                this.playerurl = FLASHPLAYERFILE+'?benicetoie6='+this.objid;
        } else {
                this.playerurl = FLASHPLAYERFILE_WORLD+'?benicetoie6='+this.objid;
        }
	} catch (e) {
			this.playerurl = FLASHPLAYERFILE+'?benicetoie6='+this.objid;
			try {
				if (!this.player_world) {
					this.playerurl = FLASHPLAYERFILE+'?benicetoie6='+this.objid;
				} else {
					this.playerurl = FLASHPLAYERFILE_WORLD+'?benicetoie6='+this.objid;
				}
			} catch (e) {
				this.playerurl = FLASHPLAYERFILE+'?benicetoie6='+this.objid;
			}
	}
	this.skinnningurl = FLASHSKINNNINGFILE;
	this.connectionxml = FLASHCONNXMLFILE;
	this.bgcolor=FLASHBGCOLOR; // background color SWF Object
	this.playercontrols={// special HTML tag properties for embedding, and object code in HTML frontend
		'simple':{
			'embed':'controls="ImageWindow"',
			'object':'<param name="controls" value="ImageWindow" />'
			},
		'home':{
			'embed':'controls="ImageWindow"',
			'object':'<param name="controls" value="ImageWindow" />'
			},
		'extended':{
			'embed':'controls="ImageWindow,StatusBar"',
			'object':'<param name="controls" value="ImageWindow,StatusBar" />'
		}
	};

	// define Flash embed sizes in config.js
	this.FLASHEMBEDAUDIOW=FLASHEMBEDAUDIOW;
	this.FLASHEMBEDAUDIOH=FLASHEMBEDAUDIOH;
	this.FLASHEMBEDSIMPLEW=FLASHEMBEDSIMPLEW;
	this.FLASHEMBEDSIMPLEH=FLASHEMBEDSIMPLEH;
	this.FLASHEMBEDW=FLASHEMBEDW;
	this.FLASHEMBEDH=FLASHEMBEDH;
	this.FLASHEMBEDHQW=FLASHEMBEDHQW;
	this.FLASHEMBEDHQH=FLASHEMBEDHQH;

	this.playercontrolsheight={ // all Players generet there own control heigts... wo correction values definined here
		'simple':{
			'embed':0,
			'object':0
			},
		'home':{
			'embed':0,
			'object':0
			},
		'extended':{
			'embed':29,
			'object':29
			}
	};

		//alert('use swfobject2');
	if (this.swfobjectversion==2) {
		// there are replaceable strings defined in player.js, %varname%.. used in this strings
		// we usw swfobject to create Flash embed/objectcode/...
		var temp = "";
		var swfobjflashvars 	= '{ objId:"'+this.objid+'",'
									+' isLiveStream:"%ISLIVE%",'
									+' mp3data:"%AUDIO%",'
									+' localmp3:"%ISMP3%",'
									+' server:"%SERVER%",'
									+' starget:escape("%FILENAME%"),'
									+' sheight:"%H%",'
									+' swidth:"%W%",'
									+' autoStart:"%AUTOSTART%",'
									+' buffer:"%BUFFER%",'
									+' previewImage:"%PREIMG%",'
									+' startMovieAt:"%STARTAT%",'
									+' xmlFile:"'+this.skinnningurl+'",'
									+' xmlConnectFile:"'+this.connectionxml+'",'
									+' showRecommend:"'+show_recommend+'",'
									+' debugmodus:"'+this.debugflash+'",'
									+' smode:"//MODE//" '
									+' } ';
		var swfobjparams		= '{ scale: "exactFit", swliveconnect:true , id:"'+this.objid+'", name:"'+this.objid+'",bgcolor:"'+this.bgcolor+'", allowfullscreen:"true", allownetworking:"all" } ';//allowscriptaccess:"always",
		var swfobjattributes 	= '{ style:";"  } ';

		temp  = swfobjflashvars.replace('//MODE//',0);
		this.jscode = 'swfobject.embedSWF("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDW%", "%FLASHEMBEDH%", "%VERSION%", false, '+temp+', '+swfobjparams+', '+swfobjattributes+' );';

		temp  = swfobjflashvars.replace('//MODE//',1);
		this.jscodehq = 'swfobject.embedSWF("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDHQW%", "%FLASHEMBEDHQH%", "%VERSION%", false, '+temp+', '+swfobjparams+', '+swfobjattributes+' );';

		temp  = swfobjflashvars.replace('//MODE//',3);
		this.jscodesimple = 'swfobject.embedSWF("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDSIMPLEW%", "%FLASHEMBEDSIMPLEH%", "%VERSION%", false, '+temp+', '+swfobjparams+', '+swfobjattributes+' );';

		temp  = swfobjflashvars.replace('//MODE//',3);
		this.jscodehome = 'swfobject.embedSWF("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDSIMPLEW%", "%FLASHEMBEDSIMPLEH%", "%VERSION%", false, '+temp+', '+swfobjparams+', '+swfobjattributes+' );';

		temp  = swfobjflashvars.replace('//MODE//',2);
		var swfobjparams_popup	= '{ swliveconnect:true , id:"'+this.objid+'popupid", name:"'+this.objid+'popupid",bgcolor:"'+this.bgcolor+'", allowfullscreen:"true", allownetworking:"all" } ';//allowscriptaccess:"always",
		var swfobjattributes_popup	= '{ style:";"  } ';
		this.jscodepopup = 'swfobject.embedSWF("'+this.playerurl+'&andtopopups=1", "popupcontent", "100%", "100%", "%VERSION%", false, '+temp+', '+swfobjparams_popup+', '+swfobjattributes_popup+' );';
		//alert(this.jscode+" "+this.jscodepopup)
		temp  = swfobjflashvars.replace('//MODE//','%MODE%');
		this.jsaudio = 'swfobject.embedSWF("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDAUDIOW%", "%FLASHEMBEDAUDIOH%", "%VERSION%", false, '+temp+', '+swfobjparams+', '+swfobjattributes+' );';
	}
	if (this.swfobjectversion==1) {
		// there are replaceable strings defined in player.js, %varname%.. used in this strings
		// we usw swfobject to create Flash embed/objectcode/...
		this.jscode = '  var so = new SWFObject("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDW%", "%FLASHEMBEDH%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "'+this.objid+'");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "0");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
	                    + '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("'+this.objid+'div");';
		// HQ needs some special things
		this.jscodehq = '  var so = new SWFObject("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDHQW%", "%FLASHEMBEDHQH%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "'+this.objid+'");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "1");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
						+ '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("'+this.objid+'div");';
		// HQ needs some special things
		this.jscodesimple = '  var so = new SWFObject("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDSIMPLEW%", "%FLASHEMBEDSIMPLEH%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "'+this.objid+'");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "3");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
						+ '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("'+this.objid+'div");';
		// SWF 4 Home
		this.jscodehome = '  var so = new SWFObject("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDSIMPLEW%", "%FLASHEMBEDSIMPLEH%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "'+this.objid+'");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "3");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
						+ '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("'+this.objid+'div");';

		// Popup needs too some special things
		this.jscodepopup = '  var so = new SWFObject("'+this.playerurl+'&andtopopups=1", "'+this.objid+'popupid", "100%", "100%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "popupcontent");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "2");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
						+ '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("popupcontent");';
		// Popup needs too some special things
		this.jsaudio = '  var so = new SWFObject("'+this.playerurl+'", "'+this.objid+'", "%FLASHEMBEDAUDIOW%", "%FLASHEMBEDAUDIOH%", "%VERSION%", "'+this.bgcolor+'");'
//                    + '  so.addParam("wmode", "transparent");'
	                    + '  so.addParam("swliveconnect", "true"); '
	                    + '  so.addVariable("objId", "'+this.objid+'");'
	                    + '  so.addVariable("isLiveStream", "%ISLIVE%");'
	                    + '  so.addVariable("mp3data", "%AUDIO%");'
	                    + '  so.addVariable("localmp3", "%ISMP3%");'
	                    + '  so.addVariable("server", "%SERVER%");'
	                    + '  so.addVariable("starget", escape("%FILENAME%"));'
	                    + '  so.addVariable("sheight", "%H%");'
	                    + '  so.addVariable("swidth", "%W%");'
	                    + '  so.addVariable("smode", "%MODE%");' //normal 0 / hq 1 / popup 2
	                    + '  so.addVariable("autoStart", "%AUTOSTART%");'
	                    + '  so.addVariable("buffer", "%BUFFER%");'
	                    + '  so.addVariable("xmlFile", "'+this.skinnningurl+'");'
	                    + '  so.addVariable("xmlConnectFile", "'+this.connectionxml+'");'
	                    + '  so.addVariable("showRecommend", "'+show_recommend+'");'
						+ '  so.addVariable("previewImage", "%PREIMG%");'
						+ '  so.addVariable("startMovieAt", "%STARTAT%");'
						+ '  so.addVariable("debugmodus", "'+this.debugflash+'");'
	                    + '  so.setAttribute("style", ";");'
	                    + '  so.write("'+this.objid+'div");';

		//this.flashparams = this.jscode;
		//this.flashparams = "";
	}

	// Jquery inserts just this div as target for swfobject
	this.playerJScodeString="";
	this.PopupplayerJScodeString="";
					if ($j.browser.msie) {
						this.playerJScodeString += '<script type="text/javascript" event="FSCommand(command,args)FSCommand(command,args)"  for="'+this.objid+'">';
						this.playerJScodeString += '	if (command == "setMovieTime") {';
						this.playerJScodeString += '		startat=args;';
						this.playerJScodeString += '	};';
						this.playerJScodeString += '</script>';

						this.PopupplayerJScodeString += '<div><span style="display:none">js</span><script type="text/javascript" event="FSCommand(command,args)" for="'+this.objid+'popupid">';
						this.PopupplayerJScodeString += '	if (command == "setMovieTime") {';
						this.PopupplayerJScodeString += '		startat=args;';
						this.PopupplayerJScodeString += '	};';
						this.PopupplayerJScodeString += '</script><div>';
					} else {
						this.playerJScodeString += '<script type="text/javascript">';
						this.playerJScodeString += 'function '+this.objid+'_DoFSCommand(command, args) {';
						this.playerJScodeString += '	if (command == "setMovieTime") {';
						this.playerJScodeString += '		startat=args;';
						this.playerJScodeString += '	}';
						this.playerJScodeString += '}';
						this.playerJScodeString += '</script>';

						this.PopupplayerJScodeString += '<script type="text/javascript">'+"\n";
						this.PopupplayerJScodeString += 'function '+this.objid+'popupid_DoFSCommand(command, args) {'+"\n";
						this.PopupplayerJScodeString += '	if (command == "setMovieTime") {'+"\n";
						this.PopupplayerJScodeString += '		startat=args;'+"\n";
						this.PopupplayerJScodeString += '	}'+"\n";
						this.PopupplayerJScodeString += '}'+"\n";
						this.PopupplayerJScodeString += '</script>'+"\n";
					}

	if (this.swfobjectversion==1) {
		this.playerstring = '<div id="'+this.objid+'div" class="playerflashposition">';
	    this.playerstring +=  'Dieser Text wird durch den Flashinhalt ersetzt.(swfoversion1)';
	    this.playerstring +=  '</div>';
	}
	if (this.swfobjectversion==2) {
		this.playerstring = '<div id="'+this.objid+'" class="playerflashposition">';
	    this.playerstring +=  'Dieser Text wird durch den Flashinhalt ersetzt.(swfoversion2)';
	    this.playerstring +=  '</div>';
	}
	//this.playerstring +=  this.playerJScodeString;

	this.playercall= function() { // callback after rendering. RP doesnt use it here.
		movieName = this.objid;
		var conn = arguments[1]; // get conn param
		var code=this.jscode; // get the JS code
		if (conn==3) { // if Conn is HQ we use another SWFobjectbase
			var code=this.jscodehq;
		}
		if (this.playertype=='home') {
			var code=this.jscodehome;
		}
		if (this.playertype=='simple') {
			var code=this.jscodesimple;
		}
		if (this.mp3stream==1) {
			var code=this.jsaudio;
		}
		if (this.videoformat=='audio') {
			var code=this.jsaudio;
		}
		if (this.playertype=='extended' && this.FLASHEMBEDW<380 && conn!=3) {
			var code=this.jscodesimple;
		}
		code = this.replace(code,conn);	 // use replace funtion definiend in player prototype for filling out %vars%
		eval(code); // eval the code... Jquery pasted code doesnt interpete JS so we need to eval it...
        //
        // SWR: hmm, you should test if you found what you searched ...
        //
//		if ($j.browser.msie) {
//			$j('#page').append('<div id="'+this.objid+'jsflash"><span style="display:none">.</span></div>');
//			t = document.getElementById(this.objid+'jsflash');
//			t.innerHTML = t.innerHTML+this.playerJScodeString;
//		}
		playmovie(this.objid);
	};

	 // add public methods
	this.enabled = true;
	this.write = writeplayercode;
	this.replace = replaceVars;
	this.setsizes = setsizes;
	this.setconn = setconn;
	this.setplayertype = setplayertype;
	this.setautostart = setautostart;
	this.setglobid = setglobid;
	this.call_popup = playerFlashFullscreen;
	this.close_popup = playerPopupClose;
	this.call_carrier = carrierPopup;
	this.cutflv = cutflv;
	this.cutmp3 = cutmp3;
	this.setPreviewimage = setPreviewImage;
	this.getPreviewimage = getPreviewImage;
	this.previewImage = previewImagecall;
	this.prepareHqMode = prepareHqMode;
	this.prepareCloseHqMode = prepareHqMode;
	// add inline methods
	this.popup = function() { // this function is used by the popup window... (see doc there)

		var code=this.jscodepopup;
		conn = player.settings['conn'];
		code = this.replace(code,conn);
		if ($j.browser.msie) {
			code +="\nvar t = document.getElementById('popupcontentjs');\n";
			code +="t.innerHTML = t.innerHTML+'"+this.PopupplayerJScodeString+"';\n";
		}
		//alert(code);
		return code;
		//dofullscreen(this.objid);
	};
	this.getconn = function () {
		return this.connurls;
	};
	this.report = function () {
		return "Player:"+this.name+" obid:"+this.objid+" url:"+this.connurls;
	};
	// later this can be evolved to provide transparent and identically Interfaces
	// play button

	this.shutdown = function () {
		return;
	};

	this.play = function () {
		dbg("Flash this.play "+movieName);
		playmovie(this.objid);
	};
	// pause button
	this.pause = function () {
		this.stop();
	};

	this.stop = function () {
		stopmovie(this.objid);
	};


	this.fullscreen = function() {
		//this.stop();
		//this.call_popup();
	};

	this.carrier = function () {
		this.call_carrier(170);
	};

	this.debug = function (str) { // debuglayer is deativated @ moment
		dbg("flashplugin: "+str);
	};

	this.testscriptconn  = function () {
		//alert("flash")
		// Flash does normal popups.. so return always true
		return true;
	};


	this.getposition = function () {
		return;
	};

	this.getstate = function () {
		return;
	};
	 // add anonn methods
}
//} else {

//flashmedia_Playercode = quicktime_Playercode;

//}
// Prototype of this object is playercode
flashmedia_Playercode.prototpe = new playercode();

//global popup var for flashplayer
var popup=false;


function flashpopup() { // callback from SWF, opening Popup Fullscreenplayer
	dbg("flashpopup function deprecated");
	//alert("flashpopup")
	//popup = window.open('popup.html','fpopup','directories=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,location=no,hotkeys=no')
	//popup.player = player;
	//popup.focus();
}

function flashpopupback() { // callback from SWF,  Popup SWF state calls this for closing the window
	dbg("flashpopupback function deprecated");
	//opener.popup.close();
}

function flashhqclose(){ // callback from SWF, Close the HQ player from Flash
	player.closeHqPlayer();
}

var o_movieName = false;
var obj_f_popup =false;



var videoopended = false;

function playerFlashFullscreen() {
	//dbg('FULLSCREEN CALL'+this.objid);
	//dofullscreen(this.objid);
}

function videoclick(id) {
	dbg("Clicked into the Videoframe: "+id);
	dbg("Function deprecated");
	/*if (videoopended==false && typeof(player) != "undefined" && player.player_type=='home') {
		dbg("Loadpopup");
		player.loadPopup();
		videoopended = true;
	} else {
		dbg("videoclick: "+id+" no Popup in this mode")
	}*/
	return;
};


		//var movieName = "player";

function thisMovie(mymovieName) {
	dbg("thisMovie: "+mymovieName);
	// IE and Netscape refer to the movie object differently.
	// This function returns the appropriate syntax depending on the browser.
	if (typeof(obj_f_popup) != "undefined" && obj_f_popup!=false) {
		if (navigator.appName.indexOf ("Microsoft") !=-1) {
			return obj_f_popup.window[mymovieName];
		} else {
			return obj_f_popup.document[mymovieName];
		}
	}
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
		return window[mymovieName];
	} else {
		return document[mymovieName];
	}
};

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
	dbg("movieIsLoaded: "+theMovie);
	if (typeof(theMovie) != "undefined" && theMovie!=undefined) {
		try {
			return theMovie.PercentLoaded() == 100;
		} catch(e) {
			dbg("theMovie.PercentLoaded is not defined "+e);
		}
	} else {
		dbg("theMovie is undefined");
		return false;
	}
};

function playmovie() {
	dbg("playmovie: "+movieName);
	if (movieIsLoaded(thisMovie(movieName))) {
		try {
			thisMovie(movieName).TPlay("_level0/mc");
		} catch(e) {dbg(e)}
	}
};

function stopmovie(mymovieName) {
	dbg("stopmovie: "+mymovieName);
		//alert(1)
	//alert(mymovieName)
	if (movieIsLoaded(thisMovie(mymovieName))) {
		thisMovie(mymovieName).TGotoLabel("_level0/mc", "stop");
		//alert(2+" "+mymovieName)
	}
};

function flashescape(id) {
	dbg("flashescape: "+id);
	var flashpopupclosed=false;
	try {
		if (typeof opener.player!="undefined") {
			opener.player.closePopup();
			window.close();
			flashpopupclosed=true;
		}
	} catch(e) {
			dbg("flashescape: popup escape failed "+id+" "+e);
	}
	try {
		if (flashpopupclosed==false && player.settings['conn']==3) {
			player.closeHqPlayer();
		}
	} catch(e) {
		dbg("flashescape: HiqhQ failed "+id+" "+e);
	}
};

function flashplayexecute(id) {
	dbg("flashplayexecute: "+id);
	for (p in loaded_Players) {
		var pobj = loaded_Players[p];
		var pobj_id= pobj.players[pobj.currentplayer].objid;
		if (pobj_id!=id) {
			dbg("stop"+" "+pobj_id);
			stopmovie(pobj_id);
		} else {
		pobj.countIVW();
		}
	}
};


function moviestopped(id) {
	dbg("moviestopped"+id);
	if (typeof player!="undefined") {
		if (player.player_type == 'extended') {
			dbg("moviestopped - show recommend pane");
			var tab = "recommend";
			$j("#b_"+ec_current).removeClass("optActive"); // remove Class from old current
			var tab = "recommend";
			if (player.function_urls[tab]!=false) {
				closeHelpInfoObj();
				var cobj = $j("#optionBoxContainer"); // tab content container
				var obj = $j("#b_"+tab); // the ivotebutton
				var url = player.function_urls[tab]; // Some URL defined in the baseHTML code
				cobj.empty(); // first empty the content container
				loading($j('#optionBoxContainer')); // loading animation
				cobj.load(url+APPHTMLEXTENSION,null); // load the url
				cobj.attr("url",url); // set an attr (used by button funcitons
				$j.getScript(url+APPJSEXTENSION); // Some Tabvs need some aditional JS code... but infopane doesnt!
				obj.addClass("optActive"); // Add correct klass to Button obj.
				ec_current = tab; // set current layer... later used to deativate Buttons--
			}
		} else {
			dbg("moviestopped - player is not extended!");
		}
	} else {
		dbg("moviestopped - player object is not avaible!");
	}
};
if (!$j.browser.msie) {
	document.writeln('<script type="text/javascript">');
	document.writeln('function setMovieTime(time) {');
	document.writeln('dbg("Parent set Time (JS )"+time); startat = time;');
	document.writeln('}');
	document.writeln('</scr' + 'ipt>');
} else {
	document.writeln('<script type="text/javascript">');
	document.writeln('function setMovieTime(time) {');
	document.writeln('dbg("Parent set Time (JS IE)"+time);startat = time;');
	document.writeln('}');
	document.writeln('</scr' + 'ipt>');
};
