	$(document).ready(function() {
		$("#menu").height($(document).height()-64);
		$("#container").width($(document).width());

		$("#menu li .sub_title, #menu li .top_title").hover(function() {
			$(this).parent().addClass("over");
		},
		function() {
			$(this).parent().removeClass("over");
		}).click(function() {
			if($(this).attr("url").length == 0 && $(this).attr("menu") == "top") {
				var tm = $(this).attr("tm");	
				var display = $(this).parent().css("display");

				$(".sub_title").each(function() { $(this).parent().hide(); });

				if(display != "none") {
					$(".sub_title").filter(".tm_"+tm).each(function() {
						$(this).parent().show();
					});
				}
			}
			else if($(this).attr("url").length > 0) {
				if($(this).attr("url").indexOf("?") > 0) {
					top.location.href=$(this).attr("url")+"&tm="+$(this).attr("tm")+"&lm="+$(this).attr("lm");
				}
				else {
					top.location.href=$(this).attr("url")+"?tm="+$(this).attr("tm")+"&lm="+$(this).attr("lm");
				}
			}
		});

		if(_tm.length) {
			$(".top_title").filter(".tm_"+_tm).each(function(){
				$("h4",$(this).parent()).addClass("selected");

				$(".sub_title").filter(".tm_"+_tm).parent().show();

				if(_lm.length) {
					$(".sub_title").filter(".tm_"+_tm).filter(".lm_"+_lm).each(function() {
						$("a",$(this).parent()).addClass("selected");
					});
				}
			});
		}
	});
