var jshover = function() {
	var sfEls = document.getElementById("horizontal-menu").getElementsByTagName("td");
	for (var i=0; i<sfEls.length; i++)
	{


			sfEls[i].onmouseover=function()
			{
				this.className+=" jshover";
			}
			sfEls[i].onmouseout=function()
			{

				this.className=this.className.replace(new RegExp(" jshover\\b"), "");
			}

	}
}

if (window.attachEvent)
	window.attachEvent("onload", jshover);

function showSubMenu(el, todo) {
	if (el == "arend_root")
		el = "arendatoram";
	if (el == "pokup_root")
		el = "pokupatelyam";
	if (el == "vlad_root")
		el = "vladelcam";
	if (el == "o_komp_root")
		el = "o_kompanii";
	if (el == "qual_root")
		el = "qualdep";
	if (el == "cont_root")
		el = "contacty";
	if (todo == "show") {
		document.getElementById(el).style.display = "block";
	}
	else {
		document.getElementById(el).style.display = "none";
	}
}

jQuery(document).ready(function() {
	jQuery("#arend_root, #arendatoram, #pokupatelyam, #pokup_root, #vladelcam, #vlad_root, #o_komp_root, #o_kompanii, #qual_root, #qualdep, #cont_root, #contacty").hover(function() {
	   		showSubMenu($(this).attr('id'), 'show');
	}, function() {
	   		showSubMenu($(this).attr('id'), 'hide');
 	});
});

var text = "<div id=\"horizontal-menu\">"+
								"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"+
									"<tr>"+
										"<td id=\"arend_root\" class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 0px; padding: 0px;\">"+
														"<tr>"+
															"<td class=\"tif\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;АРЕНДАТОРАМ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>"+
														"</tr>"+

													"</table>"+
												"</td>"+
											"</tr>"+
                                            "<tr>"+
												"<td id=\"arendatoram\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a class=\"menu_or\" href=\"/search.html\">Поиск по базе аренды</a></li>"+
														"<li><a href=\"/licensing.html\">Лицензирование</a></li>"+
														"<li><a href=\"/arenda.html\">Спецпредложения</a></li>"+
														"<li><a href=\"/reg.html\">Регистрация<br />недвижимости</a></li>"+
														"<li><a class=\"order_up\" href=\"/order_up.html\">Оставить заявку</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+
										"<td id=\"pokup_root\"  class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"+
														"<tr>"+
															"<td class=\"tif\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ПОКУПАТЕЛЯМ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>"+
														"</tr>"+
													"</table>"+
												"</td>"+
											"</tr>"+
											"<tr>"+
												"<td id=\"pokupatelyam\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a class=\"menu_or\" href=\"/search.html?oper=sale\">Поиск по базе продажи</a></li>"+
														"<li><a href=\"/busines.html\">Права аренды</a></li>"+
														"<li><a href=\"/busines-sale.html\">Готовый бизнес</a></li>"+
														"<li><a href=\"/prodaga.html\">Спецпредложения</a></li>"+
														"<li><a href=\"/licensing.html\">Лицензирование</a></li>"+
														"<li><a href=\"/reg.html\">Регистрация<br />недвижимости</a></li>"+
														"<li><a class=\"order_up\" href=\"/order_up.html\">Оставить заявку</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+
										"<td id=\"vlad_root\" class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"+
														"<tr>"+
															"<td class=\"tif\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ВЛАДЕЛЬЦАМ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>"+
														"</tr>"+
													"</table>"+
												"</td>"+
											"</tr>"+
											"<tr>"+
												"<td id=\"vladelcam\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a class=\"menu_or\" href=\"/4ownrs.html\">Спецпредложение<br />владельцам</a></li>"+
														"<li><a href=\"/ocenka.html\">Оценка помещений</a></li>"+
														"<li><a href=\"/licensing.html\">Лицензирование</a></li>"+
														"<li><a href=\"/reg.html\">Регистрация<br />недвижимости</a></li>"+
														"<li><a class=\"order_up\" href=\"/offer_up.html\">Разместить объект в базе</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+

										"<td id=\"o_komp_root\" class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"+
														"<tr>"+
															"<td class=\"tif\">О КОМПАНИИ</td>"+
														"</tr>"+
													"</table>"+
												"</td>"+
											"</tr>"+
											"<tr>"+
												"<td id=\"o_kompanii\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a href=\"/about.html\">О компании</a></li>"+
														"<li><a href=\"/clients.html\">Наши клиенты</a></li>"+
														"<li><a href=\"/partners.html\">Наши партнеры</a></li>"+
														"<li><a href=\"/vacs.html\">Вакансии</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+
										"<td id=\"qual_root\" class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"+
														"<tr>"+
															"<td class=\"tif\">СЛУЖБА КОНТРОЛЯ КАЧЕСТВА</td>"+
														"</tr>"+
													"</table>"+
												"</td>"+
											"</tr>"+
											"<tr>"+
												"<td id=\"qualdep\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a href=\"/qualdep.html\">Служба контроля качества</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+
										"<td id=\"cont_root\" class=\"root-item\" title=\"\">"+
											"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"cell\">"+
											"<tr>"+
												"<td class=\"main\">"+
													"<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">"+
														"<tr>"+
															"<td class=\"tif\">КОНТАКТЫ</td>"+
														"</tr>"+
													"</table>"+
												"</td>"+
											"</tr>"+
											"<tr>"+
												"<td id=\"contacty\" class=\"pod\" style=\"display: none; position: relative; z-index: 1000;\">"+
													"<ul class=\"menu\">"+
														"<li><a href=\"/contacts.html\">Контакты</a></li>"+
													"</ul>"+
												"</td>"+
											"</tr>"+
											"</table>"+
										"</td>"+
									"</tr>"+
									"<tr>"+

									"</tr>"+
								"</table>"+
							"</div>";
document.write(text);
