function company_comm(Branch)
declare function set_property, fieldcount, get_property, msg
begin condition
pre:
post:
end condition
Branches = 'SET_FIELDS'
convert ',' to @fm in Branches
locate Branch in Branches using @fm setting Bpos then
   on Bpos gosub SetFields
end else
   Void = msg( '', 'Invalid Branch ':Bpos:' passed to company_comm' )
end
return 0
*===========================================================================*
SetFields:
	CustArray = 'BILL_TO_ATTN/BILL_TO_CO/BILL_TO_ADDRESS/'
	CustArray:= 'BILL_TO_CITY/BILL_TO_STATE/BILL_TO_ZIP/'
	CustArray:= 'TERMS/SHIP_TO_ATTN/SHIP_TO_CO/SHIP_TO_ADDRESS/'
	CustArray:= 'SHIP_TO_CITY/SHIP_TO_STATE/SHIP_TO_ZIP/SHIPPERINFO/'
	CustArray:= 'NOTES/INVOICE_NOTES/DIRECTIONS/BUSINESS_DESC/CREDIT_INFO/'
	CustArray:= 'SALESREP/SALESOFFICE/PRODUCTS/APPLICATION/INDUSTRY/ENDUSER_CUST/'
	CustArray:= 'CUST_COMPETITION/OUR_COMPETITION/MANUTYPE/'
	CustArray:= 'BILL_TO_ATTN_LABEL/BILL_TO_CO_LABEL/BILL_TO_ADDRESS_LABEL/'
	CustArray:= 'BILL_TO_CITY_LABEL/BILL_TO_STATE_LABEL/BILL_TO_ZIP_LABEL/'
	CustArray:= 'TERMS_LABEL/SHIP_TO_ATTN_LABEL/SHIP_TO_CO_LABEL/SHIP_TO_ADDRESS_LABEL/'
	CustArray:= 'SHIP_TO_CITY_LABEL/SHIP_TO_STATE_LABEL/SHIP_TO_ZIP_LABEL/SHIPPERINFO_LABEL1/'
	CustArray:= 'SHIPPERINFO_LABEL2_LABEL/NOTES_LABEL/INVOICE_NOTES_LABEL/BILL_TO_LABEL/SHIP_TO_LABEL/SHIPPER_INFO_GROUP/'
	CustArray:= 'DIRECTIONS_LABEL/BUSINESS_DESC_LABEL/ACCOUNTREPS/ACCOUNTREPS_LABEL/'
	CustArray:= 'INDUSTRY_LABEL/PRODUCTS_LABEL/EU_LABEL/SALES_LABEL/CUSTCOMP_LABEL/'
	CustArray:= 'OURCOMP_LABEL/SALES_PLAN_PANEL'
	VendArray = 'VREMIT_TO/VREMIT_ADDR/VREMIT_CITY/VREMIT_STATE/VREMIT_ZIP/'
	VendArray:= 'VREMIT_COMPANY/VACCT_NO/VEND_NOTES/VREMIT_PHONE/'
	VendArray:= 'VREMIT_TO_LABEL/VREMIT_ADDR_LABEL/VREMIT_CITY_LABEL/VREMIT_STATE_LABEL/VREMIT_ZIP_LABEL/'
	VendArray:= 'VREMIT_COMPANY_LABEL/VACCT_NO_LABEL/VEND_NOTES_LABEL/VREMIT_PHONE_LABEL'
	OtherArray = 'OTHER_NOTES/'
	OtherArray := 'OTHER_NOTES_LABEL'
	swap '/' with @rm:@window:'.' in CustArray
	swap '/' with @rm:@window:'.' in VendArray
	swap '/' with @rm:@window:'.' in OtherArray
	CustArray = @window:'.':CustArray
	VendArray = @window:'.':VendArray
	OtherArray = @window:'.':OtherArray
	CoControl  = @window:'.CO_TYPE'
	CoType = get_property( CoControl, 'VALUE' )
	
	if CoType = 'C' then
	   ArrayToShow = CustArray
	   ArrayToHide = VendArray:@rm:OtherArray
	end else
	   if CoType = 'V' then
	      ArrayToShow = VendArray
	      ArrayToHide = CustArray:@rm:OtherArray
	   end else 
	      * it is an other
	      ArrayToShow = OtherArray
	      ArrayToHide = CustArray:@rm:VendArray
	   end
	end
   RetVal = set_property( ArrayToShow, 'VISIBLE', 1 )
   RetVal = set_property( ArrayToShow, 'ENABLED', 1 )
   RetVal = set_property( ArrayToHide, 'VISIBLE', 0 )
   RetVal = set_property( ArrayToHide, 'ENABLED', 0 )
return 

*===========================================================================*
