#-------------------------------------------------------------------------------
# Function to print a message to standard output. 
# This can of course be redirected to a file, so provide an option to turn highlighting on or off.
# $1 = message text, $2 [PLAIN|BOLD] $4 debug switch (ksh set: +x for off, -x for on).
#-------------------------------------------------------------------------------
 
MESSAGE()
{
 set "$4"
 TEXT="$1"
 typeset -u HILITE=$2 LEVEL=$3
 case $LEVEL in
      I) LEVEL="INFORMATION: " ;;
      W) LEVEL="WARNING: "     ;;
      E) LEVEL="ERROR: "       ;;
      S) LEVEL="SEVERE: "      ;;
      *) :                     ;;
 esac
 BOLD=$(tput smso)
 PLAIN=$(tput rmso)
 
 if [[ $HILITE = "BOLD" ]]
 then
    print ${BOLD} "\n ${LEVEL} ${TEXT} \n" ${PLAIN}
 else 
    print "\n ${LEVEL} ${TEXT}\n" 
 fi
}
