$("#std_excel_marks_entry").click(function(){

	var shift_id = $("#shift_id").val();
	var medium_id = $("#medium_id").val();
	var class_id = $("#class_id").val();
	var department_id = $("#department_id").val();
	var student_type_id = $("#student_type_id").val();
	var section_id = $("#section_id").val();
	var exam_term_id = $("#exam_term_id").val();
	var exam_session = $("#exam_session").val();

	var operation = 'insert';
	
	var datastr_sc="department_id="+department_id+"&section_id="+section_id+"&exam_term_id="+exam_term_id+"&exam_session="+exam_session+"&operation="+operation;
	//alert(datastr_sc);

	if(shift_id==""){
		alert("Select Shift Name");
		$('#shift_id').focus();
		return false;
	}
	else if(medium_id==""){
		alert("Select Medium Name");
		$('#medium_id').focus();
		return false;
	}
	else if(class_id==""){
		alert("Select Class Name");
		$('#class_id').focus();
		return false;
	}
	else if(department_id==""){
		alert("Select Department Name");
		$('#department_id').focus();
		return false;
	}
	else if(student_type_id==""){
		alert("Select Student Type");
		$('#student_type_id').focus();
		return false;
	}
	else if(section_id==""){
		alert("Select Section Name");
		$('#section_id').focus();
		return false;
	}

	else if(exam_term_id==""){
		alert("Select Exam Term");
		$('#exam_term_id').focus();
		return false;
	}
	else if(exam_session==""){
		alert("Select Exam Session");
		$('#exam_session').focus();
		return false;
	}
	else{

		$(".show_mark_entry_subject").load("module/exam/marks_entry_sub_chose.php",datastr_sc);
		$('#first_part').remove();
		$('#second_part').css("display","block");

	}
});

// =======================================
function call_mark_entry_sheet_by_sub(subject_id,section_id,department_id,exam_term_id,exam_session){
	// alert(department_id);
	var operation = 'sheet_create';
	var datastr="subject_id="+subject_id+"&section_id="+section_id+"&department_id="+department_id+"&exam_term_id="+exam_term_id+"&exam_session="+exam_session+"&operation="+operation;

//alert(datastr);

	if(subject_id==""){
		alert("Select Subject Name");
		$('#subject_id').focus();
		return false;
	}
	else{
		$(".show_mark_entry_sheet").load("module/exam/excel_mark_upload.php",datastr);
	}

}

// ==================================================

// ================================
function call_medium(id){
	var datastr="shift_id="+id;
	$("#medium_id").load("module/settings/get_medium_list_for_form.php",datastr);
}
function call_class(id){
	var datastr="medium_id="+id;
	$("#class_id").load("module/settings/get_class_list_for_form.php",datastr);
}
function call_department(id){
	var datastr="class_id="+id;
	$("#department_id").load("module/settings/get_department_list_for_form.php",datastr);
}
function call_std_type(id){
		var datastr="department_id="+id;
	$("#student_type_id").load("module/settings/get_student_type_list_for_form.php",datastr);
}
function call_section(id){
		var datastr="student_type_id="+id;
	$("#section_id").load("module/settings/get_section_list_for_form.php",datastr);
}