function newDocumentFormSubmit(form) {
    var msg = "";
    if (form.name.value=="") {
        msg += "Please enter an document name\n";
    }
	var tmpNewFile = form.document0.value; 
	var tmpExt = ""; 
	tmpExt = tmpNewFile.slice(tmpNewFile.length-3,tmpNewFile.length);
	if ((tmpExt != "txt") && (tmpExt != "doc") && (tmpExt != "xls") && (tmpExt != "ppt") && (tmpExt != "pdf") && (tmpExt != "csv") && (tmpExt != "pot") && (tmpExt != "dot") && (tmpExt != "xml") && (tmpExt != "")) {
        msg += "This file type is not permitted for upload for security reasons\n";
	}
    if (msg == "") {
        form.submit();
    } else {
        alert(msg);
    }
}


