var storyVal = "";

new Event.observe(window,"load", function(ev) {

	// Setup observer for the changing story value.
	storyVal = $("storycat").value;
	$("storycat").observe("dropdown:change",function(ev) {
		ev.stop();
		if (this.value != storyVal) {
			// It's been changed, let's reload the storys!
			storyVal = this.value;
			new Ajax.Updater("stories","http://www.familytreemd.org/modules/stories/get-category.php?id=" + storyVal, { onComplete: function() { AudioPlayer.Embed(); } });
		}
	});
	
});