// based on http://visitmix.com/labs/glimmer/samples/sequence.html

jQuery(function ($) {
    var timer;
    function button1_click(event) {
        $(".slide").css("visibility", "hidden");
        $("#image1").css("visibility", "visible");
        $("#image1").css("opacity", "0");
        $("#image1").animate({
            "opacity": 1
        },
        300, "linear", null);
        $("ul.buttons li").removeClass("active");
        $("#image1").animate({
            "opacity": 1
        },
        300, "linear", null);
        $("#button1").addClass("active");
        clearTimeout(timer);
        timer = setTimeout(eval("button2_click"), "5000");
        $("#image1").animate({
            "opacity": 1
        },
        300, "linear", null);
                //document.getElementById("slideshow-text-title").innerHTML = "Take a Discovery Flight!";
		//document.getElementById("slideshow-text").innerHTML = 'For just $59 plus tax you can take a ride with one of our Certified Flight Instructors to see what Air America is all about!';
    }

    function button2_click(event) {
        $(".slide").css("visibility", "hidden");
        $("#image2").css("visibility", "visible");
        $("#image2").css("opacity", "0");
        $("#image2").animate({
            "opacity": 1
        },
        300, "linear", null);
        $("ul.buttons li").removeClass("active");
        $("#image2").animate({
            "opacity": 1
        },
        300, "linear", null);
        $("#button2").addClass("active");
        clearTimeout(timer);
        timer = setTimeout(eval("button1_click"), "5000");
        $("#image2").animate({
            "opacity": 1
        },
        300, "linear", null);
                //document.getElementById("slideshow-text-title").innerHTML = "Build Your Multi Time!";
		//document.getElementById("slideshow-text").innerHTML = 'For just $186/hr you can rent one of our Beechcraft Duchess twins and fly solo anywhere in the US.  For more information, <a href="fleet.php#be76">please click here</a>.';
    }



    function OnLoad(event) {
        clearTimeout(timer);
        timer = setTimeout(eval("button2_click"), "5000");
    }

    $('#button1').bind('click', button1_click);

    $('#button2').bind('click', button2_click);


    OnLoad();

});