var nav_QuickSiteMain = new Object();

nav_QuickSiteMain.underline="false";
nav_QuickSiteMain.justification="center";
nav_QuickSiteMain.textFont="Bookman Old Style";
nav_QuickSiteMain.selectedUnderline="false";
nav_QuickSiteMain.accentStyle="Arrow";
nav_QuickSiteMain.funButton="Downtown";
nav_QuickSiteMain.mouseoverBgcolor="#CBBFBF";
nav_QuickSiteMain.mouseoverBold="true";
nav_QuickSiteMain.buttonCategory="modern";
nav_QuickSiteMain.darkButton="Minimal";
nav_QuickSiteMain.italic="true";
nav_QuickSiteMain.importedImageMouseOver="files/QuickSiteImages/nav-selected2.gif";
nav_QuickSiteMain.textSize="11";
nav_QuickSiteMain.tabCategory="basic";
nav_QuickSiteMain.style="buttons";
nav_QuickSiteMain.selectedTextcolor="#FFFFFF";
nav_QuickSiteMain.graphicSelected="true";
nav_QuickSiteMain.selectedBgcolor="";
nav_QuickSiteMain.accentColor="Black";
nav_QuickSiteMain.hasLinks="true";
nav_QuickSiteMain.basicButton="Gray";
nav_QuickSiteMain.accentType="lines";
nav_QuickSiteMain.graphicMouseover="true";
nav_QuickSiteMain.horizontalSpacing="0";
nav_QuickSiteMain.lineWidth="1";
nav_QuickSiteMain.selectedEffect="true";
nav_QuickSiteMain.lineColor="#B91806";
nav_QuickSiteMain.modernButton="Basic_Black";
nav_QuickSiteMain.border="";
nav_QuickSiteMain.simpleButton="Autumn_Leaves";
nav_QuickSiteMain.type="Navigation";
nav_QuickSiteMain.bold="true";
nav_QuickSiteMain.sophisticatedButton="Antique";
nav_QuickSiteMain.localPreview="true";
nav_QuickSiteMain.verticalSpacing="0";
nav_QuickSiteMain.selectedBold="true";
nav_QuickSiteMain.basicTab="White";
nav_QuickSiteMain.mouseoverEffect="true";
nav_QuickSiteMain.navID="nav_QuickSiteMain";
nav_QuickSiteMain.mouseoverTextcolor="#FFFFFF";
nav_QuickSiteMain.imageHeight="65";
nav_QuickSiteMain.mouseoverUnderline="false";
nav_QuickSiteMain.texturedButton="Brick";
nav_QuickSiteMain.selectedItalic="false";
nav_QuickSiteMain.brightButton="Chicky";
nav_QuickSiteMain.importedImageSelected="files/QuickSiteImages/nav-selected2.gif";
nav_QuickSiteMain.dirty="false";
nav_QuickSiteMain.squareTab="Camel";
nav_QuickSiteMain.horizontalWrap="7";
nav_QuickSiteMain.numLinks="4";
nav_QuickSiteMain.imageWidth="120";
nav_QuickSiteMain.mouseoverItalic="false";
nav_QuickSiteMain.importedImage="files/QuickSiteImages/nav.gif";
nav_QuickSiteMain.background="#CBBFBF";
nav_QuickSiteMain.shinyButton="Shiny_Aqua";
nav_QuickSiteMain.version="5";
nav_QuickSiteMain.orientation="horizontal";
nav_QuickSiteMain.textColor="#FFFFFF";
nav_QuickSiteMain.holidayButton="Christmas_Ornaments";
nav_QuickSiteMain.width="660";
nav_QuickSiteMain.height="40";

nav_QuickSiteMain.navName = "QuickSiteMain";
nav_QuickSiteMain.imagePath = "/~media/elements/LayoutClipart/../LayoutClipart/Buttons/Black_Button.gif";
nav_QuickSiteMain.selectedImagePath = "/~media/elements/LayoutClipart/../LayoutClipart/Buttons/Black_Button_2.gif";
nav_QuickSiteMain.mouseOverImagePath = "/~media/elements/LayoutClipart/../LayoutClipart/Buttons/Black_Button_2.gif";
nav_QuickSiteMain.imageWidth = "165";
nav_QuickSiteMain.imageHeight = "40";
nav_QuickSiteMain.fontClass = "size11 BookmanOldStyle11";
nav_QuickSiteMain.fontFace = "'Bookman Old Style', 'Times New Roman', Times, serif";


