<!--
	String.prototype.trim = function() {
	    return this.replace(/^\s+|\s+$/g,"");
	}
	
	function uploading() {
		if(document.getElementById('name').value.trim() == '') {
			alert('Please enter your contact name.');
			return false;
		}
		else if(document.getElementById('email').value.trim() == '') {
		    alert('Please enter your contact EMail address.');
		    return false;
		}
		else if(document.getElementById('comments').value.trim() == '') {
			alert('Please enter your comments.');
			return false;
		}
		else if (document.getElementById('file').value.trim() == '') {
			alert('You must select a file to upload.');
			return false;
		}
		else{
			var uploadDialog = document.getElementById('uploadDialog');
			uploadDialog.style.visibility='visible';
			return true;
		}
	}
	
	function drawFileField() {
		var uf = document.getElementById('uploadForm');
		var sp = document.getElementById('sp');
		var nid = (parseInt(sp.value))+1;
		sp.value=nid;
		var newInput = document.createElement('input');
		var newLabel = document.createElement('label');
		newLabel.id=nid;
		uf.appendChild(newLabel);
		innerTxt(document.getElementById(nid),'File:  ');
		newInput.type='file';
		newInput.name='filen[]';
		uf.appendChild(newInput);
		var newBr = document.createElement('br');
		uf.appendChild(newBr);
		var newBr = document.createElement('br');
		uf.appendChild(newBr);
	}

	function innerTxt(el,content) {
		if (document.getElementById && !document.all) {
			rng = document.createRange();
			rng.setStartBefore(el);
			htmlFrag = rng.createContextualFragment(content);
			while (el.hasChildNodes())
				el.removeChild(el.lastChild);
			el.appendChild(htmlFrag);
		}
		else {
			el.innerHTML = content;
		}
	}
-->