﻿$(document).ready(function () {
    $("a.new-window").click(function () {
        var width = 900;
        var height = 700;
        if (window.screen) {
            width = screen.availWidth;
            height = screen.availHeight;
        }

        window.open($(this).attr("href"), "popup", "width=" + width + ",height=" + height + ",modal=yes,alwaysRaised=yes");
        return false;
    });

    $("a#interactive-map").fancybox({
        'width': 960,
        'height': 600,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe'
    });

    $("a.accordion_link").click(function () {
        var self = $(this);
        var child = self.parent().find(".accordion_child");

        if (self.hasClass("accordion_open")) {
            child.slideUp("slow", function () {
                self.removeClass("accordion_open");
            });
        } else {
            child.slideDown("slow", function () {
                self.addClass("accordion_open");
            });
        }

        return false;
    });
});
