//  head.js
//  Written:  2002-07-22 by James Alarie <jalarie@umich.edu>
//

//  Preload images:
        function PreloadImages(What) {
          var PI_ix1, Which, PI_items;
          top.window.PI_array=new Array();
          for (PI_ix1=0; PI_ix1<What.length-1; PI_ix1++) {
            Which=What[PI_ix1];
            PI_items=Which.split(/,/);
            top.window.PI_array[PI_ix1]=new Image(PI_items[1],PI_items[2]);
            top.window.PI_array[PI_ix1].src=PI_items[0];
          }
        } // PreloadImages
        PI_images=new Array(                        // image file, width, height
          'backgrnd.jpg,193,251,',
          'arrow121.gif,32,32',
          'arrow122.gif,32,32',
          'urhere.gif,19,16',
          'zb0_back.gif,67,24', 'zb1_back.gif,67,24',
          'zb0_home.gif,67,24', 'zb1_home.gif,67,24',
          'zb0_menu.gif,67,24', 'zb1_menu.gif,67,24',
          'zb0_next.gif,67,24', 'zb1_next.gif,67,24',
          'zb0_seek.gif,67,24', 'zb1_seek.gif,67,24',
          'zb0_aud.gif,24,24',  'zb1_aud.gif,24,24',
          'zb0_null.gif,24,24',
        '');
        if (typeof(top.window.PI_array) == 'undefined') {
          PreloadImages(PI_images);
        }
        
//  Offsite links:
        function OffSite(What) {
          // <a href="http://..." onclick="return OffSite(this);">...</a>
          // <form ... onsubmit="OffSite(this);...">
          // button onclick="OffSite(this);..."
          OS_href=What['href'];
          OS_action=What['action'];
          OS_onclick=What['onclick'];
          if ((OS_href) 
          &&  (OS_href != '') 
          &&  (OS_href != 'undefined')) {           // an "a" tag
            if (OS_href.substring(0,4) == 'http') { // only the non-404's
              What.target='_blank';
              OS_Message ='';
              OS_Message+='You are now leaving my site; thank you for ';
              OS_Message+='visiting.  The target site may open in ';
              OS_Message+='a new window; please close it when you wish ';
              OS_Message+='to return. ';
                OS_Confirm=confirm(OS_Message);
              return OS_Confirm;
            }
            return true;
          } // end of "a" tag
          if ((OS_action) 
          &&  (OS_action != '') 
          &&  (OS_action != 'undefined')) {         // a "form" tag
            What.target='_blank';
            OS_Message ='';
            OS_Message+='This form links to a program outside of my ';
            OS_Message+='site.  It may open it\'s results in a new ';
            OS_Message+='window; please close it when you wish to ';
            OS_Message+='return. ';
              alert(OS_Message);
            return true;
          } // end of "form" tag
          if ((OS_onclick)
          &&  (OS_onclick != '')
          &&  (OS_onclick != 'undefined')) {        // an "onclick" button
            OS_Message ='';
            OS_Message+='This button links to a program outside of my ';
            OS_Message+='site.  It may open in a new window; please ';
            OS_Message+='close it when you wish to return. ';
              alert(OS_Message);
            return true;
          } // end of "onclick" button
          return true;
        } // OffSite

//  style1:
        S1_Out ='';
        S1_Out+='    <script type="text\/javascript" src="style1.js"><';
        S1_Out+='\/script>\n';
          document.write(S1_Out);

//  document.lastModified:
        function DocLMod(When) {                      // ex: DocLMod('02-10-09');
          mdte = new Date(document.lastModified);     // last Mod date
          cdte = new Date();                          // current date
          if ((mdte*1 < 1)                            // Netscape & WebTV null
          ||  (Date.parse(mdte) == Date.parse(cdte))) // InetExp null
          {
            document.write("Last update ");
            document.write(When);                     // manually updated
          } else {
            document.write("Last updated ");
            document.write(document.lastModified);    // retrieve from sys
          }
          document.write(' by <a href="jaa_e.htm" title="E-mail / Guestbook">James Alarie<\/a>.');
          return true;
        } // DLMod
