/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','7101',jdecode('Our+Facility'),jdecode(''),'/7101.html','true',[],'',''],
	['PAGE','6801',jdecode('Services+Offered'),jdecode(''),'/6801/index.html','true',[ 
		['PAGE','79201',jdecode('Types+of+Trusses'),jdecode(''),'/6801/79201.html','true',[],'',''],
		['PAGE','44364',jdecode('Lumber'),jdecode(''),'/6801/44364.html','true',[],'','']
	],'',''],
	['PAGE','85479',jdecode('Steep+roofs'),jdecode(''),'/85479.html','true',[],'',''],
	['PAGE','85488',jdecode('Flat+roofs'),jdecode(''),'/85488.html','true',[],'',''],
	['PAGE','6401',jdecode('Contact'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','6485',jdecode('About+us'),jdecode(''),'/6485.html','true',[],'',''],
	['PAGE','85497',jdecode('Imprint'),jdecode(''),'/85497.html','true',[],'',''],
	['PAGE','84901',jdecode('Career+Opportnuity'),jdecode(''),'/84901.html','true',[],'',''],
	['PAGE','83501',jdecode('Map'),jdecode(''),'/83501.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='61926E';
theSitetree.keyvisualId='6913';
theSitetree.keyvisualName='kv_6913.jpg';
theSitetree.fontsetId='11215';
theSitetree.graphicsetId='12037';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='80AF8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antigua',
				paletteFamily: 	'61926E',
				keyvisualId: 	'6913',
				keyvisualName: 	'kv_6913.jpg',
				fontsetId: 		'11215',
				graphicsetId: 	'12037',
				contentColor: 	'FFFFFF',
				contentBGColor: '80AF8C',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '83501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-841713']={
webappId:    '1501',
documentId:  '701',
internalId:  '841713',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090512-083605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20090512-083646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20080207-184442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20090512-083932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6485',
internalId:  '',
customField: '20090512-084009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84901',
internalId:  '',
customField: '20080215-132140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83501',
internalId:  '',
customField: '20090512-084100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79201',
internalId:  '',
customField: '20080207-182237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44364',
internalId:  '',
customField: '20080207-182821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85497',
internalId:  '',
customField: '20100706-155352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85479',
internalId:  '',
customField: '20100706-155352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85488',
internalId:  '',
customField: '20100706-155352'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEDHY';
var companyName   = 'Select+Truss%2C+Inc.';
var htmlTitle	  = 'Select+Truss%2C+Inc.';
var metaKeywords  = 'Select+Truss+Inc%2C+Truss%2C+SelectTruss%2C+Truss+Riverside%2C+Roof+Trusses%2C+Floor+Trusses%2C+Roof+Truss%2C+Floor+Truss%2C+Truss+Calcs%2C+Truss+Calc%2C+Truss+Design%2C+Norman+Sayeg%2C+Chae+Kim%2C+Armando+Ornelas%2C+Truss+SoCal%2C+Truss+Southern+California%2C+Trusses+Riverside+California%2C+Trusses+Inland+Empire%2C+Trusses+San+Bernadino+County%2C+Select+Truss%2C+Trusses+in+CA%2C+Truss+calcs%2C+Truss+layouts%2C+trusses%2C+Norman+Sayeg%2C+Chae+Kim%2C+Brian+Walsh%2C+Armando+Ornelas%2C+Jason+Walsh%2C+Roofs%2C+Lumber%2C+wood%2C+Lumber%2C+custom+home%2C+Custom+House%2C+Custom+Roof%2C+Commercial+Building%2C+Commercial+Construction%2C+Don+Clark%2C+Jason+Walsh%2C+Joe+Michael%2C+Rick+Hanna%2C+Karen+Wilson%2C+TWR%2C+EBI%2C+Trusframe%2C+Universal+Truss%2C+Cal+Truss%2C+Inland+Truss%2C+Reliable%2C+Truss%2C+Floor+Truss%2C+Mitek%2C+Hamptom+Lumber%2C+Don+Clark%2C+Hesperia%2C+Victorville%2C+High+Desert%2C+';
var metaContents  = 'Select+Truss+Inc%2C+Truss%2C+SelectTruss%2C+Truss+Riverside%2C+Roof+Trusses%2C+Floor+Trusses%2C+Roof+Truss%2C+Floor+Truss%2C+Truss+Calcs%2C+Truss+Calc%2C+Truss+Design%2C+Norman+Sayeg%2C+Chae+Kim%2C+Armando+Ornelas%2C+Truss+SoCal%2C+Truss+Southern+California%2C+Trusses+Riverside+California%2C+Trusses+Inland+Empire%2C+Trusses+San+Bernadino+County%2C+Select+Truss%2C+Trusses+in+CA%2C+Truss+calcs%2C+Truss+layouts%2C+trusses%2C+Norman+Sayeg%2C+Chae+Kim%2C+Brian+Walsh%2C+Armando+Ornelas%2C+Jason+Walsh%2C+Lumber%2C+Wood%2C+Don+Clark%2C+Hesperia%2C+Victorville%2C+High+Desert%2C+';
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();
};
