/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','2101',jdecode('Home+%26+Updates'),jdecode(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','20712',jdecode('About+the+Shop'),jdecode(''), jdecode('%2F20712.html'), 'true',[],'',''],
	['PAGE','29712',jdecode('Calendar'),jdecode(''), jdecode('%2F29712.html'), 'true',[],'',''],
	['PAGE','5612',jdecode('Wine'),jdecode(''), jdecode('%2F5612%2Findex.html'), 'true',[ 
		['PAGE','28012',jdecode('Red'),jdecode(''), jdecode('%2F5612%2F28012.html'), 'true',[],'',''],
		['PAGE','28033',jdecode('White'),jdecode(''), jdecode('%2F5612%2F28033.html'), 'true',[],'',''],
		['PAGE','28054',jdecode('Sparkling'),jdecode(''), jdecode('%2F5612%2F28054.html'), 'true',[],'',''],
		['PAGE','28075',jdecode('Dessert'),jdecode(''), jdecode('%2F5612%2F28075.html'), 'true',[],'','']
	],'',''],
	['PAGE','5633',jdecode('Beer'),jdecode(''), jdecode('%2F5633%2Findex.html'), 'true',[ 
		['PAGE','11512',jdecode('Current+Beer+List'),jdecode(''), jdecode('%2F5633%2F11512.html'), 'true',[],'','']
	],'',''],
	['PAGE','9912',jdecode('Gourmet'),jdecode(''), jdecode('%2F9912%2Findex.html'), 'true',[ 
		['PAGE','5654',jdecode('Other+Gourmet'),jdecode(''), jdecode('%2F9912%2F5654.html'), 'true',[],'','']
	],'',''],
	['PAGE','12712',jdecode('Cheeses'),jdecode(''), jdecode('%2F12712%2Findex.html'), 'true',[ 
		['PAGE','12754',jdecode('Blue'),jdecode(''), jdecode('%2F12712%2F12754.html'), 'true',[],'',''],
		['PAGE','12733',jdecode('Soft+%26+Bloomy'),jdecode(''), jdecode('%2F12712%2F12733.html'), 'true',[],'',''],
		['PAGE','12796',jdecode('Goat%26%23x27%3Bs+Milk'),jdecode(''), jdecode('%2F12712%2F12796.html'), 'true',[],'',''],
		['PAGE','12817',jdecode('Washed+Rind+'),jdecode(''), jdecode('%2F12712%2F12817.html'), 'true',[],'',''],
		['PAGE','17512',jdecode('Firm+%26+Semi-Firm'),jdecode(''), jdecode('%2F12712%2F17512.html'), 'true',[],'',''],
		['PAGE','12775',jdecode('Hard+'),jdecode(''), jdecode('%2F12712%2F12775.html'), 'true',[],'',''],
		['PAGE','12838',jdecode('Cheddars'),jdecode(''), jdecode('%2F12712%2F12838.html'), 'true',[],'',''],
		['PAGE','12859',jdecode('Other+Cheeses'),jdecode(''), jdecode('%2F12712%2F12859.html'), 'true',[],'','']
	],'',''],
	['PAGE','12880',jdecode('Charcuterie'),jdecode(''), jdecode('%2F12880%2Findex.html'), 'true',[ 
		['PAGE','12901',jdecode('Salami'),jdecode(''), jdecode('%2F12880%2F12901.html'), 'true',[],'',''],
		['PAGE','12922',jdecode('Pate+%26+Mousses'),jdecode(''), jdecode('%2F12880%2F12922.html'), 'true',[],'',''],
		['PAGE','12943',jdecode('Other+meats'),jdecode(''), jdecode('%2F12880%2F12943.html'), 'true',[],'','']
	],'',''],
	['PAGE','3001',jdecode('Tasting+Room'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','3022',jdecode('Events'),jdecode(''), jdecode('%2F3022.html'), 'true',[],'',''],
	['PAGE','3043',jdecode('Hours+%26+Directions'),jdecode(''), jdecode('%2F3043.html'), 'true',[],'',''],
	['PAGE','31812',jdecode('Job+Opportunities'),jdecode(''), jdecode('%2F31812.html'), 'false',[],'',''],
	['PAGE','9112',jdecode('Contact+Us'),jdecode(''), jdecode('%2F9112.html'), 'true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='DCCC9F';
theSitetree.keyvisualId='11900';
theSitetree.keyvisualName='kv_11900.jpg';
theSitetree.fontsetId='33182';
theSitetree.graphicsetId='14089';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='fbeec7';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp13-cbeyon',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vienna',
				paletteFamily: 	'DCCC9F',
				keyvisualId: 	'11900',
				keyvisualName: 	'kv_11900.jpg',
				fontsetId: 		'33182',
				graphicsetId: 	'14089',
				contentColor: 	'000000',
				contentBGColor: 'fbeec7',
				a_color: 		'FBEFC9',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20110927-175954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20110918-114059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3022',
internalId:  '',
customField: '20110927-175808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3043',
internalId:  '',
customField: '20110711-112354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5612',
internalId:  '',
customField: '20110719-181809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5633',
internalId:  '',
customField: '20111006-134746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5654',
internalId:  '',
customField: '20110709-184857'
};
webappMappings['7008']=webappMappings['7008-25381']={
webappId:    '7008',
documentId:  '9112',
internalId:  '25381',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9112',
internalId:  '',
customField: '20110709-190358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9912',
internalId:  '',
customField: '20110709-182835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12733',
internalId:  '',
customField: '20110709-185117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12712',
internalId:  '',
customField: '20110730-174426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11512',
internalId:  '',
customField: '20111006-131723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12817',
internalId:  '',
customField: '20110704-152211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12754',
internalId:  '',
customField: '20110709-185018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12796',
internalId:  '',
customField: '20110709-185701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12838',
internalId:  '',
customField: '20110706-195944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12775',
internalId:  '',
customField: '20110704-131740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12859',
internalId:  '',
customField: '20110709-185900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12880',
internalId:  '',
customField: '20110709-190028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20110709-190045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20110709-190108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12943',
internalId:  '',
customField: '20110709-190128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28033',
internalId:  '',
customField: '20110719-182422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17512',
internalId:  '',
customField: '20110704-132556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20712',
internalId:  '',
customField: '20110709-155241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28012',
internalId:  '',
customField: '20110719-182529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28054',
internalId:  '',
customField: '20110719-182404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28075',
internalId:  '',
customField: '20110719-182338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29712',
internalId:  '',
customField: '20110712-164650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31812',
internalId:  '',
customField: '20110719-132813'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7KEE2';
var companyName   = 'Red+White+%26+Bleu';
var htmlTitle	  = 'Red+White+%26+Bleu+a+wine+and+gourmet+shop';
var metaKeywords  = 'Red+white+bleu%0D%0Awine%0D%0Abeer%0D%0Afalls+church%0D%0Acheese%0D%0Acharcuterie%0D%0Agourmet%0D%0Awine+tasting';
var metaContents  = 'Red%2C+White+%26+Bleu+-+a+wine+and+gourmet+shop.+%0D%0ALocated+at+127+S+Washington+St.%2C+Falls+Church%2C+VA+22046+%0D%0APhone%3A+%28703%29-533-9463%0D%0AE-mail%3A+info%40redwhiteandbleu.com';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

