<html><body>
<%set book_mark = 'create_message'%>
<script>
function switch_wrap() {
  if (document.myform.msg_Content.wrap == 'off') {
    document.myform.msg_Content.wrap = 'soft';
    document.myform.bwrap.value = 'Wrap off';
  }
  else {
    document.myform.msg_Content.wrap = 'off';
    document.myform.bwrap.value = 'Wrap on';
  }
}

function resize() {
  var obj  = document.myform;
  rows = obj.nrows.value;
  cols = obj.ncols.value;
  if ( !isNaN(rows) && !isNaN(cols) ) {
    obj.msg_Content.cols = cols
    obj.msg_Content.rows = rows
  }
}

function gotoLine() {
  var obj  = document.myform.msg_Content;
  var line = document.myform.nline.value;
  if (obj.innerText) {
    var items = obj.innerText.split("\n");
    if ( ( isNaN(line) )|| ( line > items.length ) || ( line <=0 ) || !line) {
      alert('Please enter a number between 1 to ' + items.length);
      return;
    }
    var lineContent = items[line-1];
    var rangContent = '';
    for (var i=0; i<line; i++) rangContent += items[i];

    var items    = rangContent.split(lineContent);
    var numTimes = (items.length > 1) ? ( items.length-1 ) : 1;

    var txtRange = obj.createTextRange();
    var found    = txtRange.findText(rangContent);
    if (found) {
      var tmp = 0;
      while (txtRange.findText(lineContent)) {
        tmp++;
        if ( tmp == numTimes ) {
          txtRange.select();
          break;
        }
        txtRange.moveStart("character",1);
      }
      txtRange.scrollIntoView();
    }
  }
  else alert('The content is empty!')
}

</script>
<%set set_focus = 'myform.msg_subject'%>
<form name=myform action="glist.cgi" method="post" ENCTYPE='multipart/form-data'>
<%include include_header.html%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="82%">
  <tr>
    <td rowspan="2" bgcolor="#008000" height="100%" width="1"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
    <td colspan="3" height="3%" bgcolor="#E8EAD0" valign="top"><%include msg_include_menu.html%></td>
    <td rowspan="2" bgcolor="#008000" height="100%" width="1"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
  </tr>
  <tr>
    <td height="97%" width="20%" valign="top"><%include msg_include_nav.html%></td>
    <td bgcolor="#008000" height="97%" width="1" valign="top"><img src="<%image_url%>/pics/1pixel.gif" width="1" height="1"></td>
    <td height="97%" width="80%" valign="top">
      <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td><img src="<%image_url%>/pics/1pixel.gif" width="1" height="3"></td>
        </tr>
        <tr bgcolor="#C5E1A3">
          <td>
            <table width="100%" border="0" cellspacing="1" cellpadding="1">
              <tr class="bold_white">
                <td bgcolor="#336600">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr class="bold_white">
                      <td height="20"><img src="<%image_url%>/icons/message.gif" align="texttop" hspace="2" vspace="3">Create Message</td>
                      <td align="right" class="body">
                        <%set iclose = 1%>
                        <%include msg_include_icons.html%>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0" align=center>
              <tr>
                <td valign=top align="center">
                    <%if msg%><pre class="body"><br/><%msg%></pre><BR /><%else%>&nbsp;<%endif%>
                </td>
              </tr>
              <tr>
                <td valign=top>
                  <%include msg_include_record.html%>
                </td>
              </tr>
              <tr>
                <td align=center>
                    <input type=submit id="button_create" name="bsearch" value="Create Message" class=button />
                    <input type="button" id="button_spellcheck" name="spellcheck" value="Check Spelling" class="button" tabindex=15>
                    <input type="button" id="button_reset" name="breset" value=" Reset " class=button onclick="open_url('do=msg_add_form<%hidden_query%>')"/>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<input name="do" value="msg_add" type=hidden />
<%hidden_objects%>
<%include include_footer.html%>
</form>
