// JScript File
//This returns the seconds from epoch for the timezone opposed to seconds from epoch for GMT/UTC
function TimeServer_Control(timezone) {
        this.time = null;
	this.timezone = timezone;
	this.heirinit = function() {
		this.ajax.async=false;
		//This could be called before Page Object init called thus we won't know the page, but it should call sitemakr_client.cgi
		this.execute('FetchSiteLocalTime&timezone=' + this.timezone,this.handler);
	}
	this.handler = function(text,me) {
//need to pass me which is just 'this' but it gets lost cuz of scope when TimeOut executed
		me.time=text;
		if(!(me.time.toString().match(/^(\d)*$/))) {alert('Error accessing time from server.')}
		//alert(me.time);
	}
    this.heircleanup = function(controlObject) {
    }
}

TimeServer_Control.prototype = new ControlClass;

