$(document).ready(function(){
    
	$('#educationlevel').change(function () {
		var selected = $('#educationlevel option:selected').val();
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=UoM_program',
			data: 'selected='+selected,
			success: function(response){
				$('select#program').html(response);
			}
		});
	});
	
	$('#program').change(function () {
		program();
	});
	
	$('#program2').change(function () {
		var selected = $('#program2 option:selected').val();
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=UoM_right_content',
			data: 'selected='+selected,
			success: function(response){
				if (response != '') {
					$('#right_content_update').html(response);
				}
			}
		});
	});
	
	$('#samePhone').click(function () {
		if ($('#samePhone').is(':checked')) {
			$('#phone2_1').val($('#phone_1').val());
			$('#phone2_2').val($('#phone_2').val());
			$('#phone2_3').val($('#phone_3').val());
		} else {
			$('#phone2_1').val('');
			$('#phone2_2').val('');
			$('#phone2_3').val('');
		}
	});
	
	program();

});


function program() {
		var selected = $('#program option:selected').val();
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=UoM_right_content',
			data: 'selected='+selected,
			success: function(response){
				if (response != '') {
					$('#right_content_update').html(response);
				}
			}
		});
}

