﻿//sub menu
var animTime = 250

function SubMenu(selector) {
	$(selector + ' li').hover(
		function () {
			if (this.hover) return
			var $ulSub = $(this).children('ul'), height = $ulSub.css({ visibility: 'hidden', display: 'block' }).height()
			$ulSub.css({ visibility: 'visible', display: 'none', height: '0px' })
			$(this).children('ul').animate({ height: height + 'px' }, animTime)
			this.hover = 1
		},
		function () {
			var _this = this
			$(this).children('ul').slideUp(animTime, function () { _this.hover = 0; })
		}
	)
	$(selector + ' li ul').hover(
		function () {
			$(this).prev('a').addClass("Current")
		},
		function () {
			$(this).prev('a').removeClass("Current")
		}
	)
}
SubMenu("ul.UserArea_SubMenu")

