﻿/// <reference name="MicrosoftAjax.js" />
/// <reference path="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min-vsdoc.js" />
var emptyGuid = '00000000-0000-0000-0000-000000000000';
$(function() {
    // Our other sites
    var ourOtherSites = $(".ourOtherSites");
    var ourOtherSitesList = $("ul", ourOtherSites);
    ourOtherSitesList.hide();
    ourOtherSites.click(function() {
        if (ourOtherSitesList.is(':visible') && !ourOtherSitesList.is(":animated")) {
            ourOtherSitesList.animate({ height: "hide" }, 300);
        }
        else {
            ourOtherSitesList.animate({ height: "show" }, 300, "easeOutBack");
        }
    });
    // Main navigation
    var nav = $(".nav > ul > li");
    var subNavs = $(".nav > ul > li > div");
    subNavs.hide();
    nav.hover(function() {
        $(this).children("a:first-child").css("border-top", "solid 6px #B51218").css("padding-top", "7px");
        if (!$(this).children("div").is(":animated")) {
            $(this).children("div").animate({ height: "show" }, 300, "easeOutBack");
        }
    }, function() {
        $(this).children("a:first-child").css("border-top", "none").css("padding-top", "13px");
        $(this).children("div").animate({ height: "hide" }, 200);
    });
    // Music Player
    var musicPlayerLink = $(".musicPlayerLink");
    musicPlayerLink.click(function() {
        var musicPlayerWindow = window.open("http://" + location.host + "/" + $(this).attr("href"), "musicPlayerPopupWindow", "width=732, height=496, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizeable=no");
        musicPlayerWindow.resizeTo(732, 496);
        musicPlayerWindow.focus();
        return false;
    });
});

function ShowCountdown(displayElement, seconds)
{
    $get(displayElement).innerHTML = seconds;
    if (seconds > 0)
    {
        seconds -= 1;
        setTimeout('ShowCountdown("' + displayElement + '", ' + seconds + ')', 1000);
    }
}

function DisplaySuccessMessage() {
    $("<div class='saveSuccessful'>Save Successful</div>").appendTo(".content").hide().fadeIn(2000).animate({ opacity: 1.0 }, 1000).fadeOut(2000);
}