var PAGE_OFFSET_TOP = 281; //292;
var PAGE_OFFSET_LEFT = 93; //282 -3; it was 279
var hideTimeout = null;

var targetURL = null;

function navigateMap()
{
	if(!targetURL) return false;
	
	window.location.href = targetURL;
	return false;
}

function mapOver(area)
{
	dir = 'locations/';
	ext = '.php';
	targetURL = area.href;
	url = area.href
	region = url.substring((url.indexOf(dir) + dir.length), url.indexOf(ext));
	coords = url.substr(url.indexOf('?') +1).split(',');
	mapClearTimeout();
	
	regionView = region.toUpperCase();
	switch (regionView)
	{
		case "COSTARICA":
			regionView = "COSTA RICA";
			break;
		case "SRILANKA":
			regionView = "SRI LANKA";
			break;
		case "NEWZEALAND":
			regionView = "NEW ZEALAND";
			break;
		case "SOUTHAFRICA":
			regionView = "SOUTH AFRICA";
			break;
		case "HONGKONG":
			regionView = "HONG KONG";
			break;
	}
	content = document.getElementById('lText').innerHTML= regionView;
	
	l = document.getElementById('lRollover');
	l.style.top = PAGE_OFFSET_TOP + parseInt(coords[1]);
	l.style.left = PAGE_OFFSET_LEFT + parseInt(coords[0]);
	l.style.visibility = 'visible';
	
}

function mapOut(area)
{
	mapSetTimeout();
}

function mapClearTimeout()
{
	hideTimeout = clearTimeout(hideTimeout);
}

function mapSetTimeout()
{
	if(document.layers) {
		if(l = document.layers['lRollover']) {
			hideTimeout = setTimeout('document.layers[\'lRollover\'].visibility = \'hidden\'', 100);
		}
	} else if(document.all) {
		if(l = document.all.lRollover) {
			hideTimeout = setTimeout('document.all.lRollover.style.visibility = \'hidden\'', 100);
		}
	} else if(document.getElementById) {
		if(l = document.getElementById('lRollover')) {
			hideTimeout = setTimeout('document.getElementById(\'lRollover\').style.visibility = \'hidden\'', 100);
		}
	}
}