function maamarLeft(currentSite,currentEntityCd)
{
	var leftPath = top.frames["leftIframe"].document;
	
	switch ( currentSite )
	{
		case 1 :	//mabat

			//	hide the ticker and some of the items in the right menu.

			//	Only load the left side if it wasn't loaded already.
			if ( leftPath.getElementById("maamarimLeft") == null )
			{
				hideMabat('index.asp?classto=maamarimL');
			}
			hideAndShowDiv(currentSite,currentEntityCd);
			break;

		case 4 :	//Roim Olam

			//	Only load the left side if it wasn't loaded already.
			if ( leftPath.getElementById("leftList") == null )
			{
				top.document.getElementById("leftIframe").src='index.asp?classto=davarL';
				//top.frames["leftIframe"].document.location.replace('index.asp?classto=davarL');
			}
			break;

		case 5 :	//Globus

			//	Only call the function if there are maamarim on the left side.
			if ( leftPath.getElementById("maamarimList") != null )
			{
				if ( leftPath.getElementById("maamarimList").style.display == 'none' )
				{
					switchFrames(1,currentEntityCd);
				}
			}
			break;

		default :

			//	Only load the left side if it wasn't loaded already.
			if ( leftPath.getElementById("maamarimLeft") == null )
			{
				top.document.getElementById("leftIframe").src='index.asp?classto=maamarimL';
				//top.frames["leftIframe"].document.location.replace('index.asp?classto=maamarimL');
			}
			hideAndShowDiv(currentSite,currentEntityCd);
			break;
	}
			
	setScroolUp();
}
		
function hideAndShowDiv(currentSite,currentEntityCd)
{
//	if this is mabat then ALL the maamarim should show.
//	otherwise, only show the maamarim of the particular site.

	var leftPath = top.frames["leftIframe"].document;
	var numLnks = top.frames["leftIframe"].totalLnks;
	var indx;
	var lnkSiteCd;
	var lnkEntityCd;
	
	for (indx=0; indx<numLnks; indx++)
	{
		lnkSiteCd = leftPath.getElementById("maamarDivInput" + indx).value;
		lnkEntityCd = leftPath.getElementById("maamarDivEntityCd" + indx).value;

		if ( currentSite == 1 || lnkSiteCd == currentSite )
		{
			if ( lnkEntityCd != currentEntityCd )
			{
				leftPath.getElementById("maamarDiv" + indx).style.display = '';
			}
			else
			{
				leftPath.getElementById("maamarDiv" + indx).style.display = 'none';
			}
		}
		else
		{
			leftPath.getElementById("maamarDiv" + indx).style.display = 'none';
		}
	}
}
