/*
Основное меню для CMS системы
*/



// Начало меню
function CMS_MainMenu_GetBegin()
{
	document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr>");
}



// Конец меню
function CMS_MainMenu_GetEnd()
{
	document.write("<td width=\"1%\">&nbsp;</td></tr></table>");
}



// Элемент меню
function CMS_MainMenu_GetItem(piId, psName, psUrl, psDesc, psTarget, psIconURL, psIconWidth, psIconHeight, pbIsCurrMenuItem, pbIsFirstPage)
{
	document.write("<td height=\"25\" align=\"center\" ");
	if(pbIsCurrMenuItem) 
	    document.write("><table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"25\"" +
		 "><tr><td height=\"1\" background=\"/images/element.gif\">" +
		 "<img src=\"/images/dot.gif\" height=\"1\" width=\"1\"></td></tr><tr><td align=\"center\">" +
		 CMS_MenuItem_GetIcon(piId,  psName, psIconWidth, psIconHeight) +
		 "&nbsp;<a href=" + psUrl + " title='" + psDesc + "' target='" + psTarget + "' class=\"menu\" " +
		 ">" + psName + "</a>&nbsp;</td></tr><tr><td height=\"1\" background=\"/images/element.gif\"><img src=\"/images/dot.gif\" height=\"1\" width=\"1\"></td></tr></table></td><td width=\"1\"><img src=\"/images/marker.gif\"></td>");
	else
		document.write(">" + CMS_MenuItem_GetIcon(piId,  psName, psIconWidth, psIconHeight) +
			"&nbsp;<a href=" + psUrl + " title='" + psDesc + "' target='" + psTarget + "' class=\"menu\"" +
			 "><u>" + psName +
			 "</u></a>&nbsp;</td><td width=\"1\"><img src=\"/images/marker.gif\"></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 "";
}