
phpPath="../movies/flvprovider.php";


detectFlashPlayer=true;

fullScreenFunction=true;




bufferTime=1;
volume=100;
autoStart=true;
startPauseMode="First Frame";
picturesFolder="pictures";
startShowControls=true;
endBehaviour="Stop";
endFullScreenBackToNormal=true;
endJavascriptFunction="";
stopCloseConnect=true;
differentVersions=true;
version_hi_value=1000;
version_medium_value=500;
version_low_value=100;
version_hi_extension="_1000";
version_medium_extension="_500";
version_low_extension="_100";
playerWidth=384;
playerHeight=288;
//playerWidth=768;
//playerHeight=576;
autoSize="Off";
blackBorderWidth=0;
blackBorderHeight=0;
playerColor="#2B7DA5";
barColor="#FFFFFF";
playbarColor="#FFFFFF";
screenBorder=false;
screenBorderColor="#FFFFFF";
buttonsColor="#FFFFFF";
timeColor="#FFFFFF";
backgroundColor="#FFFFFF";
backgroundAlpha=100;
controlsY=0;
controlsYFullScreen=60;
playerColorFullScreen="#2B7DA5";
barColorFullScreen="#000000";
playbarColorFullScreen="#FFFFFF";
buttonsColorFullScreen="#FFFFFF";
timeColorFullScreen="#FFFFFF";
backgroundColorFullScreen="#000000";
backgroundAlphaFullScreen=100;
controls="Show";
stopButton=true;
stopButtonFirst=true;
rewindFastForwardButtons=true;
rw_ff_interval=4;
volumeSlider=true;
showTimecode=true;
controlsBarPress=true;
timeFormat="mm:ss|duration";
doubleClickListener=true;
bufferMessage=true;
bufferText="buffering";
bufferTextColor="#FFFFFF";
bufferTextBackgroundColor="#993333";
bufferTextBackgroundAlpha=40;
bufferTextPosition="Upper Right";
logo=true;
logoPath="swf/logo.swf";
logoPosition="Upper Right";
logoAlpha=70;
logo_x=10;
logo_y=10;
playCommercialFirst=false;
commercialMovieName="";
commercialLink="";
commercialText="Der Film startet nach dieser Werbeeinblendung...";
commercialTextColor="#333333";
commercialTextBold=true;
subtitleXML="";
subVisible=true;
subButton=false;
subButtonOffColor="#CCCCCC";
subColor="#FFFFFF";
subBackground=true;
subBackgroundColor="#333333";
subBackgroundAlpha=40;
subFontSize=14;
autohideSubBackground=false;
subAlign="center";
blankLineListMode=2;
subColorFullScreen="#FFFFFF";
subBackgroundFullScreen=false;
subBackgroundColorFullScreen="#993333";
subBackgroundAlphaFullScreen=40;
subFontSizeFullScreen=20;
autohideSubBackgroundFullScreen=false;
subAlignFullScreen="center";
blankLineFullScreen=2;
detectPopUpTitle="Adobe Flash Player Version";
detectPopUpText1="Sie haben Flash Player<br>version ";
detectPopUpText2=" installiert.<br><br>Vollbildschirm<br>funktioniert mit dem neuen Flash Player.";
detectPopUpButton1="Get Flash";
detectPopUpButton2="Weiter";
displayBandwidthDetectPopUp=true;
bandwidthDetectPopUpTitle="Automatische Filmgroessenauswahl";
bandwidthDetectPopUpText1="Ihre Internetgeschwindigkeit wird ermittelt<br>Bitte warten...";
bandwidthDetectPopUpText2="Ihre Geschwindigkeit:<br>"
displayLoadingMoviePopUp=true;
loadingMoviePopUpTitle="Ladevorgang...";
loadingMoviePopUpText="Film wird geladen<br>Bitte warten..."
bandwidthSelectPopUpTitle="Bandbreitenauswahl";
bandwidthSelectPopUpButton1="Langsam";
bandwidthSelectPopUpButton2="Mittel";
bandwidthSelectPopUpButton3="Schnell";
bandwidthTextForLowBandwidth="Langsam";
bandwidthTextForMediumBandwidth="Mittel";
bandwidthTextForHiBandwidth="Schnell";
bandwidthSelectPopUpText1="";
bandwidthSelectPopUpText2=" Bandbreite gewählt :<br>";
bandwidthSelectPopUpText3=" Kbps Film.<br><br>Bitte wählen Sie die gewünschte Bandbreite:";
displayInfoPopUp=true;
infoPopUpTitle="Filmauswahl";
infoPopUpText="Bitte wählen Sie einen Film aus der gewählten Kategorie"
swfPath="swf/player";
swfID="player";
speedClipPath="swf/speedClip";
swfWidth=playerWidth;
swfHeight=playerHeight+controlsY+1;
swfBackgroundColor="#FFFFFF";


