// JavaScript to be included in all pages


if (readCookie("tzSeconds") != getTzSeconds())
{
	writeCookie("tzSeconds", getTzSeconds(), 3600*24*180);
}


function getTzSeconds()
{
	// returns the difference in seconds between local time and Greenwich Mean Time (GMT), including Daylight Saving Time
	return -(new Date()).getTimezoneOffset()*60;
}


function readCookie(name)
{
	var cookieValue = "";
	var search = name + "=";

	if(document.cookie.length > 0)
	{ 
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{ 
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	
	return cookieValue;
}


function writeCookie(name, value, seconds)
{
	var expire = "";
	
	if(seconds != null)
	{
		var exp_date = new Date((new Date()).getTime() + seconds * 1000);
		expire = "; expires=" + exp_date.toGMTString();
	}
	
	document.cookie = name + "=" + escape(value) + expire + "; path=/";
}


function myChangeProperty()
{
	var args=myChangeProperty.arguments;
	for (i=0; i<(args.length); i+=3)
		eval('document.getElementById("'+args[i]+'").style.'+args[i+1]+' = "'+args[i+2]+'";');
}



function myOpenBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}
