function close_flash(event) {
	//event.preventDefault();
	$('#vcontainer').html('');
	$('#overlay').css('display','none');
	$('#cover').css('width','0px').css('height','0px');
}
function add_video(flv,top,left) {
	$('document').ready(function() {
		var flash = '<object class="flash" width="720" height="418" type="application/x-shockwave-flash" data="/_swf/video.swf?video='+flv+'"><param name="movie" value="/_swf/video.swf?video='+flv+'" /><param name="allowFullScreen" value="true" /></object>';
		var flash = '<object width="660" height="405"><param name="movie" value="http://www.youtube.com/v/Yk4GC8erHbM&hl=en_GB&fs=1&border=1&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Yk4GC8erHbM&hl=en_GB&fs=1&border=1&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="660" height="405"></embed></object>';
		var html = '<div id="overlay"><div class="close"><a href="#">close</a></div><div id="vcontainer"></div><div class="clear"></div></div>';
		$('body').append(html);
		$('body').append('<div id="cover"></div>');
		$('#overlay').css('display','none');
		$('#overlay').css('position','absolute').css('overflow','hidden');
		$('#overlay').css('width','10px').css('padding','5px');
		$('#overlay').css('background','#111');
		$('#cover').css('width','15px').css('height','0px');
		$('#video a:first').bind('click',function(e){
			e.preventDefault();
			w = 670; h = 425;
			x = (windowWidth()/2)-(w/2); y = 120; //$('#video').offset().top-40;
			spd = 500;
			$('#vcontainer').html(flash);
			$('#overlay').css('left',(windowWidth()/2+left)+'px');
			$('#overlay').css('top',top+'px');
			$('#overlay').css('width','10px');
			$('#overlay').css('height','10px');
			$('#overlay').animate({
			left:x,
			top:y,
			width:w,
			height:h
			},spd);
		});
		$('#overlay').find('.close').click(function(e) {
			e.preventDefault();
			$('#vcontainer').html('');
			$('#overlay').css('display','none');
			$('#overlay').css('width','10px');
		});
		$('#canvas').click(function(e) {
			if ($('#overlay').css('width')!=='10px') {
				e.preventDefault();
				$('#overlay').css('display','none');
				$('#overlay').css('width','10px');
				$('#vcontainer').html('');
			}
		});
	});
}
function windowWidth() {
	var x = 0;
	if (self.innerWidth) x = self.innerWidth;
	else if (document.documentElement && document.documentElement.clientHeight)
		x = document.documentElement.clientWidth;
	else if (document.body) X = document.body.clientWidth;
	return x;
}
