﻿
Date.firstDayOfWeek = 7;
Date.format = 'mm/dd/yyyy';

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

$(document).ready(function () {

    $("input[type=text]").focus(function () {
        $(this).addClass("gray");
    });

    $("input[type=text]").blur(function () {
        $(this).removeClass("gray");
    });

    $("textarea").focus(function () {
        $(this).addClass("gray");
    });

    $("textarea").blur(function () {
        $(this).removeClass("gray");
    });

    if ($("select#filterDropDown").length > 0) {
        $("select#filterDropDown").change(function () {
            $("input#update").click();
        });
    }

    if ($("select#season").length > 0) {
        $("select#season").change(function () {
            $("input#submit").click();
        });
    }

    if ($("select.textlabel").length > 0) {
        $("select.textlabel").each(function (index) {
            var text = $(this).children("option:selected").text();
            $(this).replaceWith("<span>" + text + "</span>");
        });
    }

    if ($("input.textlabel").length > 0) {
        $("input.textlabel").each(function (index) {
            var text = $(this).val();
            $(this).replaceWith("<span>" + text + "</span>");
        });
    }

    if ($("td.firstGame input").length > 0) {
        $("td.firstGame input").datePicker({ startDate: (new Date()).asString() });
    }

    if ($("td.dob input").length > 0) {
        $("td.dob input").datePicker({ startDate: '01/01/1970', endDate: (new Date()).asString() });
    }

    if (jQuery.browser.msie == true && (jQuery.browser.version == 7 || jQuery.browser.version == 6)) {
        $("table#draftControls").css("margin-top", "-1px");
    }

    if ($("div#menu").length > 0 && $("div#content").length > 0 && $("div#menu").height() > $("div#content").height()) {
        $("div#content").css("min-height", $("div#menu").height());
    }


    try {
        var pageTracker = _gat._getTracker("UA-1507482-2");
        pageTracker._trackPageview();
    } catch (err) { }

});
