 function fnValueSaveButtonClick1() {
	var himsValidator = [new hims_ctl_val("ctl00_CP_OrganizationDropDownList", "Organization", "T", "", "", "", 20),
							 new hims_ctl_val("ctl00_CP_StudentNameTextBox", 'Student Name', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_LoginNameTextBox", 'User Name', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_DisplayNameTextBox", MessageVars.SEC_0050, "T", "", "", "", 20)
									];
	if (fnDoValidate(himsValidator))
		return true;
	else
		return false;
}
function fnValueSaveButtonClick2() {
	var himsValidator = [new hims_ctl_val("ctl00_CP_OrganizationDropDownList", "Organization", "T", "", "", "", 20),
							 new hims_ctl_val("ctl00_CP_EmployeeNameTextBox", 'Employee Name', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_LoginNameTextBox", 'User Name', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_DisplayNameTextBox", MessageVars.SEC_0050, "T", "", "", "", 20)
									 ];
	if (fnDoValidate(himsValidator))
		return true;
	else
		return false;
}
function fnValueSaveButtonClick3() {
	var himsValidator = [new hims_ctl_val("ctl00_CP_OrganizationDropDownList", "Organization", "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_LoginNameTextBox", 'User Name', "T", "", "", "", 20),
									new hims_ctl_val("ctl00_CP_DisplayNameTextBox", MessageVars.SEC_0050, "T", "", "", "", 20)
									 ];
	if (fnDoValidate(himsValidator))
		return true;
	else
		return false;
}
function fnPasswordSpecialCharacters(charCode) {
	if ((charCode == 33)
	|| (charCode >= 35 && charCode <= 37)        
	|| (charCode >= 40 && charCode <= 47)
	|| (charCode >= 58 && charCode <= 64)
	|| (charCode >= 91 && charCode <= 96)
	|| (charCode >= 123 && charCode <= 125))
	{ return true; }
	return false;
}
function fnPasswordStringCharacters(charCode) {
	if ((charCode == 32)
	|| (charCode > 57 && charCode < 59)
	|| (charCode > 64 && charCode < 91)
	|| (charCode > 96 && charCode < 123))
	{ return true; }
	return false;
}
function fnPasswordNumericCharacters(charCode) {
	if (charCode >= 48 && charCode <= 57)
	{ return true; }
	return false;
}
function fnPaswordChararters(str) {
	var IsSpecialCharIncluded = false;
	var IsNumericCharIncluded = false;
	for (var j = 0; j < str.length; j++) {
		var charParam = str.charAt(j);
		var iChar = charParam.charCodeAt(0);
		var isValid = false;
		isValid = fnPasswordStringCharacters(iChar);
		if (isValid == false) {
			isValid = fnPasswordSpecialCharacters(iChar);
			if (IsSpecialCharIncluded == false) {
				IsSpecialCharIncluded = isValid;
			}
		}
		if (isValid == false) {
			isValid = fnPasswordNumericCharacters(iChar);
			if (IsNumericCharIncluded == false) {
				IsNumericCharIncluded = isValid;
			}
		}
		if (isValid == false) {
			return isValid;
		}
	}
	if (IsSpecialCharIncluded == false
	|| IsNumericCharIncluded == false) {
		return false;
	}
	return true;
}
function fnValidatePassword(textbox, minLength, maxLength) {          
	var str = fnTrim(textbox.value);
	var newStr = "";
	var isValid = true;
	if (str.length == 0) {
		textbox.value = str;
		return true;
	}
	if (str.length < minLength) { isValid = false };
	if (str.length > maxLength) { isValid = false };         
	if (isValid == false) {
		SetMessageBox('Invalid Password: Length should be Min:6 and Max:13', 'Error');
	}
	else {
		ResetMessageBox();
	}
	textbox.value = str;
}     
function addAttribute() {
	var availableList = document.getElementById('ctl00_CP_AvailableListBox');
	var selectedList = document.getElementById('ctl00_CP_SelectedListBox');
	var addIndex = availableList.selectedIndex;
	var len = availableList.length - 1;
	for (i = len; i >= 0; i--) {
		if (availableList.options(i).selected) {
			selectedList.appendChild(availableList.options.item(i));
		}
	}
	SetSelectedHiddenId();
	selectNone(selectedList, availableList);
	setSize(selectedList, availableList);
}
function delAttribute() {
	var availableList = document.getElementById('ctl00_CP_AvailableListBox');
	var selectedList = document.getElementById('ctl00_CP_SelectedListBox');
	var selIndex = selectedList.selectedIndex;
	var len = selectedList.length - 1;
	for (i = len; i >= 0; i--) {
		if (selectedList.options(i).selected) {
			availableList.appendChild(selectedList.options.item(i))
		}
	}
	SetSelectedHiddenId();
	selectNone(selectedList, availableList);
	setSize(availableList, selectedList);
}
function SetSelectedHiddenId() {
	var availableList = document.getElementById('ctl00_CP_AvailableListBox');
	var selectedList = document.getElementById('ctl00_CP_SelectedListBox');
	var SelectedIDHiddenField = document.getElementById('ctl00_CP_SelectedIDHiddenField');
	SelectedIDHiddenField.value = '';
	for (i = selectedList.length - 1; i >= 0; i--) {
		if (SelectedIDHiddenField.value == '') {
			if (selectedList.length == 0) {
				SelectedIDHiddenField.value = '';
			}
			else {
				SelectedIDHiddenField.value = (selectedList.options.item(i).value) + '|' + (selectedList.options.item(i).text);
			}
		}
		else {
			if (selectedList.length == 0) {
				SelectedIDHiddenField.value = '';
			}
			else {
				SelectedIDHiddenField.value = SelectedIDHiddenField.value + ',' + (selectedList.options.item(i).value) + '|' + (selectedList.options.item(i).text);
			}
		}
	}
}
function selectNone(list1, list2) {
	list1.selectedIndex = -1;
	list2.selectedIndex = -1;
	addIndex = -1;
	selIndex = -1;
}
function setSize(list1, list2) {
	list1.size = getSize(list1);
	list2.size = getSize(list2);
}
function getSize(list) {       
	var len = list.childNodes.length;
	var nsLen = 0;        
	for (i = 0; i < len; i++) {
		if (list.childNodes.item(i).nodeType == 1)
			nsLen++;
	}
	if (nsLen < 2)
		return 2;
	else
		return nsLen;
}     
function FormatIt(obj) {
	if (obj.value.length == 2) 
		obj.value = obj.value + "/";
	if (obj.value.length == 5) 
		obj.value = obj.value + "/";
}