jQuery.fn.videoGallery = function (options) {                      
		var options = jQuery.extend({
		swf: "videoplayer1.1.swf",
		width: 630,
		height: 360
	}, options);
	function view(ns) {								
		$(ns).find('.video_title_').html($(ns).find(".current").find(".video_title").html());
		$(ns).find('.video_content_').css('width', options.width).html($(ns).find(".current").find(".video_content").html());
		$(ns).find('.video_').css({'height': options.height, 'width': options.width}).flash({
			swf: options.swf,
			width: options.width,
			height: options.height,
			flashvars: {
				videoid: $(ns).find(".current .videoId").attr('value')
			}
		});
	}							
	return this.each( function () {                 
		var ns = $(this);				
		$(ns).prepend('<div class="video_title_"></div><div class="video_"></div>').append('<div class="video_content_"></div>');
		view(ns);								
		$(ns).find("td").bind('click', function () {
			$(ns).find("td").removeClass("current");
			$(this).addClass("current");
			view(ns);
			return false;
		});
		$(ns).find('.video_next').click( function () {				
			$(ns).find('.video_scroll').scrollTo('+=630px', 1000);				
		});
		$(ns).find('.video_prev').click( function () {				
			$(ns).find('.video_scroll').scrollTo('-=630px', 1000);				
		});
	});
}
