// JavaScript Document


//easier floaty table of contents ************************
//  http://www.csscreator.com/menu/multimenu.php

activateMenu = function(nav)
{

  /* currentStyle restricts the Javascript to IE only */
  if (document.all && document.getElementById(nav).currentStyle)
  {
    var navroot = document.getElementById(nav);
    
    /* Get all the list items within the menu */
    var lis=navroot.getElementsByTagName("LI");  
    for (i=0; i<lis.length; i++)
    {
      
      /* If the LI has another menu level */
      if (lis[i].lastChild.tagName=="UL")
      {
        
        /* assign the function to the LI */
        lis[i].onmouseover=function()
        {
          
          /* display the inner menu */
          this.lastChild.style.display="block";
        }
        lis[i].onmouseout=function()
        {
          this.lastChild.style.display="none";
        }
      }
    }
  }
}

//populates floaty table of contents 

function stuff_list(topic_name, topic_array)
{

 
document.writeln( ' '+ topic_name + '&nbsp&nbsp&nbsp');

  for (i = 0; i < topic_array.length; i++) 
  {
//document.writeln( '' + topic_array[i]+''); 
  
  var lev2 = new Array();
  lev2 = topic_array[i].split(";");
if (i<topic_array.length-1) {
document.writeln( '<a href=' + lev2[0] +'>'); 
document.writeln( '' + lev2[1] +'&nbsp;|</a>'); 
}
else
{
	   document.writeln( '<a href=' + lev2[0] +'>'); 
document.writeln( '' + lev2[1] +'&nbsp;</a>'); 
}	   
	   }

}




var nav_array = new Array(
   "mailto:chollaball@cox.net;Jason",
     "mailto:beckieholmes@cox.net;Beckie",
     "http://members.cox.net/chollaball target=\"_blank\";Homepage"
                          );    



var recent = new Array(

 "http://www.drin.org/jason/Adventures/brycezion/1_1.htm target=\"_blank\";Bryce & Zion",  
"http://members.cox.net/casa_victoria/index.htm  target=\"_blank\";Casa Victoria",  
"http://www.drin.org/jason/Adventures/Moab_2005/  target=\"_blank\";Moab 2005",  
                      "http://www.drin.org/jason/foundcat/cat.htm target=\"_blank\";Found Cat",
                      "http://members.cox.net/chollaball/wedding/index.htm target=\"_blank\";Wedding",
                      "http://www.drin.org/jason/Adventures/Grand_Canyon/index.htm target=\"_blank\";Grand Canyon" 
                      );


var albums = new Array(
                          "Albums",
                          "birth.asp;Birth",
                          "1month.htm;1 Month",
                          "2months.htm;2 Months",
						  "3months.htm;3 Months",
    					  "4_5months.htm;4-5 Months",
	     				  "6_7months.htm;6-7 Months",
						  "guest.asp; Guestbook"
                          );



 

var toplev = new Array(
                      albums
                       );




function stuff_list2(arrays)
{
  for (var i = 0; i < arrays.length;i++)
  {
    //get first item in each subarray to label the section
    document.writeln('<li><a href="#"> ' + arrays[i][0] + '</a><ul id="nav"> ');
    var lev2 = new Array();
    
    for (var j = 1; j < arrays[i].length;j++)
    {
//figures out 2nd level array headers vs. 2nd level items - 2nd level headers are less than 10
      if (arrays[i][j].length > 7)
      {
        if (arrays[i][j].length > 10)
        {
          lev2 = arrays[i][j].split(";");
//adding ids so the background can be changed onload
          //this line extract the id from the data array (statically)  
          document.write('<li id="'+lev2[2]+'"> <a href="' + lev2[0] + '" >'+ lev2[1] + '</a>');

//this line generates the id dynamically from how the array is ordered
          //  document.write('<li id="'+(1+i)+j+'"> <a href="' + lev2[0] + '" >'+ lev2[1] + (1+i)+j + '</a>');


//  use this line to fade navbar text in on top of page
//   document.write('<li id="'+(1+i)+j+'"> <a href="' + lev2[0] + '" onMouseOver="fade_text(\' ' + lev2[1] + '\');"  >'+ lev2[1] +  (1+i)+j+'</a>');

        }

        else
        {
          lev2 = arrays[i][j].split(";");
          document.write('<li><a href="' + lev2[0] + '" >'+ lev2[1] + '</a>');
        }
      } else
      {
        //writes 3rd level items
        document.write('<ul>');
        for (var k = 0; k < arrays[i][j].length; k++)
        {
          lev3 = arrays[i][j][k].split(";");
          
          
          //this line extract the id from the data array (statically)  
          document.write('<li id="'+lev3[2]+'"><a href="' + lev3[0] + '">'+ lev3[1] + '</a></li>');

//this line generates the id dynamically from how the array is ordered
//		document.write('<li id="'+(1+i)+j+k+'"><a href="' + lev3[0] + '">'+ lev3[1] + (1+i)+j+k+'</a></li>');
          
          //  use this line to fade navbar text in on top of page
//		document.write('<li id="'+(1+i)+j+k+'"><a href="' + lev3[0] + '" onMouseOver="fade_text(\' ' + lev3[1] + '\');">'+ lev3[1] + (1+i)+j+k+'</a></li>');
          
        }
        document.write('</ul>');
      }
    }
    document.writeln('</ul></li> ');
  }
}

function pagenum_launch(arrays, pagenum)
{
      
//arrays=toplev;
  for (var i = 0; i < arrays.length;i++)
  {
    var lev2 = new Array();
    for (var j = 1; j < arrays[i].length;j++)
    {
      if (arrays[i][j].length > 7)
      {
        if (arrays[i][j].length > 10)
        {
          lev2 = arrays[i][j].split(";");

          if (lev2[2]==pagenum)
          {
   
        highlight_img(lev2[2],1);
            fade_text(lev2[1]);
          }


		  
        }
		else
		{
		 lev2 = arrays[i][j].split(";");
	       
          if (lev2[2]==pagenum)
          {
   
        highlight_img(lev2[2],1);
            fade_text(lev2[1]);
          }


        }
	  }
	  else
      {
        //writes 3rd level items
          for (var k = 0; k < arrays[i][j].length; k++)
          {
          lev3 = arrays[i][j][k].split(";");
	 
	 
	          if (lev3[2]==pagenum)
    	      {

			      	   highlight_img(lev3[2],1);
          	  fade_text(lev3[1]);
              }


          }
      }
    }
  }
  
}


