/* NEW WIDGET ANDING: <button> */

/** Default Button Styles (apply to usage of <button> without 
 *  any applied class).
 **/

/* outer frame */
  button 
    {
      border              : 1px solid #000000;
      -moz-border-radius  : 3px 2px 2px 3px;
      margin              : 1px 5px 2px 5px;
      background-color    : #CCCCCC;
    }
  
  button[disabled="true"],
  button[disabled="true"]:hover,
  button[disabled="true"]:active 
    {
      border              : 1px solid #999999;
      color               : #999999;
    }
        
/* internal frame */
  button > .internal-box 
    {
      vertical-align      : middle;
      text-align          : center;
      border              : 1px outset #CCCCCC;
      padding             : 2px;
    }
    
  button:active > .internal-box 
    {
      border              : 1px inset #CCCCCC;
      padding             : 3px 1px 1px 3px;  
    }
  
  button[disabled="true"] > .internal-box,
  button[disabled="true"]:hover > .internal-box,
  button[disabled="true"]:active > .internal-box 
    {
      border              : 1px outset #CCCCCC;
      -moz-border-radius  : 0px;
      padding             : 2px;
    }

/* text wrapping frame (hack because <text> does not support alignment) */
  button > .internal-box > .text-container
    {
      text-align          : center;
      vertical-align      : middle;
    }

/* text frame */
  button > .internal-box > .text-container > text 
    {
      padding             : 0px 2px 0px 2px;
    }
  
  button[orient="vertical"] > .internal-box > .text-container > text
    {
      padding             : 2px 2px 0px 2px;
    }
  
/** Styles for "DEFAULT" buttons (usually 'OK' or equivalent in dialogs. 
 *  To activate, set 'default' attribute on button.
 **/
 
