/* [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 theSitetree=[ 
	['PAGE','2301',jdecode('Home'),jdecode(''),'/2301.html','true',[],''],
	['PAGE','2352',jdecode('About+us'),jdecode(''),'/2352.html','true',[],''],
	['PAGE','2373',jdecode('Our+Products'),jdecode(''),'/2373/index.html','true',[ 
		['PAGE','13901',jdecode('Scented+candles'),jdecode(''),'/2373/13901.html','true',[],''],
		['PAGE','13922',jdecode('Paint+Can+Lanterns'),jdecode(''),'/2373/13922.html','true',[],''],
		['PAGE','13943',jdecode('Candleholders+%26+more'),jdecode(''),'/2373/13943.html','true',[],''],
		['PAGE','13964',jdecode('Lantern+wax+refills'),jdecode(''),'/2373/13964.html','true',[],'']
	],''],
	['PAGE','2457',jdecode('Festival+Schedule'),jdecode(''),'/2457.html','true',[],''],
	['PAGE','2478',jdecode('Wholesale+Accounts'),jdecode(''),'/2478/index.html','true',[ 
		['PAGE','7401',jdecode('Wholesale+Accounts+%28follow+up+page%29'),jdecode(''),'/2478/7401.html','false',[],'']
	],''],
	['PAGE','2499',jdecode('FAQ'),jdecode(''),'/2499.html','true',[],''],
	['PAGE','2520',jdecode('Mailing+List'),jdecode(''),'/2520/index.html','true',[ 
		['PAGE','7601',jdecode('Mailing+List+%28follow+up+page%29'),jdecode(''),'/2520/7601.html','false',[],'']
	],''],
	['PAGE','2541',jdecode('Contact+Us'),jdecode(''),'/2541.html','true',[],''],
	['PAGE','2562',jdecode('Candle+Tips+%26+Tricks'),jdecode(''),'/2562.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Nurseries';
theSitetree.paletteFamily='FFE57B';
theSitetree.keyvisualId='7904';
theSitetree.keyvisualName='kv_7904.jpg';
theSitetree.fontsetId='16858';
theSitetree.graphicsetId='12313';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE57B';
var theTemplate={
				name: 			'Nurseries',
				paletteFamily: 	'FFE57B',
				keyvisualId: 	'7904',
				keyvisualName: 	'kv_7904.jpg',
				fontsetId: 		'16858',
				graphicsetId: 	'12313',
				contentColor: 	'000000',
				contentBGColor: 'FFE57B',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'true',
				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['1001']=webappMappings['1001-ahw050inej2k41bcdbaba076b7ce']={
webappId:    '1001',
documentId:  '2478',
internalId:  'ahw050inej2k41bcdbaba076b7ce',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inej2k41bcdbaba076b7ce']={
webappId:    '1001',
documentId:  '7401',
internalId:  'ahw050inej2k41bcdbaba076b7ce',
customField: 'followUp'
};
webappMappings['1001']=webappMappings['1001-ahw050inej2k8b517912d4806dd']={
webappId:    '1001',
documentId:  '2520',
internalId:  'ahw050inej2k8b517912d4806dd',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050inej2k8b517912d4806dd']={
webappId:    '1001',
documentId:  '7601',
internalId:  'ahw050inej2k8b517912d4806dd',
customField: 'followUp'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20090514-185425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2457',
internalId:  '',
customField: '20091119-163141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2352',
internalId:  '',
customField: '20070605-225144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2373',
internalId:  '',
customField: '20090106-162717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20070220-203121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13922',
internalId:  '',
customField: '20070220-203709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13943',
internalId:  '',
customField: '20070220-223613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13964',
internalId:  '',
customField: '20070220-223550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2478',
internalId:  '',
customField: '20070220-211151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20070128-174757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2499',
internalId:  '',
customField: '20070921-164110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2520',
internalId:  '',
customField: '20070220-213735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20070128-180335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2541',
internalId:  '',
customField: '20070201-033728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2562',
internalId:  '',
customField: '20070220-213839'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INEJ2K';
var companyName   = '++++++++++++++++++++++++++++++MORNING+DEW+CANDLES';
var htmlTitle	  = 'Morning+Dew+Candles';
var metaKeywords  = 'paint+can+lantern++scented+candles++handcrafted+candles++candle+lantern++morning+dew+candles++forest+candles++lilac+candles++chocolate+candles++lavender+candles++';
var metaContents  = 'scented+candles';
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();
};
