/* [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','6001',jdecode('Home'),jdecode(''),'/6001.html','true',[],'',''],
	['PAGE','6052',jdecode('Contact'),jdecode(''),'/6052.html','true',[],'',''],
	['PAGE','11501',jdecode('Camouflage+projects'),jdecode(''),'/11501/index.html','true',[ 
		['PAGE','12001',jdecode('Gun+Cabinet'),jdecode(''),'/11501/12001.html','true',[],'',''],
		['PAGE','12022',jdecode('Desk'),jdecode(''),'/11501/12022.html','true',[],'',''],
		['PAGE','12043',jdecode('Fishing+Rod+Cabinet'),jdecode(''),'/11501/12043.html','true',[],'','']
	],'',''],
	['PAGE','11585',jdecode('Kitchens'),jdecode(''),'/11585.html','true',[],'',''],
	['PAGE','18401',jdecode('Bath%2FEntertainment+centers'),jdecode(''),'/18401.html','true',[],'',''],
	['PAGE','18501',jdecode('Misc.+cabinetry'),jdecode(''),'/18501.html','true',[],'',''],
	['PAGE','22226',jdecode('Links'),jdecode(''),'/22226.html','true',[],'',''],
	['PAGE','22305',jdecode('Location'),jdecode(''),'/22305.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='E58F12';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11061';
theSitetree.graphicsetId='11833';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'E58F12',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11061',
				graphicsetId: 	'11833',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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:  '11585',
internalId:  '',
customField: '20100415-120109'
};
webappMappings['7060']=webappMappings['7060-18f264ccc5e0142dae88f7dd0a1cd826']={
webappId:    '7060',
documentId:  '18401',
internalId:  '18f264ccc5e0142dae88f7dd0a1cd826',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100213-181604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6052',
internalId:  '',
customField: '20100211-170418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100415-114936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100211-200914'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '6001',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-ccb1005d93e5baca3252bfee1d44f1ed']={
webappId:    '7060',
documentId:  '18501',
internalId:  'ccb1005d93e5baca3252bfee1d44f1ed',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20100415-115312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12043',
internalId:  '',
customField: '20100415-115721'
};
webappMappings['7060']=webappMappings['7060-27215b9a0fec6a0bf49ac6c601de1b14']={
webappId:    '7060',
documentId:  '11585',
internalId:  '27215b9a0fec6a0bf49ac6c601de1b14',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20100316-201924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20100316-202056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22226',
internalId:  '',
customField: '20100415-143731'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '22305',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22305',
internalId:  '',
customField: '20100415-141536'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INZWT9';
var companyName   = 'Simas+Design+and+Woodworking';
var htmlTitle	  = 'Simas+Design';
var metaKeywords  = 'custom+cabinets+in+oregon%2C+custom+cabinets+in+silverton+oregon%2C+mossy+oak%2C+mossy+oak+cabinets%2Ccustom+cabinet%2C+cabinet%2C+cabinets%2Ckitchens%2Cbathrooms%2Cdesks%2Coffices%2C+office+cabinets%2C+silverton+cabinet+maker%2C+oregon+cabinet+maker%2C+garage+cabinets%2C+entertainment+centers%2C+custom+cabinets%2C+custom+cabinets+in+salem+oregon%2C+custom+cabinets+in+willamette+valley%2C+cabinets+in+oregon%2C+cabinets+in+salem+oregon%2C+cabinets+in+silverton+oregon%2C+cabinets+in+willamette+valley%2C+cabinetry+in+salem+oregon%2C+cabinetry+in+portland+metro+area%2C+cabinetry+in+silverton+oregon%2C+cabinetry+in+willamette+valley%2C+custom+cabinetry+in+portland+metro+area%2C+custom+cabinetry+in+salem+oregon%2C+custom+cabinetry+in+silverton+oregon%2C+custom+enertainmaent+centers%2C+custom+garage+cabinets%2C+custom+office+cabinets%2C+pre-finished+cabinets%2C+pre-finished+cabinetry%2C+pre-finished+custom+cabinetry%2C+cupboards%2C+cupboards+in+salem%2C+cupboards+in+portland+area%2C+cupboards+in+willamette+valley%2C+bathroom+cabinets%2C+bathroom+cabinetry%2C+custom+bathroom+cabinetry%2C+custom+bathroom+cabinets%2C+';
var metaContents  = 'We+are+located+in+silverton+oregon.++We+specialize+in+custom+kitchens%2C+bathrooms%2C+offices%2C+and+entertainment+centers.++We+have+been+in+buisness+since+1979.++We+are+a+fully+equiped+cabinet+shop+with+up+to+date+design+software+and+equipment.';
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();
};
