function execXhr(e,i,n){if(isOnline()){var r=e.getUrl;Ti.API.info("-- getUrl is: "+r);var t,t=new XMLHttpRequest({mozSystem:!0});t.open("GET",r,!0),t.onreadystatechange=function(){if(200===t.status&&4===t.readyState){var e=JSON.parse(t.response);i(e)}},t.onerror=function(){Ti.API.error("xhr error"),n()},t.send()}else Ti.API.error("Device is offline"),n&&n({title:"",tagline:""})}var Alloy=require("alloy"),_=require("alloy/underscore")._,isOnline=function(){return Ti.Network.online?(Ti.API.info("device online"),!0):(Ti.API.info("device offline"),!1)},getData=function(e,i,n){execXhr(e,i,n)};exports.isOnline=isOnline,exports.getData=getData;