// JavaScript Document

//This file will contain the jquery code that runs the site.

function get_bio (page) {
	$.ajax({
		   method: "get",
		   url: "bio.php",
		   data: "page="+page,
		   beforeSend: function(){
			   $('#loader'+page).fadeIn('slow');
			   $("#biocontent").fadeOut('fast');
		   },
		   complete: function () {
			   $('#loader'+page).fadeOut('slow');
		   },
		   success: function(html){
			   $("#biocontent").html(html);
			   $("#biocontent").fadeIn(1000);
		   }
		   
		   });
}

function get_gallery () {
	$.ajax({
		   method: "get",
		   url: "get_gallery.php",
		   beforeSend: function(){
			   $("#galcontent").fadeOut('fast');
		   },
		   success: function (html) {
			   $("#galcontent").html(html);
			   $("#galcontent").fadeIn(1000);
		   }
		   });
	setTimeout('get_gallery()', 120000);
}

$(document).ready(function(){
	get_bio(4);
	
	$('#bionav a').click(function() {
		get_bio($(this).attr("title"));
		return false;
	});
	
	$('#calcontent').fullCalendar({
		events: '/get_events.php',
        weekMode: 'liquid',
		eventClick: function(event) {
			return hs.htmlExpand(this, { src: 'event_details.php?ID='+event.id, objectType: 'ajax' } );
		}
    });
	
	get_gallery();	

});