//Клиент. Схлопывание/расхлопывание менюшки + изменение картинки рядом. см файл /xsl/units/catalogue/client/navigation.xslt
function OnMenuClick(SubMenuId, GlobalImagesPath)
	{
		var SubmenuTR = document.all[SubMenuId + '_groups'];
		var UpmenuImg = document.images[SubMenuId + '_pointer'];

		if (SubmenuTR)  {
		  if (SubmenuTR.style.display == "none")  {
			SubmenuTR.style.display = "inline";
			UpmenuImg.src= GlobalImagesPath + "minus.gif"
		  }
		  else  {
			SubmenuTR.style.display = "none";
			UpmenuImg.src= GlobalImagesPath + "plus.gif"
		  }
		}
}

//Обратная связь. Проверялка на заполнение формы заказа каталога 
function TestClientFormAndSend (UniqueID, eventArgument)
{
	var Name    = document.all[UniqueID + "_customer_name"].value;
	var Contact = document.all[UniqueID + "_customer_contact"].value;

	if ( (Name.length !=0 )&&(Contact.length!=0))
	{
		__doPostBack(UniqueID, eventArgument);
	}
	else
	{
		alert('Заполните пожалуйста поля \"Имя\" и \"Контактная информация\" \n ');
	}
}
//раздвигание меню или форума
function OnElementClickIE(nElementId, OpenImgSrc, CloseImgSrc)
{
	var pElementReply = document.all["ElementReply_" + nElementId.toString()];
	var pElementPic = document.all["ElementPic_" + nElementId.toString()];
	if (pElementReply && pElementPic)  {
	  if (pElementReply.style.display == "none")  {
			pElementReply.style.display = "inline";
			pElementPic.src = OpenImgSrc;
	  }
	  else  {
			pElementReply.style.display = "none";
			pElementPic.src = CloseImgSrc;
	  }
	}
}
//пересчет цен из usd в rub и обратно
function ChangeCurrency(ControlName, Currency, Count) {
	var CurrentCurrency = Currency;
	var AlternativeCurrency;
	if (CurrentCurrency == 'RUB') AlternativeCurrency = 'USD'; else AlternativeCurrency = 'RUB';
	document.getElementById('Currency' + CurrentCurrency).style.display = "inline";
	document.getElementById('Currency' + AlternativeCurrency).style.display = "none";
	for (i = 1; i <= Count; i++) {
		var pDetailPriceCurrent = document.getElementById(ControlName + '_DetailPrice_' + i + '_' + CurrentCurrency);
		pDetailPriceCurrent.style.display = "inline";
		var pDetailPriceAlternative = document.getElementById(ControlName + '_DetailPrice_' + i + '_' + AlternativeCurrency);
		pDetailPriceAlternative.style.display = "none";
	}

}
