#||define||testbad||true||\

#||ifdef||cid||
||if(equal(output,(one)))||\
#	Get detailed information for one contact (detailed info display and after save)
#		Limiting to single contact done serverside for efficiency
	||define((late_add),json_validate_bool(blank(client_cid)))||\
	||define||full_info||true||
	||begin_list_contacts||\
#		||macro((abook_entry),(true))||\
		||tcmd_address_info||\
	||end_list_contacts||
||else||||if(equal(output,(plain_list)))||\
\
  ||ifdef||testbad||\
	||include||~bad_contacts.js||\
  ||else||\
	||begin_list_contacts||\
#		||macro((abook_entry),(true))||\
		||tcmd_address_info||\
	||end_list_contacts||
  ||endif||\
\
||else||\
\
  ||ifdef||testbad||\
	||include||~bad_contacts.js||\
  ||else||\
	books_list(toarr('||abook_all||'),toarr('||abook_write||'));

\
	||define||late_add||false||\
	||begin_list_contacts||\
#		||macro((abook_entry),(true))||\
		||tcmd_address_info||\
	||end_list_contacts||

\
	||begin_list_contact_groups||\
#		abk_entry_group('||web_encode_js(web_encode(contact_group_name))||','||contact_group_index||',||contact_group_favs||,||contact_group_shared||,||contact_group_webmail||);
#		||macro((abook_entry_group),(true))||\
		   abook_entry_group({svr_id:'||web_encode_js(contact_svr_id)||',\
				name:'||web_encode(contact_group_name)||',\
				isfav:||contact_group_favs||,\
				webmail:||contact_group_webmail||,\
				nodelete:||contact_group_nodelete||,\
\
				isbig:||contact_group_isbig||,\
				linked:||contact_group_linked||,\
				abook:'||contact_group_abook||',igroup:'||contact_group_igroup||',\
		||iftrue(contact_group_isfake)||isfake:true,||endif||\
				isabook:||contact_group_isabook||,shared:||contact_group_shared||,\
				level:||json_validate_int(level)||,ftree_node:'||ftree_node||',ftree_icon:'||ftree_icon||',\
					level_change:'||level_change||', level_steps:'||level_steps||'\
				}, '||contact_group_index||');
\
	||end_list_contact_groups||
\
	abook_ac_order(||tcmd_abook_ac_order||);
	||endif||\
	
	picklist_init('||pref_pick_list||');
	
||endif|| ||endif||