function changeBluePayFormStatus() {
	var isBluePayEnabled = document.getElementById('isBluePayEnabled');
	changeFieldStatus('isBluePayRegistrationEnabled', isBluePayEnabled.checked);
	
	var isBluePayRegistrationEnabled = document.getElementById('isBluePayRegistrationEnabled');
	if (!isBluePayEnabled.checked) {
		isBluePayRegistrationEnabled.checked = isBluePayEnabled.checked;
	}

	var status = isBluePayEnabled.checked && isBluePayRegistrationEnabled.checked;

	changeFieldStatus('bluePayApiAccountId', status);
	changeFieldStatus('bluePayApiAccountId', status);
	changeFieldStatus('bluePaySecretKey', status);
	changeFieldStatus('bluePayAgentOnlineAppId', status);
}

function changeFieldStatus(fieldId, status) {
	var field = document.getElementById(fieldId);
	field.disabled = (status) ? false : true;
}