//Everything inside .ready() triggers once the page is finished loading
$(document).ready(function(){

	<!-- This installs FlowPlayer into the embedded FLV file -->
	/*
	flowplayer("player","config/flowplayer/flowplayer-3.2.4.swf", {
		clip: {
			autoPlay: false,
			autoBuffering: true
		}
	});
	*/

	<!-- This controls the tab panes beneath the video -->
	$("ul.tabs").tabs("div.pane > div.innerpane", {effect: 'ajax'});

	<!-- Define trigger to show Subscription modal dialog -->
	var triggers = $(".modalButton").overlay({
		mask: {
			color: '#184562',
			loadSpeed: 200,
			opacity: 0.8
		},
		
		closeOnClick: true
	});
	
	<!-- JavaScript control over all forms -->
	
	<!-- Subscription Form -->
	$("#sub form").submit(function(e) {
		triggers.eq(0).overlay().close();

		var values = $("#sub form").serialize();
		$.get('do_action.php?' + values,function(data) {
			$("#response").html(data);
			triggers.eq(1).overlay().load();
		});
		return e.preventDefault();
	});
	
});

function showHint(e) {
	if (e.length == 0) {
		$('#suggest').html("");
		return;
	}
	
	$.get("search_suggest.php?q=" + e, function(data) {
		$('#suggest').html(data);
		return;
	});
}

function showEventDetails(id) {
	$.get('do_action.php?eventinfo=1&id=' + id,function(data) {
			$('.description div').html(data);
	});	
}
