function FermaRicercaMapControl(map) { 
  this.map_ = map; 
}

/**
 * @private
 */
FermaRicercaMapControl.prototype = new GControl(true, false);


/**
 * @private
 * @desc Initializes the GControl. Creates the HTML and styles.
 * @return {Element}
 */
FermaRicercaMapControl.prototype.initialize = function() {
    var container_ = document.createElement('div');
    container_.innerHTML = '<a id="idLinkFerma" href="#"><b>FERMA LA RICERCA</b></a>';
    container_.id = "divFerma";
    container_.style.display = "none";
    container_.style.padding = "10px"
    container_.style.zIndex = "9999";
    //container_.style.fontSize = "0.8em";
    //container_.style.height = "1.3em";
    container_.style.border = "solid 1px black";
    container_.style.backgroundColor = "#FFFFDD";
    this.map_.getContainer().appendChild(container_);
    return container_;
};


/**
 * @private 
 * @desc Return the default position for the control
 * @return {GControlPosition}
 */
FermaRicercaMapControl.prototype.getDefaultPosition = function () {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(100, 80));
};


/**
 * Creates a progress bar control on the given map, with the given options.
 *
 * @constructor
 * @param {GMap2} Map object
 */
function FermaRicercaControl(map) {
  this.control_ = new FermaRicercaMapControl(map);
  this.map_ = map;
  this.map_.addControl(this.control_);
  this.link_ = document.getElementById('idLinkFerma');
  this.link_.onclick = function() {
      this.parentNode.style.display = 'none'
      return false;
  }
  this.container_ = document.getElementById('divFerma');
}

FermaRicercaControl.prototype.mostra = function () {
  this.container_.style.display = "block";
};


/**
 * @desc Remove control.
 */
FermaRicercaControl.prototype.remove = function () {
  this.container_.style.display = 'none';
};


FermaRicercaControl.prototype.isVisible = function() {
    if (this.container_.style.display === 'none') {
        return false;
    } else {
        return true;
    }
};
