jQuery(function (jQuery) {
    var timer;
    function button1_click(event) {
        jQuery(".slide").css("visibility", "hidden");
        jQuery("#image1").css("visibility", "visible");
        jQuery("#image1").css("opacity", "0");
        jQuery("#image1").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("ul.buttons li").removeClass("active");
        jQuery(".bgbuttonactive").addClass("bgbutton").removeClass("bgbuttonactive");
        jQuery("#image1").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("#button1").addClass("active");
        jQuery("#bgbutton1").removeClass("bgbutton");
        jQuery("#bgbutton1").addClass("bgbuttonactive");
        clearTimeout(timer);
        timer = setTimeout(eval("button2_click"), "10000");
        jQuery("#image1").animate({ "opacity": 1 }, 300, "linear", null);
    }

    function button2_click(event) {
        jQuery(".slide").css("visibility", "hidden");
        jQuery("#image2").css("visibility", "visible");
        jQuery("#image2").css("opacity", "0");
        jQuery("#image2").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("ul.buttons li").removeClass("active");
        jQuery(".bgbuttonactive").addClass("bgbutton").removeClass("bgbuttonactive");
        jQuery("#image2").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("#button2").addClass("active");
        jQuery("#bgbutton2").removeClass("bgbutton");
        jQuery("#bgbutton2").addClass("bgbuttonactive");
        clearTimeout(timer);
        timer = setTimeout(eval("button3_click"), "10000");
        jQuery("#image2").animate({ "opacity": 1 }, 300, "linear", null);
    }

    function button3_click(event) {
        jQuery(".slide").css("visibility", "hidden");
        jQuery("#image3").css("visibility", "visible");
        jQuery("#image3").css("opacity", "0");
        jQuery("#image3").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("ul.buttons li").removeClass("active");
        jQuery(".bgbuttonactive").addClass("bgbutton").removeClass("bgbuttonactive");
        jQuery("#image3").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("#button3").addClass("active");
        jQuery("#bgbutton3").removeClass("bgbutton");
        jQuery("#bgbutton3").addClass("bgbuttonactive");
        clearTimeout(timer);
        timer = setTimeout(eval("button4_click"), "10000");
        jQuery("#image3").animate({ "opacity": 1 }, 300, "linear", null);
    }

    function button4_click(event) {
        jQuery(".slide").css("visibility", "hidden");
        jQuery("#image4").css("visibility", "visible");
        jQuery("#image4").css("opacity", "0");
        jQuery("#image4").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("ul.buttons li").removeClass("active");
        jQuery(".bgbuttonactive").addClass("bgbutton").removeClass("bgbuttonactive");
        jQuery("#image4").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("#button4").addClass("active");
        jQuery("#bgbutton4").removeClass("bgbutton");
        jQuery("#bgbutton4").addClass("bgbuttonactive");
        clearTimeout(timer);
        timer = setTimeout(eval("button5_click"), "10000");
        jQuery("#image4").animate({ "opacity": 1 }, 300, "linear", null);
    }

    function button5_click(event) {
        jQuery(".slide").css("visibility", "hidden");
        jQuery("#image5").css("visibility", "visible");
        jQuery("#image5").css("opacity", "0");
        jQuery("#image5").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("ul.buttons li").removeClass("active");
        jQuery(".bgbuttonactive").addClass("bgbutton").removeClass("bgbuttonactive");
        jQuery("#image5").animate({ "opacity": 1 }, 300, "linear", null);
        jQuery("#button5").addClass("active");
        jQuery("#bgbutton5").removeClass("bgbutton");
        jQuery("#bgbutton5").addClass("bgbuttonactive");
        clearTimeout(timer);
        timer = setTimeout(eval("button1_click"), "10000");
        jQuery("#image5").animate({ "opacity": 1 }, 300, "linear", null);
    }

    function OnLoad(event) {
        clearTimeout(timer);
        timer = setTimeout(eval("button2_click"), "10000");
    }

    jQuery('#button1').bind('click', button1_click);
    jQuery('#button2').bind('click', button2_click);
    jQuery('#button3').bind('click', button3_click);
    jQuery('#button4').bind('click', button4_click);
    jQuery('#button5').bind('click', button5_click);

    OnLoad();

});
