maggot.load('tooltip.js');
maggot.ready(function(){
  maggot.tooltip.width = 400;
  maggot('a.viewlink').map(function(a){
    maggot.attach(a,'onclick',function(e){
      e = maggot.event(e);
      window.open(a.href, 'wndView', 'width=' + screen.availWidth + ',height=' + screen.availHeight + ',left=0px,top=0px,status,resizable,scrollbars,resizable').focus();
      return e.stop();
    });
    if(a.title) {
      maggot.tooltip(a);
    }
  });
  maggot('a.viewfiles').map(function(a){
    maggot.attach(a,'onclick',function(e){
      e = maggot.event(e);
      window.open(a.href, 'wndFiles', 'width=450px,height=150px,scrollbars,status,resizable').focus();
      return e.stop();
    });
  });
});