var baseHref = '';
// this will only work if getElementsByTagName works
if (document.getElementsByTagName)
{
    // this will only work if we can find a base tag
    var base = document.getElementsByTagName('base');
    // Verify that the base object exists
    if (base && base.length > 0)
    {
        // if you don't specify a base href, href comes back as undefined
        if (base[0].href != undefined)
        {
            // get the base href
            baseHref = base[0].href;
            // add a trailing slash if base href doesn't already have one
            if (baseHref != '' && baseHref.charAt(baseHref.length - 1) != '/')
            {
                baseHref += '/';
            }
        }
    }
}


nav_QuickSiteMain.links=new Array(4);
var nav_QuickSiteMain_Link1 = new Object();
nav_QuickSiteMain_Link1.type = "existing";
nav_QuickSiteMain_Link1.displayName = "Home";
nav_QuickSiteMain_Link1.linkWindow = "_self";
nav_QuickSiteMain_Link1.linkValue = "index.html";
nav_QuickSiteMain_Link1.linkIndex = "1";
nav_QuickSiteMain.links[0] = nav_QuickSiteMain_Link1;
var nav_QuickSiteMain_Link2 = new Object();
nav_QuickSiteMain_Link2.type = "existing";
nav_QuickSiteMain_Link2.displayName = "Event&nbsp;Info";
nav_QuickSiteMain_Link2.linkWindow = "_self";
nav_QuickSiteMain_Link2.linkValue = "untitled.html";
nav_QuickSiteMain_Link2.linkIndex = "2";
nav_QuickSiteMain.links[1] = nav_QuickSiteMain_Link2;
var nav_QuickSiteMain_Link3 = new Object();
nav_QuickSiteMain_Link3.type = "existing";
nav_QuickSiteMain_Link3.displayName = "About&nbsp;ATR";
nav_QuickSiteMain_Link3.linkWindow = "_self";
nav_QuickSiteMain_Link3.linkValue = "biography.html";
nav_QuickSiteMain_Link3.linkIndex = "3";
nav_QuickSiteMain.links[2] = nav_QuickSiteMain_Link3;
var nav_QuickSiteMain_Link4 = new Object();
nav_QuickSiteMain_Link4.type = "existing";
nav_QuickSiteMain_Link4.displayName = "Contact&nbsp;Us";
nav_QuickSiteMain_Link4.linkWindow = "_self";
nav_QuickSiteMain_Link4.linkValue = "contact.html";
nav_QuickSiteMain_Link4.linkIndex = "4";
nav_QuickSiteMain.links[3] = nav_QuickSiteMain_Link4;
function renderGraphicalHTML(Navigation, strTpGif)
{
	var strHTML = '';
	strHTML += '<table border="0" cellspacing="0" cellpadding="0">';

	var i;
	for(i = 0; i < Navigation.links.length; i++)
	{
		strHTML += renderGraphicalLink(Navigation, Navigation.links[i], strTpGif);
	}

	strHTML += '</table>';
	return strHTML;
}

function mouseOn(tdCell, newBackgroundImage)
{
	tdCell.style.backgroundImage = 'url(' + newBackgroundImage + ')';
}

function mouseOff(tdCell, newBackgroundImage)
{
	tdCell.style.backgroundImage = 'url(' + newBackgroundImage + ')';
}

