Event.observe(window, 'load', function(){
	if ($('flash'))
	{
		//videoplayer		= new VideoPlayer();

		//videoplayer.play('/video/kruiswijk.flv', 'flash', 400, 233, '/video/kruiswijk.jpg');
		var source 			= '/video/flex.flv';
		var target 			= 'flash';
		var width 			= '250';
		var height 			= '146';
		var prerollimage 	= '';
		
		var flashvars = {
			flvpFolderLocation: "/flvplayer/",
			flvpAutoStartMovie: false,
			flvpPreRollImage: prerollimage,
			flvpVideoSource: source,
			flvpWidth: width,
			flvpHeight: height,
			flvpTurnOnCorners: false,
			flvpShowbInfo: false,
			flvpShowbCc: false,
			flvpShowbMenu: false,
			flvpInterfaceDisplay : "autohide",
			flvpBackButtonRollOverColor: "0x546472",
			flvpPlayButtonRollOverColor: "0x546472",
			flvpPauseButtonRollOverColor: "0x546472",
			flvpStopButtonRollOverColor: "0x546472",
			flvpForwardButtonRollOverColor: "0x546472",
			flvpInfoButtonRollOverColor: "0x546472",
			flvpCCButtonRollOverColor: "0x546472",
			flvpFullscreenButtonRollOverColor: "0x546472",
			flvpMenuButtonRollOverColor: "0x546472",
			flvpCloseMenuButtonRollOverColor: "0x546472",
			flvpScrubBarDragRollOverColor: "0x546472",
			flvpVolumeButtonOnRollOverColor: "0x546472",
			flvpVolumeButtonOffRollOverColor: "0x546472",
			flvpVolumeDragRollOverColor: "0x546472",
			flvpScrubBarFrontColor : "0x546472",
			flvpVolumeFrontColor : "0x546472"
		};
		
		var params = {
			wmode: "transparent",
			menu: "true", 
			allowfullscreen: "true"
		};
		
		swfobject.embedSWF("/video/flvplayer.swf", target, width, height, "9.0.0", "/flash/expressInstall.swf", flashvars, params);
		
		
	}
	
	if($('articles')){
		$$('.moreInfo td').each(function(el){
			el.hide();
		});
		$$('.readmore a').each(function(el){
			el.observe('click', function(event){
				Event.stop(event);
				target = el.readAttribute('href').split('#')[1];
				if($(target).style.display == 'none'){
					$(target).style.display = '';
				}
				else if($(target).style.display == ''){
					$(target).style.display = 'none';
				}
			});
			
		});
	}
	
});


var VideoPlayer = Class.create();
VideoPlayer.prototype = {
	initialize: function()
	{
		
	},
	play: function(source, target, width, height, prerollimage)
	{
		
		var flashvars = {
			flvpBgColor: "0xFFFFFF",
			flvpFolderLocation: "/flvplayer/",
			flvpAutoStartMovie: false,
			flvpPreRollImage: prerollimage,
			flvpVideoSource: source,
			flvpWidth: width,
			flvpHeight: height,
			flvpTurnOnCorners: false,
			flvpShowbInfo: false,
			flvpShowbCc: false,
			flvpShowbMenu: false,
			flvpInterfaceDisplay : "autohide",
			flvpBackButtonRollOverColor: "0x546472",
			flvpPlayButtonRollOverColor: "0x546472",
			flvpPauseButtonRollOverColor: "0x546472",
			flvpStopButtonRollOverColor: "0x546472",
			flvpForwardButtonRollOverColor: "0x546472",
			flvpInfoButtonRollOverColor: "0x546472",
			flvpCCButtonRollOverColor: "0x546472",
			flvpFullscreenButtonRollOverColor: "0x546472",
			flvpMenuButtonRollOverColor: "0x546472",
			flvpCloseMenuButtonRollOverColor: "0x546472",
			flvpScrubBarDragRollOverColor: "0x546472",
			flvpVolumeButtonOnRollOverColor: "0x546472",
			flvpVolumeButtonOffRollOverColor: "0x546472",
			flvpVolumeDragRollOverColor: "0x546472",
			flvpScrubBarFrontColor : "0x546472",
			flvpVolumeFrontColor : "0x546472"
		};
		
		var params = {
			wmode: "transparent",
			menu: "true", 
			allowfullscreen: "true"
		};
		
		swfobject.embedSWF("/video/flvplayer.swf", target, width, height, "9.0.0", "/flash/expressInstall.swf", flashvars, params);
	}
};
