/* [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','201',jdecode('Spencersmith+Homes'),jdecode(''),'/201/index.html','true',[ 
		['PAGE','36601',jdecode('Gilluly+Residence'),jdecode(''),'/201/36601.html','true',[],'',''],
		['PAGE','37701',jdecode('Barrack+Residence'),jdecode(''),'/201/37701.html','true',[],'',''],
		['PAGE','53301',jdecode('Frank+Residence'),jdecode(''),'/201/53301.html','true',[],'',''],
		['PAGE','57901',jdecode('Schultz+Residence'),jdecode(''),'/201/57901.html','true',[],'',''],
		['PAGE','38501',jdecode('Priestly+Residence'),jdecode(''),'/201/38501.html','true',[],'',''],
		['PAGE','42401',jdecode('Bonilla+Residence'),jdecode(''),'/201/42401.html','true',[],'',''],
		['PAGE','43001',jdecode('Lemon+Residence'),jdecode(''),'/201/43001.html','true',[],'',''],
		['PAGE','59601',jdecode('Siegle+Residence'),jdecode(''),'/201/59601.html','true',[],'',''],
		['PAGE','65501',jdecode('Fine+Residence'),jdecode(''),'/201/65501.html','true',[],'','']
	],'',''],
	['PAGE','9701',jdecode('Features+%26+Details'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','9743',jdecode('Photo+Gallery'),jdecode(''),'/9743.html','true',[],'',''],
	['PAGE','40701',jdecode('New+Design+Studios'),jdecode(''),'/40701.html','true',[],'',''],
	['PAGE','46401',jdecode('Designer+Showroom'),jdecode(''),'/46401.html','true',[],'',''],
	['PAGE','21301',jdecode('Signature+Community+'),jdecode(''),'/21301.html','true',[],'',''],
	['PAGE','64901',jdecode('Renovations'),jdecode(''),'/64901.html','true',[],'',''],
	['PAGE','47801',jdecode('Architect'),jdecode(''),'/47801.html','true',[],'',''],
	['PAGE','9785',jdecode('Builder'),jdecode(''),'/9785.html','true',[],'',''],
	['PAGE','24501',jdecode('Map'),jdecode(''),'/24501.html','true',[],'',''],
	['PAGE','56501',jdecode('Links'),jdecode(''),'/56501.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Linedup';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10359';
theSitetree.graphicsetId='10509';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Linedup',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10359',
				graphicsetId: 	'10509',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64901',
internalId:  '',
customField: '20091024-142536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36601',
internalId:  '',
customField: '20071030-061107'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '24501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201',
internalId:  '',
customField: '20091114-165458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20081204-130217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53301',
internalId:  '',
customField: '20080618-143402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57901',
internalId:  '',
customField: '20080716-121130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38501',
internalId:  '',
customField: '20071030-065126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42401',
internalId:  '',
customField: '20071103-160045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20071103-161305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59601',
internalId:  '',
customField: '20080721-122220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20091024-140514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9743',
internalId:  '',
customField: '20090504-054357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40701',
internalId:  '',
customField: '20091114-165114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20091024-142103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20091024-142350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20091024-142615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9785',
internalId:  '',
customField: '20091024-142817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24501',
internalId:  '',
customField: '20090504-055851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56501',
internalId:  '',
customField: '20091024-143131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65501',
internalId:  '',
customField: '20090422-035506'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010IN2JVG';
var companyName   = 'S+p+e+n+c+e+r+s+m+i+t+h++H+o+m+e+s';
var htmlTitle	  = 'Spencersmith%2C+a+New+Orleans+design-build+business+started+1978';
var metaKeywords  = 'spencersmith%2C+new+orleans+builders%2C+new+orleans+custom+home+builder%2C+new+orleans+home+builder%2C+new+design+studios%2C+richard+craig+smith%2C+new+orleans+luxury+builder%2C+new+orleans+custom+builder%2C+new+orleans+homes';
var metaContents  = 'Spencersmith+Homes+is+a+team-based+company+with+a+design-build+approach+to+guide+you+through+the+development+phase+of+your+project+looking+at+the+feasibility+of+various+building+systems.++++';
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();
};
