window:
	res:
		windowType	wstandard
	endres:
endwindow:
close:
	res:
		bitmapPath	$(bitmaps)
		bitmapFile	CLOSE::CBM
	endres:
endclose:
title:
	res:
		leftLabel	ѥ
		leftKanjiFont	$(kanjiFont)
		leftFont	$(kanaFont)
		rightLabel	$(SENDMAIL_CF)
		rightKanjiFont	$(kanjiFont)
		lrightont	$(kanaFont)
		switch $(COLOR)
			case MONO:
				bitmapPath	$(bitmaps)
				backgroundFile	GRAY3
				transparent	false
				break
		endswitch
	endres:
endtitle:
dialog: dialogs
	res:
		defaultDistance		#(fWidth)
		dialogType		modeless
		defaultButton		select
	endres:
	ditem: msg
		res:
			itemType	bitmap
			label		'ѥפ򤷤Ʋ'
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
		endres:
	endditem:
	ditem: main-00
		res:
			itemType	radio
			fromVert	msg
			vertDistance	#(fWidth)*2
			horizDistance	#(fWidth)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			label		(ᥤ)
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put main $(type)
			endswitch
		endact:
	endditem:
	ditem: sub-00
		res:
			itemType	radio
			fromVert	main-00
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			font		$(kanaFont)
			kanjiFont	$(kanjiFont)
			label		()
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put sub $(type)
			endswitch
		endact:
	endditem:
	ditem: domain_label
		res:
			itemType	bitmap
			fromVert	sub-00
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			label		ɥᥤ̾
		endres:
	endditem:
	ditem: domain
		res:
			itemType	text
			fromVert	sub-00
			fromHoriz	domain_label
			vertDistance	#(fWidth)
			horizDistance	4
			length		32
			width		#(fWidth)*32+4
			height		#(fHeight)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			shadowWidth	0
			borderWidth	2
			focus
			string		$(MAILDOMAIN_TMP)
		endres:
		act:
			put $(line)
			put $(line)@0 $(MAILDOMAIN_TMP)
		endact:
	endditem:
	ditem: no-00
		res:
			itemType	radio
			fromVert	domain_label
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			label		ä(̤)
			shadowWidth	0
			switch $(COLOR)
				case MONO:
					background	white
					foreground	black
					highlightBack	white
					highlightFore	black
					selectedBack	white
					selectedFore	black
					selhighBack	white
					break
				default:
					background	#c5c5c5
					highlightBack	#c5c5c5
					selectedBack	#c5c5c5
					break
			endswitch
		endres:
		act:
			put $(value)
			switch #(value)
				case 1:
					put off $(type)
			endswitch
		endact:
	endditem:
	ditem: select
		res:
			itemType	button
			fromHoriz	msg
			vertDistance	#(fWidth)
			horizDistance	#(fWidth)*2
			kanjiFont	$(kanjiFont)
			font		$(kanaFont)
			label		'  '
		endres:
		act:
			switch $(type)
				case sub:
					switch $(YP)
						case server:
						case client:
							job ready
							break
						default:
							put 1 $(menu_no)
							$(sub) = sub $(menu)/sub ++48++48
							trap $(sub) sub
							break
					endswitch
					break
				case off:
					put 2 $(menu_no)
					put 'mailconf Ԥʤޤ' $(confirm_msg1)
					$(confirm) = sub $(commonPath)/yesno1 ++48++48
					buzzer
					trap $(confirm) confirm
					break
				default:
					job ready
					break
			endswitch
		endact:
	endditem:
enddialog:
proc: pre
	put 0 $(menu_no)
	put '' $(remote_host)
	put 'ݥαѥ׻' $(cmdName)
	global $(mailconf)
	global $(desc)
	global $(mst)
	put on $(mapped)
	put off $(opened)
	put $(MAILDOMAIN) $(MAILDOMAIN_TMP)
endproc:
proc: close
	switch $(ONRUN)
		case on:
			quit
	endswitch
	job off
	close
endproc:
proc: off
	switch #(menu_no)
		case 1:
			close $(sub)
			break
		case 2:
			close $(confirm)
			break
	endswitch
	local $(mailconf)
	local $(desc)
	local $(mst)
