// PROCESS 2
$(document).ready(function()
{
	var button = $(uploader_btn_item), interval;
//	alert(upload_path+' | '+user_id+' | '+prefix);
	
	new AjaxUpload(button, {
		// Location of the server-side upload script
		// NOTE: You are not allowed to upload files to another domain
		action: uploader_path +'/uploader-actions.php',
		// File upload name
		name: 'fileToUpload',
		// Additional data to send
		data: {
			folder  : upload_path,
			user_id : user_id,
			prefix  : prefix
		},
		// Submit file after selection
		autoSubmit: true,
		// The type of data that you're expecting back from the server.
		// HTML (text) and XML are detected automatically.
		// Useful when you are using JSON data as a response, set to "json" in that case.
		// Also set server response type to text/html, otherwise it will not work in IE6
		responseType: false,
		// Fired after the file is selected
		// Useful when autoSubmit is disabled
		// You can return false to cancel upload
		// @param file basename of uploaded file
		// @param extension of that file
		onChange: function(file, extension){
			// alert('onChange : '+file+ '/'+extension);
		},
		// Fired before the file is uploaded
		// You can return false to cancel upload
		// @param file basename of uploaded file
		// @param extension of that file
		onSubmit: function(file, extension) {
			// alert('onSubmit : '+file+ '/'+extension);
		},
		// Fired when file upload is completed
		// WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE!
		// @param file basename of uploaded file
		// @param response server response
		onComplete: function(file, response) {
			alert('onComplete : '+file+ '/'+response);
			eval(uploader_callback)();
			// $('#avatar img').attr('src', upload_path+''+user_id+'.jpg');
		}
	});
	
});

function ajaxFileUpload()
{
	// alert('yop : '+uploader_path);
	
}

