
nav_SubMenu.mouseoverTextcolor="#FFFFFF";
nav_SubMenu.numLinks="5";
nav_SubMenu.holidayButton="Christmas_Ornaments";
nav_SubMenu.selectedItalic="false";
nav_SubMenu.modernButton="Basic_Black";
nav_SubMenu.importedImageMouseOver="images/submenu_on.gif";
nav_SubMenu.lineWidth="2";
nav_SubMenu.sophisticatedButton="Antique";
nav_SubMenu.textColor="#E5E5E5";
nav_SubMenu.buttonCategory="basic";
nav_SubMenu.selectedUnderline="false";
nav_SubMenu.underline="false";
nav_SubMenu.accentStyle="Arrow";
nav_SubMenu.mouseoverItalic="false";
nav_SubMenu.horizontalWrap="6";
nav_SubMenu.bold="true";
nav_SubMenu.accentType="none";
nav_SubMenu.border="";
nav_SubMenu.selectedBgcolor="";
nav_SubMenu.orientation="horizontal";
nav_SubMenu.squareTab="Camel";
nav_SubMenu.selectedTextcolor="#FFFF00";
nav_SubMenu.style="imported";
nav_SubMenu.horizontalSpacing="1";
nav_SubMenu.mouseoverBgcolor="";
nav_SubMenu.accentColor="Black";
//nav_SubMenu.imageWidth="143";
nav_SubMenu.basicTab="white";
nav_SubMenu.graphicMouseover="true";
nav_SubMenu.tabCategory="basic";
nav_SubMenu.localPreview="true";
nav_SubMenu.funButton="Arts_and_Crafts";
nav_SubMenu.texturedButton="Brick";
nav_SubMenu.dirty="true";
nav_SubMenu.simpleButton="Autumn_Leaves";
nav_SubMenu.selectedEffect="true";
nav_SubMenu.basicButton="Gray";
nav_SubMenu.mouseoverBold="true";
nav_SubMenu.hasLinks="true";
nav_SubMenu.importedImage="images/submenu_off.gif";
nav_SubMenu.mouseoverUnderline="false";
nav_SubMenu.lineColor="#000000";
nav_SubMenu.textSize="6";
nav_SubMenu.selectedBold="false";
nav_SubMenu.type="Navigation";
nav_SubMenu.mouseoverEffect="true";
nav_SubMenu.importedImageSelected="images/submenu_active.gif";
nav_SubMenu.textFont="Verdana";
nav_SubMenu.background="";
nav_SubMenu.darkButton="Basic_Black";
nav_SubMenu.version="4";
nav_SubMenu.italic="false";
nav_SubMenu.justification="center";
nav_SubMenu.imageHeight="31";
nav_SubMenu.graphicSelected="true";
nav_SubMenu.brightButton="Chicky";
nav_SubMenu.verticalSpacing="0";
nav_SubMenu.navID="nav_SubMenu";


nav_SubMenu.navName = "SubMenu";
nav_SubMenu.imagePath = strRelativePathToRoot + "images/submenu_off.gif";
nav_SubMenu.selectedImagePath = strRelativePathToRoot + "images/submenu_active.gif";
nav_SubMenu.mouseOverImagePath = strRelativePathToRoot + "images/submenu_on.gif";
//nav_SubMenu.imageWidth = "150";
nav_SubMenu.imageHeight = "31";
nav_SubMenu.fontClass = "submenufont";
//nav_SubMenu.fontFace = "Verdana, Helvetica, Arial, sans-serif";

var baseHref = '';

if (document.getElementsByTagName)
{
    var base = document.getElementsByTagName('base');
    if (base && base.length > 0)
    {
        if (base[0].href != undefined)
        {
            baseHref = base[0].href;
            if (baseHref != '' && baseHref.charAt(baseHref.length - 1) != '/')
            {
                baseHref += '/';
            }
        }
    }
}

