var cache = [];

$(document).ready(function () {

    $("#small img").each(function(){
        var cacheImage = document.createElement('img');
        cacheImage.src = $(this).attr('src').replace("small", "big");
        cache.push(cacheImage);
    });

    $("#small img", this).click(function() {
        src = this.src.replace("small", "big");
        if (src.indexOf($("#big img").attr('src')) < 0)
        {
            $("#big img").fadeOut(200, function(){
                $("#big img").attr('src',src).bind('readystatechange load', function(){
                    if (this.complete) $(this).fadeIn(400);
                });
            });
        }
    });

    $("#neue_ferienwohnung_link").toggle(
        function () {
            $("#neue_ferienwohnung_content_wrapper").animate({width: 'toggle'}, {duration: 1500, easing: 'easeOutBounce'})
        },
        function () {
            $("#neue_ferienwohnung_content_wrapper").animate({width: 'toggle'}, {duration: 1500, easing: 'easeOutBounce'})
        }
    );

    $("a.fancybox").fancybox();
});