$(document).ready(function() {
    $(document).ready(function() {
        $("a[href^='http']").attr('target', '_blank');
    });

    $("a.zoom").fancybox({
        'overlayOpacity': 0.7,
        'overlayColor': '#000'
    });

    $.preloadCssImages();
    $("a.zoom").fancybox({
        'overlayOpacity': 0.7,
        'overlayColor': '#000'
    });

    $('.imagecontainer').cycle({ fx: 'fade', speed: 1700 });

    function bfc(link, contentIn) {
        $(link).click(function() {
            var cont = $(".content.displayed");

            if (!cont.is(contentIn)) {
                cont.removeClass("displayed")
                .stop(true)
                .fadeTo(200, 0.2,
                function() {
                    $(contentIn)
				    .addClass("displayed")
				    .show()
				    .fadeTo(0, 0)
                    .fadeTo(1600, 1);
                })
                .fadeTo(200, 0, function() {
                    cont.hide();
                });
            }
        });
    }

    $("#landingpage").addClass("displayed");

    bfc("#landing", "#landingpage");
    bfc("#about", "#aboutstuck");
    bfc("#features", "#stuckfeatures");
    bfc("#screenshots", "#stuckscreenshots");
    bfc("#download", "#stuckdownload");

    var bts = $(".menuitem img");
    var hs = bts.filter(".hover")
    
    hs.mouseout(function() {
        hs.hide();
    });

    bts.filter(":not(.hover)").hover(function() {

    hs.hide();
        $(this).prev().show();
    });
});




