<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Документ без названия</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
.menu ul {
display: none;
}
</style>
</head>
<body>
<div class="menu">
<div>
<a href="#">Меню 1</a>
<ul id="menu_1">
<li>Меню 1.1</li>
<li>Меню 1.2</li>
<li>Меню 1.3</li>
<li>Меню 1.4</li>
<li>Меню 1.5</li>
</ul>
</div>
<div>
<a href="#">Меню 2</a>
<ul id="menu_2">
<li>Меню 2.1</li>
<li>Меню 2.2</li>
<li>Меню 2.3</li>
<li>Меню 2.4</li>
<li>Меню 2.5</li>
</ul>
</div>
</div>
<script type="text/javascript">
function cookie(a, b) {
if(b) document.cookie = a+'='+escape(b)+'; expires = Mon, 01-Jan-2999 00:00:00 GMT; path=/';
var c = '(?:; )?'+a+'=([^;]*);?', d = new RegExp(c);
return d.test(document.cookie) ? decodeURIComponent(RegExp['$1']) : 0;
}
$(function() {
$('.menu > div > a').click(function() {
$('.menu ul').css('display', 'none');
var b = $(this).next();
b.css('display', 'block');
cookie('menu', b.prop('id'));
});
var b = cookie('menu');
if(b) $('#'+b).css('display', 'block');
});
</script>
</body>
</html>