function image_reload(id) {
	theImg=document.getElementById(id);
	theImg.src +='?c='+ Math.round(Math.random()*100000);
}

function popup_img(url) {
	newwindow=window.open(url,'name','resizable=0,toolbar=0,status=0,scrollbars=0,location=0,left=20,top=20,height=600,width=750');
	if(window.focus) { newwindow.focus() }
	return false;
}

$(function() {
	var btnUpload=$('#upload');
	var status=$('#status');
	new AjaxUpload(btnUpload, {
	action: 'http://unde.ne.cazam.info/ufile.php',
	name: 'uploadfile',
	onSubmit: function(file, ext){
	if(!(ext && /^(jpg|png|jpeg|gif)$/.test(ext))) { 
	// extension is not allowed 
	status.text('Sunt acceptate doar poze in format JPG, JPEG, PNG si GIF!');
	return false;
	}
	status.text('Se ataseaza poza...');
	},
	onComplete: function(file, response){
	//On completion clear the status
	status.text('');
	//Add uploaded file to list
	if(response == "success"){
	$('<li></li>').appendTo('#files').text('Poza a fost atasata cu succes').addClass('success');
	} else {
	$('<li></li>').appendTo('#files').html(response).addClass('error');
	}
	}
	});
});