function getGraphicMouseOverHandler(Navigation, bIsCurrentPage)
{
	// If user did not check the 'Mouseover Effect' box in the Effects tab, there is no mouseover effect
	if (Navigation.mouseoverEffect != 'true') return '';

	if((Navigation.graphicSelected=='true' || Navigation.selectedTextcolor) && bIsCurrentPage && 'true' == Navigation.selectedEffect)
	{
		return '';
	}
	var bShowMouseoverText = !(bIsCurrentPage && 'true' == Navigation.selectedEffect && Navigation.selectedTextcolor);
	var strMouseOver = '';
	var strMouseOut = '';

	if(Navigation.graphicMouseover=='true')
	{
		strMouseOver += ' mouseOn(this, \'' + Navigation.mouseOverImagePath +  '\');';
		strMouseOut += ' mouseOff(this, \'' + Navigation.imagePath + '\');';
	}
	var textColor;
	var baseTextColor = Navigation.textColor;
	var bold;
	var baseBold = Navigation.bold;
	var underline;
	var baseUnderline = Navigation.underline;
	var italic;
	var baseItalic = Navigation.italic;
	if(bIsCurrentPage && 'true' == Navigation.selectedEffect)
	{
		textColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor : (Navigation.mouseoverTextColor ? Navigation.mouseoverTextcolor : Navigation.textColor);
		baseTextColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor : Navigation.textColor;
		baseBold = bold = Navigation.selectedBold;
		baseUnderline = underline = Navigation.selectedUnderline;
		baseItalic = italic = Navigation.selectedItalic;
	}
	else
	{
		textColor = Navigation.mouseoverTextcolor ? Navigation.mouseoverTextcolor : Navigation.textColor;
		bold = Navigation.mouseoverBold;
		underline = Navigation.mouseoverUnderline;
		italic = Navigation.mouseoverItalic;
	}
	strMouseOver += ' textMouseOn(this, \'' + textColor + '\', \'' + bold + '\', \'' + underline + '\', \'' + italic + '\');';
	strMouseOut += ' textMouseOff(this, \'' + baseTextColor + '\', \'' + baseBold + '\', \'' + baseUnderline + '\', \'' + baseItalic + '\');';
	return ' onMouseOver="' + strMouseOver + '" onMouseOut="' + strMouseOut + '"';
}

//
//************************************************************************
//	Creates the style attribute for the <TD> for a link.
//
//	Sets the background image and the cursor.
//	Also, specify the font color here so that we can do the textMouseovers
//	from within the <TD>.
//***************************************************************************

function getGraphicalStyle(Navigation, strImg, strFontColor, bold, italic, underline, bNetscape)
{
	var strStyle = ' style="';

	strStyle += 'cursor: pointer; cursor: hand; '; // pointer is supported by IE6/Moz, hand is required for IE 5.x
	strStyle += 'color:' + strFontColor + ';';
	strStyle += 'background-image:url(' + strImg + ');';
	strStyle += 'background-repeat:no-repeat;';
	strStyle += 'background-position:' + Navigation.justification + ';';

	if(!bNetscape)
	{
		if (bold) strStyle += 'font-weight: bold;';
		if (italic) strStyle += 'font-style: italic;';
		if (underline) strStyle += 'text-decoration: underline;';
	}

	//
	//	Align the left edge of the background image based on the justification
	//	of the text, so if the text runs past the length of the button, making the
	//	<TD> larger than the button, the button image will align
	//	correctly within the <TD>

	strStyle += Navigation.justification;

	// end style
	strStyle += '" ';

	return strStyle;
}