var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
			str +='swLiveConnect=true ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


function createObject() {

AC_FL_RunContent(
			"src", swfPath,
			"FlashVars", "version_hi_value="+version_hi_value+'&version_medium_value='+version_medium_value+'&version_low_value='+version_low_value+'&version_hi_extension='+version_hi_extension+'&version_medium_extension='+version_medium_extension+'&version_low_extension='+version_low_extension+'&detectFlashPlayer='+detectFlashPlayer+'&phpPath='+phpPath+'&movieName='+movieName+'&differentVersions='+differentVersions+'&subtitleXML='+subtitleXML+'&autoSize='+autoSize+'&playerWidth='+playerWidth+'&playerHeight='+playerHeight+'&bufferTime='+bufferTime+'&autoStart='+autoStart+'&endBehaviour='+endBehaviour+'&controls='+controls+'&screenBorder='+screenBorder+'&controlsY='+controlsY+'&stopButton='+stopButton+'&rewindFastForwardButtons='+rewindFastForwardButtons+'&subButton='+subButton+'&volumeSlider='+volumeSlider+'&playerColor='+playerColor+'&playbarColor='+playbarColor+'&timeColor='+timeColor+'&barColor='+barColor+'&buttonsColor='+buttonsColor+'&screenBorderColor='+screenBorderColor+'&subColor='+subColor+'&subButtonOffColor='+subButtonOffColor+'&subBackgroundColor='+subBackgroundColor+'&subBackgroundAlpha='+subBackgroundAlpha+'&backgroundColor='+backgroundColor+'&backgroundAlpha='+backgroundAlpha+'&subBackground='+subBackground+'&subVisible='+subVisible+'&subFontSize='+subFontSize+'&autohideSubBackground='+autohideSubBackground+'&volume='+volume+'&commercialText='+commercialText+'&commercialTextColor='+commercialTextColor+'&commercialTextBold='+commercialTextBold+'&bufferTextBackgroundColor='+bufferTextBackgroundColor+'&bufferTextBackgroundAlpha='+bufferTextBackgroundAlpha+'&bufferTextColor='+bufferTextColor+'&bufferTextPosition='+bufferTextPosition+'&bufferText='+bufferText+'&timeFormat='+timeFormat+'&logo='+logo+'&logoPath='+logoPath+'&logoPosition='+logoPosition+'&logoAlpha='+logoAlpha+'&logo_x='+logo_x+'&logo_y='+logo_y+'&controlsBarPress='+controlsBarPress+'&bufferMessage='+bufferMessage+'&showTimecode='+showTimecode+'&subAlign='+subAlign+'&rw_ff_interval='+rw_ff_interval+'&stopButtonFirst='+stopButtonFirst+'&detectPopUpTitle='+detectPopUpTitle+'&detectPopUpText1='+detectPopUpText1+'&detectPopUpText2='+detectPopUpText2+'&detectPopUpButton1='+detectPopUpButton1+'&detectPopUpButton2='+detectPopUpButton2+'&bandwidthDetectPopUpTitle='+bandwidthDetectPopUpTitle+'&bandwidthDetectPopUpText1='+bandwidthDetectPopUpText1+'&bandwidthDetectPopUpText2='+bandwidthDetectPopUpText2+'&bandwidthSelectPopUpTitle='+bandwidthSelectPopUpTitle+'&bandwidthSelectPopUpButton1='+bandwidthSelectPopUpButton1+'&bandwidthSelectPopUpButton2='+bandwidthSelectPopUpButton2+'&bandwidthSelectPopUpButton3='+bandwidthSelectPopUpButton3+'&bandwidthTextForLowBandwidth='+bandwidthTextForLowBandwidth+'&bandwidthTextForMediumBandwidth='+bandwidthTextForMediumBandwidth+'&bandwidthTextForHiBandwidth='+bandwidthTextForHiBandwidth+'&bandwidthSelectPopUpText1='+bandwidthSelectPopUpText1+'&bandwidthSelectPopUpText2='+bandwidthSelectPopUpText2+'&bandwidthSelectPopUpText3='+bandwidthSelectPopUpText3+'&playerColorFullScreen='+playerColorFullScreen+'&barColorFullScreen='+barColorFullScreen+'&playbarColorFullScreen='+playbarColorFullScreen+'&buttonsColorFullScreen='+buttonsColorFullScreen+'&timeColorFullScreen='+timeColorFullScreen+'&backgroundColorFullScreen='+backgroundColorFullScreen+'&backgroundAlphaFullScreen='+backgroundAlphaFullScreen+'&blankLineFullScreen='+blankLineFullScreen+'&controlsYFullScreen='+controlsYFullScreen+'&blankLineListMode='+blankLineListMode+'&subColorFullScreen='+subColorFullScreen+'&subBackgroundFullScreen='+subBackgroundFullScreen+'&subBackgroundColorFullScreen='+subBackgroundColorFullScreen+'&subBackgroundAlphaFullScreen='+subBackgroundAlphaFullScreen+'&subFontSizeFullScreen='+subFontSizeFullScreen+'&autohideSubBackgroundFullScreen='+autohideSubBackgroundFullScreen+'&subAlignFullScreen='+subAlignFullScreen+'&speedClipPath='+speedClipPath+'&fullScreenFunction='+fullScreenFunction+'&endFullScreenBackToNormal='+endFullScreenBackToNormal+'&blackBorderWidth='+blackBorderWidth+'&blackBorderHeight='+blackBorderHeight+'&displayBandwidthDetectPopUp='+displayBandwidthDetectPopUp+'&playCommercialFirst='+playCommercialFirst+'&commercialMovieName='+commercialMovieName+'&commercialLink='+commercialLink+'&loadingMoviePopUpTitle='+loadingMoviePopUpTitle+'&loadingMoviePopUpText='+loadingMoviePopUpText+'&displayLoadingMoviePopUp='+displayLoadingMoviePopUp+'&endJavascriptFunction='+endJavascriptFunction+'&stopCloseConnect='+stopCloseConnect+'&startShowControls='+startShowControls+'&picturesFolder='+picturesFolder+'&startPauseMode='+startPauseMode+'&infoPopUpText='+infoPopUpText+'&infoPopUpTitle='+infoPopUpTitle+'&displayInfoPopUp='+displayInfoPopUp,

			"menu","false",
			"width", swfWidth,
			"height", swfHeight,
			"align", "middle",
			"id", swfID,
			"quality", "high",
			"bgcolor", swfBackgroundColor,
			"name", swfID,
			"allowFullScreen","true",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
}



function JSFCommunicator(flashMovie)
{	
	this.init(flashMovie);
}

JSFCommunicator.prototype.init = function(flashMovie) {

	if(flashMovie=="undefined") {
		var flashMovie = null;
	 }
	this.setMovie(flashMovie);
	this.functionToCall = null;
	this.functionLocationinFlash = null;
	this.functionArgs = null;
}

JSFCommunicator.prototype.setMovie = function(flashMovie)
{
	this.flashMovie = flashMovie;
}


JSFCommunicator.prototype.setVariable  = function(propName, propValue) {
	this.flashMovie.SetVariable(propName,propValue);
}

JSFCommunicator.prototype.getVariable  = function(propName) {

	var result = this.flashMovie.GetVariable(propName);
	return result;
}

JSFCommunicator.prototype.callFunction = function(fnLocation,fnName,fnArgs) {
	if(this.flashMovie==null) {	return false; }
	var flag = this.getVariable("/:triggerFn");
	var result = false;
	if(fnName=="") {return false; }
	if(fnLocation=="") {
		var fnLocation = "_level0";
	}
	this.setVariable("/:fnLocation",fnLocation);
	this.setVariable("/:fnName",fnName);
	if(typeof(fnArgs)=="object") {
		this.setVariable("/:fnArgs",fnArgs.join("$@$$"));
	}else if(typeof(fnArgs)=="number" || typeof(fnArgs)=="string") {
		this.setVariable("/:fnArgs",fnArgs);
	}
	this.setVariable("/:triggerFn",!flag);
	result = this.getVariable("triggerFnStatus");
	this.setVariable("/:triggerFnStatus",false);
	return result;	
}

function thisMovie(movieName) {
  
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
	
  } else {
   return window.document[movieName]
  }
}


