jQuery(document).ready(function() {

	jQuery('#upload_image_button_1').click(function() {
	 formfield = jQuery('#upload_image_1').attr('name');
	 tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
	 return false;
	});		
	
	jQuery('#upload_image_button_2').click(function() {
		 formfield = jQuery('#upload_image_2').attr('name');
		 tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
		 return false;
		});			

	jQuery('#upload_image_button_3').click(function() {
		 formfield = jQuery('#upload_image_3').attr('name');
		 tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
		 return false;
		});			
	
	jQuery('#upload_image_button_4').click(function() {
		 formfield = jQuery('#upload_image_4').attr('name');
		 tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
		 return false;
		});
		
	window.send_to_editor = function(html) {
	 imgurl = jQuery('img',html).attr('src');
	 jQuery('#upload_image_1').val(imgurl);
	 tb_remove();
	}
});