function renderGraphicalLink(Navigation, Link, strTpGif)
{
	var strImg = Navigation.imagePath;
	var strFontColor = Navigation.textColor;
	var bIsCurrentPage = isCurrentPage(Link);
	var strLinkValue = fixLinkValue(Link);
	var bLastLink = Link.linkIndex == Navigation.numLinks;
	var nColIndex = 0;

	if(Navigation.orientation=='horizontal')
	{
		nColIndex = (Link.linkIndex - 1) % Navigation.horizontalWrap;
	}

	if (bIsCurrentPage && 'true' == Navigation.selectedEffect)
	{
		if(Navigation.graphicSelected=='true')
		{
			strImg = Navigation.selectedImagePath;
		}

		if(Navigation.selectedTextcolor)
		{
			strFontColor = Navigation.selectedTextcolor;
		}
	}

	//
	//	Check if using a version of Netscape 4.x, since this requires
	//	special handling.

	var bNetscape = false;
	var strAppName = navigator.appName;
	var appVer = parseFloat(navigator.appVersion);
	var nGeneralPadding = 10;

	if ( (strAppName == 'Netscape') &&
				(appVer >= 4.0 && appVer < 5) )
	{  // Note: Netscape 6 returns an appVersion of 5 . . . go figure.
		bNetscape = true;
	}

	var strHTML = '';
	//
	//	For horizontal navigations, create a new table for each row of links.
	//	Subsequent rows of links should be center aligned.

	if(Navigation.orientation=='horizontal')
	{
		if( (Link.linkIndex % Navigation.horizontalWrap) == 1)
		{
			strHTML += '<TR ALIGN="CENTER" VALIGN="MIDDLE">';
			strHTML += '<TD>';
			strHTML += '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
			strHTML += '<TR>';
		}
	}
	else
	{
		// Create a separate row for each link if vertical.
		strHTML += '<TR>'
	}

	// Table cell <TD> for this link

	strHTML += '<TD NOWRAP HEIGHT="' + Navigation.imageHeight + '"';

	strHTML += ' ALIGN="' + Navigation.justification + '" VALIGN="MIDDLE"';

	//
	//	Set id for integration with the online editor.  "[NavName]_Link[linkIndex]"
	//	NOTE: these IDs are NOT unique.  At load time, the online editor will walk the rendered HTML
	//	and prepend the unique element id.  Outside of the online editor, these IDs are NOT unique.

	strHTML += ' id="'+Navigation.navName+'_Link'+Link.linkIndex+'"';

	if(!bNetscape)
	{
		// The style tag for the <TD>
		strHTML += getGraphicalStyle(
			Navigation,
			strImg,
			strFontColor,
			((bIsCurrentPage && 'true' == Navigation.selectedEffect) ? ('true' == Navigation.selectedBold) : ('true' == Navigation.bold)),
			((bIsCurrentPage && 'true' == Navigation.selectedEffect) ? ('true' == Navigation.selectedItalic) : ('true' == Navigation.italic)),
			((bIsCurrentPage && 'true' == Navigation.selectedEffect) ? ('true' == Navigation.selectedUnderline) : ('true' == Navigation.underline)),
			bNetscape
		);
	}
	else
	{
		//
		//	Use CSS to specify the background image of the <TD>, so we can specify it not to tile.
		//	A style class is included in the <Head> section of the published page this navigation is on,
		//	and the class is called navBackground[navName] or navBackgroundSelected[navName] for current page highlights.
		//	See data\Elements\navigation\Navigation.xsl for more details.

		if(bIsCurrentPage && 'true' == Navigation.selectedEffect)
		{
			strHTML += ' CLASS="navBackgroundSelected' + Navigation.navName + '" ';
		}
		else
		{
			strHTML += ' CLASS="navBackground' + Navigation.navName + '" ';
		}
	}

	if(!bNetscape)
	{
		// onClick handler to create the link
		var strOnClick = getOnClick(strLinkValue, Link.linkWindow);

		// Gets the mouseover handling code if necessary.
		var strMouseOver = getGraphicMouseOverHandler(Navigation, bIsCurrentPage);

		strHTML += strOnClick + strMouseOver;
	}
	// For NS, we need to specify the button size in the TD because styled DIVs don't work in NS
	if(bNetscape)
	{
		strHTML += ' width="' + Navigation.imageWidth + '"';
	}

	strHTML += '>';  // End <TD>

	// Bold, Italic (Netscape 4 only; otherwise style is defined in TD for mouseover effects)
	var strFormattingStart = '';
	var strFormattingEnd = '';

	if (bNetscape)
	{
		if((bIsCurrentPage && 'true' == Navigation.selectedEffect) ? ('true' == Navigation.selectedItalic) : ('true' == Navigation.italic))
		{
			strFormattingStart += '<I>';
			strFormattingEnd = '</I>' + strFormattingEnd;
		}
		if((bIsCurrentPage && 'true' == Navigation.selectedEffect) ? ('true' == Navigation.selectedBold) : ('true' == Navigation.bold))
		{
			strFormattingStart += '<B>';
			strFormattingEnd = '</B>' + strFormattingEnd;
		}
	}

	//
	//	Place a Div tag around the display name text, setting the
	//	width of the Div to the image width.  This forces the table
	//	cell (the TD) to the correct minimum width so that the entire
	//	button image appears.
	//
	//	NOTE:  I do this instead of setting the width in the TD,
	//	because it was causing alignment issues in vertical navs.
	//	If the length of the text for a link was longer than the button,
	//	it would stretch out the TD to the length of the text.  The
	//	problem was subsequent links who's text was shorter than the
	//	length of the button, were aligning based on the specified
	//	width of the TD (the image width), even though the TD was
	//	actually being rendered based on the length of the longest
	//	text. By not specifying the width in the TD, the text
	//	is able to align based on the actual width of the
	//	TD.

	if(!bNetscape)
	{
		var nDivWidth = Navigation.imageWidth;
		// compensate for the margin if text is left/right justified
		if(Navigation.justification != 'center')
		{
			nDivWidth = nDivWidth - nGeneralPadding;
		}
		strHTML += '<DIV ';
		strHTML += ' STYLE="width:' + nDivWidth + 'px';
		//
		//	If the text is left or right justified, add a 10 px
		//	margin from the edge of the button to the text.

		if(Navigation.justification != 'center')
		{
			strHTML += ';margin-' + Navigation.justification + ':';
			strHTML += nGeneralPadding + 'px';
		}
		strHTML+='">';
	}
	// For left aligned text, add 10 px padding from the left edge of the button
	if(bNetscape)
	{
		if(Navigation.justification == 'left')
		{
			strHTML += '<IMG SRC="' + strTpGif + '" WIDTH="' + nGeneralPadding + '" HEIGHT="1" BORDER="0">';
		}

		// onClick Handler does not work for Netscape, so set the anchor <A>
		strHTML += '<A HREF="' + strLinkValue + '" TARGET="';

		//
		//	Open in the current window, but set the location to the parent
		//	in case page is displayed in a frame, like for password protected pages.

		var strLinkTarget = Link.linkWindow;
		if(strLinkTarget == '_self')
		{
			strLinkTarget = '_parent';
		}

		strHTML += strLinkTarget + '">';
	}

	// <FONT> Tag
	strHTML += '<FONT';
	strHTML += ' FACE="' + Navigation.fontFace + '"';
	strHTML += ' CLASS="' + Navigation.fontClass + '"';

	//
	//	Only include this for Netscape, in IE, font color
	//	is specified in the TD's style attribute

	if(bNetscape)
	{
		strHTML += ' COLOR="' + strFontColor + '"';
	}

	strHTML += '>';

	strHTML += strFormattingStart + Link.displayName + strFormattingEnd;
	// End Font tag
	strHTML += '</FONT>';

	// End DIV tag for IE because we use it to specify the button size
	if(!bNetscape)
	{
		strHTML += '</DIV>';
	}

	// For right aligned text, add 10 px padding from the right edge of the button
	if(bNetscape)
	{
		if(Navigation.justification == 'right')
		{
			strHTML += '<IMG SRC="' + strTpGif + '" WIDTH="' + nGeneralPadding + '" HEIGHT="1" BORDER="0">';
		}
		strHTML += '</A>';
	}

	// Close the <TD> for this link
	strHTML += '</TD>';

	// For vertical, close this row and add spacing between the next link
	if(Navigation.orientation=='vertical')
	{
		strHTML += '</TR>';
		// Add vertical spacing between the links, don't need if this is the last link
		if(Navigation.verticalSpacing > 0)
		{
			if(!bLastLink)
			{
				strHTML += '<TR><TD>';
				strHTML += '<IMG SRC="' + strTpGif + '" HEIGHT="' + Navigation.verticalSpacing + '" WIDTH="1" BORDER="0" ALT="">';
				strHTML += '</TD></TR>';
			}
		}
	}
	else
	{
		//
		//	For horizontal, add spacing between the next link,
		//	wrap to the next row if necessary.

		if(Navigation.horizontalSpacing > 0)
		{
			if(!bLastLink && (nColIndex != Navigation.horizontalWrap - 1))
			{
				strHTML += '<TD WIDTH="' + Navigation.horizontalSpacing + '">';
				strHTML += '<IMG SRC="' + strTpGif + '" WIDTH="' + Navigation.horizontalSpacing + '" HEIGHT="1" BORDER="0" ALT="">';
				strHTML += '</TD>';
			}
		}

		// Close the table for this row if its the last link or if it needs to wrap
		if (bLastLink || nColIndex == Navigation.horizontalWrap - 1)
		{
			strHTML += '</TR>';
			strHTML += '</TABLE>';
			strHTML += '</TD></TR>';
		}

		// Add a row of vertical space between this row and the next row
		if(nColIndex == Navigation.horizontalWrap - 1 && !bLastLink)
		{
			strHTML += '<TR><TD>';
			strHTML += '<IMG SRC="' + strTpGif + '" HEIGHT="' + Navigation.verticalSpacing + '" WIDTH="1" BORDER="0" ALT="">';
			strHTML += '</TD></TR>';
		}
	}
	return strHTML;
}
function renderHTML(Navigation)
{
	if (navigator.userAgent.indexOf('Mozilla/3') != -1)
	{
		return 'Sorry, since you are using an old version of Netscape, you may not be able to access all the pages in this Web site.';
	}

	if (Navigation.style == 'text')
	{
		return renderTextHTML(Navigation, '/tp.gif');
	}
	else
	{
		return renderGraphicalHTML(Navigation, '/tp.gif');
	}
}

