/*********************************************
   Integration von Flash Video Player aus dlg.org
   Who: Schneeweis
   Date added: 081119
*********************************************/
    
    function startFlash(playerPath,xPath) { 
        if (document.all) {
            w = document.body.clientWidth;
            h = document.body.clientHeight; 
        } else if (document.layers) {
            w = window.innerWidth;
            h = window.innerHeight; 
        } else {
            w = window.innerWidth;
            h = window.innerHeight;
        }
        playerWidth = 389;
        playerHeight = 473;
        topInset  = document.body.scrollTop + 50;
        leftInset = Math.round( (w / 2)  - (playerWidth / 2) );
                
        playerPath = "http://video.dlg.org/" + playerPath;
                
                
        if (document.getElementById("playerlayer") != null) { 
            alert(" C : "+document.getElementById("playerlayer"));
            alert(closeMsg);
            return; 
        } else {
            // create the whole flash object/embed and insert it  - jc
            var divTag = document.createElement("div");
            divTag.id = "playerlayer";
            xmlPath = xPath;
            divTag.style.cssText = "position: absolute;z-index: 1;left: "+ leftInset + "px; top: " + topInset + "px; width: "+playerWidth+"px; height: "+playerHeight+"px;";
            divTag.innerHTML = "<object classid= \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"100%\" height=\"100%\" id=\"player\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"movie\" value=\"" + playerPath + "\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"best\" /><param name= \"FlashVars\"value=\"xpath="+ xmlPath +"\"><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"" + playerPath + "\" menu=\"false\" quality=\"best\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\"100%\" height=\"100%\" name=\"player\" align=\"middle\" allowScriptAccess=\"always\" type= \"application/x-shockwave-flash\"FlashVars=\"xpath="+ xmlPath +"\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /><\/object>";
            document.body.appendChild(divTag);
        }
    } 
    
    function stopFlash(){
        var divTag = document.getElementById("playerlayer");
        document.body.removeChild(divTag);
    } 
        
        
        function min() { 
            
            if (document.all){
                w = document.body.clientWidth;
                h = document.body.clientHeight; 
            } else if (document.layers) {
                w = window.innerWidth;
                h = window.innerHeight; 
            } else {
                w = window.innerWidth;
                h = window.innerHeight;
            }
        
            playerWidth = 389;
            playerHeight = 473;
            topInset  = document.body.scrollTop + 50;
            leftInset = Math.round( (w / 2)  - (playerWidth / 2) );
            var divTag = document.getElementById("playerlayer");
            divTag.style.cssText =   "position: absolute;z-index: 1;left: "+ leftInset + "px; top: " + topInset + "px; width: "+playerWidth+"px; height:"+playerHeight+"px;";
        } 
        
        
    function max() { 
        if (document.all){
            w = document.body.clientWidth;
            h = document.body.clientHeight;
        } else if (document.layers) {
            w = window.innerWidth;
            h = window.innerHeight; 
        } else{
            w = window.innerWidth;
            h = window.innerHeight;
        }
        playerWidth = 800;
        playerHeight = 600;
        topInset  = document.body.scrollTop + 50;
        leftInset = Math.round( (w / 2)  - (playerWidth / 2) );
        var divTag = document.getElementById("playerlayer");
        divTag.style.cssText =  "position: absolute;z-index: 1;left: "+ leftInset + "px; top: " + topInset + "px; width: "+playerWidth+"px; height: "+playerHeight+"px;";
    }

