##
##  wml::std::box - Easily Create Rectangular Box
##  Copyright (c) 1997-2001 Ralf S. Engelschall, All Rights Reserved. 
##

#  The <preserve>/<restore> tags with multiple arguments require WML 2.0.3
#use wml::mod::version
<require 2.0.3 />

#use wml::des::space

<define-tag box endtag=required>
<preserve bgcolor fgcolor bdcolor bdwidth bdspace width summary header />
<set-var %attributes />
<when <not <get-var header /> />>
#
#  The standard box created via just two nested tables
#
<defvar bdwidth 1 />
<defvar bdspace 4 />
<if <get-var bdcolor /> <group "
<table* cellspacing=0 cellpadding=<get-var bdwidth /> \
       bgcolor=<get-var bdcolor /> border=0 \
       <if <get-var summary /> "summary=\"<get-var summary />\"" />\
>
<tr*>
<td*>\
" /> />
<table <if <get-var bgcolor /> "bgcolor=<get-var bgcolor />" /> \
       <if <get-var width /> "width=<get-var width />" /> \
       cellspacing=0 cellpadding=<get-var bdspace /> \
       border=0>
<tr>
<td>\
<if <get-var fgcolor /> "<font* color=<get-var fgcolor />>" />\
%body\
<if <get-var fgcolor /> "</font*>" />\
</td>
</tr>
</table>
<if <get-var bdcolor /> <group "
</td*>
</tr*>
</table*>
" /> />
</when>
#
#  The headlined box created via one table and space GIFs
#
<when <get-var header />>
<defvar bdcolor "#000000" />
<defvar bdspace 4 />
<defvar width 300 />
<table border=0 cellpadding=0 cellspacing=0\
       <if <get-var summary /> " summary=\"<get-var summary />\"" />>
    <tr>
        <td colspan=2><space width=1 height=8 /></td>
        <td rowspan=3>&nbsp;&nbsp;<get-var header />&nbsp;&nbsp;</td>
        <td colspan=2><space width=1 height=1 /></td>
    </tr>
    <tr>
        <td bgcolor="<get-var bdcolor />" colspan=2><space width=1 height=1 /></td>
        <td bgcolor="<get-var bdcolor />" colspan=2><space width=1 height=1 /></td>
    </tr>
    <tr>
         <td bgcolor="<get-var bdcolor />"><space width=1 height=5 /></td>
         <td <if <get-var bgcolor /> "bgcolor=<get-var bgcolor />" />>\
             <space width=40 height=1 /></td>
         <td <if <get-var bgcolor /> "bgcolor=<get-var bgcolor />" />>\
             <space width=<get-var width /> height=1 /></td>
         <td bgcolor="<get-var bdcolor />"><space width=1 height=5 /></td>
    </tr>
    <tr>
         <td bgcolor="<get-var bdcolor />"><space width=1 height=1 /></td>
         <td colspan=3 <if <get-var bgcolor /> "bgcolor=<get-var bgcolor />" />>
             <table border=0 cellspacing=<get-var bdspace />>
                 <tr>
                     <td>%body</td>
                 </tr>
             </table>
         </td>
         <td bgcolor="<get-var bdcolor />"><space width=1 height=1 /></td>
    </tr>
    <tr>
         <td colspan=5 bgcolor="<get-var bdcolor />"><space width=1 height=1 /></td>
    </tr>
</table>
</when>
<restore  bgcolor fgcolor bdcolor bdwidth bdspace width summary header />
</define-tag>

##EOF##
