$(document).ready(function () {
    $('div#menuTop ul li.menuLevel1')
    .mouseenter(function () {
        $(this).find('ul').slideToggle('fast');
    })
    .mouseleave(function () {
        $(this).find('ul').slideToggle('fast');
    });
});

$(document).ready(function(){
    // Reset Font Size
    var originalFontSize = $('html').css('font-size');
    $(".resetFont").click(function(){
        $('html').css('font-size', originalFontSize);
    });
    // Increase Font Size
    $(".increaseFont").click(function(){
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*1.2;
        $('html').css('font-size', newFontSize);
        return false;
    });
    // Decrease Font Size
    $(".decreaseFont").click(function(){
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*0.8;
        $('html').css('font-size', newFontSize);
        return false;
    });
});


$(document).ready(function(){
    /* This code is executed after the DOM has been completely loaded */

    var totWidth=0;
    var positions = new Array();

    $('#slides .slide img').each(function(i){
        /* Loop through all the slides and store their accumulative widths in totWidth */
        positions[i]= totWidth*320;
        totWidth += 1;
    });

    $('#slides').width(totWidth*320);

    /* Change the cotnainer div's width to the exact width of all the slides combined */

    $('#thumbs ul li a').click(function(e){

        /* On a thumbnail click */
        $('li.menuItem').removeClass('act').addClass('inact');
        $(this).parent().addClass('act');

        var pos = $(this).parent().prevAll('.menuItem').length;

        $('#slides').stop().animate({
            marginLeft:-positions[pos]+'px'
        },320);
        /* Start the sliding animation */

        e.preventDefault();
    /* Prevent the default action of the link */
    });

    $('#thumbs ul li.menuItem:first').addClass('act').siblings().addClass('inact');
/* On page load, mark the first thumbnail as active */
});

$(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto({
        theme: 'facebook',
        slideshow:5000,
        autoplay_slideshow:true
    });
});
