// global variables initialized

	setRunMeLast(InitializeForms);

	function InitializeForms(){
		if ((new_resume == '') && (isNav && browserVersion < 5)) {
			loadingWindow = window.open('', 'loadingWindow', 'height=200,width=400,dependant=yes');
			loadingWindow.document.open('text/html', 'replace');
			loadingWindow.focus();
			loadingWindow.document.write("<HTML><HEAD><TITLE>Loading!</TITLE>\n");
			loadingWindow.document.write("</HEAD><BODY>");
			loadingWindow.document.write("<h1>LOADING!  Please Wait!</h1>");
			loadingWindow.document.write("<h2>Retrieving your resume from your account!</h2>");
			loadingWindow.document.write("</BODY></HTML>\n");
			window.onfocus = ShowLoadingWindow;
			window.blur();
		}
		InitializeFormMaxLengths(document.resume_add);
		InitializeFormCheckRequiredOr(document.resume_add);
		CacheFormElements(document.resume_add);
		InitializeDisplayBoxes();
		//regressFormData(document.resume_add);
		if ((new_resume == '') && (isNav && browserVersion < 5)) {
			window.onfocus = '';
			loadingWindow.close();
			window.focus();
		}
//		if (document.resume_add.c_first_name) {
//			document.resume_add.c_first_name.focus();
//		}
//		window.scrollBy(0,-100000);

//		if (debug) {
//			// fill in debug data
//			enterDebugData(document.resume_add);
//		}
		if (setDefaultFieldData) setDefaultFieldData(document.resume_add);
	}

	function startFormSubmission(form) {
		if (helpWindow) {
			helpWindow.close();
		}
		if (form.value == "Preview") {
			document.resume_add.target = "Preview";
			document.resume_add.action = "resume_preview.cfm";
			prepareDataForTransmission(form);
			document.resume_add.submit();
		} else {
			//document.resume_add.target = "_self";
			//document.resume_add.action = "submit_resume2";
			if(checkAllFields(form)){
				//document.resume_add.page_status_build.value="Finish";
				prepareDataForTransmission(form);
			
				// After form has been validated for submission, disable submit button to prevent multiple submissions...
				document.resume_add.page_status_build.disabled=true;

				form.submit();			
			} else {
				return false;
			}		
		} 
		return true;
	}
	
