/* [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','5239',jdecode('Home'),jdecode(''),'/5239.html','true',[],'',''],
	['PAGE','5290',jdecode('Service'),jdecode(''),'/5290/index.html','true',[ 
		['PAGE','5332',jdecode('Site+Evaluation'),jdecode(''),'/5290/5332.html','true',[],'',''],
		['PAGE','7060',jdecode('Energy+Efficiency'),jdecode(''),'/5290/7060.html','true',[],'',''],
		['PAGE','7039',jdecode('Renewable+Energy'),jdecode(''),'/5290/7039.html','true',[],'',''],
		['PAGE','7081',jdecode('Financial'),jdecode(''),'/5290/7081.html','true',[],'','']
	],'',''],
	['PAGE','5311',jdecode('Partners'),jdecode(''),'/5311.html','true',[],'',''],
	['PAGE','15239',jdecode('Products'),jdecode(''),'/15239/index.html','false',[ 
		['PAGE','15260',jdecode('Solar+Thermal'),jdecode(''),'/15239/15260.html','true',[],'',''],
		['PAGE','15281',jdecode('Energy+Efficiency'),jdecode(''),'/15239/15281.html','true',[],'','']
	],'',''],
	['PAGE','5353',jdecode('News'),jdecode(''),'/5353/index.html','true',[ 
		['PAGE','29739',jdecode('News+Archive'),jdecode(''),'/5353/29739.html','true',[],'','']
	],'',''],
	['PAGE','19739',jdecode('Links'),jdecode(''),'/19739/index.html','true',[ 
		['PAGE','5374',jdecode('We%26%23x27%3Bre+involved+with...'),jdecode(''),'/19739/5374.html','true',[],'',''],
		['PAGE','19860',jdecode('Our+reference+shelf...'),jdecode(''),'/19739/19860.html','true',[],'',''],
		['PAGE','19839',jdecode('Other+cool+sites...'),jdecode(''),'/19739/19839.html','true',[],'','']
	],'',''],
	['PAGE','5395',jdecode('About+us'),jdecode(''),'/5395/index.html','true',[ 
		['PAGE','5416',jdecode('How+to+find+us'),jdecode(''),'/5395/5416.html','true',[],'',''],
		['PAGE','5437',jdecode('Our+team'),jdecode(''),'/5395/5437.html','true',[],'','']
	],'',''],
	['PAGE','5458',jdecode('Contact'),jdecode(''),'/5458.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='8CBBD8';
theSitetree.keyvisualId='1713';
theSitetree.keyvisualName='plaene.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='348';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='8CBBD8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'8CBBD8',
				keyvisualId: 	'1713',
				keyvisualName: 	'plaene.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'348',
				contentColor: 	'000000',
				contentBGColor: '8CBBD8',
				a_color: 		'8CBBD8',
				b_color: 		'338299',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5239',
internalId:  '',
customField: '20100605-002600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5290',
internalId:  '',
customField: '20090916-082247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20100605-000626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5332',
internalId:  '',
customField: '20090221-161218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5353',
internalId:  '',
customField: '20100605-002335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5374',
internalId:  '',
customField: '20100605-001141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5395',
internalId:  '',
customField: '20100605-002638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5416',
internalId:  '',
customField: '20090207-171223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5437',
internalId:  '',
customField: '20090303-220244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5458',
internalId:  '',
customField: '20090218-180740'
};
webappMappings['7008']=webappMappings['7008-1788']={
webappId:    '7008',
documentId:  '5458',
internalId:  '1788',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5239',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7039',
internalId:  '',
customField: '20090221-181352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7060',
internalId:  '',
customField: '20090619-113407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7081',
internalId:  '',
customField: '20090810-152943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19739',
internalId:  '',
customField: '20090311-013911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15281',
internalId:  '',
customField: '20090218-163634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15239',
internalId:  '',
customField: '20090218-163634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15260',
internalId:  '',
customField: '20090218-163634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19839',
internalId:  '',
customField: '20090311-014844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19860',
internalId:  '',
customField: '20100605-001403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29739',
internalId:  '',
customField: '20090619-120415'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INL14A';
var companyName   = 'Renewable+Concepts+%26+Design';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
