// -----------------------------------------------------------------------------------------------------------------------------
// PLAYER-JAVASCRIPTE:      .... für Win98, -ME,  Win2000,  XP  und  VISTA
//                                            .... für PCs ab ca. 800MHz (mit Vista min. 1,6 MHz)
//                                            .... Version vom 21.05.2008
// -----------------------------------------------------------------------------------------------------------------------------
//
// Um immer auf dem neuesten Stand zu bleiben macht es schon Sinn diesen 
// Script immer von www.live-dabei.tv zu ziehen.
// Hier werden keine unseriösen Sachen gemacht - ganz im Gegenteil:
// Im Wesentlichen beinhaltet dieser Script die Ablaufsteuerung des Mediaplayers
// und die Synchronisation mit dem Sound. Dazu wird eine Status-Datei laufend
// eingelesen um zu erfahren welche Videodatei momentan aktuell ist. So greift
// der Mediaplayer nicht ins Leere bzw. auf noch unfertig hochgeladene Dateien.
// Weiterhin wird in Verbindung mit einem Cookie so etwas ähnliches wie ein
// "PING" zum Videosender geschickt und gleichzeitig zu www.live-connect.de.
// Hier wird nichts ausspioniert sondern es dient einesteils dazu daß der
// Videosender merkt daß ein Zuschauer den Stream gerade anschauen möchte
// (Funktion: Fernzuschaltung zur Traffic-Minimierung) und anderenseits wird
// dieser "PING" zum Zählen der Zuschaueranzahl verwendet. Die Weiterleitung
// an www.live-connect.de dient auch nur zum Zählen - der Zuschauer und bleibt
// dabei anonym. Er bekommt per Cookie eine Kodierung um mit gleicher Kennung
// richtig aufsummieren zu können. Wer Cookies abgeschaltet hat der bekommt
// eine Zufallszahl. Auf diese Weise wird dann wenigstens die Momentan-Anzeige
// richtig.
//
// Nicht alle Player haben diese PINGs im Script. Wer es nicht möchte daß sein
// Player in Statistiken gezeigt wird kann die entsprechenden Befehle rausnehmen.
// Und bei manchen Playern wollen wir keine PINGs in unserer Statistik.
//
// Die vielen "document.write"-Anweisungen dienen zum Einbinden des Mediaplayers
// und weiterhin dazu daß per Script über die player.htm" die Position 
// auf der Webseite mitteles Variablen frei definiert werden kann.
//
// Speziell für VISTA mußten einige Änderungen vorgenommen werden. 
// Der Mediaplayer im VISTA befolgt das Kommando "AutoRewind=false" nicht. 
// So kam es laufend zu schwarzen Totalaussetzern am Ende der Teilstreams. 
// Weiterhin entstehen gelegentlich extrem lange Anlaufzeiten beim Start der
// Streams ohne diese Verzögerung durch sein wichtigstes Statussignal anzuzeigen.
// Das führte zu Fehlreaktionen im Script. Ständige Start- und Stop-Anweisungen
// mag der Vista-Mediaplayer auch nicht und quittiert das manchmal durch ein
// "vergessen" der Codecs und laufenden erfolglosen automatischen Nachinstallationen.
// Erst durch endlose Versuchsreihen wurde dann ein Script gefunden der auch
// Vista-tauglich ist.
// ---------------------------------------------------------------------------------------------------------------------------------------

document.write("<OBJECT TYPE='application/x-oleobject' ID='MP5'");
document.write("WIDTH='"+VideoBreite+"' HEIGHT='"+VideoHoehe+"'");
document.write("CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'");
if (PosVideoX==0) 
 {document.write("STYLE='position:absolute; top:"+PosVideoY+"px;'"); }
else
 {document.write("STYLE='position:absolute;left:"+PosVideoX+"px; top:"+PosVideoY+"px;'"); }

