<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="js/ajaxupload.3.5.js" ></script>
<script type="text/javascript" >






	$(function(){
		var btnUpload=$('#upload');
		var status=$('#status');
		new AjaxUpload(btnUpload, {
			action: 'upload-file.php',
			name: 'uploadfile',
			onSubmit: function(file, ext){
		
				status.text('Uploading...');
			},
			onComplete: function(file, response){
				//On completion clear the status
				status.text('');
				//Add uploaded file to list
				if(response==="success"){
					$('<li></li>').appendTo('#files').html('<img src="./email_templates/'+file+'" alt="" /><br />'+file).addClass('success');
					$("div#mail_letter").load("ajax_load/load_newsletter.php");
				} else{
					$('<li></li>').appendTo('#files').text(file).addClass('error');
					$("div#mail_letter").load("ajax_load/load_newsletter.php");

				}
			}
		});
		
	});
</script>