function myShowUI() {
	var btnSubmit = document.getElementById("btnSubmit");
	var txtLastName = document.getElementById("lastname");
	var txtFirstName = document.getElementById("firstname");
	var txtEmail = document.getElementById("email");
	
	btnSubmit.onclick = doSubmit;
	btnSubmit.disabled = true;
	
	txtLastName.onchange = validateForm;
	txtFirstName.onchange = validateForm;
	txtEmail.onchange = validateForm;
	
	
	SWFUpload.swfUploadLoaded.apply(this);
	validateForm();
  }

function validateForm() {
	var txtLastName = document.getElementById("lastname");
	var txtFirstName = document.getElementById("firstname");
	var txtFileName = document.getElementById("txtFileName");
	var txtEmail = document.getElementById("email");
	
	var is_valid = true;
	if (txtLastName.value === "") is_valid = false;
	if (txtFirstName.value === "") is_valid = false;
	if (txtFileName.value === "") is_valid = false;
	if (txtEmail.value === "") is_valid = false;
	
	document.getElementById("btnSubmit").disabled = !is_valid;
}

function fileBrowse() {
	var txtFileName = document.getElementById("txtFileName");
	txtFileName.value = "";

	this.cancelUpload();
	this.selectFile();
}

function doSubmit(e) {
	e = e || window.event;
	if (e.stopPropagation) e.stopPropagation();
	e.cancelBubble = true;
	
	try {
		swf_upload_control.startUpload();
	} catch (ex) {
	
	}
      return false;
  }

 function uploadDone() {
	try {
		document.forms[0].submit();
	} catch (ex) {
		alert("Error submitting form");
	}
  }