function initialize_player(params){
	
	if ( typeof( params ) == 'undefined' )params = {};
	var src_url = params.src_url || '';
	var audio 	= params.audio_type || 0;
	var start_sec 	= params.start_sec || 0;
	var fp_key = '';
	var initialLoad = true; 
	
	if (src_url.match(/http:\/\//))
		src_url = src_url.replace(/^(http:\/\/[^\/]+\/?)/,'');
	
	var pl_height = 220;
	var pl_fscreen = true;
	
	if (audio||0){
		pl_height = 20;
		pl_fscreen = false;
	}
	var root_url = 'http://'+location.hostname;
	if (location.port != '') root_url += ":"+location.port;
	
	var serv_name 	= location.hostname;
	serv_name 		= serv_name.replace(/^(w+?)\./,'');

	switch (serv_name) {
		case 'politicalarchive.org':
			fp_key = '#@a49f3c2122b0a41aae7';
			break;
		case 'politiekarchief.nl':
			fp_key = '#@ff6b9c892b7167c1100';
			break;
		case 'politiekarchief.org':
			fp_key = '#@fa582c418e0934726b7';
			break;
		case 'politiekarchief.devel':
		default:
			fp_key = '#@cd64e966926fd397305';
			break;
	}
	
	$f("flow_player", 
	    {   
		src: root_url+"/flowplayer/flowplayer.commercial-3.1.5.swf", 
		width: 290,
        wmode: 'opaque',
		height: pl_height
	    },
	    {   
		key: fp_key,
		contextMenu: [ 
		    // 1. "About Flowplayer...";  selecting this item goes to our homepage 
		        {'About PolitiekArchief' : function() { 
			        location.href = root_url+'/statischePagina/over/';  
			}}, 
		    // 2. menu separator.  
		        '-'
		    ],
		clip:{
		    url: src_url,
		    provider: 'rtmp',
		    start:0,
		    bufferLength: 10,
		    autoBuffering:true, 
		    autoPlay: true,
		    onStart:function(){
//	    		fp_jump(start_sec);
	    	 	if (initialLoad)   { 
	                initialLoad = false; 
	                this.seek(start_sec); 
	    	 	} 
	    		embedplayer();
	    	}
	    	
		},
		plugins:{
			rtmp:{
		    	live: true,
		        url: root_url + '/flowplayer/flowplayer.rtmp-3.1.3.swf',
		        netConnectionUrl: 'rtmp://flash2.notubiz.nl/nbvod'
		    },
		   
		    controls:{
			url: root_url + '/flowplayer/flowplayer.controls-3.1.5.swf',
			height: 20,
			fullscreen: pl_fscreen,
			tooltipColor: '#456',
			tooltips:{
			    buttons: true,
			    pause: 'Pauzeren',
			    play:  'Afspelen',
			    fullscreen: 'Volledig Scherm',
			    fullscreenExit: 'Terug naar normaal formaat',
			    mute: 'Geluid uit',
			    unmute: 'Geluid terug aan'
			},
			backgroundGradient: [0,0],
			background: '#000000',
			timeColor: '#FFFFFF', 
			scrubber: true
		    }
		},
		logo: {
		    url: root_url + '/flowplayer/nb_transparant.png',
		    top: 20,
		    right: 20,
		    opacity: 1.0,
		    fullscreenOnly: true,
		    displaytime: 0,
		    linkUrl: 'http://www.notubiz.nl'
		}
	    });
}	    
	function fp_jump(time)	{
		if ($f()){
		    if($f().isPaused())	    {
		    	$f().toggle(); // if file is pauzed, unpause before jump
		    }
		    	$f().seek(time);
		}
	}
	
	function embedplayer() {
		var time = $f().getTime();
		var code = $f().embed().getEmbedCode();
		
		code = code.replace(/"start":[0-9.]+?/g,'"start":'+time);
		code = code.replace(/("playlist"\:\[\{)([\s\S]+?)(\}\])/g,'$1$3');

		$("#embed_meeting").html(code);
	}
	
	function updateTime()
	{
	
	    var t = $f().getTime(); 
	    if (typeof t !== "undefined") { 
	        var sec = parseInt(t % 60, 10); 
	        secs= parseInt(t / 60, 10) + ":" +  (sec > 9 ? sec : "0" + sec); 
	    } else { 
	        secs= "0:00"; 
	    }
	    document.getElementById('tijd').value=secs;
	}

