function swap(imgID, newImgName)
{
	var i = document.getElementById(imgID);
	i.src = "http://commprojects.jhsph.edu/research/map/_images/" + newImgName;
}

function buttonLookOn(dir)
{
	if (dir == 'up')
	{
		swap('upLeft', 'research_map_on_01-top.gif');
		swap('upMiddle', 'research_map_on_02-gh.gif');
		swap('upRight', 'research_map_on_03b.gif');
	}
	else if (dir == 'left')
	{
		swap('upLeft', 'research_map_on_01-left.gif');
		swap('leftMiddle', 'research_map_on_04.gif');
		swap('botLeft', 'research_map_on_07-left.gif');
	}
	else if (dir == 'down')
	{
		swap('botLeft', 'research_map_on_07-down.gif');
		swap('botMiddle', 'research_map_on_08-gh.gif');
		swap('botRight', 'research_map_on_09-down.gif');
	}
	else if (dir == 'right')
	{
		swap('upRight', 'research_map_on_03-right.gif');
		swap('rightMiddle', 'research_map_on_06.gif');
		swap('botRight', 'research_map_on_09-right.gif');
	}
}

function buttonLookOff(dir)
{
	if (dir == 'up')
	{
		swap('upLeft', 'research_map_01.gif');
		swap('upMiddle', 'research_map_02-gh.gif');
		swap('upRight', 'research_map_03.gif');
	}
	else if (dir == 'left')
	{
		swap('upLeft', 'research_map_01.gif');
		swap('leftMiddle', 'research_map_04.gif');
		swap('botLeft', 'research_map_07.gif');
	}
	else if (dir == 'down')
	{
		swap('botLeft', 'research_map_07.gif');
		swap('botMiddle', 'research_map_08-gh.gif');
		swap('botRight', 'research_map_09.gif');
	}
	else if (dir == 'right')
	{
		swap('botRight', 'research_map_09.gif');
		swap('rightMiddle', 'research_map_06.gif');
		swap('upRight', 'research_map_03.gif');
	}
}

function resizeToContent()
{
	var x = this.document.body.scrollHeight;
	if (x > parent.document.getElementById("cityFrame").height)
		parent.document.getElementById("cityFrame").height = x;
}
