// Start the upload
function startUpload() {	
	document.getElementById('output').innerHTML = '<img src="../img/ico_loading.gif" alt="Uploading..." />';
	return true;
}

// Called when the upload is finished
function uploadDone(success, id) {

	if (success == 0) {
		document.getElementById('upload_form').reset();
		document.getElementById('output').innerHTML =  'Ouch.. upload failed.';
	} else {
		window.location = id;
		document.title = 'Upload complete!';
	}
	
	return true;
}

// Use this for showing errors
function printError(error) {
	document.getElementById('error').innerHTML = error;
	return true;
}

