while :
do 

page <<Bout

	 Welcome to the Open Cluster Data Base 


	What do you want to do today?

	Look at the documentation on BDA  ....... dsc
	Query BDA interactively ................. bda
	Query BDA with a program ................ int
	Query the bibliography .................. bib
	Query the references .................... ref
	Query Ruprecht's bibliography ........... bdp
	Query Lynga's catalogue ................. lyn
	Look at the man pages ................... man
	Look at the french manual ............... mnl
	Analyse the data ........................ ana
        Investigate a cluster ................... atp
	Plot photometric diagrams ............... pho
	Update the Data Base .................... maj
	Work on the co-ordinates ................ trc
	Look at the menu system information ..... hlp

	End of interrogation .................... fin

Bout
echo -n "	Express your wish:  "
read des
case $des in

dsc) dsc ;;

int) interro ;;

bib) clear ; echo ' '
      echo "	$us Interrogation of the bibliography $se"
      echo ' ' ; bib ;;

ref) clear ; echo ' '
     echo " $us Interrogation of the references $se"
     echo ' ' ; ref ;;

hlp) zex $BDA/descri/menu.hlp | page
     echo -n " back to the menu ?  "
     read suit ;;

bdp) clear ; echo ' '
     echo "	$us Interrogation of Ruprecht's bibliography $se"
     while :
     do
     echo ' ' ; echo -n "	 For which cluster ?  " ; read ams 
     case $ams in
       "") amas=$amp ;;
       *)  amas=$ams ;;
     esac
     cd $BDA/$amas ; bdp
     echo -n " suite (y/n)?  "
     read suit 
     case $suit in
       ""|y) ;;
       n) echo ' ' ; break ;;
     esac 
     done ;;

man) clear ; echo ' '
     echo "	Consultation of man pages"
     while :
     do
     echo ' ' ; echo -n "	 Which command ?  "
     read comm ; man $comm     
     echo ' ' ; echo -n " continue (y/n/f)?  " ; read suit 
     case $suit in
       ""|y) ;;
       n) break ;;
       f) echo ' ' ; exit 0 ;;
     esac 
     done ;;

mnl) clear ; echo ' '
     echo "	 $us Consultation of the manual $se"
     while :
     do
     echo ' ' ; echo -n "	 Which command or fonction?  "
     read fon ; mnl $fon
     echo -n " continue (y/n/f)?  "
     read suit
     case $suit in
       ""|y) ;;
       n) break ;;
       f) echo ' ' ; exit 0 ;;
     esac 
     done ;;

lyn) while :
     do
     echo ' ' 
     echo -n "	 For which cluster ?  " ;
     read ams 
     case $ams in
       "") amas=$amp ;;
       *)  amas=$ams ;;
     esac
     cd $BDA/$amas ; lyn
     echo -n " continue (y/n/f)?  "
     read suit 
     case $suit in
       ""|y) ;;
       n) break ;;
       f) echo ' ' ; exit 0 ;;
     esac 
     done ;;

fin) echo ' ' ; exit 0 ;;

*) echo ' ' ; echo -n "	 In which cluster?  "
   read ams 
   case $ams in
     "") amas=$amp ;;
     *)  amas=$ams ;;
   esac
   cd $BDA/$amas

   case $des in
   ana) ana ;;
   maj) maj ;;
   atp) atp ;;
   trc) trc ;;
   pho) dpt ;;
   bda) clear 
        echo "$us Interrogation of the Data Base $se" ; echo ' ' 
        (echo ' '  ; echo -n "$md$amas> $se"
        read des ret1 ret2 ret3 ret4 ret5 ret6 ret7 ret8 ret9
        while test $des != fin
        do
        echo ' '
        eval $des $ret1 $ret2 $ret3 $ret4 $ret5 $ret6 $ret7 $ret8 $ret9
        echo ' '  ; echo -n "$md$amas> $se"
        read des ret1 ret2 ret3 ret4 ret5 ret6 ret7 ret8 ret9
        done ) ;;
   esac 

amp=$amas ;;

esac

case $? in
0) ;;
1) ;;
2) exit 0 ;;
esac 

done
