var player = null;
function playerReady(thePlayer) {
	player = document.getElementById(thePlayer['id']);
	document.fire('player:loaded');
}
document.observe("dom:loaded", function(){
	var wbc = new nwbl.nbwebcast({
		url: $('siteUrl').readAttribute('value') + '/media.php?type=video',
		containerId:'webCastPlayer'
	});
	var flashvars = {
		file:'',
		image:'',
		autostart:'false',
		playlist:'bottom',
		playlistsize:'100',
		shuffle:'false',
		repeat:'always'
	};
	var params = {
		allowfullscreen:'true',
		allowscriptaccess:'always'
	};
	var attributes = {
		id:'player1',
		name:'player1'
	};
	swfobject.embedSWF(wbc.options.player, wbc.options.containerId, '320', '300', '9.0.115', false, flashvars, params, attributes);	
	document.observe('player:loaded', function(e) {		
		wbc.getWebCastList();
	});
	document.observe('webCastList:loaded', function(e) {
		player.sendEvent('LOAD', wbc.options.playList);
	});
	document.observe('webCastList:failed', function(e) {
		alert('There is no playlist at this time.');
	});
});