/*
Copyright (c) 2007, A.A. Area91, www.aasask.org
All rights reserved.

Redistribution and/or use in source and binary forms, with or without modification, 
are NOT permitted without the express written consent of A.A. Area91.  

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////
//Edit Date:   September 20, 2008
//Author:      A trudger of the road to happy destiny 
//Title:       area91.js    
//Description: 
//   This Javascript file holds the code to display the specified text in the window status bar
//Global variables:
//   scrollid   id of the page that called this script
//              scrollid is declared as follows on each page just before this script is declared:
//                 <script type="text/Javascript"> var scrollid = "";</script>
//              if the scrollid is blank, no script will be displayed in the status bar
//   values for scrollid:
//      I     I am Responsible.  When anyone, anywhere, reaches out for help, I want the hand of A.A. always to be there.  And for that:  I am responsible.
//      D     Welcome to Area 91 - Saskatchewan District Information Page.
//      1     Welcome to Area 91 - Saskatchewan District 1 Information Page.
//      2     Welcome to Area 91 - Saskatchewan District 2 Information Page.
//      3     Welcome to Area 91 - Saskatchewan District 3 Information Page.
//      4     Welcome to Area 91 - Saskatchewan District 4 Information Page.
//      6     Welcome to Area 91 - Saskatchewan District 6 Information Page.
//      7     Welcome to Area 91 - Saskatchewan District 7 Information Page.
//      8     Welcome to Area 91 - Saskatchewan District 8 Information Page.
//      8     Welcome to Area 91 - Saskatchewan District 9 Information Page.
//     10     Welcome to Area 91 - Saskatchewan District 10 Information Page.
//     11     Welcome to Area 91 - Saskatchewan District 11 Information Page.
//     12     Welcome to Area 91 - Saskatchewan District 12 Information Page.
//     13     Welcome to Area 91 - Saskatchewan District 13 Information Page.
//     14     Welcome to Area 91 - Saskatchewan District 14 Information Page.
//     15     Welcome to Area 91 - Saskatchewan District 15 Information Page.
//     16     Welcome to Area 91 - Saskatchewan District 16 Information Page.
//     17     Welcome to Area 91 - Saskatchewan District 17 Information Page.
//     18     Welcome to Area 91 - Saskatchewan District 18 Information Page.
//     19     Welcome to Area 91 - Saskatchewan District 19 Information Page.
//     20     Welcome to Area 91 - Saskatchewan District 20 Information Page.
//     21     Welcome to Area 91 - Saskatchewan District 21 Information Page.
//      L     Welcome to Area 91 - Saskatchewan Links Page.
//      A     Welcome to Area 91 - Saskatchewan's Archives Page.
//      C     Welcome to Area 91 - Contact Information.
//      R     Welcome to Area 91 - Roundup Information.
//      E     Welcome to Area 91 - Special Events Page.
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Scroller
//
// variables:
//   scrollCounter          number of characters to display in the status bar
//   scrollText             text to be scrolled in the status bar
//   scrollDisplay          number of milliseconds between repeats of scroll function
//   i                      loop counter
// description:
//   - set the text to be scrolled
//   - set the position indicator to 0 for start of text
//   - set the delay to 50 milliseconds
//   - left pad the text with spaces until the text is 140 characters in length
//   - start up the Scroller
//     - if the position indicator it at the end of the text, reset it to 0, the start of the text
//     - set the text in the window status bar to a portion of the text, starting with the
//       specified position and continuing to the end of the text
//     - increment the position indicator
//     - after the specified delay, restart the Scroller 
/////////////////////////////////////////////////////////////////////////////////////////////////////
   // declare the scrollCounter and set it to 0 to start at the beginning of the text
   var scrollCounter = 0;
   // declare the scrollText
   var scrollText = "";
   // based on the declared id, set the text to the approriate value
   // set scrollText to the text to be scrolled
   if (scrollid == "I"){scrollText = "I am Responsible.  When anyone, anywhere, reaches out for help, I want the hand of A.A. always to be there.  And for that:  I am responsible.";}
   if (scrollid == "D"){scrollText = "Welcome to Area 91 - Saskatchewan District Information Page. ";}
   if (scrollid == "L"){scrollText = "Welcome to Area 91 - Saskatchewan Links Page. ";}
   if (scrollid == "A"){scrollText = "Welcome to Area 91 - Saskatchewan's Archives Page. ";}
   if (scrollid == "C"){scrollText = "Welcome to Area 91 - Contact Information. ";}
   if (scrollid == "R"){scrollText = "Welcome to Area 91 - Roundup Information. ";}
   if (scrollid == "E"){scrollText = "Welcome to Area 91 - Special Events Page. ";}
   if (scrollid == "1"){scrollText = "Welcome to Area 91 - Saskatchewan District 1 Information Page. ";}
   if (scrollid == "2"){scrollText = "Welcome to Area 91 - Saskatchewan District 2 Information Page. ";}
   if (scrollid == "3"){scrollText = "Welcome to Area 91 - Saskatchewan District 3 Information Page. ";}
   if (scrollid == "4"){scrollText = "Welcome to Area 91 - Saskatchewan District 4 Information Page. ";}
   if (scrollid == "6"){scrollText = "Welcome to Area 91 - Saskatchewan District 6 Information Page. ";}
   if (scrollid == "7"){scrollText = "Welcome to Area 91 - Saskatchewan District 7 Information Page. ";}
   if (scrollid == "8"){scrollText = "Welcome to Area 91 - Saskatchewan District 8 Information Page. ";}
   if (scrollid == "9"){scrollText = "Welcome to Area 91 - Saskatchewan District 9 Information Page. ";}
   if (scrollid == "10"){scrollText = "Welcome to Area 91 - Saskatchewan District 10 Information Page. ";}
   if (scrollid == "11"){scrollText = "Welcome to Area 91 - Saskatchewan District 11 Information Page. ";}
   if (scrollid == "12"){scrollText = "Welcome to Area 91 - Saskatchewan District 12 Information Page. ";}
   if (scrollid == "13"){scrollText = "Welcome to Area 91 - Saskatchewan District 13 Information Page. ";}
   if (scrollid == "14"){scrollText = "Welcome to Area 91 - Saskatchewan District 14 Information Page. ";}
   if (scrollid == "15"){scrollText = "Welcome to Area 91 - Saskatchewan District 15 Information Page. ";}
   if (scrollid == "16"){scrollText = "Welcome to Area 91 - Saskatchewan District 16 Information Page. ";}
   if (scrollid == "17"){scrollText = "Welcome to Area 91 - Saskatchewan District 17 Information Page. ";}
   if (scrollid == "18"){scrollText = "Welcome to Area 91 - Saskatchewan District 18 Information Page. ";}
   if (scrollid == "19"){scrollText = "Welcome to Area 91 - Saskatchewan District 19 Information Page. ";}
   if (scrollid == "20"){scrollText = "Welcome to Area 91 - Saskatchewan District 20 Information Page. ";}
   if (scrollid == "21"){scrollText = "Welcome to Area 91 - Saskatchewan District 21 Information Page. ";}
   // declare the scrollDisplay and set it to the number of seconds between calls to scroll function
   var scrollDelay = 50;

   var i = 0;
   // left pad the scrollText with spaces until it is 140 characters in length
   // ++ increments i after it uses it
   while (i++ < 140){
       scrollText = " " + scrollText;
   }

   //function that actually does the scrolling
   function Scroller(){
       // set the text in the status bar to a substring of the original, from the scrollCounter position
       // to the end of the scrollText
       // ++ increments scrollCounter after it is used
       window.status = scrollText.substring(scrollCounter++, scrollText.length);
       // if the scrollCounter = the length of the scrollText, meaning all of the text has been scrolled
       if (scrollCounter == scrollText.length){
           // reset the scrollCounter back to 0 to start back at the beginning of the scrollText the
           // next time Scroller is called
           scrollCounter = 0;
       }
       // call on the computer's timer to determine when to call this function again
       // this function is called again after scrollDelay milliseconds
       setTimeout("Scroller()", scrollDelay);
   }

   // start up the scroller
   // the setTimout call inside Scroller() will keep it going until the web page is terminated
   Scroller();
