//timezone offset in sec
function getUserTimezoneOffset(){
	var userDate = new Date();
	var tzoffset = userDate.getTimezoneOffset()*(-60);
	return tzoffset;
}

function saveUserTimezoneOffset(offset){
	var ajaxreq;
	if (window.XMLHttpRequest) {
		ajaxreq = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		ajaxreq = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	str = "sel=settimezone&offset="+offset;
	ajaxreq.open("POST", SERVER+SITE_ROOT+'/index.php?rnd='+Math.random(), true);
	ajaxreq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8 ');
	ajaxreq.setRequestHeader("Content-length", str.length);
    ajaxreq.setRequestHeader("Connection", "close");
    ajaxreq.send(str);	
}

