/* This file incorporates a number of JavaScript functions
common to all the pages on our web site (e.g.: function
that draws a menu at the top of the page, a links
list and signature at the bottom of the page) */




function WM_preloadImages() {

/*
WM_preloadImages()
Loads images into the browser's cache for later use.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com

Usage: WM_preloadImages('image 1 URL', 'image 2 URL', 'image 3 URL', ...);
*/

  // Don't bother if there's no document.images
  if (document.images) {
    if (typeof(document.WM) == 'undefined'){
      document.WM = new Object();
    }
    document.WM.loadedImages = new Array();
    // Loop through all the arguments.
    var argLength = WM_preloadImages.arguments.length;
    for(arg=0;arg<argLength;arg++) {
      // For each arg, create a new image.
      document.WM.loadedImages[arg] = new Image();
      // Then set the source of that image to the current argument.
      document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
    }
  }
}

var maxindex = 15;
oldimagearray = new Array();
currentimagearray = new Array();
imagearray = new Array();


function loadimages()
{
   for (i = 0; i <= maxindex; i++)
   {
      imagearray[i] = new Image();
      oldimagearray[i] = new Image();
   }

   imagearray[0].src = "home_b.jpg";
   imagearray[1].src = "vancomelady_b.jpg";
   imagearray[2].src = "bio_b.jpg";
   imagearray[3].src = "antoniap_b.jpg";
   imagearray[4].src = "filmography_b.jpg";
   imagearray[5].src = "darlenemcbride_b.jpg";
   imagearray[6].src = "roles_b.jpg"
   imagearray[7].src = "guestbook_b.jpg";
   imagearray[8].src = "pictures_b.jpg";
   imagearray[9].src = "links_b.jpg";
   imagearray[10].src = "soundvideo_b.jpg";
   imagearray[11].src = "review_b.jpg";
   imagearray[12].src = "transcript_b.jpg";
   imagearray[13].src = "news_b.jpg";
   imagearray[14].src = "char_b.jpg";
   imagearray[15].src = "madtvart_b.jpg";
   oldimagearray[0].src = "home.jpg";
   oldimagearray[1].src = "vancomelady.jpg";
   oldimagearray[2].src = "bio.jpg";
   oldimagearray[3].src = "antoniap.jpg";
   oldimagearray[4].src = "filmography.jpg";
   oldimagearray[5].src = "darlenemcbride.jpg";
   oldimagearray[6].src = "roles.jpg"
   oldimagearray[7].src = "guestbook.jpg";
   oldimagearray[8].src = "pictures.jpg";
   oldimagearray[9].src = "links.jpg";
   oldimagearray[10].src = "soundvideo.jpg";
   oldimagearray[11].src = "review.jpg";
   oldimagearray[12].src = "transcript.jpg";
   oldimagearray[13].src = "news.jpg";
   oldimagearray[14].src = "char.jpg";
   oldimagearray[15].src = "madtvart.jpg";
  
   for (i = 0; i <= maxindex; i++)
   {
      currentimagearray[i] = new Image();
      currentimagearray[i].src = oldimagearray[i].src;
   }
}

web_file = new Array();
web_file[0] = new String("nicolesullivantop.html");
web_file[1] = new String("vancometop.html");
web_file[2] = new String("nicolebio.html");
web_file[3] = new String("antoniapage.html");
web_file[4] = new String("nicolecareer.html");
web_file[5] = new String("darlenemcbride.html");
web_file[6] = new String("nicoleappearances.html");
web_file[7] = new String("guestbook.html");
web_file[8] = new String("nicolepictures.html");
web_file[9] = new String("nicolesitelist.html");
web_file[10] = new String("nicolewavs.html");
web_file[11] = new String("review_archive.html");
web_file[12] = new String("nicoletranscripts.html");
web_file[13] = new String("nicolenews.html");
web_file[14] = new String("nicolecharacters.html");
web_file[15] = new String("madtvarticle.html");

var button_state = new Array(maxindex+5);

function init_button_state()
{
   for (i = 0; i < maxindex+5; i++)
        button_state[i] = new Boolean(false);
}

function img_roll(state,i)
{
    var j, oldimg, newimg;
    if (document.images)
    {
       for (j = 0; j < maxindex+3; j++)
       {
          if (state == '_b')
          {
             oldimg = currentimagearray[i].src;
             newimg = imagearray[i].src;
          }
          else
          {
             oldimg = imagearray[i].src;
             newimg = currentimagearray[i].src;
          }

          if (document.images[j].src == oldimg)
             document.images[j].src = newimg;
       }
                  
    }
}

function set_button_state()
{
        var doc_name, file_name;
        var index, i;


        doc_name = new String(document.URL);

        index = doc_name.lastIndexOf("\\");
        if (index == -1)
                index = doc_name.lastIndexOf("\/");

                
       
        if (index != -1)
        {
                file_name = new String(doc_name.substr(index+1));
                for (i = 0; i <= maxindex; i++)
                   if (web_file[i].match(file_name.toLowerCase()))
                      currentimagearray[i].src = imagearray[i].src;
              //     if (file_name.toLowerCase() == web_file[i].toLowerCase())
                //   {
                 //       currentimagearray[i].src = imagearray[i].src;
                  // }
        }
}
        

