$(document).ready(function () {

    /*menu*/
    $("#nav-list-wrapper").hide();
    $("#nav-btn").click(function () {
        $(this).parent().next('#nav-list-wrapper').slideToggle('300');
        $("#nav-btn-right").text($("#nav-btn-right").text() == '+' ? '-' : '+');
    });

    /*image overstate*/

    $(".image-text").hide();
    $(".image-category").hide();
    $('.image-text').css('opacity', '0.7');
    $('.image-wrapper').click(function () {
        
    });

    $(".image-wrapper").hover(function () {
        $(this).children().children(".image-text, .image-category").fadeIn('50');
    }, function () {
        $(this).children().children(".image-text, .image-category").fadeOut('50');
    });
    try {
        /*slideshow*/
        if ($('#slideshow1')) {
            $('#slideshow1').cycle({
                fx: 'fade',
                timeout: 4000,
                next: '.next1',
                prev: '.prev1'
            });
        }
    }
    catch (e) { }
    try {
        if ($('#slideshow2')) {
            $('#slideshow2').cycle({
                fx: 'fade',
                timeout: 4000,
                next: '.next2',
                prev: '.prev2'
            });
        }
    }
    catch (e) { }
    try {
        if ($('#slideshow3')) {
            $('#slideshow3').cycle({
                fx: 'fade',
                timeout: 4000,
                next: '.next3',
                prev: '.prev3'
            });
        }
    }
    catch (e) { }
    try {
        if ($('#slideshow4')) {
            $('#slideshow4').cycle({
                fx: 'fade',
                timeout: 4000,
                next: '.next4',
                prev: '.prev4'
            });
        }
    }
    catch (e) { }
    $('div[id^="slideshow"] a:not(:first-child)').css(
        "display", "none"
    );

    $('.next1').each(function () {
        $(this).children('img').attr('style', $(this).children('img').attr('style') + 'width:auto;');
    });
    $('.next2').each(function () {
        $(this).children('img').attr('style', $(this).children('img').attr('style') + 'width:auto;');
    });
    $('.next3').each(function () {
        $(this).children('img').attr('style', $(this).children('img').attr('style') + 'width:auto;');
    });
    $('.next4').each(function () {
        $(this).children('img').attr('style', $(this).children('img').attr('style') + 'width:auto;');
    });
});


