                    You Have Mail

This is one way to add a "you have new mail" link on your home page
for web users. Note, there's some good and bad in this design.
The good: you can easily add other applications that have 'new' items
providing they have a URL entry that will determine it. This
works for both wg apps and non-wg apps. It also doesn't require any
code changes on the server side. The bad: it's kinda clunky
and you have to be careful or it falls apart like a house of cards.

setup:
Note, we've already done the work. You can just copy the files in 
this directory to the appropriate places.

Design philosopy:
If a web add-on has a url link that indicates when it has 'new' stuff
for a logged in user, then you can auto-launch that request in a hidden frame,
(provided the url doesn't reset it's 'newness' flag when run)
and the html in the frame sets a global variable that's displayed later
to the user (via page or popup). The cool thing about this way is that 
you can add 'new' notifications for add-in apps in a few moments.
The downside is that there's some timing issues you have to get around. 
That is, the hidden page has to finish displaying before the flags can be set, 
so you'll see code in there dealign with timing issues.
The upside is that the values of these global variables can be displayed anywhere.
One the other hand, they are subject to be reset if the user resets browser.

The StartNewStuffChk() function is what kicks off the determination of new.


Requirements:
- the html code is all javascript
- Worldgroup must be set to login via cookies
- Requires you have a frame set, setup as in the example.


How To:
1) index.htm
   The main frame should be a frame set with hidden frames and special javascript
   code for the 'new stuff' check. See the sample web site provided.
   You can find the code in all the web pages related to new stuff tagged like:
      "// BEGIN NEW ITEMS NOTIFICATION SCRIPT "

   The following files are samples and contain code you need.
     index.htm  - contains the meat of everything. You'll add code here
                  for additional things you want to notify users of 'new'.
                  This is a frameset.  See section 4 for details.
     main.htm   - Where the action occurs on this web site.It has the
                  code to build the table of 'new' items
     top.htm    - the only item of note is the 'to home' link does
                  not refresh entire page, but just themain frame.
     navbar.htm - left side nav bar, nothing special in there


2) wgserv\galacth\galsesah\login\welcome.htm.
   Modify the welcome login screen, to fire up the new check sequence,
   and also to target to the main frame, rather than site home (as that'll
   reset the global variables we are trying to set).

   See the modified Welcome.htm file in this archive

3) modify the "new list' url web pages for each app that should be check for 'new'.
 
   At the top of the document add:
     <!-- BEGIN NEW ITEMS NOTIFICATION SCRIPT -->
     <script>
     <!-- 
        top.NewStuffSet("email",1);    <<<< be sure to change 'email' to a unique id (see seciton x)
     //-->
     </script>
     <!-- END NEW ITEMS NOTIFICATION SCRIPT -->
   This will set new to true when the page starts displaying.
   If no records are found the following code, will reset it.

   Find the place inthe HTML that's displayed when 'no new recs found'.
   Typically in WG modules that's a text variable. Insert this code:

     // BEGIN NEW ITEMS NOTIFICATION SCRIPT 
                top.NewStuffSet("email",0);    <<<< same unique ID as above
     // END NEW ITEMS NOTIFICATION SCRIPT 

   See the completed pages in this archive.

  Repeat for:
 
  3a) wgserv\galacth\galemlah\LIST\index.htm
  3b) wgserv\galacth\galfilah\LIST\FILES\IndexM.htm
  3c) wgserv\galacth\GALPNQAH\LIST\index.htm


4) How to add other things to check for 'new'

 - initNewStuff() in index.htm
   - Add a new checkItems[] element.
     The arguments are:
       uniqiue id - as indicated in section 3, that is the ID you use
                    to call back into and set in this array.
       InvokerUrl - URL to invoke to check to 'new' items.
                    i.e. /polls/list/?status=new
       txtNoNew   - text to display if NO new data, or ""
       txtNew     - text to display if new data (should be a link too)
       NewData    - set to 0
    
     example: 
      checkItems[1] = new checkNew("polls","/polls/list/?status=new","No new polls","<a href='/polls'>There are new polls!</a>",0);

 - NewStuffChk() in index.htm
   - add a reference to a new hidden frame in the 'lame hack' section.    

 - frame set in index.htm
   - add the hidden frame here, be sure to also add a reference to 0' for the
     row width in the frameset tag above.

 - In the addon app to check for new
   See section 3 above.
 
Things you could add that might be cool:
. new discussion quickscan forums
. new files in a particular library

-------
Important notes:
- don't put links in the site that go back to the original homepage
  else you'll reset the global variables (maybe there's a code way aorund
  this I need to investigate), instead send them back to main frame.
