/* *******************************************************
** POPUPS.JS - JS-Powered Popups Library
** =====================================
** This library contains code to enable the various types
** of JS-powered popups on the Survival Kit Popups page. 
** Enjoy ... and please maintain this header!
**
** To load this library in an HTML doc, put the following
** line in the doc's HEAD (before any other SCRIPT tags):
**
** <SCRIPT SRC="popups.js" LANGUAGE="JavaScript"></SCRIPT>
**
** Author      Ver  Date    Comments
** ======      ===  ====    ========
** Rick Scott  1.0  2/1/00  First release
**
** Copyright 2000, Rick Scott, all rights reserved.
******************************************************* */

var firstWin = true;  // used in openWin() function

function writeStatusMsg(msg)  // write msg to status bar
  {
  // when used with onMouseOver/onMouseOut, you must code like this:
  // onMouseOver="return writeStatusMsg('status-bar message')"
  window.status = msg;
  return true;
  }

function setDefaultStatusMsg(msg)  // write default msg to status bar
  {
  window.defaultStatus = msg;
  }

function doMouseOver(id)  // process mouseOvers for Popups demo
  {
//  if (!showPopup)
//   return;
   if (id == 'k1')
    drc('Tack is a nautical term defined as the position of a vessel relative to the trim of its sails, the act of changing from one position or direction to another. When going against the wind, a sailboat "tacks" back and forth to move forward. As it relates to work teams, it is a course of action to minimize opposition and maximize effort in attaining a goal. The working model is comprised of Purpose, Vision, and Practice.  Click for more information.',
        'Team Tacks™');
  else 
   if (id == 'k2')
    drc('Members of a information technology team include the owner/champion of a project or operation, IT professionals, suppliers, clients (formerly called users), and the IT team coach who many times doubles as the team leader but whose primary purpose is to keep the team members in alignment with the team purpose',
        'IT Team');
  else
   if (id == 'k3')
    drc('Click to see a slide presentation of the "The Purpose of Vision", one of the Motivated on Purpose™ series of workshops. This presentation is a guide for the team leader to promote creativity, develop character, and increase job satisfaction for each team member.',
         'Motivated on Purpose™')
  else
   if (id == 'k4')
    drc('An IT Health Checkup covers the five critical areas in having your information technology be effective: Purpose, Task Organization, Standards & Policies, Documentation, and Planning. Click for more information.',
         'Information Technology Health Checkup')
  else
   if (id == 'k5')
    drc("Anthony Dziedzic draws upon his many years experience as an information technology professional and company executive in developing the principles and methods of Team Tacks(tm). The ideas and disciplines presented in Mr. Dziedzic's 'Motivated on Purpose' series of workshops and presentations have been published and quoted in Information Technology trade journals: Datamation,  InformationWeek and CIO.",
         "Anthony R. Dziedzic founder of ARD Associates")         
}

function doMouseOut()  // process mouseOuts for Popups demo
  {
//  if (showPopup)
    nd();
  //if (showAlert)
    //window.status = "";
  }

function doClick(id)   // process clicks for Popups demo
  {
  if (showAlert)
    {
    if (id == 'f1')
      alert('You clicked on footnote #1.');
    else if (id == 'f2')
      alert('You clicked on footnote #2.');
    else if (id == 'f3')
      alert('You clicked on footnote #3.');
    else if (id == 'f4')
      alert('You clicked on footnote #4.');
    else if (id == 'f5')
      alert('You clicked on footnote #5.');
    else if (id == 'k1')
      alert('You clicked on keyword #1.');
    else if (id == 'k2')
      alert('You clicked on keyword #2.');
    else if (id == 'k3')
      alert('You clicked on keyword #3.');
    else if (id == 'k4')
      alert('You clicked on keyword #4.');
    else if (id == 'k5')
      alert('You clicked on keyword #5.');
    }
  else if (showWindow)
    {
    if (id == 'f1')
      openWin("", "<B>Footnote #1</B><P>You just clicked on it.",
              "width=120,height=140");
    else if (id == 'f2')
      openWin("", "<B>Footnote #2</B><P>You just clicked on it.",
              "width=120,height=280");
    else if (id == 'f3')
      openWin("", "<B>Footnote #3</B><P>You just clicked on it.",
              "width=320,height=280");
    else if (id == 'f4')
      openWin("", "<B>Footnote #4</B><P>You just clicked on it.",
              "width=240,height=280");
    else if (id == 'f5')
      openWin("", "<B>Footnote #5</B><P>You just clicked on it.",
              "width=240,height=140");
    else if (id == 'k1')
      openWin("", "<B>Keyword #1</B><P>You just clicked on it.",
              "width=120,height=140");
    else if (id == 'k2')
      openWin("", "<B>Keyword #2</B><P>You just clicked on it.",
              "width=240,height=140");
    else if (id == 'k3')
      openWin("", "<B>Keyword #3</B><P>You just clicked on it.",
              "width=240,height=280");
    else if (id == 'k4')
      openWin("", "<B>Keyword #4</B><P>You just clicked on it.",
              "width=120,height=280");
    else if (id == 'k5')
      openWin("", "<B>Keyword #5</B><P>You just clicked on it.",
              "width=50,height=340");
    }
  }

function openWin(url, str, features)  // open popup window
  {
  // Netscape recognizes the popupWin object, so we can
  // write code that keeps a single popup window open.
  // IE does not recognize the popupWin object, we must
  // write code that opens multiple popup windows.
  // More info: www.dannyg.com/javascript/jsminifaq.html#q13

  if (navigator.appName.indexOf("Netscape") != -1)  // Netscape only!
    {
    if (!firstWin)  // can't reference popupWin unless it exists
      if (popupWin.document)  // if user didn't already close popupWin,
        popupWin.close();     // close it now (before opening new popupWin)
    }
  popupWin = window.open(url, "", features);  // Netscape and IE from here on
  if (str != "")
    {
    popupWin.document.write(str);
    popupWin.document.close();
    }
  firstWin = false;  // because popupWin now exists
  }


