	function fileStatus(status, id, filename, error){
		if(status==1){
			initAll(id, filename);
		}else{
			alert('Er is iets fout gegevens met het uploaden.\n\nProbeer opnieuw.\n\n'+filename+'\n\n'+error);
		}
	}

	function initAll(item, filename){
		reset_imageCrop();
		var img = null;
		var dt = new Date;

		img = new Image();
		img.src=filename;
		document.getElementById('imgtagid').src = img.src + '?'+ dt.getTime();
		var t = setTimeout(function () { initValues(item, filename); }, 750);
	}
	
	
	function initValues(item, filename){
		var img = document.getElementById('imgtagid');
		var width= img.width;
		var height = img.height;

		
		crop_imageWidth  = 400;
		if(crop_imageWidth>width){
			crop_imageWidth = width;
		}
		
		var toolImFactor  = (400/width);
		crop_imageHeight = toolImFactor*height;
	
		document.getElementById('imgtagid').style.width=crop_imageWidth+"px";
		
		// Size of original image
		crop_originalImageWidth  = width;
		crop_originalImageHeight = height;

		toolImFactor = toolImFactor * 100;
		toolImFactor = Math.round(toolImFactor);
		toolImFactor = toolImFactor /100;

		document.getElementById('label_factor').innerHTML = toolImFactor;
		
		init_imageCrop();

		document.getElementById('image_file').value ="";
	}