//
// This .js file includes utility functions used by both graphical and text navs
// in their rendering.  User pages including a nav element will import this file, along
// with TextNavigation.js and GraphicNavigation.js.  The functions within will
// be called by the [navname].js file generated at publish time.

function fixLinkValue(Link)
{
	if(Link.type!='existing')
	{
		return Link.linkValue;
	}
	else
	{
		return baseHref + strRelativePathToRoot + Link.linkValue;
	}
}

function isCurrentPage(Link)
{
	if(Link.type!='existing')
	{
		return false;
	}
	var strLinkValue = Link.linkValue.toLowerCase();
	return (strRelativePagePath == strLinkValue);
}

function getOnClick(strLinkValue, strLinkTarget)
{
	var strOnClick;
	if(strLinkTarget == '_blank')
	{
		strOnClick = 'onClick="window.open(\'' + strLinkValue + '\');"';
	}
	else
	{
		strOnClick = 'onClick="document.location = \'' + strLinkValue + '\';"';
	}
	return strOnClick;
}

function netscapeDivCheck()
{
	var strAppName = navigator.appName;
	var appVer = parseFloat(navigator.appVersion);
	if ( (strAppName == 'Netscape') &&
		(appVer >= 4.0 && appVer < 5) ) {  document.write('</DIV>');
	}
}

