String.prototype.trim = function() {
	a = this.replace(/^\s+/, '');
	return a.replace(/\s+$/, '');
};


function verifyUpload() {
var missingFields = "" ;
var formName = document.getElementById('contactName').value ;
var formEmail = document.getElementById('email').value ;
var formTele = document.getElementById('Phone').value ;
var userFile = document.getElementById('userfile').value ;

var controlArray = document.forms['manu'], len = controlArray.length ;

	for (var i = 0; i < len; i++) {
		el = controlArray[i] ;
		value = el.value ;
		pos = value.indexOf("://") ;
		if (pos > -1) {
			alert("Links or other HTML are not allowed in form fields.");
			return false ;
		}
	}

	// check if the name is blank
	if (formName == "") 
		missingFields = "Name is a required field.\n" ;

	// check if the e-mail AND the telephone is blank
	// since only one is required
	if ((formEmail == "") && (formTele == "")) 
		missingFields += "E-mail or Telephone is required.\n" ;
		
	// check for bad file name characters
	var findIt=new RegExp("\\\\") ;
	
	if (findIt.test(userFile)==true) 
		missingFields += "\nPlease remove the '\\' from your file name.\n" ;

	if (missingFields != "") {
		alert("There was a problem with your Quote request:\n\n" + missingFields + "\nPlease check your entries and click 'Submit' again.")

		return false ;
	} else {
		var quoteMSG = "Your Quote will be submitted to OEMDash" ;
		if (userFile != "") quoteMSG += "\nand your image will be uploaded" ;
		return confirm(quoteMSG + ".") ;
		
	}	

}

