function showHelp(helpCode) {
	window.open("help.cfm?msgcode=" + helpCode, "Help", "fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=500,height=600");
	return true;
}
function validatesignin() {
	if(check_blank('strUserName','Please enter an username') == false) return false;
	if( document.forms[strForm].strUserName.value.length < 5 ) {
		alert("Username must be more than five letters");
		document.forms[strForm].strUserName.focus();
		return false;
	}
	if(check_blank('strPassword','Please enter the password') == false) return false;
	if(check_blank('strConfPassword','Please confirm the password') == false) return false;
	if( document.forms[strForm].strPassword.value != document.forms[strForm].strConfPassword.value ) {
		alert("Password and Confirm password are not same");
		document.forms[strForm].strPassword.focus();
		return false;
	}
	if( document.forms[strForm].strPassword.value.length < 5 ) {
		alert("Password must be more than five letters");
		document.forms[strForm].strPassword.focus();
		return false;
	}
	if(check_blank('strEmail','Please enter the email') == false) return false;
	if(check_email('strEmail','Please provide a valid email address') == false) return false;
	if(check_blank('strEmailConfirm','Please confirm the email') == false) return false;
	if( document.forms[strForm].strEmail.value != document.forms[strForm].strEmailConfirm.value ) {
		alert("Email and Confirm email are not same");
		document.forms[strForm].strEmailConfirm.focus();
		return false;
	}

	document.forms[strForm].action = "register_act.cfm";
	document.forms[strForm].submit();
	return true;
}

function validatepay1() {
	if (document.forms[strForm].paymentMode[0].checked == true) {
		document.forms[strForm].action = document.forms[strForm].secChn.value + "renewpay2.cfm";
	}
	else {
		document.forms[strForm].action = document.forms[strForm].secChn.value + "renewpay2_act.cfm";
	}
	document.forms[strForm].submit();
	return true;
}

function validatepay11() {
	document.forms[strForm].action = document.forms[strForm].secChn.value + "renewthnku.cfm";
	document.forms[strForm].submit();
	return true;
}

function validatepay2() {
	if(check_blank('strCCFirstName','Please provide the first name as present on the credit card') == false) return false;
	if(check_blank('strCCLastName','Please provide the last name as present on the credit card') == false) return false;
	if(check_blank('strCCAddress1','Please provide the address information as present on the credit card') == false) return false;
	if(check_blank('strCCCity','Pleae provide the city name for the address information') == false) return false;
	if(document.forms[strForm].strCCState.selectedIndex == 0 &&
		check_blank('strCCStateOther') == false){
		alert("Please select or provide State/Province Information for address.\n If no state/province, enter 'NONE' in the 'other' field");
		document.forms[strForm].strCCState.focus();
		return false;
	}
	if(check_blank('strCCZipCode','Please provide the zip code for the address information') == false) return false;
	if(document.forms[strForm].strCCCountry.selectedIndex == 0 &&
		check_blank('strCCCountryOther') == false){
		alert('Please select or provide the country for the address information');
		document.forms[strForm].strCCCountry.focus();
		return false;
	}
	
	if(check_blank('strCCEmail','Please provide a valid email address') == false) return false;
	if(check_email('strCCEmail','Please provide a valid email address') == false) return false;

	if(document.forms[strForm].strCCType.selectedIndex == 0){
		alert('Please select the credit card type');
		document.forms[strForm].strCCType.focus();
		return false;
	}
	
	if(check_numeric('strCCNumber','Please provide the credit card number') == false) return false;
	if(check_creditcard('strCCNumber','Please provide the credit card number') == false) return false;

	if(document.forms[strForm].strCCMonth.selectedIndex == 0){
		alert('Please select the credit card expiration month');
		document.forms[strForm].strCCMonth.focus();
		return false;
	}

	if(document.forms[strForm].strCCYear.selectedIndex == 0){
		alert('Please select the credit card expiration year');
		document.forms[strForm].strCCYear.focus();
		return false;
	}
	document.forms[strForm].action = "renewpay2_act.cfm";
	document.forms[strForm].submit();
	return true;
}


function showJuri(selfObj,showObj,hideObj,focusObj) {
	if(showObj != '')
	varShowObj = document.getElementById(showObj);
	if(hideObj != '')
	varHideObj = document.getElementById(hideObj);
	if(focusObj != '')
	varfocusObj = document.getElementById(focusObj);
	
	if(selfObj.checked == true && selfObj.value == '1') {
		if(hideObj != '')
		varHideObj.style.display = 'none';
		if(showObj != '')
		varShowObj.style.display = 'block';
		if(focusObj != '')
		varfocusObj.focus();
	}
	else if(selfObj.checked == true && selfObj.value == '0') {
		if(hideObj != '')
		varHideObj.style.display = 'none';
		if(showObj != '')
		varShowObj.style.display = 'block';
		if(focusObj != '')
		varfocusObj.focus();
	}
	return true;
}

