  function ShowNote() {
    notebox=$('#notebox');
    notebox.show();
  }

  function HideNote() {
    notebox=$('#notebox');
    notebox.hide('fast');
  }

  function SaveNote(key) {
   note=$('#note').val();
   date=$('#date').val();
   $.post('/admin/notes/'+key+'/save/',
    { note: note, date:date },
    function(data){
      data=eval(data);
      if(data[0].status=='ok'){
        $("#notif").show();
        $("#notif").animate({ dummy: 1 }, 600).hide('fast');
      }
    });
  }

  function Marcar2(marker, point,texto) {
    if (marker) {
      map.removeOverlay(marker);
    } else {
      map.removeOverlay(marcadoractual);
      marcadoractual=new GMarker(point);
      map.addOverlay(marcadoractual);
      if(texto!=''){
        marcadoractual.openInfoWindowHtml(texto);
    }
      strpoint=point.toString().substring(1,point.toString().length-1);
      $('#coordinates').val(strpoint);
    }
  }

  function showAddress(address) {
    geocoder.getLatLng(
      address,
      function(point) {
        if (!point) {
          alert(address + " not found");
        } else {
          map.setCenter(point, 13);
          Marcar2(false,point,address);
        }
      }
    );
  }

  function BuscarDireccion() {
    var textobusqueda=$('#fieldaddress').val();
    showAddress(textobusqueda);
  }
