function checkuploadForm()
{
	title = document.getElementById("title").value;
	tags = document.getElementById("tags").value;
  	vwdescription = document.getElementById("vwdescription").value;
	category = document.getElementById("category").value;
  	
  	if (title == "")
	{
  		hideAllErrors();
		document.getElementById("titleError").style.display = "inline";
		document.getElementById("title").select();
		document.getElementById("title").focus();
  		return false;
  	} 
	else if (tags == "")
	{
		hideAllErrors();
		document.getElementById("tagsError").style.display = "inline";
		document.getElementById("tags").select();
		document.getElementById("tags").focus();
  		return false;
  	}
	else if (vwdescription == "")
	{
		hideAllErrors();
		document.getElementById("vwdescriptionError").style.display = "inline";
		document.getElementById("vwdescription").select();
		document.getElementById("vwdescription").focus();
  		return false;
  	}
	else if (category == "0")
	{
		hideAllErrors();
		document.getElementById("categoryError").style.display = "inline";
  		return false;
  	}
	
  	return true;
}
 
function hideAllErrors() 
{
	document.getElementById("titleError").style.display = "none"
	document.getElementById("tagsError").style.display = "none"
	document.getElementById("vwdescriptionError").style.display = "none"
	document.getElementById("categoryError").style.display = "none"
	document.getElementById("fileError").style.display = "none"
}

function uploadPreCheck() 
{
	if (checkuploadForm())
	{
		uploadFiles();
	}
	else
	return false;
}
