jQuery(document).ready(function($) { 

	var url = document.URL;
	// show course list
	var matchPage = url.match("/prep");
	if (matchPage != null) { 
		$("#prep").addClass("currentSelection");
		$("div#widget_courseList").load("http://mustardseedacademy.com/wp/wp-content/themes/msa2010/courseDesc.php?grp=prep&random=" + Math.random()*99999,
			function() { $("div#widget_courseList").slideDown(); }
		);
	return false;
	}

	// show course list
	var matchPage = url.match("/high-school");
	if (matchPage != null) { 
		$("#high-school").addClass("currentSelection");
		$("div#widget_courseList").load("http://mustardseedacademy.com/wp/wp-content/themes/msa2010/courseDesc.php?grp=phs",
			function() { $("div#widget_courseList").slideDown(); }
		);
	return false;
	}

	// show course list
	var matchPage = url.match("/adults");
	if (matchPage != null) { 
		$("#adults").addClass("currentSelection");
		$("div#widget_courseList").load("http://mustardseedacademy.com/wp/wp-content/themes/msa2010/courseDesc.php?grp=adult",
			function() { $("div#widget_courseList").slideDown(); }
		);
	return false;
	}

	// show course list
	var matchPage = url.match("/voice");
	if (matchPage != null) { 
		var theText = $("div#gallery-1");
 		theText.html ( theText.html().replace(/\u5408\u683C/g,'<span style=\'background-color: yellow; color:red;font-weight: bold;\'>合格</span>') ); 
	}


});

/* code to show teacher details */
function showTeacher(tname) { 
	jQuery.post("wp/wp-content/themes/msa2010/instructor_details.php", 
		{ name: tname },
		function(result){ 
			jQuery('#teacher-profile-display').fadeOut('slow', function () {
				jQuery('#teacher-profile-display').html(result).fadeIn('slow'); 
			}); } 
	);
}

function showClassInfo(cid) { 
	jQuery.post("http://mustardseedacademy.com/wp/wp-content/themes/msa2010/courseDesc.php", 
		{ cc: cid },
		function(result){ 
			jQuery('.post-body').fadeOut('slow', function () {
				jQuery('.post-body').html(result).fadeIn('slow'); 
			}); } 
	);
}