/* outer frame */  
  button[default] 
    {
      /* XXX this is a HACK until 'orient' is supported in CSS! XXX */
      /* strictly speaking not necessary because default for buttonright is 
       * to lay image out horizontally, but leaving here as a reminder to
       * implement this feature */
      behavior            : url(resource:/chrome/xulBindings.xml#buttonright);
      font-weight         : bold;
	    list-style-image    : url("chrome://global/skin/return.gif");
    }
  
  button[default][disabled="true"]
    {
      list-style-image    : url("chrome://global/skin/return-disabled.gif");
    }
    
/** Styles for 'dialog' buttons (usually any command button in a dialog)
 *  This class gives buttons 10px of padding on each side to increase the
 *  strike area and make buttons with small amounts of text (e.g. 'OK') 
 *  look less silly.
 **/

/* internal frame */
  button.dialog > .internal-box,
  button.dialog:hover > .internal-box
    {
      padding             : 2px 10px 2px 10px;
    }
  
  button.dialog:hover:active > .internal-box 
    {
      padding             : 3px 9px 1px 11px;
    }

/** Styles for grey toolbar buttons. These buttons are used in places like
 *  editor's formatting toolbar or toolbars wanting a button similar to a command
 *  button but without an initial outset frame.
 **/ 
  button.borderless 
    {
      border              : 1px solid #CCCCCC;
    }
  
  button.borderless:hover
    {
      border              : 1px solid #000000;
    }
    
  button.borderless > .internal-box 
    {
      border              : 1px solid #CCCCCC;
    }
  
  button.borderless:hover > .internal-box 
    {
      border              : 1px outset #CCCCCC;
    }
  
  button.borderless:active > .internal-box 
    {
      border              : 1px inset #CCCCCC;
    }

/** Styles for the largest type of toolbar buttons. In the Seamonkey implementation, 
 *  these are only used in the navigation toolbar in the navigator package.
 **/
 
  /* outer frame */
  button.large-toolbar 
    {
      background-repeat   : no-repeat;
      background-position : 50% 0px;
      background-color    : transparent;
      background-image    : url("chrome://global/skin/button32-bg.gif");
      color               : #CCFFFF;
      min-width           : 36px;
      min-height          : 36px;
      margin              : 6px 6px 1px 1px;
      font-size           : smaller;
      border              : none;
    }
    
  button.large-toolbar:hover 
    {
      background-image    : url("chrome://global/skin/button32-bg-hover.gif");
      border              : none;
    } 

  button.large-toolbar:active
    {
      margin              : 7px 5px 0px 2px;
      border              : none;
    }

  button.large-toolbar[disabled="true"],
  button.large-toolbar[disabled="true"]:hover,
  button.large-toolbar[disabled="true"]:active
    {
      background-image    : url("chrome://global/skin/button32-bg-disabled.gif");
      margin              : 6px 6px 1px 1px;
      border              : none;
    }
    
/* internal frame */
  button.large-toolbar[disabled="true"] > .internal-box,
  button.large-toolbar[disabled="true"]:hover > .internal-box,
  button.large-toolbar[disabled="true"]:active > .internal-box
    {
      border              : none;
    }
      
  button.large-toolbar > .internal-box,
  button.large-toolbar:hover > .internal-box,
  button.large-toolbar:active > .internal-box
    {
      border              : none;
      vertical-align      : middle;
    }
    
  button.large-toolbar > .internal-box > .text-container 
    {
      display             : none;
      text-align          : center;
    }
    
/** Styles for the standard 'large' toolbar button, these buttons are used for
 *  toolbar buttons that are the most commonly used elements on a toolbar, e.g.
 *  'GetMsg' in Mailnews or 'Send' in Mail/Compose.
 **/
  button.key-toolbar 
    {
      background-repeat   : no-repeat;
      background-position : 50% 0px;
      background-color    : transparent;
      background-image    : url("chrome://global/skin/button28-bg.gif");
      color               : #CCFFFF;
      min-width           : 28px;
      min-height          : 28px;
      margin              : 4px 7px 1px 1px;
      padding             : 3px 0px 0px 1px;
      font-size           : smaller;
      border              : none;
    }
    
  button.key-toolbar:hover 
    {
      background-image    : url("chrome://global/skin/button28-bg-hover.gif");
      border              : none;
    } 

  button.key-toolbar:active
    {
      margin              : 5px 6px 0px 2px;
      border              : none;
    }

  button.key-toolbar[disabled="true"],
  button.key-toolbar[disabled="true"]:hover,
  button.key-toolbar[disabled="true"]:active
    {
      background-image    : url("chrome://global/skin/button28-bg-disabled.gif");
      margin              : 3px 7px 1px 1px;
      border              : none;
    }
    
/* internal frame */
  button.key-toolbar[disabled="true"] > .internal-box,
  button.key-toolbar[disabled="true"]:hover > .internal-box,
  button.key-toolbar[disabled="true"]:active > .internal-box
    {
      border              : none;
      vertical-align      : middle;
    }
      
  button.key-toolbar > .internal-box,
  button.key-toolbar:hover > .internal-box,
  button.key-toolbar:active > .internal-box
    {
      border              : none;
    }
  
/* text wrapper frame */
  button.key-toolbar > .internal-box > .text-container 
    {
      padding-top         : 3px;
      text-align          : center;
    }

/** Styles for the less important toolbar buttons. These buttons are used for 
 *  toolbar members of less immediate use than those of the 'key-toolbar' class.
 **/
  button.toolbar 
    {
      background-repeat   : no-repeat;
      background-position : 50% 0px;
      background-color    : transparent;
      background-image    : none;
      color               : #CCFFFF;
      min-width           : 28px;
      min-height          : 28px;
      margin              : 4px 7px 1px 1px;
      padding             : 3px 0px 0px 1px;      
      font-size           : smaller;
      border              : none;
    }
    
  button.toolbar:hover 
    {
      background-image    : url("chrome://global/skin/otherbutton28-bg-hover.gif");
      border              : none;
    } 

  button.toolbar:active
    {
      margin              : 5px 6px 0px 2px;
      border              : none;
    }

  button.toolbar[disabled="true"],
  button.toolbar[disabled="true"]:hover,
  button.toolbar[disabled="true"]:active
    {
      margin              : 3px 7px 1px 1px;
      border              : none;
      background-image    : none;
    }
    
/* internal frame */
  button.toolbar[disabled="true"] > .internal-box,
  button.toolbar[disabled="true"]:hover > .internal-box,
  button.toolbar[disabled="true"]:active > .internal-box
    {
      border              : none;
    }
      
  button.toolbar > .internal-box,
  button.toolbar:hover > .internal-box,
  button.toolbar:active > .internal-box
    {
      border              : none;
      vertical-align      : middle;
    }

/* text wrapper frame */
  button.toolbar > .internal-box > .text-container 
    {
      padding-top         : 3px;
      text-align          : center;
    }

/** Expanding Region Button **/

/* outer frame */
  button.expander
    {
      border              : none;
      padding             : none;
      margin              : 1px 5px 3px 1px;
      background-color    : inherit;
      list-style-image    : url("chrome://global/skin/closedtwisty.gif");
    }
    
  button[open="true"].expander 
    {
      list-style-image    : url("chrome://global/skin/opentwisty.gif");
    }
    
/* internal frame */
  button.expander > .internal-box
    {
      border              : none;
      background-color    : inherit;
      padding             : none;
      margin              : none;
    }

/* text frame */
  button.expander > .internal-box > .text-container > text
    {
      color               : #0000FF;
      text-decoration     : underline;
    }
    
  button.expander:hover > .internal-box > .text-container > text
    {
      color               : #FF0000;
    }
