$(document).ready(function(){
    calendarAjax();
});

function calendarAjax () {
    $('thead th a').live('click', function() {
        if (! $('body.calendarBG').length ) {
            $('#calendar_holder').fadeOut().load($(this).attr('href')+' #calendar' , function(){
                $(this).fadeIn();
            });
            return false;
        }
        else
        {
            $('#calender_wrapper').animate({ opacity: "0" }, 200 ).load($(this).attr('href')+' #calender_wrapper' , function(){
                $(this).animate({ opacity: "1" }, 600 );
            });
            return false;
        }
    });
    $('.resource_calendar p.return a').live('click', function () {
        $('#calender_wrapper').animate({ opacity: "0" }, 200 ).load($(this).attr('href')+' #calender_wrapper' , function(){
            $(this).animate({ opacity: "1" }, 400 );
        });
        return false;
    });
};

	jQuery(function(){
		        jQuery('.slide-out-div').tabSlideOut({
		            tabHandle: '.handle',                     //class of the element that will become your tab
		            pathToTabImage: 'http://www.tus-hilchenbach.de/i/handle_slider.png', //path to the image for the tab //Optionally can be set using css
		            imageHeight: '40px',                     //height of tab image           //Optionally can be set using css
		            imageWidth: '122px',                       //width of tab image            //Optionally can be set using css
		            tabLocation: 'top',                      //side of screen where tab lives, top, right, bottom, or left
		            speed: 300,                               //speed of animation
		            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
		            topPos: '200px',                          //position from the top/ use if tabLocation is left or right
		            leftPos: 'auto',                          //position from left/ use if tabLocation is bottom or top
		            fixedPosition: false                      //options: true makes it stick(fixed position) on scroll
		        });
		
		    });
