/* SIMPLE */

var rootLeftSeparator = '<tr>\n';
rootLeftSeparator += '<td width=1 bgcolor=#989898>\n';
rootLeftSeparator += '<img src=images/pixels/t_pixel.gif width=1 height=1><br>\n';
rootLeftSeparator += '</td>\n';
rootLeftSeparator += '<td width=28 bgcolor=#989898>\n';
rootLeftSeparator += '<img src=images/pixels/t_pixel.gif width=28 height=1><br>\n';
rootLeftSeparator += '</td>\n';
rootLeftSeparator += '<td width=104 bgcolor=#989898>\n';
rootLeftSeparator += '<img src=images/pixels/t_pixel.gif width=104 height=1><br>\n';
rootLeftSeparator += '</td>\n';
rootLeftSeparator += '<td width=7 bgcolor=#989898>\n';
rootLeftSeparator += '<img src=images/pixels/t_pixel.gif width=7 height=1><br>\n';
rootLeftSeparator += '</td>\n';
rootLeftSeparator += '<td width=1 bgcolor=#989898>\n';
rootLeftSeparator += '<img src=images/pixels/t_pixel.gif width=1 height=1><br>\n';
rootLeftSeparator += '</td>\n';
rootLeftSeparator += '</tr>\n';

function renderRoot_left(menu, lng) {
	var str='<table width=142 border=0 cellpadding=0 cellspacing=0 background="">\n',
		event, isPar, target, m=itemsList[menu], count=1, className,
		x=(isNN4)?'"100"':(isOpera)?'"p.x+p.w-3"':'"p.x+p.w"',
		y=(isOpera)?'"p.y-3"':'"p.y-1"';
	for (var i in m) {
		if (m[i].level==0) {

			isPar=m[i].children.length;
			event=' onmouseover=over("'+m[i].id+'",event,'+m[i].level+','+x+','+y+') onmouseout=out("'+m[i].id+'")';
			(m[i].inNewWindow=='true') ? target=' target=_blank' : target='';

			str+=rootLeftSeparator;
			if(curTarget == 'news' && m[i].text == 'НОВОСТИ') {
				className='curLeftM';
			} else if(curTarget == 'equipment' && m[i].text == 'ОБОРУДОВАНИЕ'){
				className='curLeftM';
			} else {
				className='leftM';
			}
			str+='<tr id='+top+m[i].id+event+' class='+className+'><td width=1 class=border><img src=images/pixels/t_pixel.gif width=1 height=1><br></td>';
			str+='<td width=28><img src=images/pixels/t_pixel.gif width=28 height=24><br></td>';
			str+='<td width=104><img src=images/pixels/t_pixel.gif width=104 height=1><br>';
			str+='<a'+target+event+((m[i].url!='')?(' href="'+m[i].url+'&lng='+lng+'"'):'')+' class=topmenu1>'+m[i].text+'</a>';
			str+='<br></td>';
			if(isPar>0) {
				str+='<td width=8 valign=bottom><nobr><img src=images/arrows/leftmenu1.gif width=7 height=7><img src=images/pixels/t_pixel.gif width=1 height=1></nobr><br><img src=images/pixels/t_pixel.gif width=1 height=1><br></td>';
			} else {
				str+='<td width=8 valign=bottom><img src=images/pixels/t_pixel.gif width=7 height=1><br></td>';
			}
			str+='<td width=1 class=border><img src=images/pixels/t_pixel.gif width=1 height=1><br></td></tr>';
			count++;
		}
	}
	str+=rootLeftSeparator;
	str+='</table>';
	document.write(str);
}

var subLeftSeparator = '<tr>\n';
subLeftSeparator += '<td width=1 bgcolor=#989898>\n';
subLeftSeparator += '<img src=images/pixels/t_pixel.gif width=1 height=1><br>\n';
subLeftSeparator += '</td>\n';
subLeftSeparator += '<td width=5 bgcolor=#989898>\n';
subLeftSeparator += '<img src=images/pixels/t_pixel.gif width=5 height=1><br>\n';
subLeftSeparator += '</td>\n';
subLeftSeparator += '<td width=200 bgcolor=#989898>\n';
subLeftSeparator += '<img src=images/pixels/t_pixel.gif width=200 height=1><br>\n';
subLeftSeparator += '</td>\n';
subLeftSeparator += '<td width=8 bgcolor=#989898>\n';
subLeftSeparator += '<img src=images/pixels/t_pixel.gif width=8 height=1><br>\n';
subLeftSeparator += '</td>\n';
subLeftSeparator += '<td width=1 bgcolor=#989898>\n';
subLeftSeparator += '<img src=images/pixels/t_pixel.gif width=1 height=1><br>\n';
subLeftSeparator += '</td>\n';
subLeftSeparator += '</tr>\n';

function renderSub_left(menu,lng) {
	var str, event, target, row, list, isPar, m=itemsList[menu], count,
		x=(isNN4)?'"p.x+50"':(isOpera)?'"p.x+p.w-2"':'"p.x+p.w"',
		y=(isOpera)?'"p.y-3"':'"p.y-1"';
	for (var i in m) {
		if (m[i].children.length>0) {
			list=m[i].children;
			count=1; // для индикации первого элемента, на случай если рендеринг для него отличается
			str='<div id='+sub+m[i].id+' class=popup>';
			str+='<table width=215 border=0 cellpadding=0 cellspacing=0 background="">';
			for (var j=0; j<list.length; j++) {

				isPar=m[list[j]].children.length;
				(m[list[j]].inNewWindow=='true') ? target=' target=_blank' : target='';
				event=' onmouseover=over("'+m[list[j]].id+'",event,'+m[list[j]].level+','+x+','+y+') onmouseout=out("'+m[list[j]].id+'")';

				str+=subLeftSeparator;
				str+='<tr id='+top+m[list[j]].id+event+' class=subLeftM><td width=1 class=border><img src=images/pixels/t_pixel.gif width=1 height=1><br></td>';
				str+='<td width=5><img src=images/pixels/t_pixel.gif width=5 height=24><br></td>';
				str+='<td width=200><img src=images/pixels/t_pixel.gif width=200 height=1><br>';
				str+='<a'+target+event+
					((m[list[j]].url!='')?(' href="'+m[list[j]].url+'&lng='+lng+'"'):'')+
					'>'+m[list[j]].text+'</a>';
				str+='<br></td>';
				if(isPar>0) {
					str+='<td width=8 valign=bottom><nobr><img src=images/arrows/leftmenu1.gif width=7 height=7><img src=images/pixels/t_pixel.gif width=1 height=1></nobr><br><img src=images/pixels/t_pixel.gif width=1 height=1><br></td>';
				} else {
					str+='<td width=8 valign=bottom><img src=images/pixels/t_pixel.gif width=7 height=1><br></td>';
				}
				str+='<td width=1 class=border><img src=images/pixels/t_pixel.gif width=1 height=1><br></td></tr>';
				count++;
			}
			str+=subLeftSeparator;
			str+='</table>';
			str+='</div>';
			document.write(str);
		}
	}
}

