function initialize_add_image(){
	var f = $("#upload_frame");
	$("#upload_frame").load(function(){
		var file = frames['upload_frame'].document.getElementsByTagName("body")[0].innerHTML;
		if(file != "error"){
			var img = {displayed:"false",id:file_id, file:file}
			//band_data.pics.push(img);
			if(typeof design_pics == "undefined") design_pics = [];
			design_pics.push(img);
			api.update_design_pics(resource,function(){
				$(".pic").addClass("hidden");
				the_img = create_image_elem(img, band_data.pics.length - 1);
				library_thumbnail_gallery.add_thumbnail(the_img);
				$(the_img).removeClass("hidden");
			});
			/*api.update_band_data(band_data["_id"],function(){
				$(".pic").addClass("hidden");
				the_img = create_image_elem(img, band_data.pics.length - 1);
				library_thumbnail_gallery.add_thumbnail(the_img);
				$(the_img).removeClass("hidden");
			});*/
		}
		else alert("We're sorry - there was a problem uploading this image.\n Supported filetypes are: .jpg / .gif / .png");
	});
}

function create_file_id(){
	file_id = api.generate_random_id();
	$("#file_id").attr("value",file_id);
	return true;
}


