/* adapted from the article at http://www.sitepoint.com/print/1012 */

/* The menu details */ 
var links = new Array ("stephanieandmatt.com", 
		       "stephie",
			   "imagination2010",
		       "ireland",
		       "orlando",
		       "california",
		       "birthday",
		       "safe",
               "cheyenne", 
		       "kisu", 
		       "cicadas",
		       "wallet",
		       "banana",
		       "none"); 
var links_text = new Array ("Home Page<BR>",
                            "Stephanie's Art Pages<BR>",
							"Imagination 2010<BR>",
                            "Ireland 2009<BR>",
                            "Orlando 2009<BR>",
                            "California 2005<BR>",
                            "Stephie's Birthday Party<BR>",
                            "Safe Computing<BR>",
                            "The Cheyenne Story<BR>",
                            "Kisu's Pictures<BR>",
                            "2007 Cicada Page<BR>",
                            "Grandpa's Wallet<BR>",
                            "Stephie and Diane's Banana Project<BR>",
                            "Contact Us<BR>");

var links_url = new Array ("/index.php", 
                           "/stephie/index.html",
						   "/imagination2010/index.html",
                           "/ireland/index.html",
                           "/orlando/index.html",
                           "/california/index.html",
                           "/birthday/index.html",
                           "/safe/index.html",
                           "/cheyenne/index.html", 
                           "/kisu/index.html", 
                           "/cicadas/index.html",
                           "/wallet/index.html",
                           "/banana/index.html",
                           "mailto:pookiesdad@sbcglobal.net"); 

/* The Cheyenne pages menu details */ 
var pookie_links = new Array ("index", 
               "page2", 
               "page2a", 
               "page2b", 
               "page2c", 
               "page2d", 
               "page2e", 
               "page2f", 
               "page2g", 
               "page2h", 
               "page2i", 
               "page2j", 
               "page2k", 
               "page3", 
               "page4", 
		       "page5", 
		       "page6", 
		       "page7"); 
var pookie_links_text = new Array ("Introduction",
                            "1.It was inevitable...",
                            "2.Enter: Pookie",
                            "3.The Waiting",
                            "4.The Adoption",
                            "5.The Big Day Arrives",
                            "6.Pookie's New Home",
                            "7.Life with a Dog",
                            "8.Moving",
                            "9.Being Suburbanites",
                            "10.A Traveling Dog",
                            "11.Cheyenne slows down",
                            "12.Life without Pookie<BR>",
                            "About Poopie Papers<BR>",
                            "The Beetle Bug<BR>",
                            "Dog Years<BR>",
                            "Links / References<BR>",
                            "Info<BR>");

var pookie_links_url = new Array ("/cheyenne/index.html", 
                           "/cheyenne/page2.html",
                           "/cheyenne/page2a.html",
                           "/cheyenne/page2b.html",
                           "/cheyenne/page2c.html",
                           "/cheyenne/page2d.html",
                           "/cheyenne/page2e.html",
                           "/cheyenne/page2f.html",
                           "/cheyenne/page2g.html",
                           "/cheyenne/page2h.html",
                           "/cheyenne/page2i.html",
                           "/cheyenne/page2j.html",
                           "/cheyenne/page2k.html",
                           "javascript:void window.open('/cheyenne/page3.html','MyWindow', 'height = 385, width = 605');",
                           "javascript:void window.open('/cheyenne/page4.html','MyWindow', 'height = 385, width = 605');",
                           "/cheyenne/page5.html",
                           "/cheyenne/page6.html",
                           "/cheyenne/page7.html"); 

/* Resolve the location */ 
var loc=String(this.location); 
loc=loc.split("/");
var loc_page=loc[loc.length-1].split(".");
loc_page=loc_page[loc_page.length-2]; 
loc=loc[loc.length-2]; 

/* Menu generating function */ 
function dyn_menu_gen() 
{ 
document.write('<TD vAlign=top BGCOLOR="blue" WIDTH="165">');
document.write('<P style="MARGIN-LEFT: 16px">');

for(var i=0; i<links.length; i++) 
{ 
 if(loc==links[i]) 
 { 
  document.write(links_text[i]);
  if(loc=="cheyenne")
  {
	for(var j=0; j<pookie_links.length; j++) 
	{ 
 		if(loc_page==pookie_links[j]) 
 		{ 
  			document.write(pookie_links_text[j]);
	 	} 
 	else 
 		{ 
  			document.write('<a CLASS="InMenuBar" href="' + pookie_links_url[j] + '">' + pookie_links_text[j] + '</a>');
 		} 
 	document.write('&nbsp<br>');
	}
  } 
 } 
 else 
 { 
  document.write('<a CLASS="InMenuBar" href="' + links_url[i] + '">' + links_text[i] + '</a>');
 } 
 document.write('&nbsp<br>');

} 
 document.write('</P>'); 
 document.write('</TD>');
} 

function disp_pic(strImage) 
{ 
document.write('<IMG NAME="' + strImage + '" SRC="Images/' + strImage + 'sm.jpg" ALIGN="Left" ONCLICK ="window.open(\'Images/' + strImage + '.jpg\')" ALT="' + strImage + '" border=1 hspace=3 vspace=3>');
}

function disp_vid(strVid, strSize) 
{ 
/*first determine the video size based on the parm passed */
if(strSize == "LARGE") {
	nWidth = "640";
	nHeight = "480";
}
else {
	nWidth = "320";
	nHeight = "240";
}
var path = location.href.split("/");
path[path.length-1]="";
path=path.join("/");

document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + nWidth + "' height='" + nHeight + "' id='single1' name='single1'>\
<param name='movie' value='../player.swf'>\
<param name='allowfullscreen' value='true'>\
<param name='allowscriptaccess' value='always'>\
<param name='wmode' value='transparent'>\
<param name='flashvars' value='file=" + path + "Images/" + strVid + ".flv'>\
<embed \
type='application/x-shockwave-flash'\
id='single2'\
name='single2'\
src='../player.swf'\
width='" + nWidth + "'\
height='" + nHeight + "'\
bgcolor='undefined'\
allowscriptaccess='always'\
allowfullscreen='true'\
wmode='transparent'\
flashvars='file=" + path + "Images/" + strVid + ".flv'\
/>\
</object>");


/* old code below
document.write('<object width="' + nWidth + '" height="' + nHeight + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n');
document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"> \n');
/* document.write('<param name="flashvars" value="file=http://www.stephanieandmatt.com/Cicadas/Images/' + strVid + '.flv" /> \n'); 
document.write('<param name="flashvars" value="file=./Images/' + strVid + '.flv" /> \n');
document.write('<param name="movie" value="http://www.stephanieandmatt.com/flvplayer.swf" /> \n');
document.write('<embed src="http://www.stephanieandmatt.com/flvplayer.swf" width="' + nWidth + '" height="' + nHeight + '" bgcolor="#FFFFFF"  \n');
document.write('type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  \n');
/* document.write('flashvars="file=http://www.stephanieandmatt.com/Cicadas/Images/' + strVid + '.flv" /> \n'); 
document.write('flashvars="file=./Images/' + strVid + '.flv" /> \n');
document.write('</object>  \n'); */
}

function SearchClick2()
{
	search_value = document.CurrentForm.search_field.value;
	var sPath = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	document.location.href = sPage + "?search_field=" + search_value;	
}

/* Generate the menu */ 
dyn_menu_gen(); 