﻿
$(document).ready(function () {

    // Add progress indicator
    $("#SubmitButton").click(function (event) {
        $("div.progress").addClass("progress-image");
    });

    // Set all external links to open in a new window
    $("a:not([href^=/])").not("[href^=#]")
                         .not("[href^=mailto]")
                         .not("[href^=javascript]")
                         .not("[href^=http://www.nfldata.com]")
                         .not("[href^=https://www.nfldata.com]")
                         .not("[href^=https://www.paypal.com]")
                         .attr("target", "_blank");

    // Set the dropdown menu
    $("ul.mainMenu li").hover(function () {
        $('ul:first', this).fadeTo("medium", 0.9);
    }, function () {
        $('ul:first', this).fadeTo("medium", 0);
    });

    // Set the product details expansion
    $('#productDetails a').toggle(function () {
        $(this).addClass("minus");
        $(this).removeClass("plus");
        $(this).next().next().next().slideDown("slow");
    }, function () {
        $(this).addClass("plus");
        $(this).removeClass("minus");
        $(this).next().next().next().slideUp("medium");
    });

    // Search textbox
    $('input.searchTextbox').focus(function () {
        if ($(this).val() == 'Search')
            $(this).val('');
    });
    $('input.searchTextbox').blur(function () {
        if ($(this).val() == '')
            $(this).val('Search');
    });
    $('input.searchTextbox').bind("keypress", function (e) {
        var code = (e.keyCode ? e.keyCode : e.which);
        if (code == 13) {
            $("div.progress").addClass("progress-image");
        }
    });
    $('input.searchTextbox').val('Search');

    $("#CodeTextbox").click(function () { $(this).select(); $(this).focus(); return false; });
    
    $(".slideshowContentCycle").cycle({
        fx: 'fade',
        pause: 10,
        timeout: 3000,
        speed: 3000
    });

    //        $(".slideshowContentCycle").cycle({
    //            pause: 10
    //        });

});


