var rootpath = document.getElementById("mainlogolink").href.substring("0", document.getElementById("mainlogolink").href.lastIndexOf("/")+1)

document.write("   <table border='0' cellspacing='0' cellpadding='0' width='1000' id='menu01'>")
document.write("    <tr>")
document.write("     <td width='14'><img src='" + rootpath + "0002_files/menu_left_part_2.gif' border='0'></td>")
document.write("     <td width='*' bgcolor='#DEEE46'><div id='horiz-menu'>")
document.write("<ul>")
document.write("<li><a href='" + rootpath + "index.html'>Главная</a></li>")
document.write("<li><a href='" + rootpath + "news.html'>Новости</a></li>")
document.write("<li><a class='topdaddy' href='" + rootpath + "otdeli.html'>Отделы</a>")
document.write("	<ul>")
document.write("		<li><a href='" + rootpath + "otdeli_korma.html'>Отдел кормов</a></li>")
document.write("		<li><a href='" + rootpath + "otdeli_vet.html'>Ветеринарный отдел</a></li>")
document.write("		<li><a href='" + rootpath + "otdeli_acc.html'>Отдел аксессуаров</a></li>")
document.write("		<li><a href='" + rootpath + "otdeli_akv.html'>Отдел аквариумистики</a></li>")
document.write("	</ul></li>")
document.write("<li><a class='topdaddy' href='" + rootpath + "accessories.html'>Аксессуары</a>")
document.write("	<ul>")
document.write("		<li><a href='" + rootpath + "for_pets_only.html'>For Pets Only</a></li>")
document.write("		<li><a href='" + rootpath + "gallery2/Malucchi_new.pdf'>Malucchi</a></li>")
document.write("		<li><a href='" + rootpath + "hunter.html'>Hunter</a></li>")
document.write("		<li><a href='" + rootpath + "gallery2/PS1_Brochure_08_sm.pdf'>Patch and Scott</a></li>")
document.write("	</ul></li>")
document.write("<li><a class='topdaddy' href='" + rootpath + "vetokinol/vetokinol.html'>Ветокинол</a>")
document.write("	<ul>")
document.write("		<li class='test005'><a href='" + rootpath + "vetokinol/info.html'>О фирме</a></li>")
document.write("		<li><a href='" + rootpath + "vetokinol/preparats/preparats.html'>Препараты</a></li>")
//document.write("		<li><a href='" + rootpath + "vetokinol/price_opt.html'>Прайс-лист</a></li>")
document.write("		<li><a href='" + rootpath + "vetokinol/wheretobuy_reg.html'>Где купить</a></li>")
document.write("	</ul></li>")
document.write("<li><a href='" + rootpath + "vakansii.html'>Вакансии</a></li>")
document.write("<li><a href='" + rootpath + "akcii.html'>Акции</a></li>")
document.write("<li><a href='" + rootpath + "links.html'>Ссылки</a></li>")
//document.write("<li><a class='topdaddy' href='" + rootpath + "contacts.html'>Контакты</a>")
//document.write("	<ul>")
//document.write("		<li><a href='" + rootpath + "shops.html'>Наши магазины</a></li>")
//document.write("	</ul></li>")
document.write("<li><a class='topdaddy' href='" + rootpath + "about.html'>О компании</a>")
document.write("	<ul>")
document.write("		<li><a href='" + rootpath + "shops.html'>Наши магазины</a></li>")
document.write("		<li><a href='" + rootpath + "contacts.html'>Контакты</a></li>")
document.write("	</ul></li>")
document.write("</ul>")
document.write("</div>")
document.write("     </td>")
document.write("     <td width='12'><img src='" + rootpath + "0002_files/menu_right_part.gif' border='0'></td>")
document.write("    </tr>")
document.write("   </table>")


var pageFileName = document.location.href.substring(window.location.href.lastIndexOf("/")+1, window.location.href.lastIndexOf("."))

var pagepath0 = document.location.href.substring("0", window.location.href.lastIndexOf("/"))
var pagepath1 = pagepath0.substring(pagepath0.lastIndexOf("/")+1, pagepath0.length)

function mycheck(what) {
	var what2 = "'" + what + "'"
	var what2_short = what2.substring(what2.lastIndexOf("/")+1, what2.lastIndexOf("."))
	if (what2_short == pageFileName) {
		return true;
	} else { 
		if (what2_short == pagepath1) {
			return true;
		} else return false
	}
}

var t0 = document.getElementById('menu01').getElementsByTagName("li")
	for (var i=0; i<t0.length; i++) { 
		var t1 = t0.item(i).getElementsByTagName('a')
		if (t1.length == 1) {
			mycheck(t1.item(0))
			if (mycheck(t1.item(0))) {
				t0.item(i).className+=" active"
				}
			}
		else {
			mycheck(t1.item(0))
			if (mycheck(t1.item(0))) {
				t0.item(i).className+=" active"
				}
			var t2 = t0.item(i).getElementsByTagName('li')
			for (var j=0; j<t2.length; j++) {
				var t4 = t2.item(j).getElementsByTagName('a')
				for (var k=0; k<t4.length; k++) {
					mycheck(t4.item(k))
					if (mycheck(t4.item(k))) {
						t0.item(i).className+=" active"
						t2.item(j).className+=" active"
						}
					}
				}
			i+=t2.length
			}
		}

