<?php
	$str9="SELECT $fid FROM $table ORDER BY $fid DESC LIMIT 1";
		$sql9=mysql_query($str9);
		$id=0;
		while($row9=mysql_fetch_array($sql9)){
			$id=$row9['id'];
		}
		$id=$id+1;
?>
<script type="text/javascript" >
	$(function(){
		var btnUpload=$('#upload');
		var status=$('#status');
		new AjaxUpload(btnUpload, {
			action: 'upload-file.php<?php echo $action; ?>',
			name: 'uploadfile',
			onSubmit: function(file, ext){
				 if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ 
                    // extension is not allowed 
					status.text('Only JPG, PNG or GIF files are allowed');
					return false;
				}
				status.html('<img src="../images/lightbox-ico-loading.gif" />');
			},
			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="../../Site/images/gallery_th/'+file+'" alt="" height="100" />').addClass('success');
				} else{					
					$('<li></li>').appendTo('#files').text(response).addClass('error');
				}
			}
		});
		
	});
</script>
<?php
	echo'
	<font style="font-family: Arial;font-size:12px;color:#444444; line-height:30px;"><i>Click on the button Browse to add image gallery:</i></font>
		<div id="mainbody">
		<div id="upload"><span>'.$bottonimage.'<span></div><span id="status" ></span>
		
		<ul id="files" ></ul>
</div>'; 
	
	
?>

</body>