$(function () {
    $('#gallery').galleryView({
        panel_width: 563,
        panel_height: 357,
        frame_width: 80,
        frame_height: 80,
        pause_on_hover: true
    });

    $("#fileUploadLink").click(function () {
        $('#hiddenFiles').slideToggle(300);
        return false;
    });

    $(".site-tab-content").hide(); //Hide all content
    $("ul.site-tabs li:first").addClass("active").show(); //Activate first tab
    $(".site-tab-content:first").show(); //Show first tab content

    //On Click Event
    $("ul.site-tabs li").click(function () {

        $("ul.site-tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".site-tab-content").hide(); //Hide all tab content

        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });

    try {
        $('#paging_container4').pajinate({
            nav_label_prev: '',
            nav_label_next: '',
            num_page_links_to_display: 3,
            items_per_page: 6,
            show_first_last: false,
            item_container_id: '.image_gallery_content'
        });
    }
    catch (err) {
        //Handle errors here
    }

    try {
        $("a#example1").fancybox();
        $("a#example2").fancybox();
        $("a#example3").fancybox();
        $("a#example4").fancybox();
        $("a#example5").fancybox();
        $("a#example6").fancybox();
        $("a#example7").fancybox();
        $("a#example8").fancybox();
        $("a#example9").fancybox();
        $("a#example10").fancybox();
        $("a#example11").fancybox();
        $("a#example12").fancybox();
        $("a#example13").fancybox();
        $("a#example14").fancybox();
        $("a#example15").fancybox();
        $("a#example16").fancybox();
        $("a#example17").fancybox();
        $("a#example18").fancybox();
    }
    catch (err) {
        //Handle errors here
    }
});
