﻿

$(document).ready(function() {

    $(document).pngFix();

    jQuery('#slideshow').cycle({
        speed: 400,
        timeout: 4000,
        next: '#next2',
        prev: '#prev2'
    });

/*
    $("#first").hover(function() {
        $(this).children("ul").fadeIn("slow");
    })
*/
    $("#menu li").click(function() {
        $(this).siblings("li:has(ul)").children("ul").fadeOut("slow");
        $(this).find('ul:first').css({ display: "inline" }).fadeIn("slow");
    });

/*    
    $("#slideshow").hover(function() {
        $("#menu li li ul").fadeIn("slow");
        $("#menu li li ul ul").hide();

    });
*/
    //$("#allProj").show();

    $("#wrapper").hover(
        function() {
            $("#menu li ul").fadeOut("slow");
        },
        function() {
            $("#menu li ul").fadeOut("slow");
        }
    );


    $('#pause').click(function() {
        $('#slideshow').cycle('pause');
    });

    $('#play').click(function() {
        $('#slideshow').cycle('resume');
    });







    $('#click').click(function() {
        $.blockUI({ message: $('#modal'), css: {
            width: '650px',
            height: '100%',
            background: 'none',
            border: 'none',
            position: 'absolute',
            top: '50px', //$(window).height() / 2 - (475 / 2),
            left: $(document).width() / 2 - (686 / 2)
        }
        });

        $('.blockOverlay').attr('title', 'Click to unblock').click($.unblockUI);
    });

    $('#close').click(function() {
        $.unblockUI();
    });






    $('#openAllProj').click(function() {
        $.blockUI({ message: $('#allProj'), css: {
            width: '650px',
            height: '100%',
            background: 'none',
            border: 'none',
            position: 'absolute',
            top: '50px', //$(window).height() / 2 - (475 / 2),
            left: $(document).width() / 2 - (650 / 2)
        }
        });

        $('.blockOverlay').attr('title', 'Click to unblock').click($.unblockUI);
    });


});