﻿
$(document).ready(function() {

    //    $("#logo").hover(
    //    function() {
    //        $(this).addClass('hover');
    //    }, function() {
    //        $(this).removeClass('hover');
    //    });

    $("#selectEvent").dialog({ autoOpen: false, bgiframe: true, draggable: false, height: 365, resizable: false, modal: true, title: 'Select Rally', width: 430 });

    $(".changeEvent").click(function() {
        $("#selectEvent").dialog("open");
    }).hover(
    function() {
        $(this).addClass('hover');
    }, function() {
        $(this).removeClass('hover');
    }).mousedown(function() {
        $(this).addClass("click");
    }).mouseup(function() {
        $(this).removeClass("click");
    });

    $("table#schedule").ready(function() {
        $("tbody tr:nth-child(odd)").removeClass("Row").addClass("AltRow");
        $("tbody tr:nth-child(even)").removeClass("AltRow").addClass("Row");
    });

    $("table#classes").ready(function() {
        $("tbody tr:nth-child(odd)").removeClass("Row").addClass("AltRow");
        $("tbody tr:nth-child(even)").removeClass("AltRow").addClass("Row");
    });

    $("table#entryList").tablesorter({
        sortList: [[0, 0]]
    });

    $("table#stageTimes").tablesorter({
        sortList: [[5, 0]]
    });

    $("table#finalResults").tablesorter({
        sortList: [[0, 0]]
    });

    $("#retirees").tablesorter({});

    $("table").bind("sortEnd", function() {
        $("tbody tr:nth-child(odd)").removeClass("Row").addClass("AltRow");
        $("tbody tr:nth-child(even)").removeClass("AltRow").addClass("Row");
    });

});
