﻿$(document).ready(function() {
    //hide the all of the element with class msg_body
    $(".slide").hide();

    //toggle the componenet with class msg_body
    $(".opener").click(function() {
        $(this).parent().next('.slide').slideToggle(250);
        return false;
    });

    //initialization of the ministries page
    /***********************************************/
    $("div.children").hide();
    $("div.prayer").hide();
    $("div.women-ministry").hide();
    /***********************************************/

    $("a.children").click(function() {
        $('div.prayer').hide('slow');
        $('div.women-ministry').hide('slow');
        $('div.children').show('slow');
        return false;
    });

    $("a.prayer").click(function() {
        $('div.children').hide('slow');
        $('div.women-ministry').hide('slow');
        $('div.prayer').show('slow');
        return false;
    });

    $("a.women").click(function() {
        $('div.children').hide('slow');
        $('div.prayer').hide('slow');
        $('div.women-ministry').show('slow');
        return false;
    });

    $("a.children").mouseover(function() {
        $("img.children").attr("src", "img/ministries/11963576449aEEpq_youth_over.jpg");
    });

    $("a.children").mouseout(function() {
        $("img.children").attr("src", "img/ministries/11963576449aEEpq_youth.jpg");
    });

    $("a.women").mouseover(function() {
        $("img.women").attr("src", "img/ministries/yggm_logo_over.jpg");
    });

    $("a.women").mouseout(function() {
        $("img.women").attr("src", "img/ministries/yggm_logo.jpg");
    });

    $("a.prayer").mouseover(function() {
        $("img.prayer").attr("src", "img/ministries/epaphras_prayers_front_over.jpg");
    });

    $("a.prayer").mouseout(function() {
        $("img.prayer").attr("src", "img/ministries/epaphras_prayers_front.jpg");
    });

    /*******************************************************************************/
    //end of the ministries page
    /*******************************************************************************/
    //initialization of newsletter page
    /***********************************************/
    $("div.news1").show();
    $("img.pg1").attr("src", "img/buttons/Pg1S.jpg");
    $("div.news2").hide();
    $("div.news3").hide();
    $("div.news4").hide();

    $("a.page1").click(function() {
        $('div.news1').show('slow');
        $("img.pg1").attr("src", "img/buttons/Pg1S.jpg");
        $("img.pg2").attr("src", "img/buttons/Pg2.jpg");
        $("img.pg3").attr("src", "img/buttons/Pg3.jpg");
        $("img.pg4").attr("src", "img/buttons/Pg4.jpg");
        $('div.news2').hide();
        $('div.news3').hide();
        $('div.news4').hide();
        return false;
    });

    $("a.page2").click(function() {
        $('div.news2').show('slow');
        $("img.pg1").attr("src", "img/buttons/Pg1.jpg");
        $("img.pg2").attr("src", "img/buttons/Pg2S.jpg");
        $("img.pg3").attr("src", "img/buttons/Pg3.jpg");
        $("img.pg4").attr("src", "img/buttons/Pg4.jpg");
        $('div.news1').hide();
        $('div.news3').hide();
        $('div.news4').hide();
        return false;
    });

    $("a.page3").click(function() {
        $('div.news3').show('slow');
        $("img.pg1").attr("src", "img/buttons/Pg1.jpg");
        $("img.pg2").attr("src", "img/buttons/Pg2.jpg");
        $("img.pg3").attr("src", "img/buttons/Pg3S.jpg");
        $("img.pg4").attr("src", "img/buttons/Pg4.jpg");        
        $('div.news1').hide();
        $('div.news2').hide();
        $('div.news4').hide();
        return false;
    });

    $("a.page4").click(function() {
        $('div.news4').show('slow');
        $("img.pg1").attr("src", "img/buttons/Pg1.jpg");
        $("img.pg2").attr("src", "img/buttons/Pg2.jpg");
        $("img.pg3").attr("src", "img/buttons/Pg3.jpg");
        $("img.pg4").attr("src", "img/buttons/Pg4S.jpg");        
        $('div.news1').hide();
        $('div.news2').hide();
        $('div.news3').hide();
        return false;
    });

    //initialization of the about us page
    /***********************************************/
    $("div.about").hide();
    $("div.view").hide();
    $("div.jeanne").hide();
    $("div.stephen").show();
    $("a.stephen").css('font-weight', 'bold');
    $("a.jeanne").css('font-weight', 'normal');
    $("a.vision").css('font-weight', 'normal');
    $("a.beliefs").css('font-weight', 'normal');
    /***********************************************/

    $("a.stephen").click(function() {
        $('div.stephen').show('slow');
        $('div.jeanne').hide('slow');
        $('div.vision').hide('slow');
        $('div.beliefs').hide('slow');
        $("a.stephen").css('font-weight', 'bold');
        $("a.jeanne").css('font-weight', 'normal');
        $("a.vision").css('font-weight', 'normal');
        $("a.beliefs").css('font-weight', 'normal');
        return false;
    });

    $("a.jeanne").click(function() {
        $('div.stephen').hide('slow');
        $('div.jeanne').show('slow');
        $('div.vision').hide('slow');
        $('div.beliefs').hide('slow');
        $("a.jeanne").css('font-weight', 'bold');
        $("a.stephen").css('font-weight', 'normal');
        $("a.vision").css('font-weight', 'normal');
        $("a.beliefs").css('font-weight', 'normal');
        return false;
    });

    $("a.beliefs").click(function() {
        $('div.stephen').hide('slow');
        $('div.jeanne').hide('slow');
        $('div.vision').hide('slow');
        $('div.beliefs').show('slow');
        $("a.beliefs").css('font-weight', 'bold');
        $("a.stephen").css('font-weight', 'normal');
        $("a.jeanne").css('font-weight', 'normal');
        $("a.vision").css('font-weight', 'normal');
        return false;
    });

    $("a.vision").click(function() {
        $('div.stephen').hide('slow');
        $('div.jeanne').hide('slow');
        $('div.vision').show('slow');
        $('div.beliefs').hide('slow');
        $("a.vision").css('font-weight', 'bold');
        $("a.stephen").css('font-weight', 'normal');
        $("a.jeanne").css('font-weight', 'normal');
        $("a.beliefs").css('font-weight', 'normal');
        return false;
    });

});
