function toggleThaiArea(show) {
	document.getElementById('thai_area').style.display = (show) ? '' : 'none';
}

/**
 * find the position of an element on the page
 * to use for floating divs...
 */
function findPos(obj) 
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

/**
 * enable the next click to close any popups that we have open
 */
function setBodyClickHandler()
{
	document.onclick = function (event) {
		closePopups();
	}
}

/**
 * close any open popups...
 */
function closePopups()
{
	for (key in openPopups)
	{
		openPopups[key].className = "popup";
	}
	document.onclick = function(){};
	openPopups = new Array();
}

var openPopups = new Array();
/**
 * show a popup window...
 */
function showPopup(anchor, popupName)
{
	var popup = document.getElementById(popupName);
	if (openPopups.length > 0)
	{
		closePopups();
	}
	popup.className = "popupOver"
	position = findPos(anchor);
	//alert(position);
	popup.style.left = (popupName == 'popupwhere') ? (position[0]-30)+"px" : (position[0]+15)+"px";
	popup.style.top = position[1]+"px";
	openPopups[openPopups.length] = popup;
	setTimeout("setBodyClickHandler()", 1);
}

function toggleMoreInfo()
{
	var moreInfo = document.getElementById("moreinfo");
	if (moreInfo.style.display == "block")
	{
		moreInfo.style.display = "none";
	}
	else
	{
		moreInfo.style.display = "block";
	}
}