﻿/*
* Pool.com Master JavaScript File
*
* Copyright (c) 2010 Pool.com Inc., http://www.pool.com/
*/

jQuery.noConflict();

jQuery(document).ready(function($) {
    // flash message effects
    $(".flash-messages").hide();
    $(".flash-messages").fadeIn("slow");

    var image = jQuery('<img src="/Content/blueprint/plugins/buttons/icons/cross.png" style="cursor:pointer;float:right" alt=""/>');
    $(".flash-messages > p").prepend(image);
    $(".flash-messages > p > img").click(function() {
        $(this).parent().fadeOut("slow");
    });

    // collapse sections (and show when clicked)
    $('.content').hide();
    $('.heading').css('cursor', 'pointer');
    $('.heading').prepend('<span class="collapse-indicator">\u25BA</span>');

    $('.heading').click(function() {
        var indicator = $(this).find('.collapse-indicator');
        $(this).next('.content').slideToggle(300, function() {
            if (indicator.text() == '\u25BA') {
                indicator.text('\u25BC');
            } else {
                indicator.text('\u25BA');
            }
        });
    });
});

