$(function() {
        // Start the slideshow
        function makeImage(url, clickurl) {
                return $("<img/>").
                        attr("src", url).
                        click(function() {
                                if (clickurl)
                                        document.location.href=clickurl;
                        });
        }
        $(".main_img").
                html(makeImage("/common/images/slideshow/pic1.jpg", "http://faithpcachurch.org/common/statics/12FPMMO5K10K-1.pdf")).
                append(makeImage("/common/images/slideshow/pic2.jpg")).
                append(makeImage("/common/images/slideshow/pic3.jpg", "http://faithpcachurch.org/missions.php")).
                cycle({ fx: 'fade', speed: 1500, timeout: 5000});

	// Handle making the three middle columns of the index page the same height
    function equalHeight(group) {
    	tallest = 0;
    	group.each(function() {
    		thisHeight = $(this).height();
    		if(thisHeight > tallest) {
    			tallest = thisHeight+40;
    		}
    	});
    	group.height(tallest);
    }

	$(document).ready(function(){
		equalHeight($(".equal-columns"));
	});
});

