// JavaScript Document
function ShowPanel() {
        window.panel = $("#Bannershow");
        window.second = 5;

        $.get("ShowPanel.html", function (html) {
            $("#panelBody").html(html)

            //	    if (!window.enabledShowPanel) {

            //	        return;
            //	    }
            panel.show();
            window.setTimeout(function () {
                panel.hide();
            }, window.second * 1000);
            $(document).click(function (e) {
                panel.hide();
            });
            $(document).keypress(function (e) {
                switch (e.which) {
                    case 88:
                    case 27: panel.hide();
                }
            });
            window.setTimeout(function () {
                try {
                    $(document).trigger("blur");
                    panel.trigger("focus");
                } catch (e) { }
            }, 1000);
        });
    }

    function ClosePanel() {
        if (panel) panel.hide();
    }

    jQuery(document).ready(function ($) {
        $('#photos').galleryView({
            panel_width: 668,
            panel_height: 300,
            frame_width: 104,
            frame_height: 54,
            overlay_color: '#222',
            overlay_text_color: 'white',
            caption_text_color: '#222',
            background_color: 'transparent',
            border: 'none',
            nav_theme: 'light',
            easing: 'easeInOutQuad',
            pause_on_hover: false
        });


        ShowPanel();


        var photosList = $("#photos a");
        var filmstripList = $(".filmstrip li");
        var filmstripImageList = $(".filmstrip img");

        var currentIndex = -1;

        $("#pointer").click(function () {
            var idx = currentIndex;
            var img = $(photosList[idx]);
            if (img) {
                window.open(img.attr("href"));
                img.trigger("click")
            }
        });

        filmstripImageList.click(function () {
            var idx = filmstripImageList.index($(this));
            var img = $(photosList[idx]);
            if (img) {
                $(filmstripList[idx]).trigger("click");
                window.open(img.attr("href"));
                img.trigger("click")
            }
        });
        filmstripList.mouseover(function () {
            $(this).trigger("click")
            currentIndex = filmstripList.index($(this));
        });
    });
		
	
