
function SetHeight()
{
	var iHeightOfset = 150;
	try
	{
		var iHeight = oText.clientHeight - TopHeight.clientHeight - BotHeight.clientHeight + iHeightOfset;
		if (iHeight < 320)
			iHeight = 320;
		if (iHeight > 0 && MidHeight != null)
			MidHeight.height = iHeight;
			
	}catch(e){}
}
function SetParentHeight()
{
	window.parent.SetFrameHeight();
}

function ShowComment(sHiddId,sShowId)
{
	var oToHidd = document.all[sHiddId];
	var oToShow = document.all[sShowId];
	
	oToHidd.style.display = 'none';
	oToShow.style.display = '';
}
function GotoComment(iIndex)
{
	var sParent = document.getElementById("ItemParent").value;
	var sType = document.getElementById("ItemType").value;
	var sLng = document.getElementById("ItemLng").value;
	var sUrl = "?Parent="+sParent+"&Type="+sType+"&Lng="+sLng
	switch (iIndex){
		case 1: //add a comment
			var oWin = window.open("BJComment.aspx"+sUrl,"Comment","width=420,height=429,left=200,top=100,statusbar=no,toolbar=no,menubar=no,location=no");
			oWin.focus();
			break;
		case 2: // Print
			var sHtml = document.getElementById("BJerusaText").innerHTML; 
			var oWin = window.open("BJPrint.htm","Print","statusbar=no,toolbar=no,menubar=yes,location=no");
			for (var i=0;i<1000;i++){if(oWin.document.body != null) break;}
			oWin.WriteData(sHtml);
			oWin.document.execCommand('Print');
			oWin.close();
			break;
		case 3: // Send this page to a friend
			var oWin = window.open("BJNewsSend.aspx"+sUrl,"Send","width=420,height=429,left=200,top=100,statusbar=no,toolbar=no,menubar=no,location=no");
			oWin.focus();
			break;
	}
}