function make_menu()
{
        loadimages();
        set_button_state();
        document.write('<center>');
        document.write('<table border="0" cellpadding="2" width="542">');
        document.write('<tr>');
        document.write('<td valign="top" colspan="8"><img src="ns_top.gif" width="542" height="21" alt="top line"></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolesullivantop.html" onMouseOver=" ');
        document.write("img_roll('_b',0)");
        document.write('" onMouseout="');
        document.write("img_roll('',0)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[0].src);
        document.write('" alt="Home" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" rowspan="8" colspan="1"><center><img src="nswebsm.jpg" alt="Nicole Sullivan" width="280" height="210"></center></td>');
        document.write('<td valign="top" colspan="1"><a href="vancometop.html" onMouseOver="');
        document.write("img_roll('_b',1)");
        document.write('" onMouseout="');
        document.write("img_roll('',1)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[1].src);
        document.write('" alt="Vancome Lady" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolebio.html" onMouseOver="');
        document.write("img_roll('_b',2)");
        document.write('" onMouseout="');
        document.write("img_roll('',2)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[2].src);
        document.write('" alt="Bio Sheet" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="antoniapage.html" onMouseOver="');
        document.write("img_roll('_b',3)");
        document.write('" onMouseout="');
        document.write("img_roll('',3)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[3].src);
        document.write('" alt="Antonia" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolecareer.html" onMouseOver="');
        document.write("img_roll('_b',4)");
        document.write('" onMouseout="');
        document.write("img_roll('',4)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[4].src);
        document.write('" alt="Filmography" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="darlenemcbride.html" onMouseOver="');
        document.write("img_roll('_b',5)");
        document.write('" onMouseout="');
        document.write("img_roll('',5)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[5].src);
        document.write('" alt="Darlene McBride" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolecharacters.html"');
        document.write('onMouseOver="');
        document.write("img_roll('_b',14)");
        document.write('" onMouseout="');
        document.write("img_roll('',14)");
        document.write('">');
        document.write('<center>');
        document.write('<img src="');
        document.write(currentimagearray[14].src);
        document.write('" alt="Nicole Sullivan Characters" width="120" height="15">');
        document.write('</center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="guestbook.html" onMouseOver="');
        document.write("img_roll('_b',7)");
        document.write('" onMouseout="');
        document.write("img_roll('',7)");
        document.write('">');
        document.write('<center>');
        document.write('<img src="');
        document.write(currentimagearray[7].src);
        document.write('" alt="Guestbook" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicoleappearances.html" onMouseOver="');
        document.write("img_roll('_b',6)");
        document.write('" onMouseout="');
        document.write("img_roll('',6)");
        document.write('">');
        document.write('<center>');
        document.write('<img src="');
        document.write(currentimagearray[6].src);
        document.write('" alt="Guest Appearances on Other Shows" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="nicolesitelist.html" onMouseOver="');
        document.write("img_roll('_b',9)");
        document.write('" onMouseout="');
        document.write("img_roll('',9)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[9].src);        
        document.write('" alt="Links" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolepictures.html" onMouseOver="');
        document.write("img_roll('_b',8)");
        document.write('" onMouseout="');
        document.write("img_roll('',8)");
        document.write('">');
        document.write('<center>');
        document.write('<img src="');
        document.write(currentimagearray[8].src);
        document.write('" alt="Pictures" width="120" height="15">');
        document.write('</center></td>');
        document.write('<td valign="top" colspan="1"><a href="review_archive.html" onMouseOver="');
        document.write("img_roll('_b',11)");
        document.write('" onMouseout="');
        document.write("img_roll('',11)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[11].src);
        document.write('" alt="Review Archive" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicolewavs.html" onMouseOver="');
        document.write("img_roll('_b',10)");
        document.write('" onMouseout="');
        document.write("img_roll('',10)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[10].src);
        document.write('" alt="Sound and Video" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="nicolenews.html" onMouseOver="');
        document.write("img_roll('_b',13)");
        document.write('" onMouseout="');
        document.write("img_roll('',13)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[13].src);
        document.write('" alt="News Archive" width="120" height="15"></center></a></td>');
        document.write('</tr>');
        document.write('<tr>');
        document.write('<td valign="top" colspan="1"><a href="nicoletranscripts.html" onMouseOver="');
        document.write("img_roll('_b',12)");
        document.write('" onMouseout="');
        document.write("img_roll('',12)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[12].src);
        document.write('" alt="Transcripts" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1"><a href="madtvarticle.html" onMouseOver="');
        document.write("img_roll('_b',15)");
        document.write('" onMouseOut="');
        document.write("img_roll('',15)");
        document.write('">');
        document.write('<center><img src="');
        document.write(currentimagearray[15].src);
        document.write('" alt="Mad TV Article" width="120" height="15"></center></a></td>');
        document.write('<td valign="top" colspan="1">');
        document.write('<tr>');
        document.write('<td valign="top" colspan="8"><img src="ns_bot.gif" width="542" height="21" alt="bottom line"></td>');
        document.write('</tr>');
        document.write('</table>');
        document.write('</center>');
}


function write_date_last_modified()
{
        var dateMod = "";
        dateMod = document.lastModified;
        document.write("Late Updated:  ");
        document.write(dateMod);
        document.write();
}

function write_signature()
{
        document.write('<font face="Arial" size="2" color="#FFFFFF">');
        document.write('<p>This page is maintained by <a href="mailto:dzien@nic.com">Number Six.</a></p>');
        write_date_last_modified();
        document.write('</font>');
}



function draw_image_map()
{
        document.write('<hr>');
        document.write('<p><center><img src="ns_imap2.jpg" usemap="#The Unofficial Nicole Sullivan Tribute Page"></center></p>');
        document.write('<hr>');
        document.write('<MAP NAME="The Unofficial Nicole Sullivan Tribute Page">');
        document.write('<AREA SHAPE=RECT COORDS="2,0,448,43" HREF="nicolesullivantop.html" ALT="Home Page">');
        document.write('<AREA SHAPE=RECT COORDS="2,46,448,62" HREF="nicolebio.html" ALT="Bio Sheet">');
        document.write('<AREA SHAPE=RECT COORDS="3,63,448,81" HREF="nicolecareer.html" ALT="Unofficial Nicole Sullivan Filmography">');
        document.write('<AREA SHAPE=RECT COORDS="3,83,448,98" HREF="nicolecharacters.html" ALT="Nicole Sullivan Characters">');
        document.write('<AREA SHAPE=RECT COORDS="4,99,448,118" HREF="nicoletranscripts.html" ALT="Nicole Sullivan Transcripts">');
        document.write('<AREA SHAPE=RECT COORDS="4,119,448,136" HREF="vancometop.html" ALT="The Vancome Lady">');
        document.write('<AREA SHAPE=RECT COORDS="0,139,448,155" HREF="antoniapage.html" ALT="The Antonia Page">');
        document.write('<AREA SHAPE=RECT COORDS="0,158,448,173" HREF="darlenemcbride.html" ALT="Darlene McBride">');
        document.write('<AREA SHAPE=RECT COORDS="2,175,448,193" HREF="nicolepictures.html" ALT="Nicole Sullivan Image Galleries">');
        document.write('<AREA SHAPE=RECT COORDS="0,192,448,211" HREF="nicolewavs.html" ALT="Nicole Sullivan Sound and Video Files">');
        document.write('<AREA SHAPE=RECT COORDS="2,213,448,231" HREF="nicoleappearances.html" ALT="Nicole Sullivan Guest Appearances ">');
        document.write('<AREA SHAPE=RECT COORDS="2,234,448,252" HREF="review_archive.html" ALT="Mad TV Review Archive">');
        document.write('<AREA SHAPE=RECT COORDS="2,254,448,272" HREF="guestbook.html" ALT="Sign the Guestbook">');
        document.write('<AREA SHAPE=RECT COORDS="2,275,448,290" HREF="nicolenews.html" ALT="Nicole Sullivan News Archive">');
        document.write('<AREA SHAPE=RECT COORDS="2,291,448,336" HREF="nicolesitelist.html" ALT="Other Nicole Sullivan and Mad TV Links">');
        document.write('<AREA SHAPE=default HREF="nicolesullivantop.html">');
        document.write('</MAP>');

}

function write_links_list()
{
        document.write('<p><center><a href="nicolesullivantop.html">Home Page</a> |');
        document.write('<a href="nicolebio.html">Nicole Sullivan Bio</a> |');
        document.write('<a href="nicolecareer.html">Nicole Sullivan Filmography</a> |');
        document.write('<a href="nicolepictures.html">Nicole Sullivan Pictures</a> |');
        document.write('<a href="nicolecharacters.html">Nicole Sullivan Characters</a> |');
        document.write('<a href="vancometop.html">The Vancome Lady Page</a> |');
        document.write('<a href="antoniapage.html">The Antonia Page</a> |');
        document.write('<a href="darlenemcbride.html">Darlene McBride Song Lyrics</a> |');
        document.write('<a href="nicoletranscripts.html">Nicole Sullivan Transcripts</a> |');
        document.write('<a href="nicolewavs.html">Nicole Sullivan Sound and Video Files</a> |');
        document.write('<a href="nicoleappearances.html">Nicole Sullivan');
        document.write("'");
        document.write('s Guest Appearances on Other Shows</a> |');
        document.write('<a href="review_archive.html">Archive of <i>Mad TV</i> Reviews</a> |');
        document.write('<a href="nicolesitelist.html">Other Nicole Sullivan Links</a>');
        document.write('</center></p>');
        document.write('<hr>');

}















