﻿$(document).ready(function() {
    $('.ulsidemenu li').hover(
		function () {
		    if ($(this).is(".home")) {
                $(this).addClass('home-hover');
            } else if ($(this).is(".vendors")) {
                $(this).addClass('vendors-hover');
                $(this).find("div.subnav-vendors").show();
            } else if ($(this).is(".articles")) {
                $(this).addClass('articles-hover');
            } else if ($(this).is(".events")) {
                $(this).addClass('events-hover');  
                $(this).find("div.subnav-events").show();          
            } else if ($(this).is(".forum")) {
                $(this).addClass('forum-hover');      
            } else if ($(this).is(".blog")) {
                $(this).addClass('blog-hover');      
            }
            
            //alert($(this).offset().top);
            $(this).find("div.SubMenuWrapper").css({top: + ($(this).offset().top - 160) + "px"});
			$(this).find("div.SubMenuWrapper").show();
			


		},
		function () {
		    if ($(this).is(".home")){
				$(this).removeClass('home-hover');
			} else if ($(this).is(".vendors")){
				$(this).removeClass('vendors-hover');
                $(this).find("div.subnav-vendors").hide();
			}  else if ($(this).is(".articles")){
				$(this).removeClass('articles-hover');
			}  else if ($(this).is(".events")){
				$(this).removeClass('events-hover');
                $(this).find("div.subnav-events").hide();          
			} else if ($(this).is(".forum")){
				$(this).removeClass('forum-hover');
			} else if ($(this).is(".blog")){
				$(this).removeClass('blog-hover');
			}

			$(this).find("div.SubMenuWrapper").stop(true, true).hide();
		}
	);
});