function renderGraphicalHTML(Navigation, strTpGif)
{
    var strHTML = '';
    strHTML += '<table  border="0" cellspacing="0" cellpadding="2" or>';
    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 (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 + '"';
}


function getGraphicalStyle(Navigation, strImg, strFontColor, bold, italic, underline, bNetscape)
{
    var strStyle = ' style="';

    strStyle += 'cursor: pointer; cursor: hand; ';
    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;';
    }

    strStyle += Navigation.justification;
    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;
        }
    }
    var bNetscape = false;
    var strAppName = navigator.appName;
    var appVer = parseFloat(navigator.appVersion);
    var nGeneralPadding = 10;
   
    if ( (strAppName == 'Netscape') &&  (appVer >= 4.0 && appVer < 5) )
    {
        bNetscape = true;
    }

    var strHTML = '';
   
    if(Navigation.orientation=='horizontal')
    {
        if( (Link.linkIndex % Navigation.horizontalWrap) == 1)
        {
            strHTML += '<TR ALIGN="left" VALIGN="MIDDLE">';
            strHTML += '<TD>';
            strHTML += '<TABLE  BORDER="0" CELLSPACING="0" CELLPADDING="5">';
            strHTML += '<TR>';
        }
    }
    else
    {
        strHTML += '<TR>'
    }
    strHTML += '<TD NOWRAP HEIGHT="' + Navigation.imageHeight + '"';
    strHTML += ' ALIGN="' + Navigation.justification + '" VALIGN="MIDDLE"';
    strHTML += ' id="'+Navigation.navName+'_Link'+Link.linkIndex+'"';

    if(!bNetscape)
    {
        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
    {

    if(bIsCurrentPage && 'true' == Navigation.selectedEffect)
{
strHTML += ' CLASS="navBackgroundSelected' + Navigation.navName + '" ';
}
else
{
strHTML += ' CLASS="navBackground' + Navigation.navName + '" ';
}
}

if(!bNetscape)
{

var strOnClick = getOnClick(strLinkValue, Link.linkWindow);

var strMouseOver = getGraphicMouseOverHandler(Navigation, bIsCurrentPage);

strHTML += strOnClick + strMouseOver;
}

if(bNetscape)
{
strHTML += ' width="' + Navigation.imageWidth + '"';
}

strHTML += '>';


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;
}
}


if(!bNetscape)
{
var nDivWidth = Navigation.imageWidth;

if(Navigation.justification != 'center')
{
nDivWidth = nDivWidth - nGeneralPadding;
}
strHTML += '<DIV ';
strHTML += ' STYLE="width:' + nDivWidth + 'px';

if(Navigation.justification != 'center')
{
strHTML += ';margin-' + Navigation.justification + ':';
strHTML += nGeneralPadding + 'px';
}
strHTML+='">';
}

if(bNetscape)
{
if(Navigation.justification == 'left')
{
strHTML += '<IMG SRC="' + strTpGif + '" WIDTH="' + nGeneralPadding + '" HEIGHT="1" BORDER="0">';
}


strHTML += '<A HREF="' + strLinkValue + '" TARGET="';


var strLinkTarget = Link.linkWindow;
if(strLinkTarget == '_self')
{
strLinkTarget = '_parent';
}

strHTML += strLinkTarget + '">';
}

strHTML += '<FONT';
strHTML += ' FACE="' + Navigation.fontFace + '"';
strHTML += ' CLASS="' + Navigation.fontClass + '"';

if(bNetscape)
{
strHTML += ' COLOR="' + strFontColor + '"';
}

strHTML += '>';

strHTML += strFormattingStart + Link.displayName + strFormattingEnd;

strHTML += '</FONT>';


if(!bNetscape)
{
strHTML += '</DIV>';
}


if(bNetscape)
{
if(Navigation.justification == 'right')
{
strHTML += '<IMG SRC="' + strTpGif + '" WIDTH="' + nGeneralPadding + '" HEIGHT="1" BORDER="0">';
}
strHTML += '</A>';
}

strHTML += '</TD>';

if(Navigation.orientation=='vertical')
{
strHTML += '</TR>';

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
{

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>';
}
}


if (bLastLink || nColIndex == Navigation.horizontalWrap - 1)
{
strHTML += '</TR>';
strHTML += '</TABLE>';
strHTML += '</TD></TR>';
}


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)
{

return renderGraphicalHTML(Navigation, 'images/submenu_on.gif');

}


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_SubMenu));
document.write('<hr color="blue">');

