window.addEvent('domready', function(){
	if($('openvideo') != null)
	{
		$('openvideo').addEvent('click', function(){
			var comp_layer_bg = new Element('div')
				.setStyles({
					'width': window.getWidth() + window.getScrollLeft(),
					'height': window.getHeight() + window.getScrollTop(),
					'position': 'absolute',
					'z-index': 9999999,
					'top': 0,
					'left': 0
				})
				.addEvent('click', function(){
					this.dispose();
					comp_layer.dispose();
				})
				.inject(document.body);
			var comp_layer = new Element('div')
				.setStyles({
					'width': 10,
					'height': 10,
					'overflow': 'hidden',
					'background-color':'#000000',
					'position': 'absolute',
					'z-index': 99999999,
					'left': this.getLeft(),
					'top': this.getTop(),
					'text-align': 'center',
					'padding-top': 20
				})
				.inject(document.body);
			var fx = new Fx.Morph(comp_layer, {onComplete: function(){
				comp_layer.set('html', '<div id="swf_video" style="width:640px; height:480px"></div><div style="color:#777;width:500px">Het laden van de video kan een ogenblik duren, afhankelijk van de verbinding.</div><div style="width:700px;text-align:right;"><img src="'+template_url+'/oostdk/images/close2.gif" id="close_layer"></div>');
				$('close_layer').setStyles({'margin-top': 0, 'cursor': 'pointer'}).addEvent('click', function(){
					comp_layer_bg.fireEvent('click');
				});
	
			var flashvars 	= {};
			var params 		= {"wmode": "transparent"};
			var attributes	= {};
			swfobject.embedSWF("/templates/oostdk/swf/video.swf", "swf_video", "640", "480", "9.0.0", "/templates/swf/expressInstall.swf", flashvars, params, attributes); 
				
			}});
			fx.start({	
					'width': 720,
					'height': 550,
					'left': (((window.getWidth() - 720)/2)+window.getScrollLeft()),
					'top': 30 + window.getScrollTop()
			});			
		});
	}	
	
	var image1 = new RoundedCorners('.roundedImage', {overlay: true, radius: 10, cls: 'imageSmall'});
	var image2 = new RoundedCorners('.roundedImageSmall', {overlay: true, radius: 10, cls: 'imageSmall'});
	
});
