/*
Основное меню для CMS системы
*/



// Начало меню
function CMS_MainMenu_GetBegin()
{
	document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td colspan=\"100\" height=\"1\" bgcolor=\"#9C9894\"><img src=\"images/dot.gif\"></td></tr><tr>");
}



// Конец меню
function CMS_MainMenu_GetEnd()
{
	document.write("</tr><tr><td colspan=\"100\" height=\"1\" bgcolor=\"#9C9894\"><img src=\"images/dot.gif\"></td></tr></table>");
}



// Элемент меню
function CMS_MainMenu_GetItem(piId, psName, psUrl, psDesc, psTarget, psIconWidth, psIconHeight, pbIsCurrMenuItem, pbIsFirstPage)
{
	document.write("<td height=\"20\" align=\"center\" width=\"21%\"");
	if(pbIsCurrMenuItem) document.write(" bgcolor=\"#EAE8E5\">" +
		 CMS_MenuItem_GetIcon(piId,  psName, psIconWidth, psIconHeight) +
		 "<nobr>&nbsp;<a href=" + psUrl + " title='" + psDesc + "' target='" + psTarget + "'><font class=\"menu\">" + psName + "</font></a>&nbsp;</nobr></td><td width=\"1\" bgcolor=\"#9C9894\"><img src=\"images/dot.gif\" width=\"1\" height=\"1\"></td>");
	else
		document.write(">" + CMS_MenuItem_GetIcon(piId,  psName, psIconWidth, psIconHeight) +
			"<nobr>&nbsp;<a href=" + psUrl + " title='" + psDesc + "' target='" + psTarget + "'><font class=\"menu\"><u>" + psName +
			 "</u></font></a>&nbsp;</nobr></td><td width=\"1\" bgcolor=\"#9C9894\"><img src=\"images/dot.gif\" width=\"1\" height=\"1\"></td>");

}



// Формирование кода для иконки меню
function CMS_MenuItem_GetIcon(piId,  psName, psIconWidth, psIconHeight)
{
/*	// Параметры иконки на главную страницу
	HomeIconPath = "images/marker.gif";
	HomeIconWidth = "1";
	HomeIconHeight = "16";


	if (piId == 0 && HomeIconPath != "")
		return "<img src=\"" + HomeIconPath + "\" width=\"" + HomeIconWidth + "\" height=\"" + HomeIconHeight + "\" alt=\"" + psName + "\">";
	else if (psIconWidth != "")
		return "<img src=\"image.aspx?iconId=" + piId + "\" width=\"" + psIconWidth + "\" height=\"" + psIconHeight + "\" alt=\"" + psName + "\">";
	*/	
	return "";
}