﻿var CurrentDayInt = -1;
$(document).ready(function () {
    //SetDayOfWeek();
    $("#aboutsubnav").hide();
    $("#about-nav").mouseenter(function () {
        $("#aboutsubnav").show();
    });
    $("#about-nav").mouseleave(function () {
        $("#aboutsubnav").delay(500).fadeOut();
    });
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(lazyLoadCalendarControls);
    lazyLoadCalendarControls();
    $('#SiteFooterOuterBottomContainer').hide();
    $('#SiteFooterOuterTopContainer').hover(function () {
        $('#SiteFooterOuterBottomContainer').show();
        $(window).delay(500).scrollTo($('#bottom'), 200);
    });
    $('#SiteFooterOuterTopContainer').mouseleave(function () {
        $('#SiteFooterOuterBottomContainer').delay(500).hide();
    });
});
function lazyLoadCalendarControls() {
    SetDayOfWeek();
    $("#BodyContentPlaceHolder_StartDateTextBox").datepicker({
        beforeShowDay: function (date) {
            if (date.getDay() != CurrentDayInt) {
                return [false, ''];
            } else {
                return [true, ''];
            }
            dateFormat: 'dd/mm/yy'
        },
        minDate: 0,
        numberOfMonths: 2
    });
    $("#BodyContentPlaceHolder_CalendarHiddenInput").datepicker({
        beforeShowDay: function (date) {
            if (date.getDay() != CurrentDayInt) {
                return [false, ''];
            } else {
                return [true, ''];
            }
            dateFormat: 'dd/mm/yy'
        },
        minDate: 0,
        numberOfMonths: 2,
        showOn: 'both',
        buttonText: "Select Start Date",
        buttonImage: '../images/calendar_icon.png',
        buttonImageOnly: true
    });
    $('#BodyContentPlaceHolder_CalendarHiddenInput').bind('change', function () {
        //var oldvalue = ???
        $("#BodyContentPlaceHolder_StartDateTextBox").val($(this).val());
    });
    $("#homevideolink").fancybox({
        //'modal':true,
        'hideOnContentClick': false
    });
}
function SetDayOfWeek() {
    var DayStr = $("#BodyContentPlaceHolder_ClassRadioButtonList").attr("Day");
    if (DayStr == "Sunday") {
        CurrentDayInt = 0;
    }
    else if (DayStr == "Monday") {
        CurrentDayInt = 1;
    }
    else if (DayStr == "Tuesday") {
        CurrentDayInt = 2;
    }
    else if (DayStr == "Wednesday") {
        CurrentDayInt = 3;
    }
    else if (DayStr == "Thursday") {
        CurrentDayInt = 4;
    }
    else if (DayStr == "Friday") {
        CurrentDayInt = 5;
    }
    else if (DayStr == "Saturday") {
        CurrentDayInt = 6;
    }
}
//////Drop Menu
////var site = function () {
////    this.navLi = $('#nav li').children('ul').hide().end();
////    this.init();
////};
////site.prototype = {

////    init: function () {
////        this.setMenu();
////    },

////    // Enables the slidedown menu, and adds support for IE6

////    setMenu: function () {

////        $.each(this.navLi, function () {
////            if ($(this).children('ul')[0]) {
////                $(this)
//// 				.append('<span />')
//// 				.children('span')
//// 					.addClass('hasChildren')
////            }
////        });

////        this.navLi.hover(function () {
////            // mouseover
////            $(this).find('> ul').stop(true, true).slideDown('slow', 'easeOutBounce');
////        }, function () {
////            // mouseout
////            $(this).find('> ul').stop(true, true).hide();
////        });

////    }

////}
