google.load("maps", "2");

var Glat;
var Glng;

function geolocateGoogle() {
// google IP based native location
    if (google.loader.ClientLocation) {
          Glat = google.loader.ClientLocation.latitude;
          Glng = google.loader.ClientLocation.longitude;

          city = google.loader.ClientLocation.address.city;
          country = google.loader.ClientLocation.address.country_code;

          document.getElementById("geolocation").innerHTML = city + "<br/>"+country;
          jQuery('#lat').html(Glat);
          jQuery('#lng').html(Glng);
//          jQuery('#weatherlat').html(getWeatherFormat(Glat));
//          jQuery('#weatherlng').html(getWeatherFormat(Glng));
    }
 return [Glat,Glng];
// google IP based native location
}

//function getWeatherFormat(latOrlng){
//    latOrlng = latOrlng +""; // change int to string
//    var weatherFormat = latOrlng.replace(".","");
//    strLength = weatherFormat.length;
//    numberOfDigits = 8;
//    while (strLength<numberOfDigits){
//      weatherFormat = weatherFormat + "0";
//      strLength++;
//    }
//    return weatherFormat;
//}

