﻿$(function () {
    //Animate main top navigation
    var d = 300;
    $('#tabWrapper ul li a').each(function () {
        $(this).stop().animate({
            'marginTop': '-10px'
        }, d += 150);

        //        var path = location.pathname;
        //        if (path == '/.aspx' | '/.aspx') {
        //            $('#navigation .contest a').addClass('current').stop().animate({ 'marginTop': '-2px' });
        //            $('#submit > a').addClass('current');
        //        }
        //        else if (path == '/.aspx') {
        //            $('#navigation .vote a').addClass('current').stop().animate({ 'marginTop': '-2px' });
        //            $('#vote > a').addClass('current');
        //        }
    });

    $('#tabWrapper ul li').hover(
        function () {
            $('a', $(this)).stop().animate({
                'marginTop': '-2px'
            }, 200);
        },
        function () {
            if ($('a', $(this)).hasClass('current')) {
                ;
            }
            else {
                $('a', $(this)).stop().animate({
                    'marginTop': '-10px'
                }, 200);
            }
        }
    );

    // Commented out before show 9/22/11
    //animateHpBanner();
    //hoverImageOverlay();

    // ajh 2011-08-22: make whole thing clickable.
    $('.hpBannerRightCol').click(function () {
        location.href = "/illbethere";
    });
    $(".hpBannerRightCol").hover(function() {
		$(this).css('cursor','pointer');
	}, function() {
		$(this).css('cursor','auto');
	});


});

    // HP Animation Banner
    function animateHpBanner() {
        // Set timers for main events
        var dropTextTimer = setTimeout(dropInText, 3000);  // 3 secs after page load
        var fadeCalloutTimer = setTimeout(fadeInCallout, 4850);
        var fadeAthleteTimer = setTimeout(fadeInAthlete, 4850);
        var slideInfoBoxTimer = setTimeout(slideInfoBox, 13500);

        function dropInText() {
            $('.hpHeader h4').animate({ top: '185px' }, 700)
            .prev().delay(500).animate({ top: '135px' }, 600)  //Delay
            .prev().delay(500).animate({ top: '85px' }, 600)  //Delay
            .prev().delay(800).animate({ top: '0px' }, 500);  //Delay
        }
        function fadeInCallout() {
            $('.ibtCallout').fadeIn(200);
        }
        function fadeInAthlete() {
            for (i = 0; i < 4; i++) {
                if (i == 0) {
                    var t = 0;
                }
                if (i == 3) {
                    $('.ibtAthlete').eq(i).delay(t).fadeIn(200);  //Delay
                    return false;
                }
                $('.ibtAthlete').eq(i).delay(t).fadeIn(200).delay(2000).fadeOut(200);  //Delay
                t = t + 2500;
            }
        }
        function slideInfoBox() {
            $('.ibtInfoBox').animate({ width: '310px' }, 1000).css({ padding:'10px 0px'});
            $('.ibtInfoBoxText').delay(1000).fadeIn(500).click(function () {
                location.href = "/illbethere";
            });
        }
    }

// Show yellow feedback message - admin pages
function showAdminFeedback() {
    $('.divAdminFeedback').slideDown('400').delay('3500').slideUp('slow');
}
// show yellow feedback message - feedback.ascx control
function showFeedback() {
    $('.divFeedback').slideDown('400').delay('3500').slideUp('slow');
}


