function ToOderDetail (UniqueID)
{ 
  var DetailCheckbox    = document.getElementById(UniqueID);
  DetailCheckbox.checked =true;
}

///Открывание поиска в новом окне
function BeginSearch() {
	var Query = document.getElementById("query_textfield");
	PopupWindow('viewer.aspx?obj=localsearch&q=' + escape(Query.value) + '&s=' + document.getElementById('SiteId').value);				
}
//Обратная связь. Проверялка на заполнение формы заказа каталога 
function TestClientFormAndSend (UniqueID, eventArgument)
{
 
	var CustomerName    = document.getElementById(UniqueID +"_Customername");
	var CustomerContact = document.getElementById(UniqueID + "_Customercontact");
	if ((CustomerName.value != "") && (CustomerContact.value != ""))
		__doPostBack(UniqueID, eventArgument);
	else
		alert('Заполните пожалуйста поля \"Имя\" и \"Контактная информация\" \n ');
}

//Показывание диалога для неаутентифицированных пользователей
function ShowRegDialog() {
	var pDialog = document.getElementById("dialog");
	if(pDialog != null) pDialog.style.display = "block";
}

//Скрытие диалога для неаутентифицированных пользователей
function HideRegDialog() {
	var pDialog = document.getElementById("dialog");
	if(pDialog != null) pDialog.style.display = "none";
}

	
//раздвигание меню или форума
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";
	}

}
