function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	}
}
function fnValidateSetupMaster() {
	var himsValidator = [new hims_ctl_val('ctl00_CP_FirstNameTextBox', "First Name", "T", "", "", "", 20),
		new hims_ctl_val('ctl00_CP_LastNameTextBox', "Last Name", "T", "", "", "", 20),
		new hims_ctl_val('ctl00_CP_EmployeeTypeDropDownList2', "Employee Type", "T", "", "", "", 20),
		new hims_ctl_val('ctl00_CP_EmployeeGroupDropDownList', "Employee Group", "T", "", "", "", 20),
		new hims_ctl_val('ctl00_CP_EmployeeGradeDropDownList', "Employee Grade", "T", "", "", "", 20),
		new hims_ctl_val("ctl00_CP_DepartmentDropDownList", "Department", "T", "", "", "", 20),
		new hims_ctl_val("ctl00_CP_GenderDropDown", "Gender", "T", "", "", "", 20),
		new hims_ctl_val("ctl00_CP_EmployeeStatusDropDownList1", "Status", "T", "", "", "", 20)];
	if (fnDoValidate(himsValidator))
		return true;
	else
		return false;
}
popwindow = null;
function OpenDrugDispense() {
	var left = (screen.width / 2) - (700 / 2);
	var top = (screen.height / 2) - (500 / 2);
	if (popwindow == null) {
		popwindow = window.open('../../Common/FileUpload/UploadEmployeePhoto.aspx', '', 'height=500,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes' + ', top=' + top + ', left=' + left)
	}
	else {
		popwindow.close();
		popwindow = window.open('../../Common/FileUpload/UploadEmployeePhoto.aspx', '', 'height=500,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes' + ', top=' + top + ', left=' + left)
	}
}