document.write("CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';>");
document.write("<PARAM NAME='AutoStart' VALUE='true'>");
document.write("<PARAM NAME='URL' VALUE='http://www.live-dabei.tv/liveconnect2/video01.avi'>");
//document.write("<PARAM NAME='URL' VALUE='vorspann1.avi'>");
document.write("<PARAM NAME='ShowTracker' VALUE='false'>");
document.write("<PARAM NAME='ShowStatusBar' VALUE='false'>");
document.write("<PARAM NAME='ShowControls' VALUE='False'>");
document.write("<PARAM NAME='AutoSize' VALUE='False'>");
document.write("<PARAM NAME='DisplaySize' VALUE='0'>");
document.write("<param name='AnimationAtStart' value='False'>");
document.write("<param name='TransparentAtStart' value='False'>");
document.write("<param name='PlayCount' value='10'>");
document.write("<PARAM NAME='EnableSelectionControls' VALUE='False'>"); 
document.write("<param name='Enabled' value='False'>");
document.write("<param name='uiMode' value='none'>");

document.write("</OBJECT>");



var PosX2=0;
//PosX2=0-VideoBreite-100;

PosX2=PosVideoX;

document.write("<OBJECT TYPE='application/x-oleobject' ID='MP2'");
document.write("WIDTH='"+VideoBreite+"' HEIGHT='"+VideoHoehe+"'");
document.write("CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'");
if (PosVideoX==0) 
 {document.write("STYLE='position:absolute; top:"+PosVideoY+"px;'"); }
else
 {document.write("STYLE='position:absolute;left:"+PosX2+"px; top:"+PosVideoY+"px;'"); }
 
document.write("CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';>");
document.write("<PARAM NAME='AutoStart' VALUE='1'>");
document.write("<PARAM NAME='AutoRewind' VALUE='false'>");
document.write("<PARAM NAME='ShowTracker' VALUE='false'>");
document.write("<PARAM NAME='ShowStatusBar' VALUE='false'>");
document.write("<PARAM NAME='ShowControls' VALUE='False'>");
document.write("<PARAM NAME='AutoSize' VALUE='false'>");
document.write("<PARAM NAME='AllowChangeDisplaySize' VALUE='true'>");
document.write("<PARAM NAME='DisplaySize' VALUE='2'>");

document.write("<param name='AnimationAtStart' value='False'>");
document.write("<param name='TransparentAtStart' value='False'>");
document.write("<param name='PlayCount' value='1'>");
document.write("<PARAM NAME='EnableSelectionControls' VALUE='False'>"); 
document.write("<param name='Enabled' value='False'>");
document.write("<param name='uiMode' value='none'>");
 
document.write("</OBJECT>");

PosX2=0-VideoBreite-150;
PosX2=PosVideoX;

document.write("<OBJECT TYPE='application/x-oleobject' ID='MP1'");
document.write("WIDTH='"+VideoBreite+"' HEIGHT='"+VideoHoehe+"'");
document.write("CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'");
if (PosVideoX==0) 
 {document.write("STYLE='position:absolute; top:"+PosVideoY+"px;'"); }
else
 {document.write("STYLE='position:absolute;left:"+PosX2+"px; top:"+PosVideoY+"px;'"); }

document.write("CODEBASE='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';>");
document.write("<PARAM NAME='AutoStart' VALUE='1'>");
document.write("<PARAM NAME='AutoRewind' VALUE='false'>");
document.write("<PARAM NAME='ShowTracker' VALUE='false'>");
document.write("<PARAM NAME='ShowStatusBar' VALUE='false'>");
document.write("<PARAM NAME='ShowControls' VALUE='False'>");
document.write("<PARAM NAME='AutoSize' VALUE='false'>");
document.write("<PARAM NAME='AllowChangeDisplaySize' VALUE='true'>");
document.write("<PARAM NAME='DisplaySize' VALUE='2'>");

document.write("<param name='AnimationAtStart' value='False'>");
document.write("<param name='TransparentAtStart' value='False'>");
document.write("<param name='PlayCount' value='1'>");
document.write("<PARAM NAME='EnableSelectionControls' VALUE='False'>"); 
document.write("<param name='Enabled' value='False'>");
document.write("<param name='uiMode' value='none'>");
 
document.write("</OBJECT>");



// ----------------------------------------------------------------------------------------------------------------------

