﻿$(function () {

    $("#topMenu ul.dropdown li").hover(function () {

        if (!$('body').hasClass('mobileSite')) {
            $(this).addClass("hover");
            $('ul:first', this).css('display', 'block');

            var MenuID = this.id;

            if (MenuID != "mnuNotifications" && MenuID != "mnuArchive") {
                if ($("#mnuNotifications").hasClass("hover") && $(this).parent().parent().attr("id") != "mnuNotifications") {
                    $("#mnuNotifications ul").css('display', 'none');
                    $("#mnuNotifications").removeClass("hover");
                }

                if ($("#mnuArchive").hasClass("hover") && $(this).parent().parent().attr("id") != "mnuArchive") {
                    $("#mnuArchive ul").css('display', 'none');
                    $("#mnuArchive").removeClass("hover");
                }

            }
        }

        /*If we rollover the mnuNotifications do ajax calls*/
        /*if(MenuID = "mnuNotifications" ){
        	
        alert("Hey you rolled over Me STOP IT! ID 10 D!!!!!!!!!!!!");
        	
        }*/


    }, function () {


        if (!$(this).hasClass("stick")) {
            $(this).removeClass("hover");
            $('ul:first', this).css('display', 'none');
        }
    });

    $(".mobileClickClose").click(function () {
        $("#mnuNotifications ul").css('display', 'none');
        $("#mnuNotifications").removeClass("hover");
        if ($(this).hasClass("hover")) {
            $(this).removeClass("hover");
            $('ul:first', this).css('display', 'none');
        } else {
            $(this).addClass("hover");
            $('ul:first', this).css('display', 'block');
        }
    });


    $("#notify").click(function () {
        if (!$('#mnuNotifications').hasClass("hover")) {
            $('#mnuNotifications').addClass("hover");
            $('#mnuNotifications ul:first').css('display', 'block');
        }
    });

    $("#menu").click(function () { }, function () {

        $("#mainMenu").toggle();

    });




});

