function homeOver(img) {
	img.src = 'http://' + location.host + '/slices/' + img.id + '_on.jpg'
}

function homeOut(img) {
	img.src = 'http://' + location.host + '/slices/' + img.id + '.jpg'
}

function showFloorMenu(area) {
	$('floor-menu').src = 'http://' + location.host + '/images/' + area.id + '.jpg'
	$('floor-menu').style.visibility = 'visible'
}

function floorPlanMenu(area, display) {
	leftMenu(area)

	area = $('left-menu')

	var h = getRealLeft(area)
	var v = getRealTop(area)
	if (isSafari) {
		v += window.pageYOffset
	}

	var fm = $('floor-menu')
	fm.style.visibility = 'visible'
}

function lwpMenu(id) {
	$('lwp-menu').src = 'http://' + location.host + '/slices/' + id + '_04.jpg'
}

function leftMenu(area) {
	$('left-menu').src = 'http://' + location.host + '/slices/' + area.id + '_03.jpg'
	$('floor-menu').style.visibility = 'hidden'
}

function rightMenu(area) {
	// Default area
	if (area == null) {
		area = $(cur_rmenu)
	}

	var re = new RegExp("([0-9]+),([0-9]+),[ ]*([0-9]+),([0-9]+)")
	var coords = re.exec(area.coords)
	
	// Position the highlighted menu
	var ind = $('rm-ind').style
	ind.height = (coords[4] - coords[2]) + 'px'
	ind.top = (coords[2] - 0 + 1) + 'px'
	ind.visibility = 'visible'
}

function snapRightMenu() {
	rightMenu($(cur_rmenu))
}

function snapLwpMenu() {
	lwpMenu(cur_lwpmenu)
}

function snapLeftMenu() {
	$('left-menu').src = cur_leftmenu
}

function snapFloorMenu() {
	$('floor-menu').style.visibility = 'hidden'
}

if ((location.pathname != '/index.html') && (location.pathname != '/')) {
	if ((ua.indexOf('msie 6') != - 1) || (location.search == '?gif')) {
		$('nav-img').src = 'http://' + location.host + '/images/nav.gif'
	}
	else {
		$('nav-img').src = 'http://' + location.host + '/images/nav.png'
	}

	// Map the page to the selected menu
	var rselect = new Array()
	rselect['/history.html'] = 'history'
	rselect['/office-lofts.html'] = 'office-lofts'
	rselect['/work.html'] = 'office-lofts'
	rselect['/parking-contact-info.html'] = 'office-lofts'
	rselect['/play.html'] = 'urban-village'
	rselect['/firestone-alley-renderings.html'] = 'urban-village'
	rselect['/site-map.html'] = 'urban-village'
	rselect['/arena-district-map.html'] = 'location'
	rselect['/wide-area-map.html'] = 'location'
	rselect['/location.html'] = 'location'
	rselect['/news.html'] = 'news'
	rselect['/contact.html'] = 'contact'

	// Current right menu to select
	var cur_rmenu = rselect[location.pathname]
	if (cur_rmenu == null) {
		cur_rmenu = 'lofts'
	}

	// Selected LWP menu
	var cur_lwpmenu = 'history'
	if (cur_rmenu == 'lofts') {
		cur_lwpmenu = 'live'
	}
	else if (cur_rmenu == 'office-lofts') {
		cur_lwpmenu = 'work';
	}
	else if (cur_rmenu == 'urban-village') {
		cur_lwpmenu = 'play';
	}

	// Point to the current menus
	rightMenu($(cur_rmenu))
	lwpMenu(cur_lwpmenu)
	var cur_leftmenu = $('left-menu').src
}