/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: calender_panel.js
| Author: bartek124
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
$(document).ready(function () {
	calender_panel();
});

function calender_panel() {
	$("input[name='prev_month']").bind("click", function() {
		$("div#calender-panel").fadeTo("fast", 0.01, function() {
			$.post(CALENDER_PANEL+"calender_ajax.php",{ prev_month: true, cur_month: $("input[name='cur_month']").val(), cur_year: $("input[name='cur_year']").val() }, function(data) {
				$("div#calender-panel").html(data).fadeTo("fast", 1.0);
				calender_panel();
			});
		});
		return false;
	});
		
	$("input[name='next_month']").bind("click", function () {
		$("div#calender-panel").fadeTo("fast", 0.01, function() {
			$.post(CALENDER_PANEL+"calender_ajax.php",{ next_month: true, cur_month: $("input[name='cur_month']").val(), cur_year: $("input[name='cur_year']").val() }, function(data) {
				$("div#calender-panel").html(data).fadeTo("fast", 1.0);
				calender_panel();
			});
		});
		return false;
	});
}