function FormatIt(obj) {
	if (obj.value.length == 2) 
		obj.value = obj.value + "/";
	if (obj.value.length == 5) 
		obj.value = obj.value + "/";
}
function fnValidate() {
	var himsValidator = [
						   new hims_ctl_val('ctl00_CP_OrganizationDropDownList', "Organization", "T", "", "", "", 20),
						new hims_ctl_val('ctl00_CP_BatchDropDownList', "Batch", "T", "", "", "", 20),
						new hims_ctl_val('ctl00_CP_ClassDropDownList', "Class", "T", "", "", "", 20),
						new hims_ctl_val("ctl00_CP_AdmissionCategoryDropDownList", "Admission Category", "T", "", "", "", 20)
	];

	if (fnDoValidate(himsValidator))
		return confirm('Are you sure you Want to Save?');
	else
		return false;
}

function FillCollectionGroupDropDownList(obj) {
	var row = obj.parentNode.parentNode;
	var rowIndex = row.rowIndex - 1;
	var state = row.cells[9].getElementsByTagName("select")[0];
	$.ajax({
		type: "POST",
		url: "/Pages/FeeManagement/FeeSetup.aspx/FillCollectionGroupDropDownList",
		data: '{"Id":"' + $(obj).val() + '"}',
		contentType: "application/json;charset=utf-8",
		dataType: "json",
		success: function (data) {
			var datas = $.parseJSON(data.d);
			$(state).html("");
			$(state).append($("<option></option>").val("-1").html("- Select -"));
			$.each(datas, function (index, itemData) {
				$(state).append($("<option></option>").val(itemData['Id']).html(itemData['Title']));
			});
		}
	});
}