
// simple add photo -- see simpleaddphoto action in gallery indexcontroller

function addPhoto(url, returnId, returnImgSrc) {

	var data='/objectId/'+$('#'.returnImgSrc).val();
	
	$(this).colorbox( {
		width :"420",
		height:"250",
		href :url+data,
		open :true,
		onComplete : function() {
			$('#back').bind('click', function() {
				$.validationEngine.closePrompt('.formError', true);
				$.fn.colorbox.close();
				return false;
			});
		},
		onCleanup: function () {
			metaId = $('#uploadedImgMetaId').val();
			imgSrc = $('#imagePreview').attr('src');
			$(returnId).val(metaId);
			$(returnImgSrc).attr('src', imgSrc);
		}
	});
}

