    function ajaxDeleteWorkPicture(id)
    {

    	  UpdateContent("index.php", "section=customer&action=delete_picture&id="+id, "work_pictures");
    	  //alert("OK"+"section=customer&action=delete_picture&id="+id);
    }
	function ajaxUploadCover(album_id, user_id)
	{
        $('#wait').show().centering(1,1);
        $("#cover").html("<img src='' />");
		$.ajaxFileUpload
		(
			{
				url:'album_file_upload.php?act=upload_cover&album_id='+album_id+"&user_id="+user_id,
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				success: function (data, status)
				{

					$('#wait').hide();
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{
							$("#cover").html(decodeURIComponent(data.msg));
						}
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)
		return false;
	}


	function ajaxUploadWorkPicture(album_id, user_id, work_id, file_element, desc_element)
	{
        $('#wait').show().centering(1,1);
        var desc = $("#"+desc_element).val();
        url1 = 'album_file_upload.php?act=upload_work_picture&album_id='+album_id+"&user_id="+user_id+"&work_id="+work_id+"&desc="+desc;   //   +"&debug"
		$.ajaxFileUpload
		(
			{
				url:url1,
				secureuri:false,
				fileElementId:file_element,
				dataType: 'json',
				success: function (data, status)
				{

					$('#wait').hide();
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
							alert(data.msg);
						}else
						{
							$("#work_pictures").html(decodeURIComponent(data.msg));
						}
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)

		return false;

	}

	function SetMainAlbumPicture(elem_id,user_id,al_id,pic_id)
	{         //$("#"+elem_id).attr("disabled","disabled");
         //alert("111:"+elem_id+":"+user_id+":"+al_id+":"+pic_id );
        // $.get("index.php", { section: "customer", act: "update_main_album_picture", album_id: al_id, picture_id: pic_id},
		 //function(data)
		 //{
            //alert("Обновление обложки работы прошло успешно");
            alert("OK");
		//	$("#"+elem_id).removeAttr("disabled");
		//});
		//alert("кенгу");





	}

function DeleteWork(w_id)
{	    //?section=customer&act=delete_work&work_id={$it.id}
        $('#wait').show().centering(1,1);
	    $.get("index.php", { section: "customer", act: "delete_work", work_id: w_id},
		 function(data)
		 {
   			$('#wait').hide();
			$("#works_list").html(decodeURIComponent(data));
		});
		return false;}