function textMouseOn(textObj, newColor, mouseoverBold, mouseoverUnderline, mouseoverItalic)
{
	if(newColor)
	{
		textObj.style.color=newColor;
	}
	if(mouseoverBold=='true')
	{
		textObj.style.fontWeight='bold';
	}
	else
	{
		textObj.style.fontWeight='normal';
	}
	if(mouseoverUnderline=='true')
	{
		textObj.style.textDecoration='underline';
	}
	else
	{
		textObj.style.textDecoration='none';
	}
	if(mouseoverItalic=='true')
	{
		textObj.style.fontStyle='italic';
	}
	else
	{
		textObj.style.fontStyle='normal';
	}
}

function textMouseOff(textObj, newColor, bold, underline, italic)
{
	textObj.style.color=newColor;
	if(bold=='true')
	{
		textObj.style.fontWeight='bold';
	}
	else
	{
		textObj.style.fontWeight='normal';
	}
	if(underline=='true')
	{
		textObj.style.textDecoration='underline';
	}
	else
	{
		textObj.style.textDecoration='none';
	}
	if(italic=='true')
	{
		textObj.style.fontStyle='italic';
	}
	else
	{
		textObj.style.fontStyle='normal';
	}
}


	document.write(renderHTML(nav_QuickSiteMain));


