FUNCTION find_sertsw,event,found
  common TV_SCALE, NAME,WINDOW,IX,NX,IY,NY,SX,SY,MX,MY,JX,JY,DATA
  Widget_CONTROL,event.id,Get_VALUE=originator_window
  
  found=0
  
  IF N_elements(window) eq 0 THEN return,0
  
  candidates = where(window eq originator_window $
             and event.x ge jx and event.x lt (jx + mx) $
             and event.y ge jy and event.y lt (jy + my),count)
  
  IF count eq 0 THEN BEGIN
      found=0
      return,0
  END
  
  IF count gt 1 THEN BEGIN
      cdsnotify,group=event.top,'More than one window met the criteria'
      w = [candidates(count-1)]
  END ELSE w = candidates
  
  ixw  = (reform(ix(w)))(0)
  iyw  = (reform(iy(w)))(0)
  nxw  = (reform(nx(w)))(0)
  nyw  = (reform(ny(w)))(0)
  sertsw = {SERTSW, name:!D.name,window:originator_window,$
              ix:float(ixw),nx:float(nxw),$
              iy:float(iyw),ny:float(nyw)}
  found = 1
  return,sertsw
  
END