﻿jQuery.noConflict();

jQuery(document).ready(function($) {
    // $('span.tooltip').append('<span class="arrow"></span>');
    $('.county').hover(function() {
        $(this).children('span.tooltip').show();
    }, function() {
        $(this).children('span.tooltip').hide();
    });

    $('#logobar ul.logos').adidoCarousel({ minDisplay: 6 });

    $('textarea.resize').autoResize({
        // On resize:
        onResize: function() {
            $(this).animate({ opacity: 0.8 });
        },
        // After resize:
        animateCallback: function() {
            $(this).animate({ opacity: 1 });
        },
        animateDuration: 200
    });

    $('.lnkSelectAllLocations').each(function() {
        var lnk = $(this);
        var lstBox = lnk.prev('select');

        if (lstBox.children('option:selected').size() > 0) {
            $(this).text('Deselect all');
        }
        $('.lnkSelectAllLocations').click(function(e) {
            e.preventDefault();
            if (lnk.text() == 'Select all') {
                lstBox.children('option').attr('selected', 'selected');
                lnk.text('Deselect all');
            } else {
                lstBox.children('option').attr('selected', '');
                lnk.text('Select all');
            }
        });
    });
});
