/* [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','1401',jdecode('Home'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','13801',jdecode('Hours'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','15401',jdecode('How+to+find+us'),jdecode(''),'/15401.html','true',[],'',''],
	['PAGE','1452',jdecode('About+us'),jdecode(''),'/1452.html','true',[],'',''],
	['PAGE','39501',jdecode('FAIR+TRADE+'),jdecode(''),'/39501.html','true',[],'',''],
	['PAGE','24601',jdecode('The+NG+Album'),jdecode(''),'/24601.html','true',[],'',''],
	['PAGE','1515',jdecode('MUSIC+SHOW+NEWS+'),jdecode(''),'/1515.html','true',[],'',''],
	['PAGE','18501',jdecode('Press%2FNews'),jdecode(''),'/18501.html','true',[],'',''],
	['PAGE','13864',jdecode('Menu'),jdecode(''),'/13864.html','true',[],'',''],
	['PAGE','13885',jdecode('Offers'),jdecode(''),'/13885.html','true',[],'',''],
	['PAGE','1557',jdecode('Contact'),jdecode(''),'/1557/index.html','true',[ 
		['PAGE','1599',jdecode('How+to+find+us'),jdecode(''),'/1557/1599.html','true',[],'','']
	],'',''],
	['PAGE','1536',jdecode('Jobs'),jdecode(''),'/1536.html','true',[],'',''],
	['PAGE','1620',jdecode('Links'),jdecode(''),'/1620.html','true',[],'',''],
	['PAGE','6606',jdecode('Guestbook'),jdecode(''),'/6606/index.html','true',[ 
		['PAGE','6601',jdecode('Read+Guestbook'),jdecode(''),'/6606/6601.html','false',[],'','']
	],'',''],
	['PAGE','43701',jdecode('Map'),jdecode(''),'/43701.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='C5E8B1';
theSitetree.keyvisualId='6227';
theSitetree.keyvisualName='kv_6227.jpg';
theSitetree.fontsetId='11090';
theSitetree.graphicsetId='11864';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C5E8B1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'C5E8B1',
				keyvisualId: 	'6227',
				keyvisualName: 	'kv_6227.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11864',
				contentColor: 	'000000',
				contentBGColor: 'C5E8B1',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20100107-190902'
};
webappMappings['1002']=webappMappings['1002-6606AHW050INX3SK']={
webappId:    '1002',
documentId:  '6606',
internalId:  '6606AHW050INX3SK',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-234690']={
webappId:    '1501',
documentId:  '1401',
internalId:  '234690',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '43701',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7005']=webappMappings['7005-85']={
webappId:    '7005',
documentId:  '1401',
internalId:  '85',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-3ef81bf39f3439f7da228e12989f1651']={
webappId:    '7060',
documentId:  '24601',
internalId:  '3ef81bf39f3439f7da228e12989f1651',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1515',
internalId:  '',
customField: '20100611-090410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100513-010004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20100310-074337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20071215-135515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39501',
internalId:  '',
customField: '20100611-085924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13864',
internalId:  '',
customField: '20100611-090617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13885',
internalId:  '',
customField: '20100611-090836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1452',
internalId:  '',
customField: '20100616-092417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20080511-181223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1557',
internalId:  '',
customField: '20091120-092739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1599',
internalId:  '',
customField: '20070912-025006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1536',
internalId:  '',
customField: '20100611-091412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1620',
internalId:  '',
customField: '20091214-075823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6606',
internalId:  '',
customField: '20070707-175525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20070329-012342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43701',
internalId:  '',
customField: '20071215-135649'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3SK';
var companyName   = 'The+Nesting+Grounds';
var htmlTitle	  = 'Fair+Trade+Coffees+and+Teas%2C++Music%2C+WIFI%2C+sandwiches%2C+gifts+and+more';
var metaKeywords  = 'coffee+house%2C+cafe%2C+Wyoming+MN%2C+fair+trade+coffee%2C+organic+coffee%2C+organic+teas%2C+live+music%2C+fair+trade+gifts%2C+salsas%2C+coffee+beans%2C+meetings%2C+catering%2C+Forest+Lake+MN';
var metaContents  = 'The+Nesting+Grounds+is+a+Coffee+House+that+offers+all+Fair+Trade+Certified+Coffees%2C+teas+and+chocolates.++Also+have+breakfast+sandwiches%2C+deli+and+panini+sandwiches%2C+soups+and+salads+and+baked+goods.++Live+music+on+Fridays+and+fair+trade+gifts%2C+mugs%2C+cards+and+coffee+beans+also+available';
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();
};
