$(document).ready(function(){

	// hr employment status update
	$('.update_employment_box').submit(function(){
		var thisForm = $(this),
			employmentId = thisForm.find('.update_employment_id').val(),
			employmentStatus = thisForm.find('.update_employment_status').val(),
			warningMessage = $('#click_warning_message').text() + employmentStatus + '!' ;

		// check confirmation box first
		if (confirm(warningMessage)){
			
			// disable button
			lockUnlockInput('lock', '') ;
		
			$.ajax({
				type: 'POST',
				url: 'requires/ajax_employment_update.php?type=update-status',
				data: { 'page': employmentId, 'status': employmentStatus },
				dataType: 'json',
				success: function (data) {
					if (data['result']){
						thisForm.find('.update_employment_result_success').fadeIn("fast") ;
					}else{
						thisKey.find('.update_employment_result_error').fadeIn("fast") ;
					}
					
					// remove disable
					lockUnlockInput('unlock', '') ;
					
					setTimeout(function () {
						$(".update_employment_result").fadeOut("slow") ;
					}, 2000) ;
				}
			});
		}
		
		return false ;
	}) ;

}) ;