function loanOfficersMap(mouseState, whereAt)
{
	if (document.getElementById && mouseState)
	{
		if ((mouseState == 'over') && whereAt)
		{
			changeMapsTo(mouseState, whereAt);
		}
		else if (mouseState == 'out')
		{
			changeMapsTo('off');
		}	
		else if ((mouseState == 'click') && whereAt)
		{
			swapMapsTo(whereAt);
			return false;
		}
	}
	else
	{
		return true;
	}
}

if('undefined' == typeof bloginfo_tpldir) var bloginfo_tpldir = 'wp-content/themes/accglending.com/';

var lomDefault = new Image();
var lomNorthwest = new Image();
var lomNortheast = new Image();
var lomSouth = new Image();

lomDefault.src = bloginfo_tpldir+"/images/loanofficers_map_off.gif";
lomNorthwest.src = bloginfo_tpldir+"/images/loanofficers_map_northwest.gif";
lomNortheast.src = bloginfo_tpldir+"/images/loanofficers_map_northeast.gif";
lomSouth.src = bloginfo_tpldir+"/images/loanofficers_map_south.gif";

function changeMapsTo(mouseState, whereAt)
{
	var lomObjDefault = document.getElementById('loanOfficersMapDefault');
	var lomObjNorthwest = document.getElementById('loanOfficersMapNorthwest');
	var lomObjNortheast = document.getElementById('loanOfficersMapNortheast');
	var lomObjSouth = document.getElementById('loanOfficersMapSouth');
	
	if (mouseState == 'over')
	{
		if (whereAt == 'south')
		{
			lomObjDefault.src = lomSouth.src;
			lomObjNorthwest.src = lomSouth.src;
			lomObjNortheast.src = lomSouth.src;
			lomObjSouth.src = lomSouth.src;
		}
		else if (whereAt == 'northwest')
		{
			lomObjDefault.src = lomNorthwest.src;
			lomObjNorthwest.src = lomNorthwest.src;
			lomObjNortheast.src = lomNorthwest.src;
			lomObjSouth.src = lomNorthwest.src;
		}
		else if (whereAt == 'northeast')
		{
			lomObjDefault.src = lomNortheast.src;
			lomObjNorthwest.src = lomNortheast.src;
			lomObjNortheast.src = lomNortheast.src;
			lomObjSouth.src = lomNortheast.src;
		}
	}
	else
	{
			lomObjSouth.src = lomSouth.src;
			lomObjNorthwest.src = lomNorthwest.src;
			lomObjNortheast.src = lomNortheast.src;
			lomObjDefault.src = lomDefault.src;
	}
}



function swapMapsTo(whichToSwapTo)
{
	document.getElementById("southProfile").style.display = ((whichToSwapTo == "south") ? ("block") : "none");
	document.getElementById("northeastProfile").style.display = ((whichToSwapTo == "northeast") ? "block" : "none");
	document.getElementById("northwestProfile").style.display = ((whichToSwapTo == "northwest") ? "block" : "none");
	document.getElementById("defaultProfile").style.display = ((whichToSwapTo == "default") ? "block" : "none");
	//alert("swapMapsTo('" + whichToSwapTo + "Profile')");
}

