// JavaScript Document
function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { 
        swfobject.removeSWF(thePlayerId);
        var tmp=document.getElementById(theWrapper);
        if (tmp) { tmp.innerHTML = "<div id="+thePlaceholder+"></div>"; }
}


function createPlayer(thePlaceholder, thePlayerId, theFile, nVideoWidth, nVideoHeight) {
        var flashvars = {
                file:theFile, 
                autostart:"false"
        }
        var params = {
                allowfullscreen:"true", 
                allowscriptaccess:"always",
				wmode:"opaque"
        }
        var attributes = {
                id:thePlayerId,  
                name:thePlayerId
        }
        swfobject.embedSWF("../mediaplayer/player.swf", thePlaceholder, nVideoWidth, nVideoHeight, "9.0.115", false, flashvars, params, attributes);
}


function initPlayer(thePlaceholder, thePlayerId, theFile, nVideoWidth, nVideoHeight) { 
        deletePlayer('wrapper', thePlaceholder, thePlayerId); 
        createPlayer(thePlaceholder, thePlayerId, theFile, nVideoWidth, nVideoHeight);
}
