/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','794',jdecode('Products'),jdecode(''),'/794/index.html','true',[ 
		['PAGE','815',jdecode('Euro+Style+Cabinetry'),jdecode(''),'/794/815.html','true',[],''],
		['PAGE','836',jdecode('Face+frame+Style+Cabinetry'),jdecode(''),'/794/836.html','true',[],''],
		['PAGE','857',jdecode('Commercial+Cabinerty'),jdecode(''),'/794/857.html','true',[],''],
		['PAGE','16801',jdecode('Entertainment+areas'),jdecode(''),'/794/16801.html','true',[],''],
		['PAGE','16822',jdecode('Bathrooms'),jdecode(''),'/794/16822.html','true',[],''],
		['PAGE','16843',jdecode('Offices'),jdecode(''),'/794/16843.html','true',[],''],
		['PAGE','16864',jdecode('Laundry+rooms'),jdecode(''),'/794/16864.html','true',[],''],
		['PAGE','16885',jdecode('Garage+Storage'),jdecode(''),'/794/16885.html','true',[],''],
		['PAGE','16906',jdecode('Closets'),jdecode(''),'/794/16906.html','true',[],''],
		['PAGE','13101',jdecode('Specialty+Woodworking'),jdecode(''),'/794/13101.html','true',[],'']
	],''],
	['PAGE','7501',jdecode('Custom+Design'),jdecode(''),'/7501.html','true',[],''],
	['PAGE','7522',jdecode('Specialty+Products'),jdecode(''),'/7522/index.html','true',[ 
		['PAGE','13122',jdecode('Internet+Order+Products'),jdecode(''),'/7522/13122.html','true',[],'']
	],''],
	['PAGE','752',jdecode('About+us'),jdecode(''),'/752/index.html','true',[ 
		['PAGE','773',jdecode('The+team'),jdecode(''),'/752/773.html','true',[],'']
	],''],
	['PAGE','941',jdecode('Photos'),jdecode(''),'/941.html','true',[],''],
	['PAGE','5306',jdecode('Guestbook'),jdecode(''),'/5306/index.html','true',[ 
		['PAGE','5301',jdecode('Read+Guestbook'),jdecode(''),'/5306/5301.html','false',[],'']
	],''],
	['PAGE','878',jdecode('Contact'),jdecode(''),'/878/index.html','true',[ 
		['PAGE','899',jdecode('Address'),jdecode(''),'/878/899.html','true',[],''],
		['PAGE','920',jdecode('How+to+find+us'),jdecode(''),'/878/920.html','true',[],'']
	],''],
	['PAGE','17701',jdecode('Map'),jdecode(''),'/17701.html','true',[],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='0000A0';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'0000A0',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16822',
internalId:  '',
customField: '20090416-114146'
};
webappMappings['1002']=webappMappings['1002-5306AHW050INEGJX']={
webappId:    '1002',
documentId:  '5306',
internalId:  '5306AHW050INEGJX',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17701',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090401-103355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20090408-205630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836',
internalId:  '',
customField: '20090408-210638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20091116-182817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20090408-205321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20090813-190021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16843',
internalId:  '',
customField: '20090401-184653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16864',
internalId:  '',
customField: '20090401-171240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16885',
internalId:  '',
customField: '20071209-213407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16906',
internalId:  '',
customField: '20090401-191250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20071209-210836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090408-205236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7522',
internalId:  '',
customField: '20090408-210857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13122',
internalId:  '',
customField: '20071209-203419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20090408-205137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20070520-184858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '941',
internalId:  '',
customField: '20091116-182042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5306',
internalId:  '',
customField: '20070520-185254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20070520-185254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '878',
internalId:  '',
customField: '20071209-190715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '899',
internalId:  '',
customField: '20071210-144955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '920',
internalId:  '',
customField: '20090408-204850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20071209-220112'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEGJX';
var companyName   = 'Corbin+Cabinetry+Inc.';
var htmlTitle	  = '';
var metaKeywords  = 'Oregon+custom+cabinetry+cabinets+cabinet+residential+commercial+woodworking++all+species+closets+parts+euro+face+frame+installation+craftsmanship+Corvallis+Philomath+korbels+drawers+guides+plywood+construction+';
var metaContents  = 'Custom+Cabinetry+in+Oregon%2C+commercial%2C+residential%2C+Face+Frame+of+Euro+style%2C+closets+and+parts%2C+installation%2C+Corvallis%2FPhilomath+';
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();
};
