$(document).ready(function() {
    $('#home_content .main_image div.main').cycle({
        fx: 'fade',
        after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
            //$(currSlideElement).attr("src", $(currSlideElement).attr("data-src"));
        }
    });
    
    $("#home_content .disciples").hover(function() {
		$(this).find(".hover").show();
	}, function() {
		$(this).find(".hover").hide();
	});
	
	$("#home_content .main_image div.main img").hover(function() {
	    var img = $(this);
	    img.attr("data-src", img.attr("src"));
	    img.attr("src", img.attr("data-hover"));
	}, function() {
	    $(this).attr("src", $(this).attr("data-src"));
	});
	
    $("#home_content .main_image .nav_arrow").click(function() {
        if($(this).hasClass("left")) {
            $('#home_content .main_image div.main').cycle('prev');
        } else {
            $('#home_content .main_image div.main').cycle('next');
        }
    });
    
    $("#home_content .selector").hover(function() {
        $(this).find(".main").hide();
        $(this).find(".rollover").show();
    }, function() {
        $(this).find(".rollover").hide();
        $(this).find(".main").show();
    });
    
    $("#home_content div.memberships").hover(function() {
        $("#home_content .memberships_rollover").show();
        GymJones.membershipsRollover();
    }, function() {
        $("#home_content .memberships_rollover").hide();
        $(".memberships_rollover .top,.memberships_rollover .middle").css("left", "-621px");
        $(".stats .stat .bar").height(0);
    })
    
    $("#home_content div.memberships,#home_content .selector .next_event").click(function() {
        document.location = $(this).attr("href");
    });
});