var TimerID=0;
var TimerID2=0;
var TimerID3=0;
var TimerIDF=0;
var TimerIDL=0;
var MP5gestartet=0;
var TimerStartVerzoegerung=0;
var TimerStartVerzoegerung2=0;
var StartTimer=0;
var PasswortTimer=0;
var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");
var MOZI=navigator.userAgent.indexOf("Mozilla");
var QuellAdresse=document.URL;
var PingIP="-";
var F_IP="-"; // IP für Fernzuschaltung
var Domain="";
var zaehler=0;
var PlayStatus=3;
var TopPosition=0;
var MP5sichtbar=4;
var StartKennung=" ";
var OldC=" ";
var NewC=" ";
var NewC1="00000";
var NewUser=0;
var image1 = new Image();
var image2 = new Image();
var image3 = new Image();
var AktPasswort="keinPasswort";
var PasswortZaehler=1;
 
var Browser=0;
var ErsteRunde=1;
var NewFileName=" ";
var FktStart=0;
var LastBefehl="keiner";
var FireFox=0;
var ErsterStartMP1=1;
var StatusAbfrageZaehler1=0;
var StatusAbfrageZaehler2=0;
var Restart1Kennung=0;
var Restart2Kennung=0;
var MP1geladen=0;
var MP2geladen=0;
var TimerCheckMP1=0;
var TimerCheckMP2=0;
var MP1PauseAktiv=0;
var MP2PauseAktiv=0;
var LoadFileNameX=" ";


if (MSIE==-1) { FireFox=1; }


     document.write('<script type="text/vbscript"> \n');
     document.write('on error resume next \n');
     document.write('Sub movie_FSCommand(ByVal befehl, ByVal Wert)\n');
     document.write('  call movieFScom_DoFSCommand(befehl, Wert)\n');
     document.write('end sub\n');
     document.write('</script\> \n');
if (OPER>-1) { Browser=1; } 

document.write("<script language='JavaScript' src='http://www.live-dabei.tv/demo/ping.js'></script>");
    

StartTimer=setTimeout("Start()",3000); // weil bei manchen der Start nicht funktioniert

SetHiddenMP1();
SetHiddenMP2();
document.MP1.stretchToFit="true";
document.MP2.stretchToFit="true";

document.MP1.settings.autoStart="true";
document.MP2.settings.autoStart="true";

//document.MP1.settings.setMode("autoRewind",0);
//document.MP1.settings.setMode("autoRewind",0);

//document.MP5.URL="http://www.live-dabei.tv/liveconnect2/video01.avi";
 
document.MP5.settings.autoStart="true";
//document.MP5.settings.playCount=10;


// ----------------------------------------------------------------


function Start()
 { 
   clearTimeout(StartTimer);
   if (FktStart==1) return;
   FktStart=1;
   StartTimer=setTimeout("Start1()",1000); 
 }

function Start1()
 { var txt=" ";
   clearTimeout(StartTimer);
   // --------------------------------
   txt= QuellAdresse.substring(0,22);
   if (txt=="Xttp://www.rh-video.de")
    { window.top.location.href="http://www.live-connect.de";
      return;
    }
   if (FireFox==1) {  document.movie.SetVariable("Browser",1); }
   if (OPER>-1) 
      { Browser=1; 
        PlayStatus=2;
        document.movie.SetVariable("Browser",1); 
      }
   if (NETS>-1)
      { document.movie.SetVariable("Browser",1); 
        Browser=0;
      } 
   if (MOZI>-1) 
      { // wegen PingStatistik (Firefox liefert kein "http://")
        //QuellAdresse="http://"+QuellAdresse; 
      } 

   //window.status="Lade Videostream....";
   

   document.movie.SetVariable("Player1geladen",0);
   document.movie.SetVariable("Player2geladen",0);
   document.movie.SetVariable("BrowserInfo","Start!");

   function1("http://"+PingIP+"/Playerzuschaltung"+QuellAdresse+",Playerstart.jpg");

   OldC="";
   OldC=document.cookie;
   if (OldC=="")   { NewUser=1; }
   NewC="";
   NewC=document.cookie;
   if (NewC!="")
      { if (NewUser==1)
                {  NewC1=Math.floor(Math.random()*100000);
                   NewC1=Math.floor(Math.random()*100000);
                   while  (NewC1.length<4) { NewC1="0"+NewC1;  } 
                   NewC="Name="+NewC1+"; path=/; expires=Mon, 01-Jan-2011 00:00:00 GMT";
                   document.cookie = NewC+"; path=/; expires=Mon, 01-Jan-2011 00:00:00 GMT";                  
                }
             else
                {   
                   NewC=OldC+"; path=/; expires=Mon, 01-Jan-2011 00:00:00 GMT";
                   document.cookie = NewC+"; path=/; expires=Mon, 01-Jan-2011 00:00:00 GMT";
                   NewC1=OldC.substring(5,10);
                }
           }
   else
      { 
        NewC1="00000";  
      }     
   
   StartTimer=setTimeout("StartFreigabe()",100);
   //window.status=" ";
 }

