home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / windowsxp / ftgateoffice / ftgateoffice.exe / Main / group.fts < prev    next >
Encoding:
Text File  |  2001-11-29  |  9.9 KB  |  396 lines

  1. <%
  2. #include </utility/global.fts>
  3. #include </utility/ftgate.fts>
  4. #include </utility/theme.fts>
  5. #include </utility/wmsecurity.fts>
  6.  
  7. var type=1
  8.  
  9. #include </utility/common.fts>
  10. %>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  12. <HTML>
  13. <HEAD>
  14. <LINK REL=STYLESHEET HREF="/utility/main<%=nn4%>.css" TYPE="text/css">
  15. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  16. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  17. <TITLE>FTGatePro WebMail</TITLE>
  18. </HEAD>
  19.  
  20. <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
  21. <!--
  22. var dir="<%=buttons%>"
  23.  
  24. if (!document.images) {}
  25. else {
  26.   ok0 = new Image();
  27.   ok0.src  = dir+"ok2.gif";
  28.   ok1 = new Image();
  29.   ok1.src = dir+"ok2on.gif";
  30.   cancel0 = new Image();
  31.   cancel0.src  = dir+"cancel.gif";
  32.   cancel1 = new Image();
  33.   cancel1.src = dir+"cancelon.gif";
  34.   remove0 = new Image();
  35.   remove0.src  = dir+"delete.gif";
  36.   remove1 = new Image();
  37.   remove1.src = dir+"deleteon.gif";
  38.   create0 = new Image();
  39.   create0.src  = dir+"create.gif";
  40.   create1 = new Image();
  41.   create1.src = dir+"createon.gif";
  42. }
  43.  
  44. function change(Name,Image,No)
  45. {
  46.   if (!document.images) {}
  47.   else document[Name].src = eval(Image + No + ".src");
  48.  
  49.     if (No==0)
  50.         st();
  51. }
  52.  
  53. <%
  54. if (netscape)
  55. {
  56.   %>
  57.   var enter=false;
  58.   document.captureEvents(Event.KEYPRESS);
  59.   document.onkeypress = keypress;
  60.   document.onfocus = focus;
  61.  
  62.   function focus(event)
  63.   {
  64.     if (event.target==document.ftgate.body)
  65.     {
  66.       enter=true;
  67.     }
  68.     else
  69.       enter=false;
  70.   }
  71.  
  72.   function keypress(event)
  73.   {
  74.     if (enter)
  75.       return true;
  76.  
  77.     if (event.which==13)
  78.     {
  79.             if (event.target==document.ftgate.address)
  80.                 onAdd();
  81.             else
  82.                 onOK();
  83.  
  84.       return false;
  85.     }
  86.  
  87.     return true;
  88.   }
  89.   <%
  90. }
  91. else
  92. {
  93.   %>
  94.   function keypress()
  95.   {
  96.     if (event.keyCode==13)
  97.     {
  98.       event.returnValue=null;
  99.  
  100.             if (document.activeElement==document.ftgate.address)
  101.                 onAdd();
  102.             else
  103.                 onOK();
  104.     }
  105.   }
  106.   <%
  107. }
  108. %>
  109.  
  110. function onLoad()
  111. {
  112.     <%
  113.     if (err!="")
  114.         output.writeln("alert(\""+err+"\");")
  115.     if (modify!=2)
  116.         output.writeln("document.ftgate.name.focus();");
  117.     else
  118.         output.writeln("document.ftgate.address.focus();");
  119.     %>
  120. }
  121.  
  122. function onLaunch(href)
  123. {
  124.     window.location.href=href
  125. }
  126.  
  127. function isOK(form)
  128. {
  129.     var name = form.name.value;
  130.     if (name=="")
  131.     {
  132.         alert("You must enter a Group name");
  133.         form.name.focus();
  134.  
  135.         return false;
  136.     }
  137.  
  138.     if ((name.indexOf("<",0)!=-1)||(name.indexOf(">",0)!=-1))
  139.     {
  140.         alert("You cannot use '<' or '>' characters in the name.");
  141.         form.name.focus();
  142.  
  143.         return false;
  144.     }
  145.  
  146.     return true;
  147. }
  148.  
  149. function onSelect()
  150. {
  151.     var el = document.ftgate.list;
  152.     var index=el.selectedIndex;
  153.  
  154.     if (index==-1)
  155.         return;
  156.  
  157.     document.ftgate.address.value=el.options[index].text;
  158. }
  159.  
  160. function onRemove()
  161. {
  162.     var el = document.ftgate.list;
  163.     var index=el.selectedIndex;
  164.  
  165.     change('deleteA', 'remove', 0);
  166.  
  167.     if (index==-1)
  168.         return;
  169.  
  170.     var list="";
  171.     for (i=0;i<document.ftgate.list.length;i++)
  172.     {
  173.         if (i!=index)
  174.             list=list+document.ftgate.list.options[i].text+"; ";
  175.     }
  176.  
  177.     if (list!="")
  178.         list=list.slice(0,list.length-2);
  179.  
  180.     document.ftgate.email.value=list;
  181.     document.ftgate.submit();
  182. }
  183.  
  184.  
  185. function onAdd()
  186. {
  187.     if (!isOK(document.ftgate))
  188.         return;
  189.  
  190.     if (!isEmail(document.ftgate.address.value))
  191.     {
  192.         alert("This isn't a valid email address");
  193.         document.ftgate.address.focus();
  194.         return;
  195.     }
  196.  
  197.     if (document.ftgate.list.length)
  198.     {
  199.         var index=-1;
  200.         var found=false;
  201.         for (i=0; i<document.ftgate.list.length; i++)
  202.         {
  203.             if (document.ftgate.list.options[i].text == document.ftgate.address.value)
  204.             {
  205.                 found=true;
  206.                 break;
  207.             }
  208.  
  209.             if ((document.ftgate.list.options[i].text>document.ftgate.address.value)&&(index==-1))
  210.                 index = i;
  211.         }
  212.  
  213.         if (found)
  214.         {
  215.             alert("This email address is already in the group.")
  216.             return;
  217.         }
  218.  
  219.         if (index==-1)
  220.             index=document.ftgate.list.length;
  221.     }
  222.     else
  223.         index=0;
  224.  
  225.     var i
  226.     var list = "";
  227.  
  228.     for (i=0;i<index;i++)
  229.         list=list+document.ftgate.list.options[i].text+"; ";
  230.     list=list+document.ftgate.address.value+"; ";
  231.     for (i=index;i<document.ftgate.list.length;i++)
  232.         list=list+document.ftgate.list.options[i].text+"; ";
  233.  
  234.     if (list!="")
  235.         list=list.slice(0,list.length-2);
  236.  
  237.     document.ftgate.email.value=list;
  238.     document.ftgate.submit();
  239. }
  240.  
  241. function onCancel()
  242. {
  243.     change('cancelA','cancel',0);
  244.     onLaunch("index.fts");
  245. }
  246.  
  247. function onOK()
  248. {
  249.     change('okA','ok',0);
  250.     document.ftgate.modify.value=3;
  251.     document.ftgate.submit();
  252. }
  253. //-->
  254. </SCRIPT>
  255. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/cookies.js" TYPE="text/javascript"></SCRIPT>
  256. <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/core.js" TYPE="text/javascript"></SCRIPT>
  257.  
  258. <BODY BGCOLOR="white" onLoad="onLoad()" MARGINHEIGHT="0" MARGINWIDTH="0" onKeypress="keypress()">
  259.  
  260. <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="100%" HEIGHT="<%=bodyheight%>" CELLPADDING="0" CELLSPACING="0"><TR><TD> </TD><TD VALIGN="TOP">
  261.  
  262. <FORM NAME="ftgate" METHOD="POST" ACTION="group.fts">
  263. <INPUT TYPE="HIDDEN" NAME="config" VALUE="1">
  264. <INPUT TYPE="HIDDEN" NAME="email" VALUE="<%=email%>">
  265. <INPUT TYPE="HIDDEN" NAME="modify" VALUE="<%=modify%>">
  266. <INPUT TYPE="HIDDEN" NAME="id" VALUE="<%=id%>">
  267.  
  268. <TABLE ID="table" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  269.   <TR>
  270.         <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/left.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
  271.         <TD CLASS="navoff" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('/inbox/index.fts')" CLASS="navoff">Inbox</A></TD>
  272.         <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
  273.         <TD CLASS="navon" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('/addresses/index.fts')" CLASS="navon">Addresses</A></TD>
  274.         <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
  275.         <TD CLASS="navoff" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('/options/index.fts')" CLASS="navoff">Options</A></TD>
  276.         <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/right.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
  277.         <TD WIDTH="<%=bodywidth-167%>" HEIGHT="18"> </TD>
  278.   </TR>
  279. </TABLE>
  280. <!--- end of the tabs ----->
  281.  
  282. <!--- start of the tab body --->
  283. <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="100%" CELLPADDING="0" CELLSPACING="0"><TR><TD>
  284. <TABLE <%=table%> CELLPADDING="0" CELLSPACING="0">
  285. <!----- start of block --->
  286. <TR>
  287. <TD VALIGN="TOP">
  288.     <!----- sub table goes here --->
  289.   <TABLE BORDER="0" WIDTH="100%">
  290.     <TR>
  291.       <TD>
  292.               <TABLE CLASS="box" WIDTH="100%">
  293.           <TR>
  294.             <TD>
  295.               <TABLE BORDER="0">
  296.                                 <TR>
  297.                                     <TH COLSPAN="2">
  298.                                     <%
  299.                                         if (modify==1)
  300.                                             output.write("Modify ")
  301.                                         else
  302.                                             output.write("Create ")
  303.                                     %>Group of Contacts</TH>
  304.                                 </TR>
  305.                                 <TR>
  306.                                     <TD>Group name</TD>
  307.                                     <TD><INPUT TYPE="EDIT" NAME="name" VALUE="<%=name%>"></TD>
  308.                                 </TR>
  309.               </TABLE>
  310.                         </TD>
  311.                     </TR>
  312.         </TABLE>
  313.       </TD>
  314.     </TR>
  315.     <TR>
  316.       <TD>
  317.               <TABLE CLASS="box" WIDTH="100%">
  318.           <TR>
  319.             <TD>
  320.               <TABLE BORDER="0" WIDTH="100%">
  321.                                 <TR>
  322.                                     <TH COLSPAN="5">Group</TH>
  323.                                 </TR>
  324.                         <TR>
  325.                             <TD VALIGN="TOP" WIDTH="1%">
  326.                                 <A HREF="javascript:onRemove()"
  327.                                         onMouseDown="change('deleteA','remove',1)"
  328.                                         onMouseOut="change('deleteA','remove',0)">
  329.                     <IMG SRC="<%=buttons%>delete.gif" WIDTH="20" HEIGHT="20" BORDER="0" NAME="deleteA" ALT="Delete filter"></A>
  330.                             </TD>
  331.                             <TD>
  332.                                 <SELECT NAME="list" CLASS="SEL100" SIZE="10" onChange="onSelect()">
  333.                                     <%
  334.                                             var entry
  335.  
  336.                                             while (email!="")
  337.                                             {
  338.                                                 var index=email.indexof(";",0)
  339.  
  340.                                                 if (string(index)!="-1")
  341.                                                 {
  342.                                                     entry=email.slice(0,index)
  343.                                                     email=email.slice(index+1,999)
  344.                                                     email=email.trim()
  345.                                                 }
  346.                                                 else
  347.                                                 {
  348.                                                     entry=email.slice(0,email.length)
  349.                                                     email=""
  350.                                                 }
  351.  
  352.                                                 output.writeln("<OPTION VALUE=\""+entry+"\">"+entry+"</OPTION>")
  353.                                             }
  354.                                     %>
  355.                                 </SELECT>
  356.                             </TD>
  357.                             <TD VALIGN="TOP" WIDTH="1%">Address</TD>
  358.                   <TD VALIGN="TOP" WIDTH="1%"><INPUT TYPE="EDIT" NAME="address" SIZE="<%=size30%>"></TD>
  359.                   <TD VALIGN="TOP" WIDTH="1%">
  360.                     <A HREF="javascript:onAdd()"
  361.                                         onmMouseOver="return st('Add this email address to the group')"
  362.                                         onMouseDown="change('createA','create',1)"
  363.                                         onMouseOut="change('createA','create',0)"><IMG SRC="<%=buttons%>create.gif" WIDTH="20" HEIGHT="20" BORDER="0" NAME="createA" ALT="Add to group"></A>
  364.                             </TD>
  365.                         </TR>
  366.               </TABLE>
  367.                         </TD>
  368.                     </TR>
  369.         </TABLE>
  370.       </TD>
  371.     </TR>
  372.     <TR>
  373.             <TD ALIGN="RIGHT">
  374.                 <A HREF="javascript:onOK()"
  375.                 onMouseOver="return st('Create the new contact')"
  376.                 onMouseDown="change('okA', 'ok', 1)"
  377.                 onMouseOut="change('okA', 'ok', 0)"><IMG SRC="<%=buttons%>ok2.gif" NAME="okA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Create the new contact"></A>
  378.                 <A HREF="javascript:onCancel()"
  379.                 onMouseOver="return st('Return to Address book without creating a new contact')"
  380.                 onMouseDown="change('cancelA', 'cancel', 1)"
  381.                 onMouseOut="change('cancelA', 'cancel', 0)"><IMG SRC="<%=buttons%>cancel.gif" NAME="cancelA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Do not create a new contact"></A>
  382.             </TD>
  383.         </TR>
  384.   </TABLE>
  385.     <!----- sub table ends here --->
  386. </TD>
  387. </TR>
  388. <!------ end of block ----->
  389. </TABLE>
  390. </TD></TR></TABLE>
  391.  
  392. </FORM>
  393. </TD><TD WIDTH="10"> </TD></TD></TR></TABLE>
  394. </BODY>
  395. </HTML>
  396.