$(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);    		    
     		}
    	});
   });
   
   
   
   $("#util ul li ul").hide();
	$("#util ul li").hoverIntent(
		function(){
	        $(this).children('ul').slideDown('fast');
	    },
	    function(){
	       $(this).children('ul').slideUp('fast');
	    }
	);
	
/*  	$('.event_name a').colorbox({iframe:true, innerWidth:710, innerHeight:400}); */
 	$('.event_name a').colorbox({iframe:true, innerWidth:710, innerHeight:400});
 	$('.cbox').colorbox();
	
	
	// Load thumbnail image for galleries into div with id #bigImage
	$('.art_image').live('click', function() {
		var id = $(this).attr('id');
		$.ajax({
     		type: "POST",
     		url: "/gallery_image_load.php",
     		data:  "id="+id,
     		success: function(html){
       			$('#bigImage').html(html);    		    
     		}
    	});
	});

	
	// Moves the images in the gallery preview
	
	$("#move_left").click(function() {
		
		if(parseInt($('.image_scroll').position().left) < 0){
			$(".image_scroll").animate({"left": "+=300px"}, "fast");
		}
	});
	
	$("#move_right").click(function(){
		
		// 655 is the width of the containing div #image_holder
		if( Math.abs(parseInt($('.image_scroll').position().left)-655) < parseInt($('.image_scroll').width()) ) {
			$(".image_scroll").animate({"left": "-=300px"}, "fast");
		}

	});
	

	// For jump menu
	$(".category").change(function() {
		var val = $("select option:selected").val()
       // if (val != '') {
			location.href=val;
       // }
    });



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