define(["Ti/_/Evented","Ti/_/lang"],function(e,n){function t(e){"online"===e.type&&!r&&(r=1),"offline"===e.type&&r&&(r=0),N.fireEvent("change",{networkType:N.networkType,networkTypeName:N.networkTypeName,online:r})}var o=navigator.connection,r=navigator.onLine,N=n.setObject("Ti.Network",e,{constants:{NETWORK_LAN:1,NETWORK_MOBILE:3,NETWORK_NONE:0,NETWORK_UNKNOWN:-1,NETWORK_WIFI:2,networkType:function(){return r?o&&o.type==o.WIFI?N.NETWORK_WIFI:o&&o.type==o.ETHERNET?N.NETWORK_LAN:!o||o.type!=o.CELL_2G&&o.type!=o.CELL_3G?N.NETWORK_UNKNOWN:N.NETWORK_MOBILE:N.NETWORK_NONE},networkTypeName:function(){return r?o&&o.type==o.WIFI?"WIFI":o&&o.type==o.ETHERNET?"LAN":!o||o.type!=o.CELL_2G&&o.type!=o.CELL_3G?"UNKNOWN":"MOBILE":"NONE"},online:function(){return r}},properties:{httpURLFormatter:null},createHTTPClient:function(e){return new(require("Ti/Network/HTTPClient"))(e)},decodeURIComponent:function(e){return decodeURIComponent(e)},encodeURIComponent:function(e){return encodeURIComponent(e)}});return require.on(window,"online",t),require.on(window,"offline",t),N});