function initErrors() {
	g_errorStr = '';
	g_numErrors = 0;
	g_returnValue = true;
}

function addError(field, errmsg) {
	if(g_numErrors == 0) {
		field.focus();
	}
		
	g_numErrors++;
	g_returnValue = false;
		
	g_errorStr = errmsg+'\n';
}

function showErrors() {
	if(g_numErrors > 0) {
		alert(g_errorStr);
	}
}	
	
function MM_validateForm() { //v4.0
	initErrors();
	if(document.getElementById('userfile').value.length < 1){
		addError(document.getElementById('userfile'), 'Filename cannot be blank.');
	}																	
showErrors();
}
