<!--
// check browsers
var ua = navigator.userAgent;
var opera = /opera [56789]|opera\/[56789]/i.test(ua);
var ie = !opera && /MSIE/.test(ua);
var ie50 = ie && /MSIE 5\.[01234]/.test(ua);
var ie6 = ie && /MSIE [6789]/.test(ua);
var ieBox = ie && (document.compatMode == null || document.compatMode != "CSS1Compat");
var moz = !opera && /gecko/i.test(ua);
var nn6 = !opera && /netscape.*6\./i.test(ua);

// od nothing
function doNothing()
{
	returnValue  = false;
}

// hide and move a frame
function hideFrame(oFrame)
{
	oFrame.style.visibility='hidden'
	oFrame.style.left = "-2000px";
}

// function to show a calendar
function showCalendar(calendar_field, date_type, return_function, framed, currentValue)
{	
	var oFrame = document.getElementById("float_frame");

	oFrame.contentWindow.calShowCalendar(calendar_field,date_type,framed,currentValue)

	oFrame.style.visibility = "visible";
		
	if (return_function)
		oFrame.return_function = return_function;
			
	// centre in browser	
	centreMe(oFrame);
		
	// bring the frame to top	
	floatToTop(oFrame);	

}

// bring a floating frame to top
function floatToTop(oFrame)
{
  
	oFrame.style.zIndex = 5000;	
	var oFrames = document.all.item("float_frame");		
	if (oFrames && oFrames.length)
		for(i = 0; i < oFrames.length; i++)
		{
			if (oFrames[i] != oFrame)
				oFrames[i].style.zIndex = 1000;
		}

}

// function to centre an item in the windo
function centreMe(obj)
{
	var scrollPos = getScrollPos();

	obj.style.top = (document.body.clientHeight - obj.clientHeight + scrollPos.top)/2  + "px";
	obj.style.left = (document.body.clientWidth - obj.clientWidth + scrollPos.left)/2 + "px";

}

function getScrollPos() 
{
	return {
		left:	(ie ?
					(ieBox ? document.body.scrollLeft : document.documentElement.scrollLeft) :
					window.pageXOffset
				),
		top:	(ie ?
					(ieBox ? document.body.scrollTop : document.documentElement.scrollTop) :
					window.pageYOffset
				)
	};
}
//-->