/////////////////////////////////////////////////////////////////////////////
// Function : NavNode (constructor)
// Comments :
/////////////////////////////////////////////////////////////////////////////
function NavNode(id, label, href, parent)
{
	this.m_parent = null;
	this.m_level = 0;

	if (parent)
	{
		this.m_parent = parent;
		this.m_level = parent.m_level+1;
	}

	this.m_id = id;

	// assume that m_label will most often be used directly as HTML
	this.m_rawlabel = label;

	label = label.replace(/&/g, '&amp;');
	label = label.replace(/</g, '&lt;');
	label = label.replace(/>/g, '&gt;');
	label = label.replace(/"/g, '&quot;');

	this.m_label = label;

	this.m_href = href;
	this.m_subNodes = new Array();

	var argValues = NavNode.arguments;
	var argCount = NavNode.arguments.length;

	for (i = 4 ; i < argCount ; i++)
	{
		var eqPos = argValues[i].indexOf("==");
		var attrName = argValues[i].substring(0,eqPos);
		var attrValue = argValues[i].substring(eqPos+2);

		eval("this.cp_" + attrName + " = '" + attrValue + "';");
	}

	NavNode.prototype.addNode = addNode;
	NavNode.prototype.isSelected = isSelected;
}

/////////////////////////////////////////////////////////////////////////////
// Function : addNode
// Comments :
/////////////////////////////////////////////////////////////////////////////
function addNode(id, label, href)
{
	var newIndex = this.m_subNodes.length;
	var newNode = new NavNode(id, label, href, this);

	var argValues = addNode.arguments;
	var argCount = addNode.arguments.length;

	for (i = 3 ; i < argCount ; i++)
	{
		var eqPos = argValues[i].indexOf("==");
		var attrName = argValues[i].substring(0,eqPos);
		var attrValue = argValues[i].substring(eqPos+2);

		eval("newNode.cp_" + attrName + " = '" + attrValue + "';");
	}

	this.m_subNodes[newIndex] = newNode;
	return newNode;
}

/////////////////////////////////////////////////////////////////////////////
// Function : isSelected
// Comments :
/////////////////////////////////////////////////////////////////////////////
function isSelected()
{
    var pos = window.location.href.lastIndexOf("/");
    var docname = window.location.href.substring(pos+1, window.location.href.length);

    pos = this.m_href.lastIndexOf("/");
    var myname = this.m_href.substring(pos+1, this.m_href.length);

    if (docname == myname)
		return true;
	else
		return false;
}

/////////////////////////////////////////////////////////////////////////////
// Function : customSectionPropertyExists
// Comments :
/////////////////////////////////////////////////////////////////////////////
function customSectionPropertyExists(csp)
{
	return (typeof csp != _U && csp != null);
}

/////////////////////////////////////////////////////////////////////////////
// Function : getCustomSectionProperty
// Comments :
/////////////////////////////////////////////////////////////////////////////
function getCustomSectionProperty(csp)
{
	if (customSectionPropertyExists(csp))
	{
		return csp;
	}
	else
	{
		return "";
	}
}

/////////////////////////////////////////////////////////////////////////////

var g_navNode_Root = new NavNode('ClosDuBois','Home',ssUrlPrefix + 'index.htm',null);
g_navNode_0=g_navNode_Root.addNode('WinesCDB','Wines',ssUrlPrefix + 'Wines/index.htm');
g_navNode_0_0=g_navNode_0.addNode('LimitedReleaseCDB','Limited Release',ssUrlPrefix + 'Wines/LimitedRelease/index.htm','cspWineType==Limited Release');
g_navNode_0_0_0=g_navNode_0_0.addNode('ZinfandelLimitedCDB','Old Vine Zinfandel',ssUrlPrefix + 'Wines/LimitedRelease/Zinfandel/index.htm','cspNavType==11','cspNext==DryCreekValleyZinLimitedCDB','cspPrevious==ZinfandelClassicCDB','cspVarietalFull==Old Vine','cspWineColor==Red','cspWineType==Zinfandel');
g_navNode_0_0_1=g_navNode_0_0.addNode('MalbecLimitedCDB','Alexander Valley Malbec',ssUrlPrefix + 'Wines/LimitedRelease/Malbec/index.htm','cspNavType==4','cspNext==None','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Malbec');
g_navNode_0_0_2=g_navNode_0_0.addNode('PetiteSirahLimitedCDB','Knights Valley Petite Sirah',ssUrlPrefix + 'Wines/LimitedRelease/PetiteSirah/index.htm','cspNavType==7','cspNext==None','cspVarietalFull==Knights Valley','cspWineColor==Red','cspWineType==Petite Sirah');
g_navNode_0_0_3=g_navNode_0_0.addNode('OldVineCarignaneLimitedCDB','Old Vine Carignane',ssUrlPrefix + 'Wines/LimitedRelease/OldVineCarignane/index.htm','cspNavType==3','cspNext==None','cspVarietalFull==Old Vine','cspWineColor==Red','cspWineType==Carignane');
g_navNode_0_0_4=g_navNode_0_0.addNode('DryCreekValleyZinLimitedCDB','Dry Creek Valley Zinfandel',ssUrlPrefix + 'Wines/LimitedRelease/DryCreekValleyZinfandel/index.htm','cspNavType==11','cspNext==ZinfandelClassicCDB','cspPrevious==ZinfandelLimitedCDB','cspVarietalFull==Dry Creek Valley','cspWineColor==Red','cspWineType==Zinfandel');
g_navNode_0_0_5=g_navNode_0_0.addNode('PetiteVerdotLimitedCDB','Alexander Valley Petit Verdot',ssUrlPrefix + 'Wines/LimitedRelease/PetiteVerdot/index.htm','cspNavType==6','cspNext==None','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Petit Verdot');
g_navNode_0_1=g_navNode_0.addNode('ClassicsCDB','Classics',ssUrlPrefix + 'Wines/Classics/index.htm','cspWineType==Classics');
g_navNode_0_1_0=g_navNode_0_1.addNode('RieslingCDB','California Riesling',ssUrlPrefix + 'Wines/Classics/Riesling/index.htm','cspNavType==15','cspNext==None','cspVarietalFull==California','cspWineColor==White','cspWineType==Riesling');
g_navNode_0_1_1=g_navNode_0_1.addNode('SauvignonBlancCDB','North Coast Sauvignon Blanc',ssUrlPrefix + 'Wines/Classics/SauvignonBlanc/index.htm','cspNavType==16','cspNext==None','cspVarietalFull==North Coast','cspWineColor==White','cspWineType==Sauvignon Blanc');
g_navNode_0_1_2=g_navNode_0_1.addNode('PinotGrigioCDB','California Pinot Grigio',ssUrlPrefix + 'Wines/Classics/PinotGrigio/index.htm','cspNavType==14','cspNext==None','cspVarietalFull==California','cspWineColor==White','cspWineType==Pinot Grigio');
g_navNode_0_1_3=g_navNode_0_1.addNode('ChardonnayClassicCDB','North Coast Chardonnay',ssUrlPrefix + 'Wines/Classics/Chardonnay/index.htm','cspNavType==12','cspNext==CalcaireCDB','cspPrevious==ChardonnayCDB','cspVarietalFull==North Coast','cspWineColor==White','cspWineType==Chardonnay');
g_navNode_0_1_4=g_navNode_0_1.addNode('CabernetSauvignonClassicCDB','North Coast Cabernet Sauvignon',ssUrlPrefix + 'Wines/Classics/CabernetSauvignon/index.htm','cspNavType==2','cspNext==CabernetCDB','cspPrevious==BriarcrestCDB','cspVarietalFull==North Coast','cspWineColor==Red','cspWineType==Cabernet Sauvignon');
g_navNode_0_1_5=g_navNode_0_1.addNode('MerlotClassicCDB','North Coast Merlot',ssUrlPrefix + 'Wines/Classics/Merlot/index.htm','cspNavType==5','cspNext==MerlotCDB','cspPrevious==MerlotCDB','cspVarietalFull==North Coast','cspWineColor==Red','cspWineType==Merlot');
g_navNode_0_1_6=g_navNode_0_1.addNode('PinotNoirClassicCDB','North Coast Pinot Noir',ssUrlPrefix + 'Wines/Classics/PinotNoir/index.htm','cspNavType==8','cspNext==PinotNoirCDB','cspPrevious==PinotNoirCDB','cspVarietalFull==North Coast','cspWineColor==Red','cspWineType==Pinot Noir');
g_navNode_0_1_7=g_navNode_0_1.addNode('ShirazClassicCDB','North Coast Shiraz',ssUrlPrefix + 'Wines/Classics/Shiraz/index.htm','cspNavType==9','cspNext==None','cspVarietalFull==North Coast','cspWineColor==Red','cspWineType==Shiraz');
g_navNode_0_1_8=g_navNode_0_1.addNode('ZinfandelClassicCDB','North Coast Zinfandel',ssUrlPrefix + 'Wines/Classics/Zinfandel/index.htm','cspNavType==11','cspNext==ZinfandelLimitedCDB','cspPrevious==DryCreekValleyZinLimitedCDB','cspVarietalFull==North Coast','cspWineColor==Red','cspWineType==Zinfandel');
g_navNode_0_2=g_navNode_0.addNode('SonomaReserveCDB','Sonoma Reserve',ssUrlPrefix + 'Wines/SonomaReserve/index.htm','cspWineType==Sonoma Reserve');
g_navNode_0_2_0=g_navNode_0_2.addNode('ChardonnayCDB','Russian River Valley Chardonnay',ssUrlPrefix + 'Wines/SonomaReserve/Chardonnay/index.htm','cspNavType==12','cspNext==ChardonnayClassicCDB','cspPrevious==CalcaireCDB','cspVarietalFull==Russian River Valley','cspWineColor==White','cspWineType==Chardonnay');
g_navNode_0_2_1=g_navNode_0_2.addNode('CabernetCDB','Alexander Valley Cabernet Sauvignon',ssUrlPrefix + 'Wines/SonomaReserve/Cabernet/index.htm','cspNavType==2','cspNext==BriarcrestCDB','cspPrevious==CabernetSauvignonClassicCDB','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Cabernet Sauvignon');
g_navNode_0_2_2=g_navNode_0_2.addNode('MerlotCDB','Alexander Valley Merlot',ssUrlPrefix + 'Wines/SonomaReserve/Merlot/index.htm','cspNavType==5','cspNext==MerlotClassicCDB','cspPrevious==MerlotClassicCDB','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Merlot');
g_navNode_0_2_3=g_navNode_0_2.addNode('TempranilloCDB','Alexander Valley Tempranillo',ssUrlPrefix + 'Wines/SonomaReserve/Tempranillo/index.htm','cspNavType==10','cspNext==None','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Tempranillo');
g_navNode_0_2_4=g_navNode_0_2.addNode('PinotNoirCDB','Sonoma Coast Pinot Noir',ssUrlPrefix + 'Wines/SonomaReserve/PinotNoir/index.htm','cspNavType==8','cspNext==PinotNoirClassicCDB','cspPrevious==PinotNoirClassicCDB','cspVarietalFull==Sonoma Coast','cspWineColor==Red','cspWineType==Pinot Noir');
g_navNode_0_2_5=g_navNode_0_2.addNode('FumeBlancCDB','Alexander Valley Fum\xe8 Blanc',ssUrlPrefix + 'Wines/SonomaReserve/FumeBlanc/index.htm','cspNavType==13','cspNext==None','cspVarietalFull==Alexander Valley','cspWineColor==White','cspWineType==Fum\xe8 Blanc');
g_navNode_0_3=g_navNode_0.addNode('ProprietaryCDB','Proprietary',ssUrlPrefix + 'Wines/Proprietary/index.htm','cspWineType==Proprietary');
g_navNode_0_3_0=g_navNode_0_3.addNode('MarlstoneCDB','Marlstone Bordeaux Blend',ssUrlPrefix + 'Wines/Proprietary/Marlstone/index.htm','cspNavType==1','cspNext==None','cspVarietalFull==Alexander Valley','cspWineColor==Red','cspWineType==Marlstone');
g_navNode_0_3_1=g_navNode_0_3.addNode('CalcaireCDB','Russian River Valley Calcaire',ssUrlPrefix + 'Wines/Proprietary/Calcaire/index.htm','cspNavType==12','cspNext==ChardonnayCDB','cspPrevious==ChardonnayClassicCDB','cspVarietalFull==Russian River Valley Calcaire','cspWineColor==White','cspWineType==Chardonnay');
g_navNode_0_3_2=g_navNode_0_3.addNode('BriarcrestCDB','Briarcrest Cabernet Sauvignon',ssUrlPrefix + 'Wines/Proprietary/Briarcrest/index.htm','cspNavType==2','cspNext==CabernetSauvignonClassicCDB','cspPrevious==CabernetCDB','cspVarietalFull==Alexander Valley Briarcrest','cspWineColor==Red','cspWineType==Cabernet Sauvignon');
g_navNode_2=g_navNode_Root.addNode('TheWineryCDB','The Winery',ssUrlPrefix + 'TheWinery/index.htm');
g_navNode_2_0=g_navNode_2.addNode('HistoryofClosDuBoisCDB','History of Clos Du Bois',ssUrlPrefix + 'TheWinery/HistoryofClosDuBois/index.htm');
g_navNode_2_1=g_navNode_2.addNode('OurWinemakerCDB','Our Winemaker',ssUrlPrefix + 'TheWinery/OurWinemaker/index.htm');
g_navNode_2_2=g_navNode_2.addNode('OurVineyardsCDB','Our Vineyards',ssUrlPrefix + 'TheWinery/OurVineyards/index.htm');
g_navNode_2_3=g_navNode_2.addNode('ToursandTastingsCDB','Tours and Tastings',ssUrlPrefix + 'TheWinery/ToursandTastings/index.htm');
g_navNode_2_4=g_navNode_2.addNode('EventsCDB','Events',ssUrlPrefix + 'TheWinery/Events/index.htm');
g_navNode_2_5=g_navNode_2.addNode('SustainableWinemakingCDB','Sustainable Winemaking',ssUrlPrefix + 'TheWinery/SustainableWinemaking/index.htm');
g_navNode_3=g_navNode_Root.addNode('EnjoyingWineCDB','Enjoying Wine',ssUrlPrefix + 'EnjoyingWine/index.htm');
g_navNode_3_0=g_navNode_3.addNode('FoodandWineCDB','Food and Wine',ssUrlPrefix + 'EnjoyingWine/FoodandWine/index.htm');
g_navNode_3_1=g_navNode_3.addNode('HowTosCDB','How To\'s',ssUrlPrefix + 'EnjoyingWine/HowTos/index.htm');
g_navNode_3_2=g_navNode_3.addNode('Wine101CDB','Wine101',ssUrlPrefix + 'EnjoyingWine/Wine101/index.htm');
g_navNode_4=g_navNode_Root.addNode('WineShopCDB','Wine Shop',ssUrlPrefix + 'WineShop/index.htm');
g_navNode_6=g_navNode_Root.addNode('PrivacyPolicyCDB','Privacy Policy',ssUrlPrefix + 'PrivacyPolicy/index.htm');
g_navNode_7=g_navNode_Root.addNode('TermofUseCDB','Terms of Use',ssUrlPrefix + 'TermofUse/index.htm');
g_navNode_8=g_navNode_Root.addNode('ContactUsFormCDB','Contact Us Form',ssUrlPrefix + 'ContactUs/index.htm');
g_navNode_9=g_navNode_Root.addNode('ReportAnIssueCDB','Report An Issue',ssUrlPrefix + 'ReportAnIssue/index.htm');
g_navNode_12=g_navNode_Root.addNode('RedCDB','Red',ssUrlPrefix + 'Red/index.htm','cspWineType==Red');
g_navNode_13=g_navNode_Root.addNode('WhiteCDB','White',ssUrlPrefix + 'White/index.htm','cspWineType==White');
g_navNode_14=g_navNode_Root.addNode('ContactUsCDB','Contact Us',ssUrlPrefix + 'ContactUsMain/index.htm');
g_navNode_15=g_navNode_Root.addNode('FAQCDB','FAQ',ssUrlPrefix + 'FAQ/index.htm');
g_navNode_16=g_navNode_Root.addNode('SiteMapCDB','SiteMap',ssUrlPrefix + 'SiteMap/index.htm');