function StartFreigabe()
 {
    document.movie.SetVariable("FreigabeFlash",1);
 
 }

function function1(adresse)
 {  
   var adresse1 = adresse;
   var adresse2 = " ";
   var x=0;
   var datum = new Date();
   var txt=datum.getTime();
   var txt1=" ";   
   
   txt1="x"+txt; // Formatumwandlung
   if (StartKennung==" ") { StartKennung=txt1.substring(9,14);}
   x=adresse1.search(/FlashVideo.+/);
   if (x!=-1)
      { adresse2=adresse1.substring(0,x);

        adresse2=adresse2+"F_"+NewC1+"_"+StartKennung+"_"+adresse1.substring(x+11,adresse1.length-3);
        x=adresse2.search(/function1.+/);        
        if (x!=-1)
           {
             adresse1=adresse2.substring(22,adresse2.length);
             adresse2=adresse1+",Passwort("+PasswortZaehler+"):"+AktPasswort;
             adresse2=adresse2+",Playerping.jpg";

           }
        else
           { 
             adresse2=adresse2+",Passwort("+PasswortZaehler+"):"+AktPasswort;
             adresse2=adresse2+",Playerping.jpg');";    
           }
        image1.src=adresse2;
        LastBefehl="PING2:"+adresse;
        return;
      }
   adresse=adresse+",Passwort("+PasswortZaehler+"):"+AktPasswort+",ping.jpg";
   image1.src=adresse;
   if (FireFox==1) Check_F_IP(adresse);
   //LastBefehl="PING1:"+adresse;
 }


function function2(adresse)
 {  

    image2.src=adresse;
 }

function Check_F_IP(adresse)
 { var x=0;
   var Port="";
   var Padresse="";
   x=adresse.search(/Playerzuschaltung.+/);
   if (x!=-1)
     { Port=adresse.substring(x-5,x-1);
       Padresse=adresse.substring(0,x-6);
       x=eval(Port)-1;
       Port=""+x;
       Padresse=Padresse+":"+Port+"/FFox_"+NewC1+"_"+StartKennung+"_TV-Live";
       //LastBefehl="PingAdresse: "+Padresse;
       image2.src=Padresse;
     }
 }



function movieFScom_DoFSCommand(befehl, wert) 
  { //LastBefehl=befehl+","+wert;
   if (MP5gestartet==0)
      { document.MP5.controls.pause();
        document.MP5.controls.play(); 
        MP5gestartet=1;
      }

    if (befehl=="startmp1") { StartMP1();  return; }
    if (befehl=="startmp2") { StartMP2();  return; }
    if (befehl=="VideoNameSender") { VideoNameSender=wert; return; }
    if (befehl=="LoadMP1") { LoadMP1(wert); return; }
    if (befehl=="LoadMP2") { LoadMP2(wert); return; }
   // if (befehl=="StopMP") { StopMP1(); StopMP2(); return; }
    if (befehl=="Ping") { function1(wert); return; }
    if (befehl=="SetDomain") { SetDomain(wert); return; }
    return;
  }
 
function SetDomain(txt)
 { zaehler=zaehler+1;
   Domain=txt;
   //window.status="Zugriffspfad: "+Domain+" Z:"+zaehler;
 }

