;+
; NAME        : EIT_SUB_UTIL_OFF
;
; PURPOSE     : Indicate the EIT subfield offset subfield with "nubbies".
;
; CATEGORY    : EIT Subfield
;
; EXPLANATION :
;
; SYNTAX      : 
;
; EXAMPLES    : none
;
; CALLED BY   :
;
; CALLS TO    : none
;
; ARGURMENTS  :	none
;
; KEYWORDS    : none
;
; OUTPUTS     : none
;
; COMMON      : none
;
; RESTRICTIONS: none
;
; SIDE EFFECTS: none
;
; PROJECT     : SOHO - EIT
;
; HISTORY     : V1,  Elaine Einfalt (HSTX)
;
; CONTACT     : eit@xanado.nascom.nasa.gov
;-

pro EIT_SUB_UTIL_OFF, $
			old_offset 	= old_offset, 	$
		      	sub_ids		= sub_ids,	$
			substruc	= substruc

 ;
 ; Get the new offset that may be modified by the previous addition or 
 ; subtraction of blocks.  
 ; Also get the locs readout area coords for maximum extent of sub_ids
 ;
 locs_coords = 1
 new_offset = EIT_SUB_GETOFF(sub_ids, locs_coords=locs_coords)

 if n_elements(locs_coords) ne 1 then $
    ; Rewrite the Subfield tool's locs coord for extent of readou area
    widget_control, substruc.locs_label_id, $
		set_value= strtrim(locs_coords(0),2) + ',' + $
			   strtrim(locs_coords(1),2) + '/' + $
			   strtrim(locs_coords(2),2) + ',' + $
			   strtrim(locs_coords(3),2) $
 else  widget_control, substruc.locs_label_id, set_value = 'none'



 ; When the old offset is no longer highlighted then erase it's "nubbies"

 if sub_ids(old_offset) eq 0 then $

       EIT_SUB_UTIL_NUB, (old_offset mod 32)*substruc.pix_per, $
		(31-(old_offset/32 mod 32))*substruc.pix_per, $
	     	0, /top, /bottom, /left, /right, pix_per=substruc.pix_per


 ; When a new offset is not one of the highlighted blocks 
 ; then draw just then "nubbies" in the block that is the new offset.

 if sub_ids(new_offset) eq 0 then $

    EIT_SUB_UTIL_NUB, (new_offset mod 32)*substruc.pix_per, $
		(31-(new_offset/32 mod 32))*substruc.pix_per, $
	     	1, /top, /bottom, /left, /right, pix_per=substruc.pix_per



 if new_offset ne old_offset then begin	

    substruc.offset = new_offset

;1997/1/27  removed this and gave its ID to "LOCS COORD:"
;    ; Rewrite the Subfield tool's offset value
;    widget_control, substruc.offset_label_id,	$		
;     	   		set_value=EIT_SUB_CONVOFF(offset=new_offset,/text)

    ; Rewrite the main Science Plan's offset (if present)
    if substruc.main_offset_id ne -1 then $
	   widget_control, substruc.main_offset_id, $
;1997/6/25	     set_value=EIT_SUB_CONVOFF(offset=new_offset,/text)
	             set_value=strtrim(new_offset,2)

 endif

return
end
