// JavaScript Document

var timeout	= 100;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id) {
	mcancelclosetime();
	if(ddmenuitem) {
		ddmenuitem.style.visibility = 'hidden';
	}
	if (document.getElementById(id)) {
		ddmenuitem = document.getElementById(id);
		ddmenuitem.style.visibility = 'visible';
		document.body.style.cursor = 'pointer'
	}
	dditem = document.getElementById(id + 'b');
}

// close showed layer
function mclose() {
	if(ddmenuitem) {
		ddmenuitem.style.visibility = 'hidden';
  		document.body.style.cursor = 'default'
	}
}

// go close timer
function mclosetime() {
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime() {
	if(closetimer) {
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

function tdOver(it) {
  document.body.style.cursor = 'pointer'
  it.style.color = "#d3bb1c";
}

function tdOut(it) {
  document.body.style.cursor = 'default'
  it.style.color = "#ffffff";
}

function tdGo(it) {
	if (it.substring(0,7) == "http://") {
		document.location = it;
	} else {
		document.location = "http://selecttrees.com/pgs/" + it;
	}
}

function highlight(it) {
	document.body.style.cursor = 'pointer'
	it.style.color = "#276204";
}

function lowlight(it) {
	document.body.style.cursor = 'default'
	it.style.color = "#444";
}

