var prospekt_sichtbar = 0;
var prospekt_in_bewegung = 0;

prospekt_sidebar_vorbereiten();

function prospekt_sidebar_vorbereiten()
{
    try{
        if (prospekt_sidebar_ausrichtung == "rechts")
        {
            $("prospekt_sidebar").style.marginLeft = get_window_width() - 0 + "px";
            $("prospekt_logo").style.marginLeft = "-38px";
        }
        else
        {
            $("prospekt_sidebar").style.marginLeft = "-" + (parseInt(prospekt_sidebar_breite) + 10) + "px";
            $("prospekt_logo").style.marginLeft = parseInt(prospekt_sidebar_breite) + 10 + "px";
        }	
        $("prospekt_sidebar").style.marginTop = (get_window_height() / 2) - (prospekt_sidebar_hoehe / 2) + "px"; 
        $("prospekt_logo").style.marginTop = (parseInt(prospekt_sidebar_hoehe) / 2 - 50) + "px";
        $("prospekt_sidebar").appear();
    } catch (e) {
         
    }
         
       
}

function prospekt_sidebar(modus)
{
    try{
        var offset_x = prospekt_sidebar_breite;
        if (modus == "anzeigen")
        {
            modus_prospekt_sichtbar = 1;
            if (prospekt_sidebar_ausrichtung == "rechts")
                offset_x = "-" + offset_x;
        }
        else
        {
            modus_prospekt_sichtbar = 0;
            if (prospekt_sidebar_ausrichtung == "links")
                offset_x = "-" + offset_x;		
        }
        if (prospekt_sichtbar == modus_prospekt_sichtbar) return;
        if (prospekt_in_bewegung == 1) return;
        prospekt_sichtbar = modus_prospekt_sichtbar;
        prospekt_in_bewegung = 1;	
        
        new Effect.Move($("prospekt_sidebar"), {
            x: offset_x, 
            y: 0
        });
        var timer_prospekt_in_bewegung = window.setTimeout("prospekt_in_bewegung = 0", 1000);
    } catch (e) {
         
    }
}
