_sv_act_init();

function _sv_act_init() {
  var x;
  _sv.init_sv_action = init_sv_action;

  _sv.load_function(_l_load,10);

/* ***
**  sv_type = 'action'
**
**  El elemento contiene un hipervínculo.
**
**  sv_conf :
**
**    status : Es un texto que debe aparecer en la barra de estado al ser apuntado con el
**             ratón.
**
**    value :  Describe hacia donde deber ir el enlace. En principio es un array, pero si
**             éste sólo va a tener un único elemento entoces basta ponerlo tal cual y
**             el script generará automaticamente el array con ese único elemento.
**
**             El primer valor del array puede ser:
**
**             Una función en cuyo caso se ejecutará pasándole como parámetros:
**
**             - El objeto svEvent.
**             - El array sv_conf.value.
**             - El objeto sv_conf.
**
**    enter : Igual que value, pero la accion se desencadena cuando entra el ratón.
**    leave : Igual que value, pero la accion se desencadena cuando sale el ratón.
**
*/

  function init_sv_action(o) {
    var c,d,v,s;
    c = o.getAttribute("sv_conf");
    if(_sv.is_emp(c)) { c=''; }
    o._sv_conf = new Object();
    d = o._sv_conf;
    _sv.parse_atts(c,d);
    v=(d.value)?d.value:[];
    if(typeof(v)!='object') v=[v];
    if(!d.status)d.status=false;
    if(!d.mode)d.mode=2;
    if(!d.target)d.target=false;
    d.value=v;
    _sv.add_event_handler(o, 'm_enter', hme);
    _sv.add_event_handler(o, 'm_leave', hml);
    _sv.add_event_handler(o, 'm_down', hmd);
    _sv.add_event_handler(o, 'm_click', hmc);
  }

  function hmd(e) {
    e.stop();
  }

  function hme(e) {
    var t,cc;
    t = e.target;
    if(t._sv_conf) {
      cc = t._sv_conf;
      t.style.cursor = 'pointer';
      //window.status = cc.status;
      if(cc.status) {
        window.status = cc.status;
      }
      if(cc.pointer_class) {
        if(!t._sv_act_clas) {
          t._sv_act_clas = t.className;
        }
        t.className = cc.pointer_class;
      }
    }
  }

  function hml(e) {
    var t,cc;
    t = e.target;
    if(t._sv_conf) {
      cc = t._sv_conf;
      if(cc.status) {
        window.status = '';
      }
    }
    if(t._sv_act_clas) {
        t.className = t._sv_act_clas;
    }
  }

  function hmc(e) { //# FALTA: Ahora supone siempre que el primer índice del array
                    //#        values es una función.
                    //# return w.confirm("¿Seguro que desea borrar esta fila?");

    var t,c,v,w,x,f;
    if(!e.button) {
      t=e.self;
      c=t._sv_conf;
      v=c.value;
      x=e.target_window;
      if(c.target) {          //# FALTA: Ahora si se especifica una ventana TARGET para el
        x=x.parent[c.target]; //# enlace solo se busca en la ventana padre de la actual.
                              //# Tal vez debería implementar otra forma buscar la ventana.
        e.user_window =
        e.target_window = x;
      }
      if(c.confirm) {
        if(!x.confirm(c.confirm)) {
          return;
        }
      }
      if(e.shiftKey) {
        w = window.open();
        e.user_window = w;
      }
      v[0](e,v,c);
      e.kill();
    }
  }

  function _l_load() {
  }

}