function Statusabfrage1()
 { var stat1=0; 
   var txt=" ";
    
   stat1=GetPlayStateMP1();
   zaehler=zaehler+1;
   StatusAbfrageZaehler1=StatusAbfrageZaehler1+1;
   if (StatusAbfrageZaehler1>80) { Restart1(); return; }
   if ((stat1==PlayStatus)&&(document.MP1.controls.currentPosition>1)) 
      {  
        //window.status=" ";
        StatusAbfrageZaehler1=0;
        if (PasswortZaehler>180)
           {
             document.movie.SetVariable("TextZeile","PLAYER STOP (Trafficschutz)"); 
             window.status="ACHTUNG! Player wurde angehalten - Trafficschutz!";
             TimerID2=setTimeout("TrafficSchutzAnzeige()",1000);
             return;
           }

        //document.MP1.AutoRewind="False";
        //document.MP1.settings.setMode("autoRewind","false");
        function2("http://"+PingIP+"/Playerzuschaltung"+QuellAdresse+",Playerping ");
        //document.movie.SetVariable("Player1geladen",1);
        PasswortZaehler=PasswortZaehler+1;
        if (MP5gestartet==1)
           { 
             document.MP5.controls.pause();
             //if (FireFox==0) { document.MP5.style.top=-1000; } else { document.MP5.style.left=-1000; }
             //document.MP5.style.left=0-VideoBreite-200;
             document.MP5.uiMode="invisible";
             MP5gestartet=2;
             document.MP5.controls.stop();
             //document.MP5.filename="";
           }       
        //document.movie.SetVariable("Player1geladen",1);
          StopMP1();
         TimerID2=setTimeout("FreigabePlayer1()",500);
      }
   else
      { 
        //window.status="Loading Stream 1 ("+StatusAbfrageZaehler1+")";
        TimerID2=setTimeout("Statusabfrage1()",300); 
      }
 }


function FreigabePlayer1()
 {  clearTimeout(TimerID2);
    SetPositionMP1(0);
    TimerID2=setTimeout("FreigabePlayer12()",300);
 }

function FreigabePlayer12()
 {  clearTimeout(TimerID2);
    MP1geladen=1;
    document.movie.SetVariable("Player1geladen",1);
 }

function Restart1()
 {
   //window.status="RESTART !!!";
   StatusAbfrageZaehler1=0;
   function1("http://"+PingIP+"/Playerzuschaltung"+QuellAdresse+",Playerstart ");
   Restart1Kennung=1;
   document.movie.SetVariable("Player1geladen",1);
 }


function Restart2()
 {
   //window.status="RESTART !!!";
   StatusAbfrageZaehler2=0;
   function1("http://"+PingIP+"/Playerzuschaltung"+QuellAdresse+",Playerstart ");
   Restart2Kennung=1;
   document.movie.SetVariable("Player2geladen",1);
 }


function Statusabfrage2()
 { var stat2=0; 
   var txt=" ";
    
   stat2=GetPlayStateMP2();
   zaehler=zaehler+1;
   StatusAbfrageZaehler2=StatusAbfrageZaehler2+1;
   if (StatusAbfrageZaehler2>80) { Restart2(); return; }
   if ((stat2==PlayStatus)&&(document.MP2.controls.currentPosition>1)) 
      { 
        
        //window.status=" ";
        StatusAbfrageZaehler2=0;
        //document.MP2.AutoRewind="False";
        //document.MP2.settings.setMode("autoRewind","false");
       
        function2("http://"+PingIP+"/Playerzuschaltung"+QuellAdresse+",Playerstart ");
       
        PasswortZaehler=PasswortZaehler+1;
        if (MP5gestartet==1)
           { 
             document.MP5.controls.pause();
             //if (FireFox==0) { document.MP5.style.top=-1000; } else { document.MP5.style.left=-1000; }
             //document.MP5.style.left=0-VideoBreite-200;
             document.MP5.uiMode="invisible";
             MP5gestartet=2;
             document.MP5.controls.stop();
             //document.MP5.filename="";
           }       
          //document.movie.SetVariable("Player2geladen",1);
         StopMP2();
         TimerID2=setTimeout("FreigabePlayer2()",500);
      }
   else 
      { 
        //window.status="Loading Stream 2 ("+StatusAbfrageZaehler2+")";
        TimerID2=setTimeout("Statusabfrage2()",300); }
 } 


