﻿

$(document).ready(function() {

    // Set focus on the search box, if it is on the page
    $(".SearchTextBox").focus();

    $(".ToolTip").hover(
        function() {
            $(this).find(".ToolTip_Content").animate({
                height: "show"
            }, 150);
        },
        function() {
            $(this).find(".ToolTip_Content").animate({
                height: "hide"
            }, 150);
        }
    );

    $("textarea.expandingTextArea").focus(
        function() {
            $(this).animate({
                height: 300,
                opacity: 1
            }, 250);
        }).blur(
        function() {
            $(this).animate({
                height: 100,
                opacity: 0.85
            }, 250);
        }
    );

        $(".NarrowFormSkin .form_section_title").click(function() {
        $(this).parent().children(".form_section_content").slideToggle(500);

        if ($(this).parent().hasClass("form_sectionToggleHidden")) {
            $(this).parent().removeClass("form_sectionToggleHidden");
            $(this).parent().addClass("form_sectionToggleShown");
        }
        else if ($(this).parent().hasClass("form_sectionToggleShown")) {
            $(this).parent().removeClass("form_sectionToggleShown");
            $(this).parent().addClass("form_sectionToggleHidden");
        }
        
    });
    
    
    $(".DeleteDivision_Trigger").click(function() {
        $(this).parent().children(".DeleteDivision_Target").slideToggle(500);
    });
});