/* [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','2201',jdecode('Home'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','2252',jdecode('About+Us'),jdecode(''),'/2252.html','true',[],'',''],
	['PAGE','2273',jdecode('Services'),jdecode(''),'/2273.html','true',[],'',''],
	['PAGE','2294',jdecode('Products'),jdecode(''),'/2294.html','true',[],'',''],
	['PAGE','2378',jdecode('Our+Team'),jdecode(''),'/2378.html','true',[],'',''],
	['PAGE','15433',jdecode('Testimonials'),jdecode(''),'/15433.html','true',[],'',''],
	['PAGE','13212',jdecode('Our+map+location'),jdecode(''),'/13212.html','true',[],'',''],
	['PAGE','15112',jdecode('Completed+jobs'),jdecode(''),'/15112.html','true',[],'',''],
	['PAGE','4812',jdecode('Contact+us'),jdecode(''),'/4812.html','true',[],'',''],
	['PAGE','27112',jdecode('Employee+Resources'),jdecode(''),'/27112.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='A71E1E';
theSitetree.keyvisualId='4236';
theSitetree.keyvisualName='kv_4236.jpg';
theSitetree.fontsetId='10678';
theSitetree.graphicsetId='11208';
theSitetree.contentColor='5A0A0A';
theSitetree.contentBGColor='C53131';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Americanlife',
				paletteFamily: 	'A71E1E',
				keyvisualId: 	'4236',
				keyvisualName: 	'kv_4236.jpg',
				fontsetId: 		'10678',
				graphicsetId: 	'11208',
				contentColor: 	'5A0A0A',
				contentBGColor: 'C53131',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100909-150959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20100909-151154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20100909-150820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20091002-001459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20100909-143726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4812',
internalId:  '',
customField: '20101122-163013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15433',
internalId:  '',
customField: '20100909-143229'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '13212',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15112',
internalId:  '',
customField: '20091104-104127'
};
webappMappings['1501']=webappMappings['1501-5982841']={
webappId:    '1501',
documentId:  '2201',
internalId:  '5982841',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-5011']={
webappId:    '7008',
documentId:  '4812',
internalId:  '5011',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13212',
internalId:  '',
customField: '20091001-231452'
};
webappMappings['7060']=webappMappings['7060-0163590599d33c6032d30c315a1b253e']={
webappId:    '7060',
documentId:  '15112',
internalId:  '0163590599d33c6032d30c315a1b253e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27112',
internalId:  '',
customField: '20100909-141108'
};
webappMappings['7050']=webappMappings['7050-1611']={
webappId:    '7050',
documentId:  '27112',
internalId:  '1611',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INLESH';
var companyName   = 'Universal+Flooring+Inc.';
var htmlTitle	  = 'Universal+Flooring+Inc.';
var metaKeywords  = 'flooring+installer%0D%0ASacramento%0D%0Acommercial+floors';
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();
};

