
function showSubMenu(idx)
{
	var sm=document.getElementById("subMenu"+idx);
	if(sm)
	{
		sm.style.display="block"; 
		sm.style.zIndex="10";
	}
}

function hideSubMenu(idx)
{
	var sm=document.getElementById("subMenu"+idx);
	if(sm)
	{
		sm.style.display="none"; 
	}
}
function toggleHide(c,id)
{
	var d=document.getElementById(id);
	var srb=document.getElementById("search_results_box");
	if(d)
	{
		if(d.style.display=="none")
		{
			d.style.visibility="visible";
			d.style.display="block";
			c.innerHTML="[Hide]";
			srb.style.height="400px";
		}
		else
		{
			d.style.visibility="hidden";
			d.style.display="none";
			c.innerHTML="[Show]";
			srb.style.height="auto";
		}
	}
}

var lastRow=0;
function hiliteSmallRow(MLS,scroll)
{
	if(MLS==lastRow)
		return;
	if (lastRow != 0)
	{
		unhiliteLastRow();
		if(!scroll)
		{
			map.closeInfoWindow();
		}
	}
	lastRow=MLS;
	var id_a="a"+MLS;
	var r=document.getElementById(id_a);
	r.style.background="#4ea520";
	if(scroll)
	{
		r.scrollIntoView(0);
	}
	else
	{
		//open marker
		if(mlsMarkers[MLS])
		{
			var atabs=new Array();
			atabs[0]=new GInfoWindowTab("Details", mlsDescs[MLS][0]);//, onClick)
			atabs[1]=new GInfoWindowTab("Pictures", mlsDescs[MLS][1]);//, onClick)
			mlsMarkers[MLS].openInfoWindowTabsHtml(atabs);
			//hiliteSmallRow(point[3],1);
		}
		else
		{
			map.openInfoWindowHtml(map.getCenter(),'No map info is available for this property.');
		}
	}
}

function unhiliteLastRow()
{
	var id_a="a"+lastRow;
	document.getElementById(id_a).style.background="transparent";
}

function nextResults()
{
	var f=document.getElementById("busSearch");
	var ns=parseInt(f.start.value);
	f.start.value=ns+10;
	f.submit();
}
function prevResults()
{
	var f=document.getElementById("busSearch");
	var ns=parseInt(f.start.value);
	f.start.value=Math.max(0,ns-10);
	f.submit();
}
