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",
        repeat: "always",
        playlist: "none",
		/*playlistsize: "245",*/
		//controlbar:"over",
		stretching:"none"
		/*skin: "sites/rimon/_static_media/public/nacht/nacht.swf",
		backcolor:000000,
		frontcolor:000000,
		lightcolor:000000,
		screencolor:000000*/
        /*displaywidth:'352',
        displayheight:'329',*/
    
    }

    var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always",
		wmode: "transparent"
    }

    var attributes = {
        id:thePlayerId,  
        name:thePlayerId
    }
    
	//var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);
    swfobject.embedSWF("/sites/metatrade/_static_media/public/player.swf", thePlaceholder, "238", "220", "9.0.115", false, flashvars, params, attributes); /*b4 325 194   real@"352", "288"*/
}


function initPlayer(theFile) { 
    deletePlayer('media_player', 'div_to_replace', 'player'); 
    createPlayer('div_to_replace', 'player', theFile);
}