 function fnCreateRoleSaveButtonClick() {
	var himsValidator = [new hims_ctl_val("ctl00_CP_RoleTitleTextBox", 'Role', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_RemarkTextBox", 'Remarks', "T", "", "", "", 20)];
	if (fnDoValidate(himsValidator))
		return true;
	else
		return false;
}
function OnItemSelected(RoleNameLinkButton) {
	var RoleIDHiddenField = document.getElementById(RoleNameLinkButton.id.replace('RoleNameLinkButton', 'RoleIDHiddenField'));
	var RoleIDHF = document.getElementById('ctl00_CP_RoleIDHiddenField');
	RoleIDHF.value = RoleIDHiddenField.value;
	var UpdatedDateHiddenField = document.getElementById(RoleNameLinkButton.id.replace('RoleNameLinkButton', 'UpdatedDateHiddenField'));
	var UpdatedDateHF = document.getElementById('ctl00_CP_UpdatedDateHiddenField');
	UpdatedDateHF.value = UpdatedDateHiddenField.value;
	var RoleTitleTextBox = document.getElementById('ctl00_CP_RoleTitleTextBox');
	RoleTitleTextBox.value = RoleNameLinkButton.innerText;
	RoleTitleTextBox.disabled = true;
	var RemarkLabel = document.getElementById(RoleNameLinkButton.id.replace('RoleNameLinkButton', 'RemarkLabel'));
	var RemarkTextBox = document.getElementById('ctl00_CP_RemarkTextBox');
	RemarkTextBox.value = RemarkLabel.innerText;
	var IsSystemCheckBox = document.getElementById(RoleNameLinkButton.id.replace('RoleNameLinkButton', 'IsSystemCheckBox'));
	var IsSystemCheckBox1 = document.getElementById('ctl00_CP_IsSystemCheckBox');
	IsSystemCheckBox1.checked = IsSystemCheckBox.checked;
	var IsObsoleteCheckBox = document.getElementById(RoleNameLinkButton.id.replace('RoleNameLinkButton', 'IsObsoleteCheckBox'));
	var IsObsoleteCheckBox1 = document.getElementById('ctl00_CP_IsObsoleteCheckBox');
	IsObsoleteCheckBox1.checked = IsObsoleteCheckBox.checked;
	EnableFields('true');
	return false;
}
function ClearFields() {
	var RoleIDHF = document.getElementById('ctl00_CP_RoleIDHiddenField');
	RoleIDHF.value = '';
	var RoleTitleTextBox = document.getElementById('ctl00_CP_RoleTitleTextBox');
	RoleTitleTextBox.value = '';
	RoleTitleTextBox.disabled = false;
	var RemarkTextBox = document.getElementById('ctl00_CP_RemarkTextBox');
	RemarkTextBox.value = '';
	var IsSystemCheckBox = document.getElementById('ctl00_CP_IsSystemCheckBox');
	IsSystemCheckBox.checked = false;
	var IsObsoleteCheckBox = document.getElementById('ctl00_CP_IsObsoleteCheckBox');
	IsObsoleteCheckBox.checked = false;
	return false;
}
function EnableFields(disable) {
	if (disable == 'true') {
		document.getElementById('ctl00_CP_RemarkTextBox').disabled = true;
		document.getElementById('ctl00_CP_IsObsoleteCheckBox').disabled = true;
	}
	else if (disable == 'false') {
		document.getElementById('ctl00_CP_RemarkTextBox').disabled = false;
		document.getElementById('ctl00_CP_IsObsoleteCheckBox').disabled = false;
	}
	return false;
}
function clickButton(e) {
	if (navigator.appName.indexOf("Netscape") > (-1)) {
		if (e.keyCode == 13) {
			bt.click();
			return false;
		}
	}
	if (navigator.appName.indexOf("Microsoft Internet Explorer") > (-1)) {
		if ((event.keyCode == Sys.UI.Key.pageUp) ||
	   (event.keyCode == Sys.UI.Key.pageDown) ||
	   (event.keyCode == Sys.UI.Key.up) ||

	   (event.keyCode == Sys.UI.Key.down) ||
	   (event.keyCode == Sys.UI.Key.left) ||
	   (event.keyCode == Sys.UI.Key.right) ||
	   (event.keyCode == Sys.UI.Key.home) ||
	   (event.keyCode == Sys.UI.Key.end) ||
	   (event.keyCode == 46 ) ||
	   (event.ctrlKey )) {
			return;
		}
		var text = event.srcElement.value || '';
		var invalidchar = "~`!@#$%^&*()_+={}[]:;'<>,./?\\|\"";
		var result = new Sys.StringBuilder();
		for (var i = 0; i < text.length; i++) {
			var ch = text.substring(i, i + 1);
			if (invalidchar.indexOf(ch) == -1) {
				result.append(ch);
			}
		}
		if (event.srcElement.value != result.toString()) {
			event.srcElement.value = result.toString();
		}
	}
}