jQuery(function($) {
	$(document).ready(function() {
		$('.file_parameter_block').each(function() {
			var $fileblock = $(this);
			var $fileselect = $('.fileselect', $fileblock);
			var $filevalue = $('.filevalue', $fileblock);

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

			//function loadFileFrame(callback)		
		});
	});
});