function FreigabePlayer2()
 {  clearTimeout(TimerID2);
    SetPositionMP2(0); 
     TimerID2=setTimeout("FreigabePlayer21()",300);
 }

function FreigabePlayer21()
 {  clearTimeout(TimerID2);
    MP2geladen=1;
    document.movie.SetVariable("Player2geladen",1);
 }

function StartMP1()
 { if (Restart1Kennung==1) { Restart1Kennung=0; return; }
   clearTimeout(TimerCheckMP1);
   StopMP2();
   if (FireFox==1)  
     { TimerStartVerzoegerung=setTimeout("StartMP11()",50); }
   else
     { if (ErsterStartMP1==1)
          { TimerStartVerzoegerung=setTimeout("StartMP11()",50); }
       else
          { TimerStartVerzoegerung=setTimeout("StartMP11()",100); }

     }
   ErsterStartMP1=0; 
 }

function StartMP11()
 {  SetVisibleMP1();
    TimerStartVerzoegerung=setTimeout("StartMP12()",100);
 }

function StartMP12()
 { var zz=0.01;
   var txt="";
   zz=document.MP1.currentMedia.duration; 
   zz=zz*1000;
   zz=zz-200; 
   //document.getElementById("vs_ebene6725").innerHTML="Duration: "+ zz;
   MP2PauseAktiv=0;
   TimerCheckMP1=setTimeout("CheckMP1()",zz);
   PlayMP1(); 
   document.MP1.settings.setMode("autoRewind","false");
   MP1geladen=0;
 } 

 
 function StartMP2()
 { if (Restart2Kennung==1) { Restart2Kennung=0; return; }
   clearTimeout(TimerCheckMP2);
   StopMP1();
   if (FireFox==1)  
     { TimerStartVerzoegerung=setTimeout("StartMP21()",50); }
   else
     { TimerStartVerzoegerung=setTimeout("StartMP21()",100); }
    
 }

function StartMP21()
 {  SetVisibleMP2();
    TimerStartVerzoegerung=setTimeout("StartMP22()",100);
 }

function StartMP22()
 { var zz=0.01;
   zz=document.MP2.currentMedia.duration;
   zz=zz * 1000;
   zz=zz-200;
   MP2PauseAktiv=0;
   TimerCheckMP2=setTimeout("CheckMP2()",zz);
    PlayMP2(); 
   document.MP2.settings.setMode("autoRewind","false");
   MP2geladen=0;
 } 


function CheckMP1()
 {  clearTimeout(TimerCheckMP1);
    document.MP1.controls.pause();
 }

function CheckMP2()
 {  clearTimeout(TimerCheckMP2);
    document.MP2.controls.pause();
 }

function PlayMP1()
  { if (Browser==0)
      {  
        document.MP1.controls.play();
      }
   else
      { document.MP1.Play; }
  }

function PlayMP2()
  { if (Browser==0)
      {  
        document.MP2.controls.play(); 
      }
   else
      { document.MP2.Play; }
  } 
 

function LoadMP2(LoadFileName)
  {
      clearTimeout(TimerIDL);   
      LoadFileNameX=LoadFileName;   
      StopMP2();
      TimerIDL=setTimeout("LoadMP21()",500);
  }


function LoadMP21()
 { var datum = new Date();
   var stat=0;
   clearTimeout(TimerIDL);
  
   zaehler=zaehler+1;
   SetHiddenMP2();
   //document.MP2.style.left=PosVideoX;
  // document.MP2.style.top=PosVideoY;
   

   if (Browser==0)
      { stat=document.MP2.playstate;
        //document.MP2.open(Domain+LoadFileName+"?"+datum.getTime());
        document.MP2.URL=Domain+LoadFileNameX+"?"+datum.getTime();
      }
   else
      { 
        document.MP2.SetFileName(Domain+filename);
      }
   TimerID2=setTimeout("Statusabfrage2()",2000);
 }

 
function LoadMP1(LoadFileName)
  {
      clearTimeout(TimerIDL);  
      LoadFileNameX=LoadFileName; 
       StopMP1();
      TimerIDL=setTimeout("LoadMP11()",500);
  }

