// Browser detection snippets

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

// If NS -- that is, !IE -- then set up for mouse capture
if (isNS4) {document.captureEvents(Event.MOUSEMOVE);}

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
	var posx = 0;
	var posy = 0;

// Main function to retrieve mouse x-y pos.s
function getMouseXY(e)
{
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX;
		posy = e.clientY;
		if (isIE4 || isIE5)
		{
			posx += document.body.scrollLeft;
			posy += document.body.scrollTop;
		}
	}
	if (posx < 0){posx = 0;}
	if (posy < 0){posy = 0;}
	// posx and posy contain
	// the mouse position relative to the document
	// Do something with this information
	return true
}
/*
function openEvent(monthId)
{
	if(isNS6)
	{
		//alert("PsX:" + posx);
		document.getElementById(monthId).style.top = posy + "px";
		document.getElementById(monthId).style.left = (posx)-150 + "px";
		document.getElementById(monthId).style.visibility = "visible";
	}
	else if(isIE4 || isIE5)
	{
		document.all[monthId].style.top = posy + "px";
		document.all[monthId].style.left = (posx)-150 + "px";
		document.all[monthId].style.visibility = "visible";
	}
	else if(isNS4)
	{
		document.layers[monthId].visibility = "show";
		document.layers[monthId].top = posy;
		document.layers[monthId].left = (posx)-150;		
	}
}
*/
function openEvent(classid,month,day,yr)
{
	id = "class="+classid+"&month="+month+"&day="+day+"&yr="+yr;
	window.open('event_win.php?'+id,'eventWin','width=500,height=200,resizable=yes,scrollbars=yes');
}

function closeEvent(monthId)
{
	if(isNS6)
	{
		document.getElementById(monthId).style.visibility = "hidden";
	}
	else if(isIE4 || isIE5)
	{
		document.all[monthId].style.visibility = "hidden";
	}
	else if(isNS4)
	{
		document.layers[monthId].visibility = "hide";
	}
}

function tdColor(id,color)
{
	id.style.background = "#" + color;
}

function mapOpen()
{
	window.open("map.htm","map","width=478,height=434");
}

function extWin(url)
{
	window.open(url,"newwin","width=640,height=420,resizable=yes,scrollbars=yes");
}
