﻿/// <reference path="jquery-1.4.2.min.js" />

//Cufon.replace(
//    '#newslist p, #newslist h2, #newslist span, #newslettersignup ul, #matchreports p, #matchreports h2, #matchreports span, .articletext, ' +
//    '#footer #leftarea #links a, #footer #leftarea #copy, #footer #rightarea #signup .label label',
//    { fontFamily: "Lucida Grande" }
//);

Cufon.replace('#caption h1', { fontFamily: "Frutiger", textShadow: '1px 2px #000' });
Cufon.replace('.ScoreHolder h4', { fontFamily: "Frutiger", textShadow: '1px 1px #0067b9' });
Cufon.replace("h1, .TopLevelMenu a, #subnav *, #mediapaging a, h3, h4, .history a, .Frutiger, .SeasonSummaryWidget td, .CheerTeamList .Name,.ProfileNameAndPosition .Name, .ProfileNameAndPosition .Number, .ProfileNameAndPositionSmall .Name, .ProfileNameAndPositionSmall .Number, .QuickStatHeader, .QuickStatDetail, #Stats .ValuesContainer .Top, #Stats .ValuesContainer .Bottom, #Stats .ValuesContainer .ArrowDown, #Stats .ValuesContainer .ArrowUp", { fontFamily: "Frutiger", hover: true });
Cufon.replace("h2, .PollTitle h3", { fontFamily: "Lucida Grande" });
Cufon.replace("#SeasonHeader, .MatchResultsSubNavigation ul li a", { fontFamily: "Frutiger", hover: true });

var menuHeight;

$(function () {

    $(".minisignup .signupemail").attr({ value: 'Enter email for updates' }).focus(function () {
        if ($(this).val() == "Enter email for updates") {
            $(this).val("");
        }
    }).blur(function () {
        if ($(this).val() == "") {
            $(this).val("Enter email for updates");
        }
    });

    $(".search_text").attr({ value: 'Search Blues' }).focus(function () {
        if ($(this).val() == "Search Blues") {
            $(this).val("");
        }
    }).blur(function () {
        if ($(this).val() == "") {
            $(this).val("Search Blues");
        }
    });

    var hoverConfiguration = {
        over: function () {
            $("#menuextension").animate({ height: "280px" }, { queue: false, duration: 400 });
        },
        out: function () {
            $("#menuextension").animate({ height: "0px" }, { queue: false, duration: 250 });
            $("#menuextension select").trigger("blur");
        },
        timeout: 500
    };

    $("#extendedmenu select").mouseleave(function (event) {
        event.stopPropagation();
    });

    $("#extendedmenu").hoverIntent(hoverConfiguration);

    $(".TopLevelMenu li").hover(function () {
        var menuExtension = $("#menuextension").length;
        if (menuExtension > 0) {
            var index = $(this).index();
            if (index > 0) {
                $("#menuextension .extendedsection").hide();
                $("#menuextension .extendedsection").eq(index).show();
            }
            else {
                $("#menuextension .extendedsection").hide(); //this is to hide home extended menu
            }
        }
    });

    $(".linkedsection").hover(function () {
        $("*", this).css("color", "#6BC0EA");
    }, function () {
        $("*", this).css("color", "#FFF");
    });

    $(".linkedsection").click(function () {
        var url = $("a:first", this).attr("href");
        window.location = url;
    });

    $("img").not(".notlazy").lazyload({ effect: "fadeIn" });

    // set up the media viewer control if it is on the page.
    var mediaViewer = $(".mediaviewer").length;
    if (mediaViewer > 0) mediaviewer();

});

function GenerateUrlSlug(urlString) {

    var slug = urlString
            .replace(/[^ A-Za-z\-0-9]/g, "")
            .replace(/ /g, "-");

    return slug;
}




