
function showPlayer(theFile, theTitle) {
/*
	if($('video_placeholder')){
		$('video_placeholder').remove();
	}
	if($('video_wrapper')){
		$('video_wrapper').remove();		
	}
*/	
  theTitle = theTitle || 'Video';
/*
	Modalbox.show($('video_wrapper'), {title: theTitle, width: 320, height: 258, contentOverflow: 'hidden', contentHeightAdjust: 0});
  $('MB_content').style.padding = '0px';
  $('MB_content').style.margin = '0px';
  $('MB_frame').style.overflow = 'hidden';
  $('MB_frame').style.paddingBottom = '0px';
*/
  resetCenterContainer(theTitle);
  var zCenterContainerdiv = $('div_CenterContainer');
  var VideoDiv = new Element('div',{'id': 'dv_Video'});
  VideoDiv.appendChild($('video_wrapper'));
	
  zCenterContainerdiv.appendChild(VideoDiv);
  $('video_wrapper').style.display = 'block';
	$('video_wrapper').style.marginTop = '10px';
	$('video_wrapper').style.textAlign = 'center';
	initPlayer(theFile, '', '', true);
}

function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { 
//    if (typeof(swfobject)!='undefined') {
			swfobject.removeSWF(thePlayerId);
//		}
    var tmp=document.getElementById(theWrapper);
    if (tmp) { tmp.innerHTML = "<div id='" + thePlaceholder + "'></div>"; }
}

function createPlayer(thePlaceholder, thePlayerId, theWidth, theHeight, theFile, theImage, theLink, theLogo, theAutostart) {
    var flashvars = {
            config:"",

            author:"",
            captions:"",
            description:"",
            duration:"0",
            file:theFile, 
            image:theImage, 
            link:theLink,  
            start:"0", 
            title:"", 
            type:"", 

            controlbar:"bottom",
            logo:theLogo, 
            playlist:"none", 
            playlistsize:"180",  
            skin:"",

            autostart:theAutostart, 
            bufferlength:"1", 
            displayclick:"play", 
            item:"0",
            mute:"false", 
            quality:"true", 
            repeat:"none", 
            shuffle:"false", 
            stretching:"uniform",
            volume:"90",  

            abouttext:"",
            aboutlink:"",
            linktarget:"_blank",
            streamer:"",
            tracecall:""
    }
    var params = {
            allowfullscreen:"true", 
            allowscriptaccess:"always"
    }
    var attributes = {
            id:thePlayerId,  
            name:thePlayerId
    }
    swfobject.embedSWF("/js/jw/player.swf", thePlaceholder, theWidth, theHeight, "9.0.115", false, flashvars, params, attributes);
}


function initPlayer(theFile, theImage, theLogo, theAutostart) {
    deletePlayer('video_wrapper', 'video_placeholder', 'player1'); 
    createPlayer('video_placeholder', 'player1',
            '320', '240', 
            theFile, 
            theImage, 
            'http://www.jeroenwijering.com', 
            theLogo,
            theAutostart);
}