$(document).ready(function(){

	$(".pmenu").bind("mouseover", function(e){
		var pmenu = e.target;
		$(this).animate({opacity: 0.4}, "slow");
		var div = document.createElement('div');
		var rd = document.createElement('img');
		rd.src = "/script/menu/p.gif";
		$(rd).css({height: "40px", width: "104px", border: "0px"});
		$(div).append(rd);
		$(rd).one("click", function(){
			switch(pmenu.getAttribute("c"))
			{
				case "1": location.href="/exhibitions/"; break;
				case "2": location.href="/news/"; break;
				case "3": location.href="/press_club/"; break;
				case "4": location.href="/about/"; break;
				case "5": location.href="/contacts/question/"; break;
				case "6": location.href="/culture/"; break;
				case "7": location.href="/rest/"; break;
				case "8": location.href="/business/"; break;
				case "9": location.href="/contacts/"; break;
			}
		});
		div.pMenuObject = 1;
		$(div).css({zIndex: 5, cursor: "pointer", width: "104px", position: "absolute", top: $(this).offset().top, left: $(this).offset().left-2});
		$(div).bind("mouseout", function(e){
			if(e.relatedTarget != "null")
				if(e.relatedTarget.parentNode != this && e.relatedTarget != this){
					$(this).animate({opacity: 0, height: 0}, 300 , function(){ this.parentNode.removeChild(this) });
					$(div).unbind("mouseout");
				}
		});
		$("body").append(div)
		switch(this.getAttribute("c"))
		{
			case "1":
				var divs = document.createElement('div');
				$(divs).css(ps);
				$(divs).text("выставки, конгрессы, семинары");
				$(divs).one("click", function(){ location.href="/exhibitions/organizers_and_participants/" });
				$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
				$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
				$(div).append(divs);
				$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
					var divs = document.createElement('div');
					$(divs).css(ps);
					$(divs).text("календарь");
					$(divs).one("click", function(){ location.href="/exhibitions/calendar/" });
					$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
					$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
					$(div).append(divs);
					$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
						var divs = document.createElement('div');
						$(divs).css(ps);
						$(divs).text("ВВЦ за рубежом");
						$(divs).one("click", function(){ location.href="/exhibitions/foreign/" });
						$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
						$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
						$(div).append(divs);
						$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
							var divs = document.createElement('div');
							$(divs).css(ps);
							$(divs).text("аренда площадей");
							$(divs).one("click", function(){ location.href="/exhibitions/rent/" });
							$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
							$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
							$(div).append(divs);
							$(divs).animate({opacity: 1, marginTop: 0}, 100);
				});});});
			break
			case "3":
			var divs = document.createElement('div');
				$(divs).css(ps);
				$(divs).text("для прессы");
				$(divs).one("click", function(){ location.href="/press_club/for_press/" });
				$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
				$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
				$(div).append(divs);
				$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
					var divs = document.createElement('div');
					$(divs).css(ps);
					$(divs).text("СМИ о нас");
					$(divs).one("click", function(){ location.href="/press_club/review/" });
					$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
					$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
					$(div).append(divs);
					$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
						var divs = document.createElement('div');
						$(divs).css(ps);
						$(divs).text("спецпроекты");
						$(divs).one("click", function(){ location.href="/press_club/projects/" });
						$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
						$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
						$(div).append(divs);
						$(divs).animate({opacity: 1, marginTop: 0}, 100);
				});});
			break
			case "4":
				var divs = document.createElement('div');
				$(divs).css(ps);
				$(divs).text("история ВВЦ");
				$(divs).one("click", function(){ location.href="/about/history/" });
				$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
				$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
				$(div).append(divs);
				$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
					var divs = document.createElement('div');
					$(divs).css(ps);
					$(divs).text("интерактивная карта");
					$(divs).one("click", function(){ location.href="/interactive_map/" });
					$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
					$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
					$(div).append(divs);
					$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
						var divs = document.createElement('div');
						$(divs).css(ps);
						$(divs).text("наши партнеры");
						$(divs).one("click", function(){ location.href="/about/our_partners/" });
						$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
						$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
						$(div).append(divs);
						$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
							var divs = document.createElement('div');
							$(divs).css(ps);
							$(divs).text("70-летие ВВЦ");
							$(divs).one("click", function(){ location.href="/70years/" });
							$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
							$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
							$(div).append(divs);
							$(divs).animate({opacity: 1, marginTop: 0}, 100);
				});});});
			break
			case "7":
				var divs = document.createElement('div');
				$(divs).css(ps);
				$(divs).text("экскурсии по ВВЦ");
				$(divs).one("click", function(){ location.href="/rest/interest/index.php" });
				$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
				$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
				$(div).append(divs);
				$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
					var divs = document.createElement('div');
					$(divs).css(ps);
					$(divs).text("досуг на ВВЦ");
					$(divs).one("click", function(){ location.href="/rest/" });
					$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
					$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
					$(div).append(divs);
					$(divs).animate({opacity: 1, marginTop: 0}, 100,function(){
						var divs = document.createElement('div');
						$(divs).css(ps);
						$(divs).text("фотогалерея");
						$(divs).one("click", function(){ location.href="/rest/photogallery/" });
						$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
						$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
						$(div).append(divs);
						$(divs).animate({opacity: 1, marginTop: 0}, 100);
				})});
			break
			case "8":
				
					var divs = document.createElement('div');
					$(divs).css(ps);
					$(divs).text("подразделения");
					$(divs).one("click", function(){ location.href="/business/subdivisions/" });
					$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
					$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
					$(div).append(divs);
					$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
						var divs = document.createElement('div');
						$(divs).css(ps);
						$(divs).text("акционерам и инвесторам");
						$(divs).one("click", function(){ location.href="/business/investors/" });
						$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
						$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
						$(div).append(divs);
						$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
							var divs = document.createElement('div');
							$(divs).css(ps);
							$(divs).text("третейский суд");
							$(divs).one("click", function(){ location.href="/business/sud/index.php" });
							$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
							$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
							$(div).append(divs);
							$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
								var divs = document.createElement('div');
								$(divs).css(ps);
								$(divs).text("услуги");
								$(divs).one("click", function(){ location.href="/exhibitions/organizers_and_participants/exhib_service/" });
								$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
								$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
								$(div).append(divs);
								$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
									var divs = document.createElement('div');
									$(divs).css(ps);
									$(divs).text("вакансии");
									$(divs).one("click", function(){ location.href="/administration/vacancy/" });
									$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
									$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
									$(div).append(divs);
									$(divs).animate({opacity: 1, marginTop: 0}, 100, function(){
										var divs = document.createElement('div');
										$(divs).css(ps);
										$(divs).text("аренда залов");
										$(divs).one("click", function(){ location.href="/business/rent/hall.php" });
										$(divs).bind("mouseover", function(e){ $(this).animate({backgroundColor: "#547DAD"}, "slow")});
										$(divs).bind("mouseout", function(e){ $(this).stop(true, true).animate({backgroundColor: "#244D8D"}, "slow")});
										$(div).append(divs);
										$(divs).animate({opacity: 1, marginTop: 0}, 100);});});});});});
				break
		}
	});
	$(".pmenu").mouseout(function(){
		$(this).stop(false, true);
		$(this).animate({opacity: 1}, "fast");

	});
});
var ps = {opacity: 0, color: "#FFF", textAlign: "center", borderRight: "1px solid #FFF", borderBottom: "1px solid #FFF", borderLeft: "1px solid #FFF", backgroundColor: "#244D8D", marginTop: "100px", fontSize: "12px", fontFamily: "Georgia, 'Times New Roman', Times, serif", padding: "1px"};
