    /*
     
     *  File: embed.js
     *  Abstract: Javascript function **InsertMovie()** for embeding Apple Quicktime content 
     *  Version: 0.2
     *	© 2007 Team-Tejat, Hamburg Marc Wright 	
     
     */
    
    // alert ('ok embed is there an can be used ! ');
    
    
    function InsertMovie()
    {
    var qtInstalled = false;
    //qtObj = false;
	if (navigator.plugins && navigator.plugins.length) {
		for (var i=0; i < navigator.plugins.length; i++ ) {
         
         //alert(navigator.plugins[i].name);
         
         var plugin = navigator.plugins[i];
         if (plugin.name.indexOf("QuickTime") > -1) {
			qtInstalled = true;
         }
      }
	} 
	
        //  SET UP THE MOVIE SRC
        var myId        = "myMovie";                                                // id of movie
        var myName      = "myMovie";                                                // name of movie
        var my_src      = "matthias-staehle_dircetor-trailer";       // the source of the movie, can be relative
        var myQtnext    = "../index.php";                                           // go to this URL after movie is played relative to the src of the movie
        var myHeight    = 391;                                                      // height of movie in pixels                
        var myWidth     = 640;                                                      // width of movie in pixels
        var myHspace    = 0;                                                        // LEFT spacing
        var myVspace    = 20;                                                        // top+bottom space
        var myAlign     = "top";                                                    // 
        var myBorder    = 0;                                                        // border of the movie
        var myAutoplay  = true;                                                     // does the movie start automaticaly    usage: TRUE/ FALSE        
        var myKioskmode = true;                                                     // is there a download movie dialog?    usage: TRUE/ FALSE
        var myControler = true;                                                     // show the controler                   usage: TRUE/ FALSE
        var myLoop      = true;                                                     // loop the movie ?                     usage: TRUE/ FALSE
        var myTarget    = "myself";                                                 // could also be the QT Player
        var myEnableJS  = true;                                                     // can quicktime do Javascript
        var mySHOWLOGO	= false;													// Show the QuickTime logo or not     	usage:	TRUE/ FALSE

        var myCodebase  = "http://www.apple.com/qtactivex/qtplugin.cab";            //
        var myPlugin    = "http://www.apple.com/quicktime/download/indext.html";    //
        var myType      = "video/quicktime";                                        // content type could be audio/mpeg mp3 etc ...
        var myCache     = true;                                                     // should the browser cache the movie?
        var myNoplugin  = "http://www.uebelundgefaehrlich.com";                     // redirect to when no plugin is available
        var myPmessage  = "Sorry Dir fehlt das Quicktime Plugin";                   // alert message if there is no plugin installed
        
        if(qtInstalled == true || navigator.userAgent.indexOf('MSIE') != -1){
        
        // embeding the movie
        document.writeln('<object id ="'+myId+'" classid="clsid: clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="'+myCodebase+'" width="'+myWidth+'" height="'+myHeight+'" hspace="'+myHspace+'" vspace="'+myVspace+'" align="'+myAlign+'" border="'+myBorder+'">');
            document.writeln('<param name="kioskmode"   value="'+myKioskmode+'" \/> ' );
            document.writeln('<param name="src"         value="'+my_src+'"      \/> ' );
            document.writeln('<param name="controller"  value="'+myControler+'" \/> ' );
            document.writeln('<param name="loop"        value="'+myLoop+'"      \/> ' );
            document.writeln('<param name="pluginspage" value="'+myPlugin+'"    \/> ' );
            document.writeln('<param name="target"      value="'+myTarget+'"    \/> ' );
            document.writeln('<param name="type"        value="'+myType+'"      \/> ' );
            document.writeln('<param name="src"         value="'+my_src+'"      \/> ' );
            document.writeln('<embed enablejavascript="'+myEnableJS+'" name="'+myName+'" src="'+my_src+'" width="'+myWidth+'" height="'+myHeight+'" kioskmode="'+myKioskmode+'" hspace="'+myHspace+'" vspace="'+myVspace+'" align="'+myAlign+'" cache="'+myCache+'" autoplay="'+myAutoplay+'" controller="'+myControler+'" border="'+myBorder+'" pluginspage="'+myPlugin+'" target="'+myTarget+'" QTNEXT1="'+myQtnext+'" SHOWLOGO="'+mySHOWLOGO+'"><\/embed>' );
        document.writeln('<\/object>');
        }else{
            alert(myPmessage);
        //    parent.location.href = myNoplugin;
        }
    }
