function LawyerDetails(directionControls)
{
	this.Items = [];
	this.CurrentOfficeIndex = 0;
	this.CurrentOffice = "";
	
	this.DirectionControls = directionControls;
	
	this.SelectOffice = function(index)
	{
		var lbl = $get("MapOfficeLabel_" + index);
		var a = this.Items[index];
		
		var radio = $get("MapOffice_" + index);
		if (radio && !radio.checked)
			radio.checked = true;
		
		var spans = $get('_addressDetails').getElementsByTagName('span');
		
		for (var i=0; i<spans.length; i++)
		{
			var span = spans[i];
			var text = a[span.id.substr(1)];
			span.innerHTML = (text) ? text : "";
		}
		
		this.CurrentOfficeIndex = index;		
		this.CurrentOffice = lbl.innerHTML;
		
		var state_code = this.Items[index].state_code;
		var stateDropDown = $get(this.DirectionControls.StateId);
		
		for (var i=0; i<stateDropDown.options.length; i++)
		{
			if (stateDropDown.options[i].value == state_code)
			{
				stateDropDown.selectedIndex = i;
				break;
			}
		}
	}
	
	this.AddAddress = function(address)
	{
		this.Items.push(address);
	}
	
	this.FindDirection = function()
	{
		var stateDropDown = $get(this.DirectionControls.StateId);
		var address = $get(this.DirectionControls.AddressId).value;
		var city = $get(this.DirectionControls.CityId).value;

		var from = "";
		if (address)
			from += address + ", ";
		if (city)
			from += city + ", ";
		
		from += stateDropDown.options[stateDropDown.selectedIndex].value;
			
		var dirDiv = $get('_directions');
		dirDiv.innerHTML = '';	
		
		g_map.GetDirections(from, this.CurrentOffice, dirDiv, 
			function() { $get('tdPrintDirection').style.display = 'none'; },
			function() { $get('tdPrintDirection').style.display = ''; });
	}
}

/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/

//Enter "frombottom" or "fromtop"
var verticalpos = "fromtop"

function JSFX_FloatTopDiv(x, y) {
	var startX = x || 300, startY = y || 300;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id) {
		var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.layers[id];
		if (d.layers) el.style = el;
		el.sP = function(x, y) { this.style.left = x; this.style.top = y; };
		el.x = startX;
		if (verticalpos == "fromtop")
			el.y = startY;
		else {
			el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
			el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft = function() {
		if (verticalpos == "fromtop") {
			var pY = ns ? pageYOffset : document.body.scrollTop;
			ftlObj.y += (pY + startY - ftlObj.y) / 8;
		}
		else {
			var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
			ftlObj.y += (pY - startY - ftlObj.y) / 8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("divStayTopLeft");
	stayTopLeft();
}
