﻿/// <reference path="jQueryIntellisense.js"/>
/// <reference path="/Standard/Core/Javascript/Relational.Standard.Core.js"/>

Type.registerNamespace('Relational.Standard.Core');
Type.registerNamespace('Website.Behavior');

$(function() {

    // Menus
    $('ul#Menu li').hover(
        function(e) {
            $('div.DropDownMenu', $(this)).stop(true, true).slideDown('fast')
            $(this).addClass("Hover");
        },
        function(e) {
            $('div.DropDownMenu', $(this)).stop(true, true).slideUp('fast')
            $(this).removeClass("Hover");
        }
    );

    // Render AddThis buttons in all AddThisButtonsTargets
    $("div.AddThisButtonsTarget").each(function (index) {
        // See this list for service codes: http://www.addthis.com/services/list
        var services = { twitter: 'Twitter', facebook: 'Facebook', email: 'Email', compact: 'More' },
        buttons = '';
        for (var s in services) {
            // Spacing of the buttons controlled by AddThisButton class
            buttons += '<a class="addthis_button_' + s + ' AddThisButton"></a>';
        }
        $(this).html(buttons);
        var toolboxConfig = {
            data_track_clickback: true // enable click analytics
        };
        addthis.toolbox(this, toolboxConfig);
    });


});

