/****************************************Dreamweaver mouse overs***********************************************/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}

/****************************************writing the template***********************************************/
var logo
var className
var navBarArray
var gRelativeRoot
navBarArray = new Array()

function setupSection(section){
/*
0 = home
1 = FCRV
2 = Embers
3 = Calendar
4 = Retirees
5 = Maps
*/
	switch(section){
		case 0:
			logo="HomeLogo.gif"
			className="home"
			dotGif="GreenDot.gif"
			break
		case 1:
			logo="FCRVLogo2.gif"
			className="fcrv"
			dotGif="BrownDot.gif"
			break
		case 2:
			logo="EmbersLogo.gif"
			className="embers"
			dotGif="RedDot.gif"
			break			
		case 3:
			logo="CalendarLogo.gif"
			className="calendar"
			dotGif="BlueDot.gif"
			break
	 	case 4:
			logo="RetireesLogo.gif"
			className="retirees"
			dotGif="PurpleDot.gif"
			break
	 	case 5:
			logo="book.gif"
			className="retirees"
			dotGif="PurpleDot.gif"
			break
		default:
			document.write("Invalid section.")
		}
}

function beginTemplate(section, highlightIndex, sectionTitle, sectionSubTitle, showArchives, relativeRoot){
//set the global variable, gRelativeRoot, to the relative root argument - this is so the variable can be used in the end template procedure
gRelativeRoot = relativeRoot
setupSection(section)
document.write("<table width='97%' height='97%' border='0' bgcolor='#FFFFCC' cellpadding='0' cellspacing='0'>")
//top yellow row
document.write(  "<tr>")
document.write(    "<td height='10' width='10'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(    "<td colspan = 2><img src='" + relativeRoot + "/graphics/FCRVTitle.gif' height='20' width='140'alt='Colorado FCRV'></td>")
document.write(    "<td width='100%'>&nbsp;</td>")
document.write(  "</tr>")
//section logo
document.write(  "<tr>")
document.write(    "<td width='10' height='10' ><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(    "<td width='25' height='25' bgcolor='#cccc99'><img src='" + relativeRoot + "/graphics/spacer.gif' width='25' height='25'></td>")
document.write(    "<td width='300' height='10' bgcolor='#ffffcc' rowspan='2' valign='top'>")
document.write(		   "<table width='100%' height='300' border='0' cellspacing='0' cellpadding='0'>")
document.write(        "<tr>")
document.write(          "<td width='175' height='160' bgcolor='#cccc99' align='left' valign='top'>")
document.write(		 		 "<img src='" + relativeRoot + "/graphics/" +  logo  + "' width='125' height='160' alt= '" + logo + "'>")
document.write(						"<img src='" + relativeRoot + "/graphics/spacer.gif' width='175' height='6'>")
document.write(		  	 "</td>")
document.write(        "</tr>")
document.write(        "<tr>")
document.write(				"<td height='300' width='175' valign='top'>")
document.write(					"<table width='100% height='300'>")
document.write(					"<tr>")
//side navigation
document.write(    	        	  "<td width='100%' bgcolor='#FFFFCC' valign = 'top'>")
document.write(						"<span class='" + className + "sidebarTitle'>" + sectionTitle + "</span><br>")
document.write(                     "<span class='" + className + "sidebarSubTitle'>" + sectionSubTitle + "</span>")
document.write(                     "<table width='100%' border='0' cellspacing='0' cellpadding='3'>")
//change the hyperlink style depending on the current section
for (i=0;i < navBarArray.length;i++){
	document.write(               "<tr> ")
	document.write(                 "<td valign='top' align='right'>")
	if (highlightIndex == i){
		document.write(					"<img src='" + relativeRoot + "/graphics/" + dotGif + "' width='6' height='6' vspace=3>")
	} else {
		document.write(					"<img src='" + relativeRoot + "/graphics/spacer.gif' width='6' height='6'>")
	}
	document.write(					 "</td>")
	document.write(                  "<td valign='top'><span class='" + className + "'>")
	document.write(						 "<a class='" + className + "' href='" + navBarArray[i].url + "'>" + navBarArray[i].label + "</a></span>")
	document.write(                  "</td>")
	document.write(               "</tr>")
}
document.write(                  "</table>")
//write the Archives link if the showArchives var is set to 1
if(showArchives == 1){
	document.write(              "<hr><a href='" + relativeRoot + "/embers/archives.htm'><span class='" + className + "sidebarTitle'>Archives</span></a>")
}
document.write(			"</td>")
document.write(		  "</tr>")
document.write(		  "</table>")
document.write(		  "</td>")
document.write(        "</tr>")
document.write(      "</table></td>")
document.write(    "<td bgcolor='#cccc99' align='left' width='100%' height='25'>")
//top navigation bar
document.write(	   "<table height='25'  border='0' cellpadding='5' cellspacing='0'>")
document.write(        "<tr> ")
document.write(    	  "<td height='25'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='25'></td>")
document.write(       "<td height='25'>")
document.write(			"<a href='" + relativeRoot + "/index.html' onClick=MM_nbGroup('down','group1','home','" + relativeRoot + "/graphics/NavBarHighlight_r1_c1.gif',1) onMouseOver=MM_nbGroup('over','home','" + relativeRoot + "/graphics/NavBarOver_r1_c1.gif','" + relativeRoot + "/graphics/NavBarHighlightOver_r1_c1.gif',1) onMouseOut=MM_nbGroup('out')>")
document.write(			"<img name='home' src='" + relativeRoot + "/graphics/NavBar_r1_c1.gif' border='0' alt='Home'")
if(section == 0){
	document.write(		" onLoad=MM_nbGroup('init','group1','home','" + relativeRoot + "/graphics/NavBarHighlight_r1_c1.gif',1)")
}
document.write(		    "></a>")
document.write(		  "</td>")
document.write(		  "<td height='25'><img name='divider' src='" + relativeRoot + "/graphics/divider.gif' border='0'></td>")
document.write(          "<td height='25'>")
document.write(				"<a href='" + relativeRoot + "/fcrv/fcrvOverview.htm' onClick=MM_nbGroup('down','group1','fcrv','" + relativeRoot + "/graphics/NavBarHighlight_r1_c3.gif',1) onMouseOver=MM_nbGroup('over','fcrv','" + relativeRoot + "/graphics/NavBarOver_r1_c3.gif','" + relativeRoot + "/graphics/NavBarHighlightOver_r1_c3.gif',1) onMouseOut=MM_nbGroup('out')>")
document.write(				"<img name='fcrv' border='0' alt='FCRV' src='" + relativeRoot + "/graphics/")
if(section == 1){
	document.write(		"NavBarHighlight_r1_c3.gif' onLoad=MM_nbGroup('init','group1','fcrv','" + relativeRoot + "/graphics/NavBarHighlight_r1_c3.gif',1)")
	} else {
	document.write("	NavBar_r1_c3.gif'")
}
document.write(				"></a>")
document.write(			"</td>")
document.write(  		 "<td height='25'><img name='divider' src='" + relativeRoot + "/graphics/divider.gif' border='0'></td>")
//TO-DO  disallow access to the embers, calendar and retirees without a password
document.write(          "<td height='25'>")
document.write(				"<a href='" + relativeRoot + "/embers/xxxvii/issue2/embersApr-May2007.htm' onClick=MM_nbGroup('down','group1','embers','" + relativeRoot + "/graphics/NavBarHighlight_r1_c5.gif',1) onMouseOver=MM_nbGroup('over','embers','" + relativeRoot + "/graphics/NavBarOver_r1_c5.gif','" + relativeRoot + "/graphics/NavBarHighlightOver_r1_c5.gif',1) onMouseOut=MM_nbGroup('out')>")
document.write(				"<img name='embers' border='0' alt='Fireside Embers' src='" + relativeRoot + "/graphics/")
if(section == 2){
	document.write(		"NavBarHighlight_r1_c5.gif' onLoad=MM_nbGroup('init','group1','embers','" + relativeRoot + "/graphics/NavBarHighlight_r1_c5.gif',1)")
	} else {
	document.write(		"NavBar_r1_c5.gif'")
}
document.write(				"></a>")
document.write(			"</td>")
document.write(  		 "<td height='25'><img name='divider' src='" + relativeRoot + "/graphics/divider.gif' border='0'></td>")
document.write(          "<td height='25'>")
document.write(				"<a href='" + relativeRoot + "/calendar/yearCalendar.htm' onClick=MM_nbGroup('down','group1','calendar','" + relativeRoot + "/graphics/NavBarHighlight_r1_c7.gif',1) onMouseOver=MM_nbGroup('over','calendar','" + relativeRoot + "/graphics/NavBarOver_r1_c7.gif','" + relativeRoot + "/graphics/NavBarHighlightOver_r1_c7.gif',1) onMouseOut=MM_nbGroup('out')>")
document.write(				"<img name='calendar' border='0' alt='Calendar' src='" + relativeRoot + "/graphics/")
if(section == 3){
	document.write(		"NavBarHighlight_r1_c7.gif' onLoad=MM_nbGroup('init','group1','calendar','" + relativeRoot + "/graphics/NavBarHighlight_r1_c7.gif',1)")
} else {
document.write(			"NavBar_r1_c7.gif'")
}
document.write(				"></a>")
document.write(			"</td>")
document.write(		     "<td height='25'><img name='divider' src='" + relativeRoot + "/graphics/divider.gif' border='0'></td>")
document.write(          "<td height='25'>")

/* Retiree Chapter */
document.write(				"<a href='" + relativeRoot +"/retirees/RetireeChapters.php' onClick=MM_nbGroup('down','group1','retirees','" + relativeRoot + "/graphics/NavBarHighlight_r1_c9.gif',1) onMouseOver=MM_nbGroup('over','retirees','" + relativeRoot + "/graphics/NavBarOver_r1_c9.gif','" + relativeRoot + "/graphics/NavBarHighlightOver_r1_c9.gif',1) onMouseOut=MM_nbGroup('out')>")

document.write(				"<img name='retirees' border='0' alt='Retirees' src='" + relativeRoot + "/graphics/")
if(section == 4){
document.write(				"NavBarHighlight_r1_c9.gif' onLoad=MM_nbGroup('init','group1','retirees','" + relativeRoot + "/graphics/NavBarHighlight_r1_c9.gif',1)")
} else {
document.write(				"NavBar_r1_c9.gif'")
}
document.write(				"></a>")
document.write(				"</td>")
document.write(        "</tr>")
document.write(      "</table>")
document.write(    "</td>")
document.write(  "</tr>")
//border around main body area
document.write(  "<tr>")
document.write(    "<td width='10' height='10'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(    "<td width='25' height='10' bgcolor='#cccc99'><img src='" + relativeRoot + "/graphics/spacer.gif' width='25' height='10'></td>")
document.write(    "<td height='300' width='100%' valign=top> ")
document.write(      "<table width='100%' height='300' border='0' cellspacing='0' cellpadding='0'>")
document.write(        "<tr>")
document.write(          "<td height='10' width='10'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(          "<td height='5' width='5'><img src='" + relativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5' width='100%'>&nbsp;</td>")
document.write(          "<td height='5' width='5'><img src='" + relativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='10' width='10'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(        "</tr>")
document.write(        "<tr>")
document.write(          "<td height='5'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='5'></td>")
document.write(          "<td height='5' background='" + relativeRoot + "/graphics/" + dotGif + "' rowspan=3><img src='" + relativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5' background='" + relativeRoot + "/graphics/" + dotGif + "'><img src='" + relativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5' background='" + relativeRoot + "/graphics/" + dotGif + "' rowspan=3><img src='" + relativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='5'></td>")
document.write(        "</tr>")
document.write(        "<tr>")
document.write(          "<td height='300'><img src='" + relativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(          "<td height='300' bgcolor='#FFFFFF'valign='top'>")
document.write(		  "<table height='300' width='100%' border='0' cellspacing='5' cellpadding='5'>")
document.write(			  "<tr>")
document.write(			    "<td valign='top'>")
//cell for main body area
}

function endTemplate(){
//close cell for main body area
document.write(				"</td>")
document.write(			  "</tr>")
document.write(		  "</table>")
document.write(          "</td>")
document.write(          "<td height='10'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(        "</tr>")
//close the border for the main body
document.write(        "<tr>")
document.write(          "<td height='5'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='10' height='5></td>")
document.write(          "<td height='5'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5' background='" + gRelativeRoot + "/graphics/" + dotGif + "'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='5' height='5'></td>")
document.write(          "<td height='5'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='10' height='5'></td>")
document.write(        "</tr>")
document.write(        "<tr>")
document.write(          "<td height='10'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(          "<td height='10'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='5' height='10'></td>")
document.write(          "<td height='10'>&nbsp;</td>")
document.write(          "<td height='10'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='5' height='10'></td>")
document.write(          "<td height='10'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='10' height='10'></td>")
document.write(        "</tr>")
document.write(      "</table>")
document.write(    "</td>")
document.write(  "</tr>")
//copyright
document.write(  "<tr>")
document.write(	   "<td>&nbsp;</td>")
document.write(	   "<td bgcolor='#cccc99' width='25'><img src='" + gRelativeRoot + "/graphics/spacer.gif' width='25' height='1'></td>")
document.write(    "<td colspan='2' align='right' nowrap valign='bottom'><span class='copyright'>Copyright © 2002-2005, Colorado FCRV</span></td></tr>")
document.write("</table>")
}
