<%@page info="vacation settings" language="java" pageEncoding="utf-8" contentType="text/html; charset=UTF-8"  %>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>

<%@include file="/uwc/js/resourceBundleUtils.js"%>
<jato:useViewBean className="com.sun.uwc.MailPreferencesSettingsViewBean">
<HTML>
<HEAD>
<TITLE><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-global-title" defaultValue="Sun&#153;ONE Affinity - Options - Mail"/></TITLE>
<SCRIPT language="JavaScript" src="../uwc/js/scripts.js"></SCRIPT>
<SCRIPT src="../uwc/js/browserVersion.js" ></SCRIPT>
<script src="../uwc/js/uwcUtils.js" type="text/javascript"> </script>
<SCRIPT>
  if (is_ie5up) // IE5
  {
   document.write('<LINK href=<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="skinModel" lookInSession="true" name="Style-Sheet-IE" defaultValue="../uwc/css/css_ie5win.css"/> type=text/css rel=stylesheet>')
  }
  else if (is_gecko) // Netscape 6/7 or Mozilla
  {
   document.write('<LINK href=<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="skinModel" lookInSession="true" name="Style-Sheet-NN" defaultValue="../uwc/css/css_ns6up.css"/> type=text/css rel=stylesheet>')
  }
  else  // All others
  {
   document.write('<LINK href=<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="skinModel" lookInSession="true" name="Style-Sheet-NN" defaultValue="../uwc/css/css_ns6up.css"/> type=text/css rel=stylesheet>')
  }

  var dirtyCache = 0;
    
  //Function to submit the form.
  function handleSave(){
    var subt = saveSettings();
    if(subt == true){
      document.forms[0].submit();
      dirtyCache=0;
    }
      return false;
      }
    
      function setDirtyCache() {
        dirtyCache = 1;
      }
      
    function unloadPage() {
        if(0 != dirtyCache) {
          if(UWCConfirm("<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-save-page" defaultValue="Save changes you made in this tabbed pane?"/>")) {
            handleSave();
          }
        }
      }
</SCRIPT>
<script>
     
    ///JavaScript Alert Strings
    var invalid_Email="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-error-invalid-email" defaultValue="Invalid Email Address !"/>";
    
    
    function setRadioSelection(){
    var form=document.forms[0].elements;
    var r=form["MailPreferencesSettings.deleteFromFolder"];
    var r1=form["deleteFromFolderRadio"];
        
    var radioValue=r.value;
        if(radioValue=="Y")r1[0].checked=true;
        else r1[1].checked=true;
        
    }

    function CheckOther(which){
    concatenateAddresses();
    var form=document.forms[0].elements;
    var r=form["MailPreferencesSettings.deleteFromFolder"];
    var r1=form["deleteFromFolderRadio"];
    var c0=form["MailPreferencesSettings.emptyOnLogout"];
    var c1=form["MailPreferencesSettings.removeOnLogout"];
        
    if(which==1){
    if(c1.checked==true){
    c0.checked=true;
    c1.checked=false;
    }
    form["MailPreferencesSettings.deleteFromFolder"].value="Y";
    }
    else
    if(which==2){
    if(c0.checked==true){
    c1.checked=true;
    c0.checked=false;
    }
    form["MailPreferencesSettings.deleteFromFolder"].value="N";
    }
     else if(which==3){
     r1[0].checked=true;
     c1.checked=false;
     form["MailPreferencesSettings.deleteFromFolder"].value="Y";
     }
     else  if(which==4){
     r1[1].checked=true;
     c0.checked=false;
     form["MailPreferencesSettings.deleteFromFolder"].value="N";
     }
         
    
    
    return false;
    
    }

    function AddEmail(){
     var form=document.forms[0].elements;
     var emailField=form["MailPreferencesSettings.forwardEmail"];
     var emailvalue=emailField.value;
     var values = emailvalue.split(',');
     
     if(values[0]=='')
     return false; // Nothing meaningful typed.
     var err;
     for(i=0;i<values.length; i++){
     values[i]=validAddr(values[i]);
     if(values[i] == null)
        { err=true; break;}
     }
     
     if(err==true){
      UWCAlert(invalid_Email);
      return false;
      }
      
      //If we have come so far then we have valid email address to populate.
      var emailList=form["MailPreferencesSettings.forwardList"];
      var count =emailList.options.length;
      for(i=0;i<values.length; i++)
      emailList.options[count++]= new Option(values[i],values[i]);
      
      emailField.value="";
      
      return false;
    
    }
    
    function removeEmail(){
    var form=document.forms[0].elements;
    var emailList=form["MailPreferencesSettings.forwardList"];
      var count =emailList.options.length;
      var selectedEmails=new Array();
      for(i=0;i<count; i++){
      if(emailList.options[i].selected==true)
      selectedEmails[selectedEmails.length]=i;
        }
        for(i=0;i<selectedEmails.length; i++) {
           emailList.options[selectedEmails[i]] = null;
        }
        if(selectedEmails.length > 0) 
           dirtyCache = 1;
      return false;
    }
    
    function isasciistring(s) {
      for (var i = 0; i < s.length; i++) {
        if (s.charAt(i) > '~')
          return false
      }
      return true
    }
    
    
    
    function concatenateAddresses(){
    var form=document.forms[0].elements;
    var emailList=form["MailPreferencesSettings.forwardList"];
    var emailHiddenList=form["MailPreferencesSettings.emailAddresses"];
      var count =emailList.options.length;
      var s = ''
      if(count > 0) {
         s=emailList.options[0].text;
         for(i=1;i<count; i++) {
           if(emailList.options[i].text != '') { 
             if(s != '') s+=',' 
             s+=emailList.options[i].text;
           }
         }
      } 
     document.forms[0].elements["MailPreferencesSettings.emailAddresses"].value = s;
     //emailHiddenList.value=s;
    }
    
    function saveSettings() {
       //parent.mailcfg.folder(document.forms[0].trashList.options[document.forms[0].trashList.selectedIndex].value)
       mailcf = parent.mailcfg; 
       selInd = document.forms[0].trashList.selectedIndex;
       if(selInd > 1)
          document.forms[0].elements["MailPreferencesSettings.deleteFolder"].value = mailcf.folder(document.forms[0].trashList.options[selInd].value);

       selInd = document.forms[0].sentList.selectedIndex;
       if(selInd > 1)
          document.forms[0].elements["MailPreferencesSettings.sentMessages"].value = mailcf.folder(document.forms[0].sentList.options[document.forms[0].sentList.selectedIndex].value);

       selInd = document.forms[0].draftList.selectedIndex;
       if(selInd > 1)
          document.forms[0].elements["MailPreferencesSettings.draftMessages"].value = mailcf.folder(document.forms[0].draftList.options[document.forms[0].draftList.selectedIndex].value);

       concatenateAddresses();
       return true;
    }
    
    function validAddr(addr) {
      if(addr=='') return ''
      var bp = addr.lastIndexOf('@')
      if (bp == -1) {
        bp = addr.length - 1
        while (addr.charAt(bp) == ' ' || addr.charAt(bp) == '>')
          bp--
        ++bp
        addr = addr.substring(0, bp) + '@' + document.forms[0].elements["MailPreferencesSettings.defaultDomain"].value + addr.substring(bp)
      }
      var ep = bp
      if (bp > 0) {
        --bp
        for (;;) {
          ch = addr.charAt(bp)
          if (ch == ' ' || ch == '<' ||
              ch == '"' || ch == ')' || ch == ',' ) {
            ++bp
            break
          }
          if (--bp < 0) {
            bp = 0
            break
          }
        }
        ++ep
        for (;;) {
          ch = addr.charAt(ep)
          if (ch == ''  || ch == '>' || ch == ' ' ||
              ch == '"' || ch == '(' || ch == ',') {
            break
          }
          ++ep
        }
        if (!isasciistring(addr.substring(bp, ep))) {
          isInvalidAddr = true
          return null
        }
      }
      return addr
    }


   
</script>
</HEAD>

<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="Page" onLoad="setRadioSelection();" onUnload="unloadPage()">
<jato:form name="MailPreferencesSettings" method="post" defaultCommandChild="/Save">
<!-- Pagelet for branding -->
  <jato:containerView name="MasterHead">
    <%@include file="/uwc/common/MasterHeadNormal.jsp"%>
  </jato:containerView>

  <%@include file="/uwc/common/OptionsApplBarPagelet.jsp"%>

<!-- Secondary Row of Tabs -->
<div class="Tab2">
<TABLE border="0" cellspacing="0" cellpadding="0" class="Tab2Tbl" width="100%" summary="Table that contains the Calendar View Tabs">
  <tr> 
    <td colspan="13"><img src="../uwc/images/spacer.gif" width="1" height="10" alt=""></td>
  </tr>
  <tr>
    <td colspan="3"><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <td colspan="5" class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td colspan="5"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
  <tr>
    <td><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <td class="Tab2NotSel"> 
        <div class="Tab2NotSel"><a title='<%=getLocalizedLabel(session, "uwc-common-tooltip-global", "Global Option")%>' href="<%= getContextURI(request) %>/base/UserPreferencesSettings" class="TabLblNormal" onMouseOver="return true;" onMouseOut="status=';'" target="_parent"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-global" defaultValue="Global"/></a> 
        </div>
    <td><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <td class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td class="Tab2Sel"><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <td class="Tab2Sel"> 
      <DIV class="Tab2Sel"><SPAN class="TabLblSel" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-tooltip-mail" defaultValue="Mail Options"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-mail" defaultValue="Mail"/></span></div>
    </td>
    <td class="Tab2Sel"><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <td class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td><img src="../uwc/images/spacer.gif" width="10" height="1" alt=""></td>
    <jato:content name="CalendarTab">
      <td nowrap><div class="Tab2NotSel"><A title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-tooltip-calendar" defaultValue="Calendar Options"/>" href="<%= getContextURI(request) %>/base/CalendarPreferences" class="TabLblNormal" onMouseOver="status='Calendar Options'; return true;" onMouseOut="status=';'" target="_parent"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-calendar" defaultValue="Calendar"/></a></div></td>
      <td><img src="../uwc/images/dividerbar.gif" alt=""></td>
</jato:content>
    <td width="90%"> 
      <div class="Tab2NotSel"><A title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-tooltip-addressbook" defaultValue="Address Book Options"/>" href="<%= getContextURI(request) %>/base/ABPreferences" class="TabLblNormal" onMouseOver="status='Address Book Options'; return true;" onMouseOut="status=';'" target="_parent"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-common-addressbook" defaultValue="Address Book"/></a></div>
           </td>
  </tr>
  <tr> 
    <td class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td colspan="3" class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td colspan="3" class="Tab2Sel"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
    <td colspan="5" class="Tab2LineBkgd"><img src="../uwc/images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
</table>
</div>
<!-- Third Level of Tabs -->
<div class="Tab3"> 
<table class="Tab3Tbl" width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <tr>
    <td><img src="../uwc/images/spacer.gif" width=1 height=10 alt=""></td>
  </tr>
</table>
<table class="Tab3Tbl" border="0" cellspacing="0" cellpadding="0" title="">
  <tr> 
    <td><img src="../uwc/images/spacer.gif" width=1 height=10 alt=""></td>
    <td> 
      <div class="Tab3"><a href="<%= getContextURI(request) %>/base/MailPreferencesPersonal" class="TabLblNormal" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-tooltip-personal" defaultValue="Personal Information"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-personal" defaultValue="Personal Information"/></a></div> 
    </td>
    <td><img src="../uwc/images/dividerbar.gif" alt=""></td>
    <td> 
      <div class="Tab3"><span class="TabLblSel" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-tooltip-settings" defaultValue="Settings"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings" defaultValue="Settings"/></span></div>
    </td>
    <td><img src="../uwc/images/dividerbar.gif" alt=""></td>
    <td> 
      <div class="Tab3"><a href="<%= getContextURI(request) %>/base/MailPreferencesLayout" class="TabLblNormal" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-tooltip-layout" defaultValue="Layout"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-layout" defaultValue="Layout"/></a></div> 
    </td>
    <td><img src="../uwc/images/dividerbar.gif" alt=""></td>
     <td> 
      <div class="Tab3"><a href="<%= getContextURI(request) %>/base/MailPreferencesVacation" class="TabLblNormal" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-tooltip-vacation" defaultValue="Vacation"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-vacation" defaultValue="Vacation"/></a></div> 
	</td>
	<td><img src="../uwc/images/dividerbar.gif" alt=""></td>
     <td> 
      <div class="Tab3"><a href="<%= getContextURI(request) %>/base/MailPreferencesSieve" class="TabLblNormal" title="<jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-tooltip-seieve" defaultValue="Mail Filters"/>"><jato:getModelFieldValue escape="false" modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-sieve" defaultValue="Mail Filters"/></a></div> 
	</td>
  </tr>
</table>
</div>

<!-- Page Title with Save Button -->
<!-- Error information pagelet -->
   <jato:containerView name="errorPlugin">
      <%@include file="/uwc/common/error.jsp"%>
   </jato:containerView>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD colspan="4">&nbsp; </TD>
  </TR>
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
    <TD width="100%"> <SPAN class="TtlTxt"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-title" defaultValue="Options - Mail Settings" /> </SPAN></TD>
    <TD align="right">
      <jato:button styleClass="Btn1"  name="savetop" defaultValue=" Save " onClick="handleSave();return false;"  onFocus="if (this.disabled==0) this.className='Btn1Hov'" onMouseOver="if (this.disabled==0) this.className='Btn1Hov'" onMouseOut="if (this.disabled==0) this.className='Btn1'" onBlur="if (this.disabled==0) this.className='Btn1'" tabIndex="19" extraHtml='<%= getTitleForExtraHtml(session, "uwc-mail-options-save-tooltip","Save Changes to  Mail Options") %>' />      
    </TD>
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
  </TR>
</TABLE>
<!-- Horizontal Top/Bottom of Page Line -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
    <TD class="TtlLin" width="100%"><IMG src="../uwc/images/spacer.gif" width="1" height="1" alt=""></TD>
  </TR>
</TABLE>
<!-- Form Input -->
<TABLE class="FormInputTableOptions" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD class="PropLabel" colspan="2"><IMG src="../uwc/images/spacer.gif" width="1" height="15" alt=""></TD>
  </TR>
  <TR> 
    <TD class="PropLabel" valign="top" width="20%"><SPAN class="Lbl2"><label for="deleteMessageOptions"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-deleting-messages-heading" defaultValue="Deleting Messages from Folders" />:</label></SPAN></TD>
    <TD width="80%" valign="top"> 
      <table border="0" cellspacing="0" cellpadding="0" id="deleteMessageOptions" title='<%=getLocalizedLabel(session, "uwc-mail-options-delete", "Delete Message Options")%>'>
        <tr> 
          <td class="PropInput"> 

            <input type="radio" name="deleteFromFolderRadio" onClick="CheckOther(1);" value="Y" tabIndex="20" >

          </td>
          <td class="PropInput"><label for="deleteFromFolder1"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-move-to-folder" defaultValue="Move deleted messages to folder" />:</label> 
           <script> 
                 
                  var mailcf = parent.mailcfg.cfgFrame
                  var f = "<jato:getDisplayFieldValue name='deleteFolder' />"
                  if(f == null || f == "") f = parent.mailcfg.i18n['trash folder']  
                  /* f = mailcf['meTrashFolder'] ? mailcf['meTrashFolder'] :
                        (mailcf['mePrevTrash'] ? mailcf['mePrevTrash'] : parent.mailcfg.i18n['trash folder']) */
                  document.write(parent.mailcfg.folderSelection('trashList',null,null,null,null,f,null))
           </script>
              
          </td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
          <td class="PropCheckBoxLvl2"> 
            <jato:checkbox name="emptyOnLogout" elementId="emptyOnLogout" onClick="CheckOther(3);"  tabIndex="3"/>
            <label for="emptyOnLogout"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-empty-on-logout" defaultValue="Empty messages from this folder on logout." /></label></td>
        </tr>
        <tr> 
          <td class="PropInput"> 
            <input type="radio" name="deleteFromFolderRadio" onClick="CheckOther(2);" value="N" tabIndex="21" >
           </td>
          <td class="PropInput"><label for="deleteFromFolder2"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mark-deleted" defaultValue="Mark messages as deleted; Use Expunge to delete messages permanently." /> 
            </label></td>
        </tr>
        <tr> 
          <td>&nbsp;</td>
          <td class="PropCheckBoxLvl2"> 
            <jato:checkbox name="removeOnLogout" elementId="removeOnLogout" onClick="CheckOther(4);" tabIndex="5"/>
            <label for="removeOnLogout"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mark-deleted-remove" defaultValue="Mark messages as deleted; Use Expunge to delete messages permanently." /></label></td>
        </tr>
         </table>
    </TD>
  </TR>
  <TR> 
    <TD class="PropLabel"><SPAN class="Lbl2"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-sent-messages-heading" defaultValue="Sent Messages" />:</SPAN></TD>
    <TD class="PropInput"><label for="sentMessages"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-sent-messages-desc" defaultValue="Save a copy of all sent messages in folder" />:</label> 
     <script>
           var mailcf = parent.mailcfg.cfgFrame
           f = "<jato:getDisplayFieldValue name='sentMessages' />"
           if(f == null || f == "") f = parent.mailcfg.i18n['sent folder'];
           /* f = mailcf['meSentFolder'] ? mailcf['meSentFolder'] : parent.mailcfg.i18n['sent folder'] */
           document.write(parent.mailcfg.folderSelection('sentList',null,null,null,null,f,null))
         //<jato:textField name="sentMessages" elementId="sentMessages" tabIndex="9"/>
      </script>
            </TD>
  </TR>
  <TR> 
    <TD class="PropLabel"><SPAN class="Lbl2"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-draft-messages-heading" defaultValue="Message Drafts" />:</span></TD>
    <TD class="PropInput"><label for="draftMessages"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-draft-messages-desc" defaultValue="Save message drafts in folder" />:</label> 
     <script>
           var mailcf = parent.mailcfg.cfgFrame
           f = "<jato:getDisplayFieldValue name='draftMessages' />"
           if(f == null || f == "") f = parent.mailcfg.i18n['draft folder']
           //f = mailcf['meDraftFolder'] ? mailcf['meDraftFolder'] : parent.mailcfg.i18n['draft folder']
           document.write(parent.mailcfg.folderSelection('draftList',null,null,null,null,f,null))

      //<jato:textField name="draftMessages" elementId="draftMessages" tabIndex="10"/>
     </script>
          </TD>
  </TR>
  <TR> 
    <TD class="PropLabel"><SPAN class="Lbl2"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-quote-reply-heading" defaultValue="Reply Quoting" />:</span></TD>
    <TD class="PropInput"> 
      <jato:checkbox name="includeMessage" elementId="includeMessage" tabIndex="11"/>
      <label for="includeMessage"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-quote-reply-desc" defaultValue="Include the original message in reply." /></label></TD>
  </TR>
  <TR> 
    <TD class="PropLabel"><SPAN class="Lbl2"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-auto-spellcheck-heading" defaultValue="Spell Check" />:</span></TD>
    <TD class="PropInput"> 
      <jato:checkbox name="spellCheck" elementId="spellCheck"  tabIndex="12"/>
      <label for="spellCheck"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-auto-spellcheck-desc" defaultValue="Always spell check before sending a message." /></label></TD>
  </TR>
</TABLE>
<!-- Sub-section Title with 5 pixel gray bar -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD colspan="3"><IMG src="../uwc/images/spacer.gif" width="1" height="20" alt=""></TD>
  </TR>
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="5" alt=""></TD>
    <TD class="SectionDivider" width="100%"><IMG src="../uwc/images/spacer.gif" width="1" height="5" alt=""></TD>
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="5" alt=""></TD>
  </TR>
  <TR> 
    <TD colspan="3" class="SectionHeader"><SPAN class="SectionHeader"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mail-forwarding-heading" defaultValue="Mail Forwarding" /></SPAN></TD>
  </TR>
</TABLE>
<!-- Form fill-in -->
<TABLE class="FormInputTableOptions" border="0" cellspacing="0" cellpadding="0" title="">
    <tr>
      <td width="1">&nbsp;  </td>
      <td class="PropCheckBox" valign="top">
        <jato:checkbox name="enabledForward" elementId = "enabledForward" onChange="setDirtyCache()" tabIndex="13" />
      <label for="enabledForward"> <%= getLocalizedLabel(session, "uwc-mail-options-settings-forwarding-enabled", "Enable forwarding") %> </label></td>
    </tr>

    <tr>
      <td width="1">&nbsp;  </td>
      <td class="PropCheckBox" valign="top">
        <jato:checkbox name="dontLeaveCopy" elementId ="dontLeaveCopy" onChange="setDirtyCache()" tabIndex="14" />
      <label for="dontLeaveCopy"><%= getLocalizedLabel(session, "uwc-mail-options-settings-dont-leavecopy-inserver", "Do not leave copy on server") %></label></td>
    </tr>

  <TR> 
    <TD class="PropLabelWHelp"><SPAN class="Lbl2"><label for="forwardEmail"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mail-forwarding-email" defaultValue="Email Address" />:</label></SPAN></TD>
    <TD class="PropInputWHelp"> 
      <jato:textField name="forwardEmail" elementId="forwardEmail" size="30" tabIndex="15"/>
      &nbsp; 
      <jato:button styleClass="Btn1"  name="add" defaultValue="  Add  " onClick="AddEmail();return false ;" onFocus="if (this.disabled==0) this.className='Btn1Hov'" onMouseOver="if (this.disabled==0) this.className='Btn1Hov'" onMouseOut="if (this.disabled==0) this.className='Btn1'" onBlur="if (this.disabled==0) this.className='Btn1'"  tabIndex="16" extraHtml='<%= getTitleForExtraHtml(session, "uwc-mail-options-save-fwd-email","Add the entered email addresses to the Mail Forwarding List")  %>' />

       </TD>
  </TR>
  <TR>
    <TD class="PropLabel">&nbsp;</TD>
    <TD class="PropHelp"><span class="inlineHelpText"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mail-forwarding-email-comment" defaultValue="Separate multiple addresses using a comma." /></span></TD>
  </TR>
  <TR> 
    <TD class="PropLabel" valign="top"><SPAN class="Lbl2"><label for="forwardList"><jato:getModelFieldValue escape="false"  modelClass="com.sun.uwc.common.model.UWCResourceBundleModel" modelName="i18nModel" lookInSession="true" name="uwc-mail-options-settings-mail-forwarding-list" defaultValue="Mail Forwarding list" />:</label></span></TD>
    <TD class="PropInput"> 
      <table border="0" cellspacing="0" cellpadding="0" title="">
        <tr> 
          <td> 
            <jato:listbox name="forwardList" elementId="forwardList" size="4" multiple="true" tabIndex="17"/>
            </td>
          <td><img src="../uwc/images/spacer.gif" width="10" height="1"></td>
          <td> 
            <jato:button styleClass="Btn1" name="remove" elementId="remove" defaultValue=" Remove " onClick="removeEmail();return false ;" onMouseOver="if (this.disabled==0) this.className='Btn1Hov'" onFocus="if (this.disabled==0) this.className='Btn1Hov'" onMouseOut="if (this.disabled==0) this.className='Btn1'" onBlur="if (this.disabled==0) this.className='Btn1'" tabIndex="18"/>
          </td>
        </tr>
      </table>
    </TD>
  </TR>
</TABLE>
<!-- Spacer -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="1" height="20" alt=""></TD>
  </TR>
</TABLE>
<!-- Horizontal Top/Bottom of Page Line -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
    <TD class="TtlLin" width="100%"><IMG src="../uwc/images/spacer.gif" width="1" height="1" alt=""></TD>
  </TR>
</TABLE>
<!-- Bottom of Page Buttons -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD colspan="3"><IMG src="../uwc/images/spacer.gif" width="1" height="5" alt=""></TD>
  </TR>
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
    <TD align="right" width="100%"> 
      <jato:button styleClass="Btn1"  name="savebottom" defaultValue=" Save " onClick="handleSave();return false;" onFocus="if (this.disabled==0) this.className='Btn1Hov'" onMouseOver="if (this.disabled==0) this.className='Btn1Hov'" onMouseOut="if (this.disabled==0) this.className='Btn1'" onBlur="if (this.disabled==0) this.className='Btn1'" tabIndex="18" extraHtml='<%= getTitleForExtraHtml(session, "uwc-mail-options-save-tooltip","Save Changes to  Mail Options") %>' />
    </TD>
    <TD><IMG src="../uwc/images/spacer.gif" width="10" height="1" alt=""></TD>
  </TR>
</TABLE>
<!-- Spacer -->
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0" title="">
  <TR> 
    <TD><IMG src="../uwc/images/spacer.gif" width="1" height="20" alt=""></TD>
  </TR>
</TABLE>
<jato:hidden name="emailAddresses" />
<jato:hidden name="defaultDomain" />
<jato:hidden name="deleteFromFolder" />
<jato:hidden name="sentMessages" />
<jato:hidden name="draftMessages" />
<jato:hidden name="deleteFolder" />

   <jato:href name="Save"/>
</jato:form>
</BODY>
</HTML>
</jato:useViewBean>