endproc:
proc: open
	setval main-00 selected false
	setval sub-00 selected false
	setval no-00 selected false
	switch $(MAIL_MODE)
		case main:
			setval main-00 selected true
			break
		case sub:
			setval sub-00 selected true
			break
		case off:
			setval no-00 selected true
			break
	endswitch
	switch $(YP)
		case *server:
		case client:
			setval domain sensitive false
			break
		default:
			setval domain sensitive true
			break
	endswitch
endproc:
proc: sub
	switch $(remote_host)
		case '':
			put 0 $(menu_no)
			quit
		default:
			job ready
			break
	endswitch
endproc:
proc: ready
	put 101 $(menu_no)
	put on $(ONRUN)
	put 1 $(cmd)
	put $(MAILDOMAIN_TMP) $(MAILDOMAIN)
	$(onrun) = sub $(commonPath)/onrun ++48++48
	$(pid) = bg $(etc)/Mail/Smail.sh $(type) $(MAILDOMAIN) $(remote_host)
	$(bgstat) = trap $(pid) cmd_end
endproc:
proc: confirm
	switch $(answer)
		case ok:
			put 1 $(menu_no)
			$(sub) = sub $(menu)/mailconf ++48++48
			trap $(sub) mailconf
			break
		default:
			job ready
			break
	endswitch
endproc:
proc: mailconf
	switch $(mailconf)
		case off:
			job ready
			quit
	endswitch
	put 101 $(menu_no)
	put on $(ONRUN)
	put 2 $(cmd)
	$(onrun) = sub $(commonPath)/onrun ++48++48
	$(pid) = bg $(etc)/Mail/Smail.sh conf $(desc) $(mst)
	$(bgstat) = trap $(pid) cmd_end
endproc:
proc: cmd_end
	close $(onrun)
	put 102 $(menu_no)
	switch $(mapped)
		case on:
			job bgdone
			break
		default:
			put on $(opened)
			break
	endswitch
	buzzer
endproc:
proc: bgdone
	switch #(bgstat)
		case 0:
			put $(type) $(MAIL_MODE)
			switch #(cmd)
				case 1:
					switch $(YP)
						case server:
						case client:
							put 'ΣɣӥޥݥݥС¦ǥ꤬' $(confirm_msg1)
							put 'ʤƤ뤳ȤǧƲ' $(confirm_msg2)
							$(n_end) = sub $(commonPath)/normalEnd2 ++48++48
							break
						default:
							$(n_end) = sub $(commonPath)/normalEnd ++48++48
							break
					endswitch
					break
				default:
					$(n_end) = sub $(commonPath)/normalEnd ++48++48
					break
			endswitch
			trap $(n_end) n_end
			break
		default:
			put 'mailconf ǥݤȯޤ' $(confirm_msg1)
			$(n_end) = sub $(commonPath)/error1 ++48++48
			trap $(n_end) n_err
			break
	endswitch
endproc:
proc: n_end
	put off $(ONRUN)
	put 0 $(menu_no)
	job off
	close
endproc:
proc: n_err
	put off $(ONRUN)
	put 0 $(menu_no)
endproc:
proc: unmap
	switch #(menu_no)
		case 1:
			unmap $(sub)
			break
		case 2:
			unmap $(confirm)
			break
		case 101:
			unmap $(onrun)
			break
		case 102:
			unmap $(n_end)
			break
	endswitch
	put off $(mapped)
endproc:
proc: map
	switch #(menu_no)
		case 1:
			raise $(sub)
			map $(sub)
			break
		case 2:
			move $(confirm)
			raise $(confirm)
			map $(confirm)
			break
		case 101:
			move $(onrun)
			raise $(onrun)
			map $(onrun)
			break
		case 102:
			switch $(opened)
				case on:
					job bgdone
					break
				default:
					move $(n_end)
					raise $(n_end)
					map $(n_end)
					break
			endswitch
			break
	endswitch
endproc:
proc: title
	job move
	job up
endproc:
proc: raise
	job up
endproc:
proc: move
	switch #(menu_no)
		case 2:
			move $(confirm)
			break
		case 101:
			move $(onrun)
			break
		case 102:
			move $(n_end)
			break
	endswitch
endproc:
proc: up
	switch #(menu_no)
		case 2:
			raise $(confirm)
			break
		case 101:
			raise $(onrun)
			break
		case 102:
			raise $(n_end)
			break
	endswitch
endproc:
