$(document).ready(function() {
    /* 
    * attach a function to open all links with a class of "external" in a new window 
    * this avoids the use of target="_blank" and allows us to validate as XHTML strict
    */
    $("a[rel^='external']").click( function() {
        window.open(this.href);
        return false;
    });
    
    $('#slideshow').cycle({ 
        speed:  2000,
        timeout:  7000
    });
    
    $("a[rel^='prettyPhoto']").prettyPhoto({
        overlay_gallery: false,
        social_tools: false,
        slideshow: false
    });
    
    $('#contact_us_form').validate();
    $('#join_us_form').validate();
    
/*    var year = "";

    render_calendar(month,year);

    function render_calendar(month,year) {
        var minicalurl = "http://chippewafallsrotary.org/calendar/mini" + year + "/" + month ;
        $.post(
            minicalurl,
            { month : month, year : year },
            function(str) {
                $('#miniCal').html(str).fadeIn('fast');
            }
        );
    }

    $("a.prevNext").live('click',function(){
        $('#miniCal').fadeOut('fast');
        newDateArray = $(this).attr('id').split('-');
        month = newDateArray[0];
        year = newDateArray[1];
        render_calendar(month,year);
    });
    */
    
    $('#showAllEmail').click(function(){
        $('#allBirthdays').hide();
        $('#allJoinDates').hide();
        $('#allEmail').animate({"height": "toggle", "opacity": "toggle"}, { duration: "500" });
    });
    
    $('#showBirthday').click(function(){
        $('#allEmail').hide();
        $('#allJoinDates').hide();
        $('#allBirthdays').animate({"height": "toggle", "opacity": "toggle"}, { duration: "500" });
        
    });

    $('#showJoinDate').click(function(){
        $('#allBirthdays').hide();
        $('#allEmail').hide();
        $('#allJoinDates').animate({"height": "toggle", "opacity": "toggle"}, { duration: "500" });
    });

    
});


