(function($){
	if(typeof(jambu) === 'undefined'){jambu = {};}
	if(typeof(jambu.third_party) === 'undefined'){jambu.third_party = {};}
	if(typeof(jambu.third_party.google) === 'undefined'){jambu.third_party.google = {};}
	if(typeof(jambu.third_party.google.maps) === 'undefined'){jambu.third_party.google.maps= {};}
	jambu.third_party.google.maps.geocoder = new google.maps.Geocoder();
	jambu.third_party.google.maps.geocode = function(address, callback){
		var geocoder = jambu.third_party.google.maps.geocoder;
			if (geocoder){
				geocoder.geocode({ 'address': address}, function(response, status){
//console.log({response: response[0].geometry.bounds});
				jambu.webapps.find_a_store.data['google'] = response;
					if(status == google.maps.GeocoderStatus.OK){
						callback(response);
					}else{
						callback({"error" : {"msg":"Unable To Find Lat/Long for information provided", "status": status}});
					}
				});
			}else{
				callback({"error" : {"msg":"Geocoder not working", "status": "n/a"}});
			}
	};
})(jQuery);

