/* [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','53',jdecode('HOME'),jdecode(''), jdecode('%2F53.html'), 'true',[],'',''],
	['PAGE','29301',jdecode('%22IN-STOCK+SPECIALS%22'),jdecode(''), jdecode('%2F29301.html'), 'true',[],'',''],
	['PAGE','2155',jdecode('Carved+Doors'),jdecode(''), jdecode('%2F2155.html'), 'true',[],'',''],
	['PAGE','2164',jdecode('Carved+Screen+Doors'),jdecode(''), jdecode('%2F2164.html'), 'true',[],'',''],
	['PAGE','2173',jdecode('Carved++Mantels'),jdecode(''), jdecode('%2F2173.html'), 'true',[],'',''],
	['PAGE','2191',jdecode('Carved+Signs'),jdecode(''), jdecode('%2F2191.html'), 'true',[],'',''],
	['PAGE','2182',jdecode('Rustic+Furnishings'),jdecode(''), jdecode('%2F2182.html'), 'true',[],'',''],
	['PAGE','2567',jdecode('Rustic+Hardware+'),jdecode(''), jdecode('%2F2567.html'), 'true',[],'',''],
	['PAGE','2576',jdecode('Handmade+Gifts'),jdecode(''), jdecode('%2F2576.html'), 'true',[],'',''],
	['PAGE','31901',jdecode('Custom+Jewelry'),jdecode(''), jdecode('%2F31901.html'), 'true',[],'',''],
	['PAGE','7601',jdecode('+Collectables'),jdecode(''), jdecode('%2F7601.html'), 'true',[],'',''],
	['PAGE','7622',jdecode('Carving+Tools'),jdecode(''), jdecode('%2F7622%2Findex.html'), 'true',[ 
		['PAGE','13301',jdecode('Patterns'),jdecode(''), jdecode('%2F7622%2F13301.html'), 'true',[],'','']
	],'',''],
	['PAGE','2146',jdecode('Design+Service'),jdecode(''), jdecode('%2F2146.html'), 'true',[],'',''],
	['PAGE','2669',jdecode('Portfolio'),jdecode(''), jdecode('%2F2669.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('CONTACT'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','2119',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F2119%2Findex.html'), 'true',[ 
		['PAGE','2137',jdecode('Events'),jdecode(''), jdecode('%2F2119%2F2137.html'), 'true',[],'','']
	],'',''],
	['PAGE','2594',jdecode('POLICY'),jdecode(''), jdecode('%2F2594%2Findex.html'), 'true',[ 
		['PAGE','2603',jdecode('Order+Info'),jdecode(''), jdecode('%2F2594%2F2603.html'), 'true',[],'',''],
		['PAGE','2612',jdecode('Returns%2FExchange'),jdecode(''), jdecode('%2F2594%2F2612.html'), 'true',[],'','']
	],'',''],
	['PAGE','2585',jdecode(''),jdecode(''), jdecode('%2F2585.html'), 'false',[],'',''],
	['PAGE','30701',jdecode('LINKS'),jdecode(''), jdecode('%2F30701.html'), 'true',[],'',''],
	['PAGE','31701',jdecode('BLOG'),jdecode(''), jdecode('%2F31701.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Livinginamerica';
theSitetree.paletteFamily='83A270';
theSitetree.keyvisualId='6338';
theSitetree.keyvisualName='kv_6338.jpg';
theSitetree.fontsetId='11152';
theSitetree.graphicsetId='12906';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D1E0C7';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC24G'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Livinginamerica',
				paletteFamily: 	'83A270',
				keyvisualId: 	'6338',
				keyvisualName: 	'kv_6338.jpg',
				fontsetId: 		'11152',
				graphicsetId: 	'12906',
				contentColor: 	'000000',
				contentBGColor: 'D1E0C7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '53',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-040e9221a085505894ee438421bdf84b']={
webappId:    '7060',
documentId:  '2669',
internalId:  '040e9221a085505894ee438421bdf84b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20110210-195023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2119',
internalId:  '',
customField: '20110202-091446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20110208-163352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2137',
internalId:  '',
customField: '20110123-110758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2146',
internalId:  '',
customField: '20110123-105711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2155',
internalId:  '',
customField: '20110123-102319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2164',
internalId:  '',
customField: '20110123-102619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20110202-090620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2191',
internalId:  '',
customField: '20110123-103410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2182',
internalId:  '',
customField: '20110123-103649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2567',
internalId:  '',
customField: '20110123-103938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2576',
internalId:  '',
customField: '20110123-104202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2585',
internalId:  '',
customField: '20080222-043329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2669',
internalId:  '',
customField: '20091126-225919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2594',
internalId:  '',
customField: '20100127-172417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2603',
internalId:  '',
customField: '20080206-050401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2612',
internalId:  '',
customField: '20080206-053734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20110123-112032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7622',
internalId:  '',
customField: '20110208-160417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20081124-095012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20091126-204748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20110123-100720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30701',
internalId:  '',
customField: '20110202-085920'
};
webappMappings['7050']=webappMappings['7050-3320']={
webappId:    '7050',
documentId:  '31701',
internalId:  '3320',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20110122-114713'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INV0EE';
var companyName   = 'Woodland+Carvings+%26+Design+by+K.+Adamson';
var htmlTitle	  = 'Custom+woodcarving+and+design+by+Kathy+Adamson+specializing+in+carved+doors%2Cscreen+doors%2Cfireplace+mantels%2Ccarved+signs%2Crustic+furniture+in+rustic%2Clodge%2Cwestern%2C+log+home+decor';
var metaKeywords  = 'custom+woodcarving%2Ccarved+doors%2Cfireplace+mantels%2Cscreen+doors%2Ccarved+signs%2Crustic%2Clodge%2Clog+home%2Cwestern';
var metaContents  = 'Woodland+Carvings+by+Kathy+Adamson+features+custom+woodcarving%2Ccarved+doors%2Cscreen+doors%2Cfireplace+mantels%2Ccarved+signs+and+rustic+furniture+in+western%2Crustic%2Clodge+and+log+home+decor';
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();
};

