/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
slideshowShown = 0;

function slideShow_init() {
    // Für die SlideShow die MouseOver handler einfügen
    $(".slideShow_container").mouseover(function() {
        c = $(this).attr("c");
        $(this).animate({
            bottom: 20
        }, "fast", function() {
            $(this).mouseout(function() {
                c = $(this).attr("c");
                //$("#slideShow_infobox_" + c).fadeOut("fast");
                $(this).animate({
                    bottom: 15
                }, "fast");
            })
        });
    }).click(function() {
        c = $(this).attr("c");
        slideShow_next(c);
    });

    // Alle Anzeigen zurüpcksetzen
    $(".slideShow_content_bild, .slideShow_content_text").css("left", "1000px");
    slideshowShown = 999;
    // Den ersten Text + Bild sichtbar machen
    $("#slideShow_container_1").click();
    //$("#slideShow_content_text_1").css("left", "20px");
    //$("#slideShow_content_bild_1").css("left", "460px");
}

function slideShow_next(id) {
    // Nur etwas machen wenn nicht schon geklickt wurde
    if(id == slideshowShown)
        return;
    // suche das gerade angeziegte event
    $("#slideShow_content_text_"+slideshowShown).animate({
        left: -480
    }, 1400, "easeInBack");
    
    $("#slideShow_content_bild_"+slideshowShown).animate({
        left: -480
    }, 1000, "easeInBack");
    // Blende ds neue ein
    setTimeout(function() {
        $("#slideShow_content_text_"+id).css("left", "-480px").animate({
            left: 20
        }, 1000, "easeOutBack");
        $("#slideShow_content_bild_"+id).css("left", "-480px").animate({
            left: 460
        }, 1400, "easeOutBack");
    }, 500);
    
    slideshowShown = id;
    
    ////, #slideShow_content_bild_"+slideshowShown).animate({}, fast)
}
