jQuery(document).ready(function() {

    // Tooltip für Informationsbutton
    // By suppling no content attribute, the library uses each elements title attribute by default
    jQuery('.tooltip a[href][title]').qtip({
        content: {
            text: false // Use each elements title attribute
        },
        style: 'cream' // Give it some style
    });

    jQuery('a.teamFilterButton').click(function() {


    var foo = "http://www.kloten-flyers.ch/contento/Home/Saison/Trainingskalender/tabid/70/language/de-CH/Default.aspx?udt_518_param_league=";
        jQuery('select[multiple] option:selected').each(function() {

            foo += jQuery(this).attr('value') + '|';
            window.location.replace(foo);

        });

    });

    jQuery('a.pdfButton').click(function() {


        var foo = "http://www.kloten-flyers.ch/contento/DesktopModules/ContentoTrainingSchedule/Download.aspx?";
        jQuery('select[multiple] option:selected').each(function() {
            foo += 'league=' + jQuery(this).attr('value') + '&';
            window.location.replace(foo);

        });

    });

    // NOTE: You can even omit all options and simply replace the regular title tooltips like so:
    // $('#content a[href]').qtip();

    // Multi-Select

    jQuery("select[multiple]").asmSelect({
        addItemTarget: 'bottom',
        animate: true,
        highlight: true,
        sortable: false
    });





});
