$(document).ready(function(){
    
	function program() {
		var selected = $('#program option:selected').val();
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=GCU_optionals',
			data: 'selected='+selected,
			success: function(response){
				if (response == 'health') {
					$('#div_health').show();
				} else {
					$('#div_health').hide();
				}
				if (response == 'certified') {
					$('#div_certified').show();
				} else {
					$('#div_certified').hide();
				}
			}
		});
		if (selected == 'EMBA') {
			$('#div_experience').show();
		} else {
			$('#div_experience').hide();
		}
		
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=GCU_right_content',
			data: 'selected='+selected,
			success: function(response){
				if (response != '') {
					$('#right_content_update').html(response);
				}
			}
		});
	}
	
	function education() {
		var selected = $('#education option:selected').val();
		$.ajax({
			type: 'POST',
			url: '/ajax.php?action=GCU_program',
			data: 'selected='+selected,
			success: function(response){
				if (response != '') {
					$('select#program').html(response);
				}
			}
		});
	}
	
	program();
	
	$('#program').change(function () { program(); });
	$('#education').change(function () { education(); });
	
});
