
// The following script is used to hide the calendar whenever you click the document.
// When using it you should set the name of popup button or image to "popcal", otherwise the calendar won't show up.

document.onmousedown=function(e){
	if (!self.gfPop) return;
	var n=!e?self.event.srcElement.name:e.target.name;
	if (document.layers) {
		with (gfPop) var l=pageX, t=pageY, r=l+clip.width, b=t+clip.height;
		if (n!="popcal"&&(e.pageX>r||e.pageX<l||e.pageY>b||e.pageY<t)) gfPop.fHideCal();
		return routeEvent(e);	// must use return here.
	} else if (n!="popcal") gfPop.fHideCal();
}
if (document.layers) document.captureEvents(Event.MOUSEDOWN);

