﻿$(document).ready(function() {
    $("#accordion").accordion({ collapsible: true });
    $("#accordion").accordion('activate', false);

    $(".accordion .head").click(function() { $(this).next().toggle('slow'); return false; }).next().hide();
    $("a#single_image").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300 });
    $("a#group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300 });

    $("li.menu_class").click(function() { $('p.the_menu').slideToggle('fast'); } );

    //Run script only for MSIE 6
    jQuery.each(jQuery.browser, function(i, val) {
        if (i == "msie"
			&& jQuery.browser.version.substr(0, 3) == "6.0"
			) {
            //ID of modal window
            var id = "#dialog";

            var maskHeight = $(document).height();
            var maskWidth = $(window).width();

            //Set heigth and width to mask to fill up the whole screen
            $('#mask').css({ 'width': maskWidth, 'height': maskHeight });
            $('#mask').fadeTo(15, 0.8);

            //Get the window height and width
            var winH = $(window).height();
            var winW = $(window).width();

            //Set the popup window to center
            $(id).css('top', winH / 2 - $(id).height() / 2);
            $(id).css('left', winW / 2 - $(id).width() / 2);

            //transition effect
            $(id).show();

        }
    });

    //if close button is clicked
    $('.window .close').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();

        $('#mask').hide();
        $('.window').hide();
    });
});