function createJSFCommunicatorObject(playerObj)
{
		fc = new JSFCommunicator(playerObj);
}



function play() {
fc.callFunction("_level0","playMovie");		
}
function pause() {
fc.callFunction("_level0","pauseMovie");		
}
function stop() {
fc.callFunction("_level0","stopMovie");		
}
function seek(time) {
fc.callFunction("_level0","seek",[time]);		
}
function load(movie,sub) {
fc.callFunction("_level0","load",[movie,sub]);		
}
function loadWithCommercial(com,movie,comlink,sub) {
fc.callFunction("_level0","loadWithCommercial",[com,movie,comlink,sub]);		
}
function showSubtitles() {
fc.callFunction("_level0","showSubtitles");		
}
function hideSubtitles() {
fc.callFunction("_level0","hideSubtitles");		
}
function showControls() {
fc.callFunction("_level0","showControls");		
}
function hideControls() {
fc.callFunction("_level0","hideControls");		
}
function setVolume(v) {
fc.callFunction("_level0","setVolume",[v]);		
}
function mute() {
fc.callFunction("_level0","mute");		
}
function changeSubtitles(sub) {
fc.callFunction("_level0","changeSubtitles",[sub]);		
}
function close() {
fc.callFunction("_level0","close");		
}


createObject();

createJSFCommunicatorObject(thisMovie(swfID));

