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:"true",
        playlist: "bottom",
		playlistsize: "300",
		controlbar:"over",
		stretching:"exactfit",
		skin: "sites/idan/_static_media/public/nacht/nacht.swf"/*,
		
		backcolor:000000,
		frontcolor:000000,
		lightcolor:000000,
		screencolor:000000*/
    }

    var params = {
		allowfullscreen:"false", /*false*/
		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/idan/_static_media/public/player.swf", thePlaceholder, "470", "683", "9.0.115", false , flashvars, params, attributes);
}


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