function write_menu_l1(ox, oy){
	if (!isDOM) return true;
menu_x = ox;
menu_y = oy;
write_menu_custom(0);
}
function write_menu_other(){
	if (!isDOM) return true;
}
function write_menu_custom(id){
	if (!isDOM) return true;
	var temp_menu = new Array();
	var index_menu = new Array();
	var str = '';


	for(i=0; i<menu_gen.length; i++)
		if (menu_gen[i] == id)
			return true;

	for(i=1; i<menu.length; i++)
		if (menu[i].pid == id){
			temp_menu[(temp_menu.length?temp_menu.length:0)] = menu[i];
			index_menu[(index_menu.length?index_menu.length:0)] = i;
		}
	if (temp_menu.length){
		if (menu_gen.length && menu[id].ori== 2){
			xx = menu[id].x + menu[id].w;
			yy = menu[id].y;
		}else{
			xx = menu_gen.length?menu[id].x:'';
			yy = menu_gen.length?(menu[id].y + menu[id].h):'';
		}

		if (!menu_gen.length){
str = '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
str += '<tr><td width="10%" bgcolor="#F0F0F0" style="background-position: top right; background-repeat: no-repeat;" background="/common/imgs/bg3.gif"></td>';
	for(i=0; i<temp_menu.length; i++){
    if(temp_menu[i].div_style){
		str += '<td onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><img id="td_a_' + index_menu[i] + '" name="td_a_' + index_menu[i] + '" src="/common/imgs/m5.gif" width="5" height="28" border="0" alt=""></td>';
		str += '<td width="13%" onmouseover="this.className = \'table-umenu-s\';td_menu_over(' + index_menu[i] + ');" onmouseout="this.className = \'table-umenu\';td_menu_out();" onclick="document.location=\'' + temp_menu[i].url + '\';" id="td_' + index_menu[i] + '" name="td_' + index_menu[i] + '" bgcolor="#6D6E71">';
		str += '<a href="' + temp_menu[i].url + '"><img id="td_x_' + index_menu[i] + '" name="td_x_' + index_menu[i] + '" src="' + temp_menu[i].table_style + '" border="0" alt=""></a>';
		str += '</td>';
		str += '<td onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><img id="td_b_' + index_menu[i] + '" name="td_b_' + index_menu[i] + '" src="/common/imgs/m6.gif" width="5" height="28" border="0" alt=""></td>';


	}else{
		str += '<td onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><img id="td_a_' + index_menu[i] + '" name="td_a_' + index_menu[i] + '" src="/common/imgs/m1.gif" width="5" height="28" border="0" alt=""></td>';
		str += '<td width="13%" onmouseover="this.className = \'table-umenu-s\';td_menu_over(' + index_menu[i] + ');" onmouseout="this.className = \'table-umenu\';td_menu_out();" onclick="document.location=\'' + temp_menu[i].url + '\';" id="td_' + index_menu[i] + '" name="td_' + index_menu[i] + '" bgcolor="#009BBF">';
		str += '<a href="' + temp_menu[i].url + '"><img id="td_x_' + index_menu[i] + '" name="td_x_' + index_menu[i] + '" src="' + temp_menu[i].img + '" border="0" alt=""></a>';
		str += '</td>';
		str += '<td onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><img id="td_b_' + index_menu[i] + '" name="td_b_' + index_menu[i] + '" src="/common/imgs/m2.gif" width="5" height="28" border="0" alt=""></td>';
	}

}
str += '<td width="10%" bgcolor="#F0F0F0" style="background-repeat: no-repeat;" background="/common/imgs/bg4.gif"><DIV style="width: 50px;"><SPACER type="block" width="50"></SPACER></DIV></td></tr>';
str += '</table>';
		}else{
str = "<div id='a" + id + "' name='a" + id + "' style='width: "+ (menu[id].w + 10) +"px; position: absolute; left: " + xx + "px; top: " + yy + "px; visibility: visible; z-index: 999999;'>";
str += '<table cellspacing="0" cellpadding="0" border="0" width="100%">';
			for(i=0; i<temp_menu.length; i++){
str += '<tr><td colspan="3" onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><DIV style="width: 1px; height: 1;"><SPACER type="block" width="1" height="1"></SPACER></DIV></td></tr>';
str += '<tr>';
str += '<td><img src="/common/imgs/mz1' + (temp_menu[i].div_style?'h':'') + '.gif" width="5" height="5" border="0" alt=""></td>';
str += '<td '+ (temp_menu[i].div_style?'bgcolor="#6D6E71"':'bgcolor="#916BAF"') + '><DIV style="width: 1px; height: 1;"><SPACER type="block" width="1" height="1"></SPACER></DIV></td></td>';
str += '<td><img src="/common/imgs/mz2' + (temp_menu[i].div_style?'h':'') + '.gif" width="5" height="5" border="0" alt=""></td>';
str += '</tr>';
str += '<tr>';
str += '<td '+ (temp_menu[i].div_style?'bgcolor="#6D6E71"':'bgcolor="#916BAF"') + ' onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><DIV style="width: 1px; height: 1;"><SPACER type="block" width="1" height="1"></SPACER></DIV></td></td>';
str += '<td width="100%"'+ (temp_menu[i].div_style?'bgcolor="#6D6E71"':'bgcolor="#916BAF"') + ' onclick="document.location=\'' + temp_menu[i].url + '\';" onmouseover="this.className = \'table-umenu-s\';td_menu_over(' + index_menu[i] + ');" onmouseout="this.className = \'table-umenu\';td_menu_out();" id="td_' + index_menu[i] + '" name="td_' + index_menu[i] + '">';
str += '	<a href="' + temp_menu[i].url + '" class="dmenu2">'+ temp_menu[i].text + '</a>';
str += '</td>';
str += '<td '+ (temp_menu[i].div_style?'bgcolor="#6D6E71"':'bgcolor="#916BAF"') + ' onmouseover="td_menu_over(' + index_menu[i] + ');" onmouseout="td_menu_out();"><DIV style="width: 1px; height: 1;"><SPACER type="block" width="1" height="1"></SPACER></DIV></td></td>';
str += '</tr>';
str += '<tr>';
str += '<td><img src="/common/imgs/mz3' + (temp_menu[i].div_style?'h':'') + '.gif" width="5" height="5" border="0" alt=""></td>';
str += '<td '+ (temp_menu[i].div_style?'bgcolor="#6D6E71"':'bgcolor="#916BAF"') + '><DIV style="width: 1px; height: 1;"><SPACER type="block" width="1" height="1"></SPACER></DIV></td></td>';
str += '<td><img src="/common/imgs/mz4' + (temp_menu[i].div_style?'h':'') + '.gif" width="5" height="5" border="0" alt=""></td>';
str += '</tr>';
}
str += '</table>';
str += "</div>";
		}
		if(menu_gen.length){
			getRef('place_menu2').innerHTML += str;
		}else{
			getRef('place_menu').innerHTML = str;
		}
		for(i=0; i<temp_menu.length; i++){
			if (menu_gen.length){
				menu[index_menu[i]].x = getRef("a" + id).offsetLeft + getRef("td_" + index_menu[i]).offsetLeft;
				menu[index_menu[i]].y = getRef("a" + id).offsetTop + getRef("td_" + index_menu[i]).offsetTop;
			}else{
				menu[index_menu[i]].x = menu_x + getRef("place_menu").offsetLeft + getRef("td_" + index_menu[i]).offsetLeft - 3;
				menu[index_menu[i]].y = menu_y + getRef("place_menu").offsetTop + getRef("td_" + index_menu[i]).offsetTop;
			}
			menu[index_menu[i]].h = getRef("td_" + index_menu[i]).offsetHeight;
			menu[index_menu[i]].w = getRef("td_" + index_menu[i]).offsetWidth - 4;
		}
		menu_gen[(menu_gen.length?menu_gen.length:0)] = id;
	}
}


init = function() {
	var arr = document.getElementById("menu").getElementsByTagName("TD");

	for (var i=0, len=arr.length; i<len; i++) {
		arr[i].onmouseover=function() {this.className+=" jshover";}
		arr[i].onmouseout=function() {this.className=this.className.replace(" jshover", "");}
	}

	var arr = document.getElementById("catalog").getElementsByTagName("DIV");
	for (var i=0, len=arr.length; i<len; i++) {
		if (arr[i].className=="more") {
			arr[i].onmouseover=function() {var arr2 = this.getElementsByTagName("UL");arr2[0].style.display="block";}
			arr[i].onmouseout=function() {var arr2 = this.getElementsByTagName("UL");arr2[0].style.display="none";}
		}
	}

}
if (window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) window.attachEvent("onload", init);

function over() {
	var zix=100;
	var nav = document.getElementsByTagName('div');
	for(var i=0; i<nav.length; i++) {
		if (nav[i].className=="cat_item") {
			nav[i].style.zIndex=zix;
			zix=zix-1;
		}
	}
}

window.onload = over;
