/*
	Разные полезные функции
*/

//Common. Замена картинки  
function ChangeImgSrc(sImgName, sValue) {
	var oImage = document.images[sImgName];
	if (oImage != null)  {
	  oImage.src = sValue;
	}
}

//раздвигание меню или форума
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;
	  }
	}
}

//Проверка на нажатие enter
function TestKeyPressOnEnter(UniqueID){
	if (event.keyCode == 13) {
		document.all[UniqueID].focus();
		document.all[UniqueID].click();
	}
}

//открытие popupwindow
function PopupWindow(url)
{
	window.open( url , null, 'status=no,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes');
}