/* [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','2701',jdecode('HOME'),jdecode(''),'/2701.html','true',[],'',''],
	['PAGE','12622',jdecode('LEADERSHIP'),jdecode(''),'/12622.html','true',[],'',''],
	['PAGE','12664',jdecode('HOW+WE+WORK'),jdecode(''),'/12664.html','true',[],'',''],
	['PAGE','12643',jdecode('AREAS+OF+PRACTICE'),jdecode(''),'/12643.html','true',[],'',''],
	['PAGE','12706',jdecode('CONTACT'),jdecode(''),'/12706.html','true',[],'',''],
	['PAGE','12685',jdecode('PROJECTS'),jdecode(''),'/12685.html','true',[],'',''],
	['PAGE','15601',jdecode('Office+Buildings'),jdecode(''),'/15601.html','true',[],'',''],
	['PAGE','24001',jdecode('Residential'),jdecode(''),'/24001.html','true',[],'',''],
	['PAGE','15622',jdecode('+Schools+K%2CK2%2CK12'),jdecode(''),'/15622.html','true',[],'',''],
	['PAGE','15664',jdecode('Food+Service+-+Eatery'),jdecode(''),'/15664.html','true',[],'',''],
	['PAGE','33012',jdecode('Renovations+-+Additions'),jdecode(''),'/33012.html','true',[],'',''],
	['PAGE','15685',jdecode('Office+Building%2C+NJ'),jdecode(''),'/15685.html','true',[],'',''],
	['PAGE','15706',jdecode('GSK+Laboratory+Building'),jdecode(''),'/15706.html','true',[],'',''],
	['PAGE','15727',jdecode('BMS+Laboratory+Building'),jdecode(''),'/15727.html','true',[],'',''],
	['PAGE','23401',jdecode('Published+projects+'),jdecode(''),'/23401.html','true',[],'',''],
	['PAGE','15769',jdecode('NEW+PROJECTS'),jdecode(''),'/15769.html','true',[],'',''],
	['PAGE','15790',jdecode('Competition+project'),jdecode(''),'/15790.html','true',[],'',''],
	['PAGE','15811',jdecode('House+1'),jdecode(''),'/15811.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='7E7E7E';
theSitetree.keyvisualId='7102';
theSitetree.keyvisualName='kv_7102.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12124';
theSitetree.contentColor='484747';
theSitetree.contentBGColor='7E7E7E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'7E7E7E',
				keyvisualId: 	'7102',
				keyvisualName: 	'kv_7102.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12124',
				contentColor: 	'484747',
				contentBGColor: '7E7E7E',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20101126-093834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12622',
internalId:  '',
customField: '20100909-081823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15769',
internalId:  '',
customField: '20100610-101532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12643',
internalId:  '',
customField: '20101126-093757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12664',
internalId:  '',
customField: '20100610-104022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12685',
internalId:  '',
customField: '20100610-090944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12706',
internalId:  '',
customField: '20100612-193330'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '2701',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15811',
internalId:  '',
customField: '20100909-084000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20101126-092114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15790',
internalId:  '',
customField: '20100909-083440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15622',
internalId:  '',
customField: '20101126-093742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23401',
internalId:  '',
customField: '20100610-091601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15664',
internalId:  '',
customField: '20101126-092536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15685',
internalId:  '',
customField: '20101126-092626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15706',
internalId:  '',
customField: '20101126-092718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15727',
internalId:  '',
customField: '20100610-091245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33012',
internalId:  '',
customField: '20101126-093555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20101126-093631'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INZUCI';
var companyName   = 'RODRIGUEZ+ARCHITECTURE+';
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();
};

