

function checkTimeZoneSettings()
{
	now = new Date();

	// code to work out if the user is experiencing daylight savings
	// should work for both northern and southern hemispheres
	// would be much easier with built in DST function!!

	// current year for use in date creation
	y = now.getYear();

	// get the timezone at new years eve and 1st june
	midYear = new Date(y,6,1); // June 1st
	midYearOffset = midYear.getTimezoneOffset();

	endYear = new Date(y,12,31); // Dec 31st
	endYearOffset = endYear.getTimezoneOffset();

	dst = 0;
	// if both are the same, no DST at user time zone
	if(midYearOffset != endYearOffset)
	{
		// find out which time offset is larger
		dstOffset = endYearOffset;
		if(midYearOffset < endYearOffset) dstOffset = midYearOffset;

		// now if the current offset is equal to DST, then it's daylight savings!
		if(dstOffset == now.getTimezoneOffset()) dst = 1;
	}

	getElemById("clienttimedst").value = dst; // update DST
	getElemById("clienttimeoffset").value = now.getTimezoneOffset(); // hours from GMT
}