/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','352',jdecode('What+we+do'),jdecode(''),'/352.html','true',[],''],
	['PAGE','373',jdecode('Key+People'),jdecode(''),'/373.html','true',[],''],
	['PAGE','478',jdecode('Contact+Us'),jdecode(''),'/478.html','true',[],''],
	['PAGE','541',jdecode('References'),jdecode(''),'/541.html','true',[],''],
	['PAGE','7201',jdecode('Links'),jdecode(''),'/7201.html','true',[],''],
	['PAGE','18239',jdecode('Pictures'),jdecode(''),'/18239/index.html','true',[ 
		['PAGE','18260',jdecode('Recreational'),jdecode(''),'/18239/18260.html','true',[],''],
		['PAGE','17839',jdecode('Hangers'),jdecode(''),'/18239/17839.html','true',[],''],
		['PAGE','19739',jdecode('Warehouse'),jdecode(''),'/18239/19739.html','true',[],''],
		['PAGE','19760',jdecode('Industrial'),jdecode(''),'/18239/19760.html','true',[],''],
		['PAGE','19781',jdecode('Church'),jdecode(''),'/18239/19781.html','true',[],''],
		['PAGE','19802',jdecode('Office'),jdecode(''),'/18239/19802.html','true',[],''],
		['PAGE','19823',jdecode('Small'),jdecode(''),'/18239/19823.html','true',[],''],
		['PAGE','38939',jdecode('Special'),jdecode(''),'/18239/38939.html','true',[],'']
	],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='5E5E5E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10344';
theSitetree.graphicsetId='10448';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5e5e5e';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Akropolis',
				paletteFamily: 	'5E5E5E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10344',
				graphicsetId: 	'10448',
				contentColor: 	'FFFFFF',
				contentBGColor: '5e5e5e',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'5E5E5E',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-11744719']={
webappId:    '1501',
documentId:  '301',
internalId:  '11744719',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-10903']={
webappId:    '7008',
documentId:  '478',
internalId:  '10903',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20081031-174157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20081031-154656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20081022-162855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '478',
internalId:  '',
customField: '20081031-155612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '541',
internalId:  '',
customField: '20081023-182429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20090310-211322'
};
webappMappings['7060']=webappMappings['7060-b6273e4b745747c8f507f2153ee9991a']={
webappId:    '7060',
documentId:  '17839',
internalId:  'b6273e4b745747c8f507f2153ee9991a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17839',
internalId:  '',
customField: '20090310-194711'
};
webappMappings['7060']=webappMappings['7060-fca4ba56ba784eae41980ac6fe0c0c54']={
webappId:    '7060',
documentId:  '18239',
internalId:  'fca4ba56ba784eae41980ac6fe0c0c54',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-cd900f668b3d84ed0251ab84dfdf3110']={
webappId:    '7060',
documentId:  '18260',
internalId:  'cd900f668b3d84ed0251ab84dfdf3110',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18260',
internalId:  '',
customField: '20090310-210950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18239',
internalId:  '',
customField: '20090310-210904'
};
webappMappings['7060']=webappMappings['7060-f54ecc161f70a47454ca8b30f4bbabae']={
webappId:    '7060',
documentId:  '19739',
internalId:  'f54ecc161f70a47454ca8b30f4bbabae',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-3c2a7e3cf032492fe28fa3b26589fc50']={
webappId:    '7060',
documentId:  '19760',
internalId:  '3c2a7e3cf032492fe28fa3b26589fc50',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-c7841dff2ef9df2d1d25e91b98937e25']={
webappId:    '7060',
documentId:  '19781',
internalId:  'c7841dff2ef9df2d1d25e91b98937e25',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-0570ccc6abadb1a9af950fa785bb9978']={
webappId:    '7060',
documentId:  '19802',
internalId:  '0570ccc6abadb1a9af950fa785bb9978',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-c4e839dc1713ef9e01a19a708e492c04']={
webappId:    '7060',
documentId:  '19823',
internalId:  'c4e839dc1713ef9e01a19a708e492c04',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19739',
internalId:  '',
customField: '20090310-211031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19760',
internalId:  '',
customField: '20090310-205352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19781',
internalId:  '',
customField: '20090310-211109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19802',
internalId:  '',
customField: '20090310-211143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19823',
internalId:  '',
customField: '20090310-211220'
};
webappMappings['7060']=webappMappings['7060-c2a9aba3b811a8950784dd2cfffdb4de']={
webappId:    '7060',
documentId:  '38939',
internalId:  'c2a9aba3b811a8950784dd2cfffdb4de',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38939',
internalId:  '',
customField: '20090901-191951'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPQ31';
var companyName   = 'G+%26+W+BUILDERS+INC%2C+BREA+CA';
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();
};
