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) {
    
        var flashvars = {
                file:theFile, 
                autostart:"false",
                streamer:"rtmp://67.227.133.1/vod/media",
                image:"/images/preview3.jpg"
        }
        var params = {
                allowfullscreen:"true", 
                allowscriptaccess:"always",
                wmode:"opaque"
        }
        var attributes = {
                id:thePlayerId,  
                name:thePlayerId
        }

        swfobject.embedSWF("/player.swf", thePlaceholder, "480", "340", "9.0.0", "/expressInstall.swf", flashvars, params, attributes);
}


function initPlayer(theFile,videoTitle) { 
       
        var caption;
                
        caption = document.getElementById("videoCaption");
               
        deletePlayer('wrapper', 'placeholder1', 'player1'); 
        createPlayer('placeholder1', 'player1', theFile);
               
        if(videoTitle=="")
            videoTitle = " "; // sets title to single space for spacing purposes
            
        if(caption)
        {          
            caption.innerText = videoTitle;
            caption.innerHTML = "<H2>" + videoTitle + "</H2>";
            
/*
            if(document.all) //IE
            {
                 caption.innerText = videoTitle;
            } 
            else
            {
                caption.textContent = videoTitle;
            }
*/

        }
}

initPlayer('GTNWelcome.flv','Welcome');