function LoadMP11()
 { var datum = new Date();
   var stat=0;
   clearTimeout(TimerIDL);
   zaehler=zaehler+1;
   SetHiddenMP1();
  
  // document.MP1.style.left=PosVideoX;
  // document.MP1.style.top=PosVideoY;

   if (Browser==0)
      { stat=document.MP1.playstate;
        //document.MP1.open(Domain+LoadFileName+"?"+datum.getTime());
        document.MP1.URL=Domain+LoadFileNameX+"?"+datum.getTime();


      }
   else
      { window.status="Lade Video1(OOOOPERA): "+filename+" Z: "+zaehler;
        document.MP1.SetFileName(Domain+filename);
      }

   TimerID2=setTimeout("Statusabfrage1()",2000);

 }

function GetPlayStateMP1()
 { var stat=0;
   if (Browser==0)
      { stat=document.MP1.playstate;
        //stat=document.getElementById("MP1").playstate; 
      }
   else
      { stat=document.MP1.GetPlayState(); }
   return(stat);
 }

function GetPlayStateMP2()
 { var stat=0;
   if (Browser==0) { stat=document.MP2.playstate; }
   else { stat=document.MP2.GetPlayState(); }
   return(stat);
 }

 function StopMP1()
  { if (Browser==0)
      {  
        document.MP1.controls.pause();
      }
   else
      { document.MP1.controls.Stop(); }
  }

function StopMP2()
  { if (Browser==0)
      { document.MP2.controls.pause(); }
   else
      { document.MP2.controls.Stop(); }
  }
 
function SetPositionMP1(pos)
 { if (Browser==0)
      {   
        document.MP1.controls.currentPosition=0; 
      }
   else
      { document.MP1.SetCurrentPosition(0); }
 }

function SetPositionMP2(pos)
 { if (Browser==0)
      { 
        document.MP2.controls.currentPosition=0;
      }
   else
      { document.MP2.SetCurrentPosition(0); }
 }

function SetVisibleMP1()
  { 
    
    if (Browser==0)
      { document.MP1.style.left=PosVideoX;
        document.MP1.style.top=PosVideoY; 
        document.MP1.uiMode="none";      
      }
   else
      {
        //document.MP1.style.style.top=15;
      }
  }

function SetVisibleMP2()
  { 
    if (Browser==0)
      { document.MP2.style.left=PosVideoX;
        document.MP2.style.top=PosVideoY;
        document.MP2.uiMode="none";
      }
   else
      {
        //document.MP2.style.top=15;
      }
  }

function SetHiddenMP1()
  {  

    if (FireFox==0)
      { 
        //document.MP1.style.top=-1000;
        //document.MP1.style.left=0-VideoBreite-100;
        document.MP1.uiMode="invisible";

        //document.MP1.style.left=PosVideoX;
        //document.MP1.style.top=PosVideoY;
      

      }
   else
      {
        document.MP1.style.top=-1800;
      }
  }

function SetHiddenMP2()
  { 
    
    if (FireFox==0)
      { 
        //document.MP2.style.top=-1000; 
        //document.MP2.style.left=0-VideoBreite-150; 


        document.MP2.uiMode="invisible";

        //document.MP2.style.left=PosVideoX;
        //document.MP2.style.top=PosVideoY;
      

      }
   else
      {
        document.MP2.style.top=-1800; 
      }
  }

function Anzeige1()
 { clearTimeout(ZZ);
   //document.getElementById("txt1").value=LastBefehl;
   ZZ=setTimeout("Anzeige1()",1000); 
 }

function installActiveX() 
  { if (FireFox==0) return;
    xpi={'Mozilla Firefox 1.5 ActiveX Plug-in':'mozactivex-ff-15.xpi'}; InstallTrigger.install(xpi);
  } 

function TrafficSchutzAnzeige()
 { clearTimeout(TimerID);
   PasswortZaehler=PasswortZaehler+1;
   if (PasswortZaehler>1) 
      { PasswortZaehler=0;
        window.status=" ";
      }
   else
      {
        window.status="ACHTUNG! Player wurde angehalten - Trafficschutz!";
      }
   TimerID2=setTimeout("TrafficSchutzAnzeige()",1000);
 }



