$(document).ready(function(){  

// Button Flip Hover
 $('.button a').hover(function() {

        $(this).children('img').show().stop().animate({ marginTop: '-42px' }, 200);
      }, function() {
        $(this).children('img').show().stop().animate({ marginTop: '0px' }, 200);         
  });
  
  $('.big_button a').hover(function() {

        $(this).children('img').show().stop().animate({ marginTop: '-78px' }, 200);
      }, function() {
        $(this).children('img').show().stop().animate({ marginTop: '0px' }, 200);         
  });
  
  
  $('.text_button').hover(function() {

        $(this).stop().animate({backgroundPosition:"(0 -42px)"}, 200);
      }, function() {
        $(this).stop().animate({backgroundPosition:"(0 0px)"}, 200);         
  });
	
// Image Opacity Rollover 

$(".image").hover(function(){
    $(this).stop().animate({opacity: 0.8, marginTop: "-=2px", marginBottom: "+=2px"}, 100);
},function(){
    $(this).stop().animate({opacity: 1, marginTop: "0px", marginBottom: "0px"}, 100);
});



$(".fade").hover(function(){
    $(this).stop().animate({opacity: 0.8}, 100);
},function(){
    $(this).stop().animate({opacity: 1}, 100);
});


// Tour Button Hover 

$("a#tour").hover( 
  function () {
  			
			$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  
			},
  function () {
			$(this).stop().animate({backgroundColor: '#000000'}, { queue:false, duration:150 });  

			
		});


	
	
//Home Menu Hover

$('#menu ul li a').hover(function() {

        $(this).stop().animate({backgroundPosition:"(0 -44px)"}, 200);
      }, function() {
        $(this).stop().animate({backgroundPosition:"(0 0px)"}, 200);        
  });

$("#menu ul ul li").hover( 
  function () {
  			
			$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  
			},
  function () {
			$(this).stop().animate({backgroundColor: '#1c1c1c'}, { queue:false, duration:150 });  

			
		}
);



	

$("#connect").hover( 
  function () {
			$("#connect > ul").fadeIn("fast");  
			},
  function () {
			$("#connect > ul").fadeOut("fast");  
		}
);  

$("#resources").hover( 
  function () {
			$("#resources > ul").fadeIn("fast");  
			},
  function () {
			$("#resources > ul").fadeOut("fast");  
		}
);  

$("#about").hover( 
  function () {
			$("#about > ul").fadeIn("fast");  
			},
  function () {
			$("#about > ul").fadeOut("fast");  
		}
);  
    
    $(".creative_menu > li").click(function(){  
			var id = this.id;
       switch(id){  
            case "band":  
                //change status & style menu  
                 
                $(".creative_menu > li").removeClass("hover");
				$("#band").addClass("hover"); 
                //display selected division, hide others  
                $(".creative_content").css("display", "none");  
                $("div#content_66").fadeIn();  
            break;  
            case "orchestra":  
                //change status & style menu  
                  
                $(".creative_menu > li").removeClass("hover");
				$("#orchestra").addClass("hover"); 
                //display selected division, hide others  
                $(".creative_content").css("display", "none");  
                $("div#content_67").fadeIn();  
            break;  
            case "vocals":  
                //change status & style menu  
                $("#vocals").addClass("hover");  
                $("#band").removeClass("hover");
                $("#orchestra").removeClass("hover");
                $("#dance").removeClass("hover");   
                $("#design").removeClass("hover");
                $("#drama").removeClass("hover");
                //display selected division, hide others  
                $("div#content_68").fadeIn();  
                $("div#content_66").css("display", "none");  
                $("div#content_67").css("display", "none"); 
                $("div#content_69").css("display", "none"); 
                 $("div#content_70").css("display", "none");  
                 $("div#content_71").css("display", "none");
            break;   
            case "dance":  
                //change status & style menu  
                $("#dance").addClass("hover");  
                $("#band").removeClass("hover");
                $("#design").removeClass("hover");  
                $("#vocals").removeClass("hover"); 
                $("#orchestra").removeClass("hover");
                $("#drama").removeClass("hover");
                //display selected division, hide others  
                $("div#content_69").fadeIn();  
                $("div#content_66").css("display", "none");  
                $("div#content_67").css("display", "none"); 
                $("div#content_68").css("display", "none");  
                $("div#content_70").css("display", "none"); 
                $("div#content_71").css("display", "none"); 
            break;  
            case "design":  
                //change status & style menu  
                $("#design").addClass("hover");  
                $("#drama").removeClass("hover");
                $("#band").removeClass("hover");
                $("#vocals").removeClass("hover"); 
                $("#dance").removeClass("hover");  
                $("#orchestra").removeClass("hover");
                //display selected division, hide others  
                $("div#content_70").fadeIn();  
                $("div#content_66").css("display", "none");  
                $("div#content_67").css("display", "none");  
                $("div#content_68").css("display", "none"); 
                $("div#content_69").css("display", "none"); 
                $("div#content_71").css("display", "none"); 
            break;  
            case "drama":  
                //change status & style menu  
                $("#drama").addClass("hover");  
                $("#design").removeClass("hover");
                $("#band").removeClass("hover");
                $("#vocals").removeClass("hover"); 
                $("#dance").removeClass("hover");  
                $("#orchestra").removeClass("hover");
                //display selected division, hide others  
                $("div#content_71").fadeIn();  
                $("div#content_66").css("display", "none");  
                $("div#content_67").css("display", "none");  
                $("div#content_68").css("display", "none"); 
                $("div#content_69").css("display", "none"); 
                $("div#content_70").css("display", "none"); 
            break;  
            } 
        return false;  
    });  
    
    $(".sli_menu > li").click(function(){  
			var id = this.id;
       switch(id){  
            case "program":  
                //change status & style menu  
                 
                $(".sli_menu > li").removeClass("hover");
				$("#program").addClass("hover"); 
                //display selected division, hide others  
                $(".sli_content").css("display", "none");  
                $("div#sli_program").fadeIn();  
            break;  
            case "instructors":  
                //change status & style menu  
                  
                $(".sli_menu > li").removeClass("hover");
				$("#instructors").addClass("hover"); 
                //display selected division, hide others  
                $(".sli_content").css("display", "none");  
                $("div#sli_instructors").fadeIn();  
            break;  
            case "requirements":  
                //change status & style menu  
                  
                $(".sli_menu > li").removeClass("hover");
				$("#requirements").addClass("hover"); 
                //display selected division, hide others  
                $(".sli_content").css("display", "none");  
                $("div#sli_requirements").fadeIn();  
            break; 
            } 
        return false;  
    });  
    
        $(".disc_menu > li").click(function(){  
			var id = this.id;
       switch(id){  
            case "salv":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#salv").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_280").fadeIn();  
            break;
            case "dail":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#dail").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_281").fadeIn();  
            break;  
            case "regu":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#regu").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_282").fadeIn();  
            break; 
            case "wate":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#wate").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_283").fadeIn();  
            break;  
            case "spir":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#spir").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_284").fadeIn();  
            break;
            case "gett":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#gett").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_285").fadeIn();  
            break;  
            case "root":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#root").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_288").fadeIn();  
            break; 
            case "catc":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#catc").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_286").fadeIn();  
            break;
            case "serv":  
                //change status & style menu  
                 
                $(".disc_menu > li").removeClass("hover");
				$("#serv").addClass("hover"); 
                //display selected division, hide others  
                $(".disc_content").css("display", "none");  
                $("div#content_287").fadeIn();  
            break;      
            } 
        return false;  
    });  
    
    
    $(".messages_menu > li").click(function(){  
    var id = this.id;
    $(".video").hide();
       switch(id){  
            case "sunday":  
                //change status & style menu  
                $("#sunday").addClass("hover");
                $("#wednesday").removeClass("hover");  
                $("#special").removeClass("hover");
                $("#twenty20").removeClass("hover");  
                $("#impact").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".sunday").fadeIn();  
                $(".divine-weekly").css("display", "none");
                $(".special").css("display", "none");
                $(".wednesday").css("display", "none"); 
                $(".twenty20").css("display", "none");  
                $(".impact").css("display", "none"); 
            break;  
            case "wednesday":  
                //change status & style menu  
                $("#wednesday").addClass("hover")
                $("#sunday").removeClass("hover");  
                $("#special").removeClass("hover");
                $("#twenty20").removeClass("hover");  
                $("#impact").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".wednesday").fadeIn();  
                $(".divine-weekly").css("display", "none");
                $(".sunday").css("display", "none");
                $(".special").css("display", "none"); 
                $(".twenty20").css("display", "none");  
                $(".impact").css("display", "none"); 
            break; 
            case "special":  
                //change status & style menu  
                $("#special").addClass("hover");  
                $("#sunday").removeClass("hover");
                $("#wednesday").removeClass("hover");
                $("#twenty20").removeClass("hover");  
                $("#impact").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".special").fadeIn();  
                $(".divine-weekly").css("display", "none");
                $(".sunday").css("display", "none"); 
                $(".wednesday").css("display", "none"); 
                $(".twenty20").css("display", "none");  
                $(".impact").css("display", "none"); 
            break;  
            case "twenty20":  
                //change status & style menu  
                $("#twenty20").addClass("hover");  
                $("#wednesday").removeClass("hover");
                $("#sunday").removeClass("hover");
                $("#special").removeClass("hover");  
                $("#impact").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".twenty20").fadeIn();  
                $(".divine-weekly").css("display", "none");
                $(".sunday").css("display", "none"); 
                $(".wednesday").css("display", "none"); 
                $(".special").css("display", "none");  
                $(".impact").css("display", "none"); 
            break;   
            case "impact":  
                //change status & style menu  
                $("#impact").addClass("hover");  
                $("#wednesday").removeClass("hover");
                $("#sunday").removeClass("hover");
                $("#special").removeClass("hover");  
                $("#twenty20").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".impact").fadeIn();  
                $(".divine-weekly").css("display", "none");
                $(".sunday").css("display", "none"); 
                $(".wednesday").css("display", "none"); 
                $(".special").css("display", "none");  
                $(".twenty20").css("display", "none"); 
            break;   
            case "divine-weekly":  
                //change status & style menu  
                $("#divine-weekly").addClass("hover");
                $("#impact").removeClass("hover");  
                $("#wednesday").removeClass("hover");
                $("#sunday").removeClass("hover");
                $("#special").removeClass("hover");  
                $("#twenty20").removeClass("hover");
                $("#divine-weekly").removeClass("hover");
                //display selected division, hide others  
                $(".divine-weekly").fadeIn();  
                $(".impact").css("display", "none"); 
                $(".sunday").css("display", "none"); 
                $(".wednesday").css("display", "none"); 
                $(".special").css("display", "none");  
                $(".twenty20").css("display", "none"); 
            break;  
            } 
        return false;  
    });  
    
     // Go through each item in the life groups page page and shorten if bigger than 1500px
  $('.shrink').each(function (i) {
    $(this).children("ul").hide();
    $(this).children("p").hide();
  });
  
  // Add the 'click to expand' behavior to the links
  $('.shrink').hover(function() {
    $(this).children("ul").show();
    $(this).children("p").show();
    $(this).children("span").hide();
  }, function() {
  	$(this).children("ul").hide();
    $(this).children("p").hide();
    $(this).children("span").show();
  });
  
  //The Pulse Slideshow
  
   $('.gallery').cycle({
   prev:   '.prev', 
    next:   '.next', 
    timeout: 1000,
    speed:2000
   });
   
      $('.gallery:first').cycle({
   prev:   '.prev', 
    next:   '.next', 
    timeout: 2000,
    speed: 2500
   });
   
   //Calendar show/hide
   
 // toggles the slickbox on clicking the noted link  
  $('#calendar-show').click(function() {
	$(this).hide();
	$('#calendar-hide').show();
    $('#calendar').slideToggle(400);
    $('.fc-button-content').click();
    return false;
  });
  
  $('#calendar-hide').click(function() {
	$(this).hide();
	$('#calendar-show').show();
    $('#calendar').slideToggle(400);
    $('.fc-button-content').click();
    return false;
  });
    
    $(".add_to_cal").hover( 
  function () {
			$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  
			},
  function () {
			$(this).stop().animate({backgroundColor: '#A4A3A8'}, { queue:false, duration:150 });  
		});
		
	 	$("#calendar-show").hover( 
  			function () {	
				$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  
			},
  			function () {
				$(this).stop().animate({backgroundColor: '#3c3c3c'}, { queue:false, duration:150 });  
		});
		
		$("#calendar-hide").hover( 
  			function () {	
				$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  
			},
  			function () {
				$(this).stop().animate({backgroundColor: '#3c3c3c'}, { queue:false, duration:150 });  
		});
		
		$(".sign_up").hover( 
  			function () {
				$(this).stop().animate({backgroundColor: '#3D0537'}, { queue:false, duration:150 });  
			},
  			function () {
			$(this).stop().animate({backgroundColor: '#680A5D'}, { queue:false, duration:150 });  	
		});
		
	$('.more_info').click(function() {
    	$(this).hide();
    	$(this).parent(".event_desc").parent(".info").children('.extended').slideToggle(200);
    return false;
  	});
  	
  	$('.sign_up').click(function() {
  	$(this).parent(".buttons").parent("li").children(".info").children(".event_desc").children('.more_info').toggle();
    $(this).parent(".buttons").parent("li").children(".info").children('.extended').slideToggle(200);
    return false;
  	});
  
});  
