function checkSize()
{
	var filepath = document.uploadForm.file.value;
	if (filepath == null || filepath == "")
	{
		alert("Es ist keine Datei gewählt.");
		return false;
	}
	return true;
}

// TODO solve upload problem
/*function get_progress()
{
	alert("test1");
	setInterval(function() 
	{
		$.get(
			"<?php echo $url; ?>?progress_key=<?php echo $_GET['up_id']; ?>&randval="+ Math.random(), 
			{
				//get request to the current URL (upload_frame.php) which calls the code at the top of the page.
				//It checks the file's progress based on the file id "progress_key=" and returns the value with the function below:
			},
			function(data)	//return information back from jQuery's get request
			{
				$('#progress_container').fadeIn(100);	//fade in progress bar	
				$('#progress_bar').width(data +"%");	//set width of progress bar based on the $status value (set at the top of this page)
				$('#progress_completed').html(parseInt(data) +"%");	//display the % completed within the progress bar
			}
		)
	},500);	//Interval is set at 500 milliseconds (the progress bar will refresh every .5 seconds)
}

function show_progress()
{
	alert("test3");
	//show the progress bar only if a file field was clicked
	var show_bar = 0;
  	$('input[type="file"]').click(function(){
		show_bar = 1;
	});

	//show iframe on form submit
  	$("#form1").submit(function(){
	if (show_bar === 1) { 
		$('#upload_frame').show();
		function set () {
			$('#upload_frame').attr('src','upload_frame.php?unique_id=<?php echo $up_id; ?>');
		}
		setTimeout(set);
	}
}*/
