$(document).ready(function() {
	
	// Begin jQuery for calendar.php
	$('#next').live('click', function() {
		var currentmonth = $('#currentmonth').val();
		$.ajax({
     		type: "POST",
     		url: "/_calendar_ajax_load.php",
     		data: "direction=next&currentmonth="+currentmonth,
     		success: function(html){
				$('#calendar').html(html);    		    
     		}
    	});
   });
   
   $('#previous').live('click', function() {
		var currentmonth = $('#currentmonthp').val();
		$.ajax({
     		type: "POST",
     		url: "/_calendar_ajax_load.php",
     		data:  "direction=previous&currentmonth="+currentmonth,
     		success: function(html){
       			$('#calendar').html(html);    		    
     		}
    	});
   });

	// Tracking clicks for the callouts
	$('a.callouts').click(function(e) {
			e.preventDefault();
			
			var url = $(this).attr('href');
			
			var go_to = $(this).attr('target');

			var callout_id = $(this).attr('rel');
			
			var page_id = $("meta[name='page_id']").attr('content');
						
			$.ajax({
				type: "POST",
				url: "/ajax_calls/track_clicks.php",
				data: "callout_id="+callout_id+"&page_id="+page_id,
				success: function(msg){

					if(go_to) {

						window.open(url,'',''); 
											
					} else {

						window.location = url;
					
					}
					
				}
			});

		});
	
	// Scorecard Images
	$("#scorecard-buttons table td.scorecard-btn").hover(
		function () {
		$(".active").removeClass('active');
		$(this).addClass("active");
		$(".first").removeClass('active')
		}
	);

	$("#scorecard-info div .course").hover(
		function () {
		$(".active").removeClass('active');
		$(".first").addClass('active');
		}
	);
	
	
	$("#scorecard-info div .first").hover(
		function () {
		$(this).addClass('active');
		}
	);


	// Scorecard Information
	$("#scorecard-info div").hover(
		function () {
		$(".hover").removeClass('hover');
		$(this).addClass("hover");
		}
	);


	//Course Construction Page Slider
	$('#sub #slider').nivoSlider({effect: 'fade', pauseTime: 4000, controlNav: false});


});	// END $(document).ready(function()

