

//при наведении мыши на строку
function line_over(obj)
{
	obj.className = 'line_over';
	
	child = obj.firstChild;
	while (child = child.nextSibling)
	{
		if (child.nodeName == 'A') child = child.firstChild;
		if (child.nodeName == 'IMG')
		{
			if (child.src.indexOf('sort_hide.gif') != -1) { child.src = path_to_img + 'sort.gif'; continue; }
			if (child.src.indexOf('eye_hide.gif') != -1) { child.src = path_to_img + 'eye.gif'; continue; }
			if (child.src.indexOf('eyesleep_hide.gif') != -1) { child.src = path_to_img + 'eyesleep.gif'; continue; }
			if (child.src.indexOf('delete_hide.gif') != -1) { child.src = path_to_img + 'delete.gif'; continue; }
			if (child.src.indexOf('delete2_hide.gif') != -1) { child.src = path_to_img + 'delete2.gif'; continue; }
			if (child.src.indexOf('star_hide.gif') != -1) { child.src = path_to_img + 'star.gif'; continue; }
			if (child.src.indexOf('starno_hide.gif') != -1) { child.src = path_to_img + 'starno.gif'; continue; }
		}
	}
}
//при уведении мыши со строки
function line_out(obj)
{
	obj.className = 'line';
	
	child = obj.firstChild;
	while (child = child.nextSibling)
	{
		if (child.nodeName == 'A') child = child.firstChild;
		if (child.nodeName == 'IMG')
		{
			if (child.src.indexOf('sort.gif') != -1) { child.src = path_to_img + 'sort_hide.gif'; continue; }
			if (child.src.indexOf('eye.gif') != -1) { child.src = path_to_img + 'eye_hide.gif'; continue; }
			if (child.src.indexOf('eyesleep.gif') != -1) { child.src = path_to_img + 'eyesleep_hide.gif'; continue; }
			if (child.src.indexOf('delete.gif') != -1) { child.src = path_to_img + 'delete_hide.gif'; continue; }
			if (child.src.indexOf('delete2.gif') != -1) { child.src = path_to_img + 'delete2_hide.gif'; continue; }
			if (child.src.indexOf('star.gif') != -1) { child.src = path_to_img + 'star_hide.gif'; continue; }
			if (child.src.indexOf('starno.gif') != -1) { child.src = path_to_img + 'starno_hide.gif'; continue; }
		}
	}
}
//нажание на плюс\минус
function plus_minus_click(num, img_pm, send, code)
{
	if (num < 1) return;
	
	img_folder = img_pm.nextSibling.nextSibling;
	if (img_folder.src.indexOf('folder.gif') != -1) // если закрыто
	{
		img_folder.src = path_to_img + 'folder_open.gif';
		img_pm.src = path_to_img + 'line_minus.gif';
		div_class = 'tline';
		if (lang == 'ru' && send == true) sendAction('addOpenMenuId', code + '&id=' + img_pm.getAttribute('_id') + '&lang=' + lang);
	}
	else // иначе, если открыто
	{
		img_folder.src = path_to_img + 'folder.gif';
		img_pm.src = path_to_img + 'line_plus_1.gif';
		div_class = 'tline_hide';
		if (lang == 'ru' && send == true) sendAction('delOpenMenuId', code + '&id=' + img_pm.getAttribute('_id') + '&lang=' + lang);
	}
	divline = img_pm.parentNode;
	i = 0; j = 0;
	while (divline = divline.nextSibling)
	{
		if (divline.nodeName == 'DIV')
		{
			if (j > 0)
				j--;
			else
			{
				if (div_class == 'tline') j = divline.getAttribute('count_childs');
				divline.className = div_class;
				
				if (div_class == 'tline_hide')
				{
					img_pm = divline.firstChild;
					while (img_pm = img_pm.nextSibling)
					{
						if (img_pm.nodeName == 'IMG' && img_pm.src.indexOf('line_minus.gif') != -1)
						{
							img_pm.src = path_to_img + 'line_plus_1.gif';
							img_pm.nextSibling.nextSibling.src = path_to_img + 'folder.gif';
							break;
						}
					}
				}
			}
			i++; if (i >= num) break;
		}
	}
}
