/* [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','1601',jdecode('Home'),jdecode(''),'/1601.html','true',[],'',''],
	['PAGE','7385',jdecode('CraftiArt'),jdecode(''),'/7385/index.html','true',[ 
		['PAGE','13401',jdecode('Benches%2FStools'),jdecode(''),'/7385/13401.html','true',[],'',''],
		['PAGE','13422',jdecode('Birdhouses'),jdecode(''),'/7385/13422.html','true',[],'',''],
		['PAGE','7406',jdecode('Candle+Holders'),jdecode(''),'/7385/7406.html','true',[],'',''],
		['PAGE','13443',jdecode('Desk+Sets'),jdecode(''),'/7385/13443.html','true',[],'',''],
		['PAGE','7427',jdecode('Lamps'),jdecode(''),'/7385/7427.html','true',[],'',''],
		['PAGE','13527',jdecode('Ornaments%2FPlaques'),jdecode(''),'/7385/13527.html','true',[],'',''],
		['PAGE','13464',jdecode('Pet+Diners'),jdecode(''),'/7385/13464.html','true',[],'',''],
		['PAGE','13485',jdecode('This+%26%23x27%3BN+That'),jdecode(''),'/7385/13485.html','true',[],'','']
	],'',''],
	['PAGE','7511',jdecode('Shows'),jdecode(''),'/7511.html','true',[],'',''],
	['PAGE','13569',jdecode('Contact'),jdecode(''),'/13569.html','true',[],'',''],
	['PAGE','13590',jdecode('Links'),jdecode(''),'/13590.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20110602-151001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7511',
internalId:  '',
customField: '20110524-123732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7385',
internalId:  '',
customField: '20110524-125037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7406',
internalId:  '',
customField: '20101118-161853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13443',
internalId:  '',
customField: '20090326-180350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13527',
internalId:  '',
customField: '20090326-183316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20110503-031033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13422',
internalId:  '',
customField: '20110524-125405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7427',
internalId:  '',
customField: '20090403-133126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13464',
internalId:  '',
customField: '20090628-151930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13569',
internalId:  '',
customField: '20100511-192039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13485',
internalId:  '',
customField: '20110524-125855'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13590',
internalId:  '',
customField: '20110503-031348'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INXEAF';
var companyName   = 'High+Country+Wood+Crafters';
var htmlTitle	  = 'High+Country+Wood+Crafters+Bears+in+the+Wood+aspen+bears+and+paws';
var metaKeywords  = 'aspen+bears+and+paws%2C+bears+in+the+woods%2C+aspen%2C+pine%2C+bear%2C+birdhouse%2C+dog%2C+cat%2C+candle+holders%2C+lamps%2C+wine+racks%2C+ornaments%2C+wood+burned%2C+dog+and+cat+log+dishes+and+diners%2C+lodge+furnishings%2C+handmade+and+crafted';
var metaContents  = 'Our+Bears+in+the+Wood+and+aspen+bears+and+paws+are+handmade+and+crafted.+We+make+unique+aspen+birdhouses%2C+old+barn+wood+birdhouses%2C+custom+dog+and+cat+log+furniture%2C+aspen+bear+candle+holders+and+lamps%2C+wine+racks%2C+and+other+custom+made+aspen+bear+crafts.+These+go+in+any+home%2C+especially+lodge+and+log+cabins+and+homes.+We+use+mainly+aspen+and+beautiful+beetle-kill+pine.';
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();
};

