jQuery(function($) {
	$(document).ready(function() {
		$('.video_parameter_block').each(function() {
			var $videoblock = $(this);
			var $videoselect = $('.videoselect', $videoblock);
			var $videovalue = $('.videovalue', $videoblock);

			$videoselect.click(function() {
				window.parent.loadVideoFrame($(this), function(attachment) {
					$videovalue.val(attachment.id);
					// jQuery("#imagethumb").attr("src", attachment.sizes.thumbnail.url);
				});
			});

			//function loadVideoFrame(callback)		
		});
	});
});