﻿jQuery(document).ready(function () {
	jQuery(".TopMenu ul li a").click(function (event) {
		event.preventDefault();

		var menuLink = this;
		setTimeout(function () {
			jQuery(menuLink).parent().find("ul").show();
			jQuery(menuLink).parent().addClass("clicked");
		}, 300);

		jQuery(this).parent().hover(function () {
			//do nothing
		}, function () {
			var menu = this;
			setTimeout(function () {
				jQuery(menu).parent().find("ul").hide();
				jQuery(menu).removeClass("clicked");
			}, 500);
		});
	});

	//gör undernivån länkbar
	jQuery('.TopMenu ul li ul li a').click(function (e) {
		var $self = jQuery(this);
		document.location = $self.attr('href');
	});
});
