﻿function ModulePrintPage() {
  lochref = '' + this.location;
	if (lochref.indexOf('?') > 0) {
		lochref = '?' + lochref.substring((lochref.indexOf('?')) + 1);
	} else {
		lochref = '';
	}

	w_width = 790;
	w_height = 500;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=yes';

	fparam = 'print_mod.php'+lochref;
  window.showPrintWindow = open(fparam, 'showPrintWindow', theWindowParam);
	setTimeout('if(showPrintWindow&&!showPrintWindow.closed)showPrintWindow.focus()',100);
}

function ValidateForm_JobApplication_General(theForm) {
  var jap_title = theForm.jap_title.value;
  var jap_fname = theForm.jap_fname.value;
  var jap_lname = theForm.jap_lname.value;
  var jap_gender = theForm.jap_gender.value;
  var jap_age = theForm.jap_age.value;
  var jap_nationality = theForm.jap_nationality.value;
  var jap_home_phone = theForm.jap_home_phone.value;
  var jap_mobile_phone = theForm.jap_mobile_phone.value;
	var jap_email = theForm.jap_email.value;
	var security_code = theForm.security_code.value;
	
	if ((!jap_title)||(!jap_fname)||(!jap_lname)||(!jap_gender)||(!jap_age)||(!jap_nationality)||(!jap_home_phone)||(!jap_mobile_phone)/*||(!security_code)*/) {
		alert("All fields mark with * are required.");
		return false;
	} else if ((jap_email != '')&&((jap_email.indexOf('@') == -1) || (jap_email.indexOf('.') == -1))) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}

function changeFieldValue(theField,theValue) {
	theValue = String (theValue);

	document.getElementById(theField).value = theValue;

}

function changeCheckboxValue(theField, theValue) {
	if (theValue == 'Y') {
		theField.value = 'N';
	} else {
		theField.value = 'Y';
	}
}

