// Navigation
var current = "";
var list = ["practice-areas", "our-people", "about-law-partners", "languages-we-speak", "testimonials", "contact-us"];
function unfloat(sect)
{
	var i;
	for(i=0; i<list.length; i++) $("[class=float_col][id=" + list[i] + "]").hide();
	
	// Bring in new
	$("[class=floating]").show();
	current = "[class=float_col][id=" + sect + "]";
	$(current).show();
}
function float()
{
	if(current.length > 0)
	{
		$("[class=floating]").hide();
		$(current).hide();
		current = "";
	}
}

// Repairs
function is_child_of(a, b) 
{
	if(b != null) 
	{			
		while(b.parentNode) 
		{
			if((b = b.parentNode) == a) return true;
		}
	}
	
	return false;
}
function mo_repair(elem, event, js) 
{
	var current_mouse_target = null;
	if(event.toElement) current_mouse_target = event.toElement;
	else if(event.relatedTarget) current_mouse_target = event.relatedTarget;
	if(!is_child_of(elem, current_mouse_target) && elem != current_mouse_target) eval(js);
}

function printImage(src)
{
	
	var win = window.open('');
	win.document.write('<title>Map</title><img src="' + src + '" alt="image not found" />');
	
	
	win.print();
	
	//win.close();
}

function showMap(src)
{
	
	var db = $("[class=lighter]");
	var imgbox = $("[id=imgbox]");
	imgbox.html("<img src='" + src + "' alt='map' />");
	db.fadeIn();
}
function closeMap()
{
	$("[class=lighter]").fadeOut();
}

function swap(src, target)
{
	$('#' + target).attr('src',src);

}

function cleartxt(name)
{
	name.value = "";
}
function replacetxt(name)
{
	name.value = name.defaultValue;
}
