﻿/// <reference path="jquery-1.4.4.js" />
/// <reference path="jquery-ui-1.8.7.custom.min.js" />

$().ready(function () {
    $('.featuredEventLink').one('mouseover', function () {
        $(this).animate({ fontSize: 36, lineHeight: 48, top: -18 }, 50);
    }).blur(function () {
        $(this).animate({ fontSize: 12, lineHeight: 18 }, 0.01);
    });

    $('#footer ul').append('<li id="footerItemShowUpcomingEvents"><a href="#"></a></li>');
    $('#footerItemShowUpcomingEvents').hide(0).live('click', function (event) { $(this).hide(0); $('[id$=UpcomingEventsPanel]').show(); $(this).children('a').text(''); });

    $('#upcomingEventsClose').click(function () {
        $('[id$=UpcomingEventsPanel]').hide('slow');
        $('#footerItemShowUpcomingEvents').show(0).children('a').text('Show Events');
    });
    $('[id$=UpcomingEventsPanel]').draggable({ handle: $('#upcomingEventsPanelHeader', '#upcomingEventsPanelHeader span'), cursor: 'move', opacity: 0.35 });
    /*    $('.featuredEventLink').hover(
    function () {
    $(this).animate({ fontSize: 36, lineHeight: 48 }, 'fast');
    },
    function () {
    $(this).delay.animate({ fontSize: 12, lineHeight: 18 }, 0.01);
    }
    );
    */
    var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
    //    $('.first, .second, .third').animate({ color: "red" }, 5000);

    spectrum();

    function spectrum() {
        var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';

        $('.first, .second, .third').animate({ color: hue }, 500, spectrum);
//        $('.second').animate({ color: hue }, 1000);
//        $('.third').animate({ color: hue }, 1000);

//        spectrum();
    } 
});

