google.load("maps", "2.x"); google.setOnLoadCallback(function() { Array.prototype.inArray = function (value) { // Returns true if the passed value is found in the // array. Returns false if it is not. var i; for (i=0; i < this.length; i++) { if (this[i] == value) { return true; } } return false; }; if(google.loader.ClientLocation) { var permittedCountries = []; //defines a new array which contains the countries which are permitted //to view this site var permittedCountries = ["CA", "US", "UM"]; //The ISO code of the countries permitted see http://www.iso.org/iso/iso-3166-1_decoding_table var cl = google.loader.ClientLocation; geo_location = [cl.address.country_code]; //alert(geo_location); if(permittedCountries.inArray(geo_location)) //jp mod: 28 June 2009 | updated to function opposite to US version { document.getElementById('location_message').style.display = 'block'; } //document.getElementById('loc').innerHTML = geo_location; } else { } } ); function hideLocationMessage() { document.getElementById('location_message').style.display = 'none'; }