		function checkAndSend() {
			var message = "";
			/* check that all the necessary fields are filled-in */
			if (isblank($F("last_name"))) message = "\n* " + msgJSLastName;
			if (isblank($F("company"))) message = message + "\n* " + msgJSCompany;
			if (isblank($F("ref_number"))) message = message + "\n* " + msgJSRefNumber;
			// $F can't deal with file fields for some reason so have to be more specific
			if (isblank(document.upload.pres.value)) message = message + "\n* " + msgJSFile;
			if (!isblank(message)) {
				message = msgJSIntro + "\n" + message;
				alert (message);
				return false;
			/* check that the file has a .ppt suffix */
			} else if (!checkSuffix(document.upload.pres.value,"ppt")) {
				if (!confirm(msgJSNoPPT)) {
					return false;
				}
			}
			alert (msgJSSizeWarning);
			return true;
		}
		
		// Utility function checking for blank strings
		function isblank(s) {
	  		if (s == null) return true;
	  		if (s == "") return true;
	  		for(var i = 0; i<s.length; i++) {
	    		var c = s.charAt(i);
	    		if ((c!=' ') && (c!='\n') && (c!='\t'))
	    			return false;
	  		}
	  		return true;
		}

		function checkSuffix(filename,fileExt) {
			dotPos = filename.lastIndexOf(".");
			if (dotPos != -1) {
				newExt = filename.substr(dotPos+1);
				// alert(newExt);
				if (newExt == fileExt) {
					return true;
				}
			}
			return false;
		}
		

