<?xml version="1.0"?> 
<?xml-stylesheet href="xul.css" type="text/css"?> 
<!DOCTYPE window> 

<xul:window xmlns:html="http://www.w3.org/TR/REC-html40"
            xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 

  <html:script language="JavaScript">

  function StartUp()
  {
    appCore = XPAppCoresManager.Find("MailAppCore");  
    if (appCore==null) {
      appCore = new MailCore();
      if (appCore != null) {
	    dump("MailAppCore was created!\n");
        appCore.Init("MailAppCore");
	    appCore.MailCompleteCallback("MailSent();");
	    appCore.SetWindow(window);
      }
    }
  }

  function SendMailMessage()
  {
    dump("SendMailMessage!\n");
    var appCore = XPAppCoresManager.Find("MailAppCore");
    if (appCore != null) {
	  dump("Mail was sent!\n");
	  appCore.SendMail(window.parent.frames[1].document.forms[0].elements[1].value, 
	                   window.parent.frames[1].document.forms[0].elements[2].value, 
					   window.parent.frames[1].document.forms[0].elements[4].value);
    }
  
  }

  function MailSent()
  {

    // Clear Them
    window.parent.frames[1].document.forms[0].elements[1].value = "";
    window.parent.frames[1].document.forms[0].elements[2].value = "";
    window.parent.frames[1].document.forms[0].elements[4].value = "";

  }

  </html:script>


  <xul:commands>
    <xul:command name="nsCmd:StartUp" onCommand="StartUp();"/>
    <xul:command name="nsCmd:MailSendMsg" onCommand="SendMailMessage();"/>
  </xul:commands>
  
  <xul:toolbox> 
   
    <xul:toolbar>
          <html:button cmd="nsCmd:MailSendMsg" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/Mail_SendMsg.gif"/><html:br/>Send
          </html:button>
          <html:button cmd="nsCmd:MailGetMsg" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/Mail_GetMsg.gif"/><html:br/>GetMsg
          </html:button>
          <html:button cmd="nsCmd:MailNewMsg" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/Mail_NewMsg.gif"/><html:br/>New Msg
          </html:button>
          <html:button cmd="nsCmd:MailReply" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/Mail_Reply.gif"/><html:br/>Reply
          </html:button>
          <html:button cmd="nsCmd:MailForward" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/Mail_Forward.gif"/><html:br/>Forward
          </html:button>
          <html:button cmd="nsCmd:BrowserPrint" style="background-color:rgb(192,192,192);">
                          <html:img src="resource:/res/toolbar/TB_Print.gif"/><html:br/>Print
          </html:button>
          <html:a style="position:relative; direction:rtl; right:3; top: 2px;" href="http://www.netscape.com">
                  <html:img alt="Throbber!" border="0" src="resource:/res/throbber/anims00.gif"/>
          </html:a>
    </xul:toolbar>
    
    <xul:toolbar>
		<html:form>
    	<html:select style="width:200px;">
		<html:option>INBOX</html:option>
		</html:select>
		</html:form>
    </xul:toolbox>
    
  </xul:toolbox>
  
</xul:window>

