obips.TimeZones=function(){};obips.TimeZones.TimeZone=function(c,d,a,b){this.id=c;this.name=d;this.stdAbbrev=a;this.dstAbbrev=b};obips.TimeZones.TimeZone.prototype.clone=function(){return new obips.TimeZones.TimeZone(this.id,this.name,this.stdAbbrev,this.dstAbbrev)};obips.TimeZones.TimeZone.parseJSON=function(b){var a=new obips.TimeZones.TimeZone(b.id,b.name,b.abbrvNameSTD,b.abbrvNameDST);return a};obips.TimeZones.TimeZone.prototype.getUTCOffset=function(){return this.id.substring(4,this.id.indexOf(")"))};obips.TimeZones.TimeZone.prototype.getUTCOffsetByMinutes=function(){var a=this.getUTCOffset();var b=a.split(":");var d=[];for(var c=0;c<b.length;c++){if(b[c]!=""&&b[c]!=null){d.push(parseInt(b[c],10))}}if(d.length==0){return 0}else{if(d.length==1){return d[0]}else{if(d[0]>0){return d[0]*60+d[1]}else{return d[0]*60-d[1]}}}return};obips.TimeZones.TimeZone.prototype.toXSDTimeZoneString=function(){var a=this.getUTCOffset();var b=(a!="")?a:"Z";return b};obips.TimeZones.sort=function(f,d){var g=0;var e=f.getUTCOffset();var c=d.getUTCOffset();if(e.substr(0,1)=="-"&&c.substr(0,1)!="-"){g=-1}else{if(e.substr(0,1)=="-"){if(e<c){g=1}else{if(e>c){g=-1}}}else{if(e.substr(0,1)=="+"&&c.substr(0,1)!="+"){g=1}else{if(e.substr(0,1)=="+"){if(e>c){g=1}else{if(e<c){g=-1}}}else{if(c.substr(0,1)=="+"){g=-1}else{if(c.substr(0,1)=="-"){g=1}else{if(f.id>d.id){g=1}else{if(f.id<d.id){g=-1}}}}}}}}return g};obips.TimeZones.Manager=function(){var f=obips.getSingleton(obips.TimeZones.Manager.SINGLETON_NAME);if(f){return f}this.list=new Array();var e=new saw.ajax.Request(saw.commandToURL("getTimezoneInfo"));var d=saw.ajax.createConnection(e);d.setSync(true);var a=d.post();if(a.errors){throw new Error(saw.ajax.collapseErrors(a.errors))}var b=a.response.getJSON();if(b){for(var c=0;c!=b.length;++c){var g=obips.TimeZones.TimeZone.parseJSON(b[c]);this.list.push(g)}this.list.sort(obips.TimeZones.sort)}globalRegister.addObject(obips.TimeZones.Manager.SINGLETON_NAME,this)};obips.TimeZones.Manager.SINGLETON_NAME="timeZonesManager";obips.TimeZones.Manager.getSingleton=function(){return new obips.TimeZones.Manager()};obips.TimeZones.Manager.prototype.getTimeZoneByID=function(c){var a=null;for(var b=0;b<this.list.length;b++){var d=this.list[b];if(d.id==c){a=d;break}}return a};