function validatepersonal() {
	if(check_blank('strFirstName','First name can not be blank') == false) return false;
	if(check_blank('strLastName','Last name can not be blank') == false) return false;
	if(check_blank('strBusTitle','Business title can not be blank') == false) return false;
	if(check_blank('strBusCompany','Business name can not be blank') == false) return false;
	if(check_blank('strBusAddr1','Business address Line 1 can not be blank') == false) return false;
	if(check_blank('strBusCity','Business address City can not be blank') == false) return false;
	if(check_blank('strBusState','Business address state can not be blank') == false) return false;
	if(check_blank('strBusZipCode','Business address zip code can not be blank') == false) return false;
	if(check_blank('strBusCountry','Business address country can not be blank') == false) return false;
	if(check_blank('strBusEmail','Business Email is not valid') == false) return false;
	if(check_email('strBusEmail','Business Email is not valid') == false) return false;

	if(document.forms[strForm].strEngLic[0].checked == true) {
		if(check_blank('strJurisdiction','Jurisdiction can not be blank') == false) return false;
		if(check_blank('strLicExp','License Expiration date can not be blank') == false) return false;
		//if(check_numeric('strLicExp','License Expiration Year should be a number') == false) return false;
		if(check_date('strLicExp','mdy','Please enter a valid License Expiration date') == false)return false;
	}
	if(document.forms[strForm].strEngLic[1].checked == true) {
		if(check_blank('strEngLicExplain','Explanation for no engineering license can not be blank') == false) return false;
	}

	//if(document.forms[strForm].strPDHReq[1].checked == true) {
		//if(check_blank('strPDHReqExplain','Explanation for 30 PDH requirement can not be blank') == false) return false;
	//}

	document.forms[strForm].action = "renewpersonal_act.cfm";
	document.forms[strForm].submit();
	return true;
}

function validateAddOedu() {
	document.forms[strForm].strAction.value = 'ADD';
	validateOedu();
	return true;
}

function validateSaveOedu() {
	document.forms[strForm].strAction.value = 'Save';
	validateOedu();
	return true;
}

function validateOedu() {
	if(check_blank('strSchName','Provider or Location can not be blank') == false) return false;
	if(check_blank('strSchCity','City can not be blank') == false) return false;
	if(check_blank('strSchState','State can not be blank') == false) return false;
	if(check_blank('strSchCountry','Country can not be blank') == false) return false;
	if(check_blank('strDegName','Type of Activity can not be blank') == false) return false;
	if(check_blank('strDegDesc','Activity Description can not be blank') == false) return false;
	if(document.forms[strForm].strDegDesc.value.length > 199) {
		alert("Activity Description can be maximum of 199 characters.");
		return false;
	}
	if(check_blank('strCredits','Invalid number of Credits for this course') == false) return false;
	if(check_decimal('strCredits','Invalid number of Credits for this course') == false) return false;
	
	if(check_blank('strStartDate','Activity Start Date can not be blank') == false) return false;
	if(check_date('strStartDate','mdy','Please enter a valid Activity Start Date') == false)return false;
	if(check_blank('strDegDate','Activity End Date can not be blank') == false) return false;
	if(check_date('strDegDate','mdy','Please enter a valid Activity End Date') == false)return false;

	document.forms[strForm].action = "renewoedu_act.cfm";
	document.forms[strForm].submit();
	return true;
}

function displayCount(objCount,objDisplayCount) {
	varShowObj = document.getElementById(objDisplayCount);
	varShowObj.innerHTML = "&nbsp;" + objCount.value.length;
	return true;
}

function validateprofeth() {
	if(document.forms[strForm].strattest.checked == false) {
		alert("Please Accept to the agreement to proceed with your application.");
		return false;
	}
	document.forms[strForm].action = "renewethics_act.cfm";
	document.forms[strForm].submit();
	return true;
}

function validateAddPexp() {
	document.forms[strForm].strAction.value = 'ADD';
	validatepexp();
	return true;
}

function validateSavePexp() {
	document.forms[strForm].strAction.value = 'Save';
	validatepexp();
	return true;
}

function validatepexp() {
	if(document.forms[strForm].strExpDesc.value.length > 199) {
		alert("Description of Experience can be maximum of 200 characters.");
		return false;
	}
	
	document.forms[strForm].action = "renewpexp_act.cfm";
	document.forms[strForm].submit();
	return true;
}
function validatecheckin() {
	if(check_blank('strUserName','Please enter an username') == false) return false;
	if(check_blank('strPassword','Please enter the password') == false) return false;
	document.forms[strForm].action = "renewcheckin_act.cfm";
	document.forms[strForm].submit();
	return true;
}
