$(document).ready(function(){
	
	$('.contentBox').jScrollPane();
	
	//Menu Hover Controls
	$(".rollover").hover(function() {
		$(this).css({'margin-top':'-44px'});
	}, function(){
		$(this).css({'margin-top':'0px'});
	});
	
	//Event Calendar Info
	//Change Month
	$(".get-month").livequery('click', function() {
		variables = $(this).attr('href');
		variables = variables.split("?");
		url = variables[0].split("calendar.php");
		url = url[0];
		$.ajax({
		   type: "POST",
		   url: $(this).attr('href'),
		   success: function(newcal) {
			  $("#calendar-date").html(newcal);
			  $.ajax({
			  			     type: "POST",
			  			     url: url+'showEvents.php?'+variables[1],
			  			     success: function(t) {
			  				    $("#calendar-info").html(t);
			  			     }
			  			  });
		   }
		});
		return false;
	});
	
	//Show Events
	$(".showEvent").livequery('click', function() {
		variables = $(this).attr('href');
		variables = variables.split("?");
		url = variables[0].split("showEvents.php");
		url = url[0];
		$.ajax({
		   type: "GET",
		   url: $(this).attr('href'),
		  success: function(t) {
			  $("#calendar-info").html(t);
			  $.ajax({
			     type: "GET",
			     url: url+'calendar.php?'+variables[1],
			    success: function(t) {
				    $("#calendar-date").html(t);
			     }
			  });
		   }
		});
		return false;
	});
	
	
	//Set Content
	$(".setcontent").livequery("click", function(){
		var parent = $(this).parent().parent();
		var url = $(this).attr('href');
		$.ajax({
		   type: "GET",
		   url: url,
		   success: function(t) {
			 parent.html(t);
		   }
		});
		return false;
	});
	
	$(".setgallery").livequery("click", function(){
		var url = $(this).attr('href');
		$.ajax({
		   type: "GET",
		   url: url,
		   success: function(result) {
			 $("#gallery-box").html(result);
		   }
		});
		return false;
	});
	
	$(".setfilm").livequery("click", function(){
		var url = $(this).attr('href');
		$.ajax({
		   type: "GET",
		   url: url,
		   success: function(result) {
			 $("#film-box").html(result);
		   }
		});
		return false;
	});

});
