﻿
//geoip_country_code();
//geoip_country_name();
//geoip_city();
//geoip_region();
//geoip_region_name();
//geoip_latitude();
//geoip_longitude();
    //geoip_postal_code();
function ObtenerLocalizacion() {
    var _objetoGeolocalizacion = new Geolocalizacion();
        _objetoGeolocalizacion.iniciarGeolocalizacion();
        return _objetoGeolocalizacion;
    }

 function Geolocalizacion () {

     this.Ciudad;
     this.Estado;
     this.iniciarGeolocalizacion = function () {

         if (google.loader.ClientLocation.address != null) {
             this.Ciudad = google.loader.ClientLocation.address.city;
         } else if (geoip_city() != null) {
             this.Ciudad = geoip_city(); 
         } else {
             this.Ciudad = "Miami";
         }

         if (google.loader.ClientLocation.address != null) {
             this.Estado = google.loader.ClientLocation.address.region;
         } else if (geoip_region() != null) {
             this.Estado = geoip_region_name();
         } else {
             this.Estado = "FL";
         }
     };

 }


