//JSON (function(){ if('JSON'in window && JSON.stringify && JSON.parse){return;} if(!this.JSON){this.JSON={};}(function(){function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i'+ storageCFG.exceededMessage +''); } $('#swflocalstorageshim-wrapper').css({ top: $(window).scrollTop() + 20, left: ($(window).width() / 2) - ($('#swflocalstorageshim-wrapper').outerWidth() / 2) }); }, hide: function(success){ $('#swflocalstorageshim-wrapper') .css({top: '', left: ''}) .find('div.polyfill-exceeded-message') .remove() ; if(!success){ var err = new Error('DOMException: QUOTA_EXCEEDED_ERR'); err.code = 22; err.name = 'DOMException'; throw(err); } }, isReady: localStorageSwfCallback }; // $.webshims.swfLocalStorage.storageEvent = function(newVal, oldVal, url){ // // }; $.webshims.ready('DOM swfobject', function(){ if(runStart || (('localStorage' in window) && document.getElementById('swflocalstorageshim')) ){return;} runStart = true; if(window.swfobject && swfobject.hasFlashPlayerVersion('8.0.0')){ $('body')[$.browser.mozilla ? 'after' : 'append']('
'); swfobject.embedSWF($.webshims.cfg.basePath +'swf/localStorage.swf' +($.webshims.cfg.addCacheBuster || ''), 'swflocalstorageshim', '295', '198', '8.0.0', '', {allowscriptaccess: 'always'}, {name: 'swflocalstorageshim'}, function(e){ if(!e.success && !window.localStorage){ localStorageSwfCallback(); } }); clearTimeout(swfTimer); swfTimer = setTimeout(function(){ if(!('localStorage' in window)){ $.webshims.warn('Add your development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html'); } localStorageSwfCallback(); }, (location.protocol.indexOf('file') === 0) ? 500 : 9999); } else { localStorageSwfCallback(); } }); })(); })(); (function($){ if(navigator.geolocation){return;} var domWrite = function(){ setTimeout(function(){ throw('document.write is overwritten by geolocation shim. This method is incompatible with this plugin'); }, 1); }, id = 0 ; var geoOpts = $.webshims.cfg.geolocation.options || {}; navigator.geolocation = (function(){ var pos; var api = { getCurrentPosition: function(success, error, opts){ var locationAPIs = 2, errorTimer, googleTimer, calledEnd, endCallback = function(){ if(calledEnd){return;} if(pos){ calledEnd = true; success($.extend({timestamp: new Date().getTime()}, pos)); resetCallback(); if(window.JSON && window.sessionStorage){ try{ sessionStorage.setItem('storedGeolocationData654321', JSON.stringify(pos)); } catch(e){} } } else if(error && !locationAPIs) { calledEnd = true; resetCallback(); error({ code: 2, message: "POSITION_UNAVAILABLE"}); } }, googleCallback = function(){ locationAPIs--; getGoogleCoords(); endCallback(); }, resetCallback = function(){ $(document).unbind('google-loader', resetCallback); clearTimeout(googleTimer); clearTimeout(errorTimer); }, getGoogleCoords = function(){ if(pos || !window.google || !google.loader || !google.loader.ClientLocation){return false;} var cl = google.loader.ClientLocation; pos = { coords: { latitude: cl.latitude, longitude: cl.longitude, altitude: null, accuracy: 43000, altitudeAccuracy: null, heading: parseInt('NaN', 10), velocity: null }, //extension similiar to FF implementation address: $.extend({streetNumber: '', street: '', premises: '', county: '', postalCode: ''}, cl.address) }; return true; }, getInitCoords = function(){ if(pos){return;} getGoogleCoords(); if(pos || !window.JSON || !window.sessionStorage){return;} try{ pos = sessionStorage.getItem('storedGeolocationData654321'); pos = (pos) ? JSON.parse(pos) : false; if(!pos.coords){pos = false;} } catch(e){ pos = false; } } ; getInitCoords(); if(!pos){ if(geoOpts.confirmText && !confirm(geoOpts.confirmText.replace('{location}', location.hostname))){ if(error){ error({ code: 1, message: "PERMISSION_DENIED"}); } return; } $.ajax({ url: 'http://freegeoip.net/json/', dataType: 'jsonp', cache: true, jsonp: 'callback', success: function(data){ locationAPIs--; if(!data){return;} pos = pos || { coords: { latitude: data.latitude, longitude: data.longitude, altitude: null, accuracy: 43000, altitudeAccuracy: null, heading: parseInt('NaN', 10), velocity: null }, //extension similiar to FF implementation address: { city: data.city, country: data.country_name, countryCode: data.country_code, county: "", postalCode: data.zipcode, premises: "", region: data.region_name, street: "", streetNumber: "" } }; endCallback(); }, error: function(){ locationAPIs--; endCallback(); } }); clearTimeout(googleTimer); if (!window.google || !window.google.loader) { googleTimer = setTimeout(function(){ //destroys document.write!!! if (geoOpts.destroyWrite) { document.write = domWrite; document.writeln = domWrite; } $(document).one('google-loader', googleCallback); $.webshims.loader.loadScript('http://www.google.com/jsapi', false, 'google-loader'); }, 800); } else { locationAPIs--; } } else { setTimeout(endCallback, 1); return; } if(opts && opts.timeout){ errorTimer = setTimeout(function(){ resetCallback(); if(error) { error({ code: 3, message: "TIMEOUT"}); } }, opts.timeout); } else { errorTimer = setTimeout(function(){ locationAPIs = 0; endCallback(); }, 10000); } }, clearWatch: $.noop }; api.watchPosition = function(a, b, c){ api.getCurrentPosition(a, b, c); id++; return id; }; return api; })(); $.webshims.isReady('geolocation', true); })(jQuery);