/* [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','3401',jdecode('%26%23x27%3BBax+Base'),jdecode(''),'/3401.html','true',[],''],
	['PAGE','12615',jdecode('%26%23x27%3BBax+Hall+of+Fame'),jdecode(''),'/12615.html','true',[],''],
	['PAGE','3452',jdecode('%26%23x27%3BBax+Blog'),jdecode(''),'/3452.html','true',[],''],
	['PAGE','3473',jdecode('%26%23x27%3BBax+Chat'),jdecode(''),'/3473.html','true',[],''],
	['PAGE','3494',jdecode('%26%23x27%3BBax+Snaps'),jdecode(''),'/3494.html','true',[],''],
	['PAGE','3515',jdecode('%26%23x27%3BBax+Ballot'),jdecode(''),'/3515.html','true',[],''],
	['PAGE','5501',jdecode('%26%23x27%3BBax-abilia'),jdecode(''),'/5501.html','true',[],''],
	['PAGE','3536',jdecode('%26%23x27%3BBax+Field'),jdecode(''),'/3536.html','true',[],''],
	['PAGE','6801',jdecode('%26%23x27%3BBax+Directions'),jdecode(''),'/6801.html','true',[],''],
	['PAGE','7301',jdecode('%26%23x27%3BBax+Stats'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','7901',jdecode('%26%23x27%3BBax+Book'),jdecode(''),'/7901.html','true',[],''],
	['PAGE','12415',jdecode('%26%23x27%3BBax+Links'),jdecode(''),'/12415.html','true',[],''],
	['PAGE','6001',jdecode('%26%23x27%3BBax+Weather'),jdecode(''),'/6001.html','true',[],''],
	['PAGE','6501',jdecode('%26%23x27%3BBax+Search'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','16215',jdecode('Form+test'),jdecode(''),'/16215.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='A71E1E';
theSitetree.keyvisualId='4234';
theSitetree.keyvisualName='kv_4234.jpg';
theSitetree.fontsetId='10673';
theSitetree.graphicsetId='11208';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='C53131';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Americanlife',
				paletteFamily: 	'A71E1E',
				keyvisualId: 	'4234',
				keyvisualName: 	'kv_4234.jpg',
				fontsetId: 		'10673',
				graphicsetId: 	'11208',
				contentColor: 	'FFFFFF',
				contentBGColor: 'C53131',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-4026']={
webappId:    '7050',
documentId:  '3452',
internalId:  '4026',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-aendu0in2sdm11b5799fb86']={
webappId:    '1003',
documentId:  '3473',
internalId:  'aendu0in2sdm11b5799fb86',
customField: 'en:US'
};
webappMappings['7060']=webappMappings['7060-a28d5272868ae423ea5a331b60770397']={
webappId:    '7060',
documentId:  '3494',
internalId:  'a28d5272868ae423ea5a331b60770397',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-857']={
webappId:    '7005',
documentId:  '3515',
internalId:  '857',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3536',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20080815-191522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3536',
internalId:  '',
customField: '20080812-191501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3452',
internalId:  '',
customField: '20080815-183632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3473',
internalId:  '',
customField: '20080812-182056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3494',
internalId:  '',
customField: '20080725-131550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3515',
internalId:  '',
customField: '20080815-181225'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3401',
internalId:  '1006',
customField: '1006'
};
webappMappings['4001']=webappMappings['4001-11009039']={
webappId:    '4001',
documentId:  '5501',
internalId:  '11009039',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20080725-141349'
};
webappMappings['7080']=webappMappings['7080-127']={
webappId:    '7080',
documentId:  '6001',
internalId:  '127',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20080725-163729'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '6501',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20080725-175854'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '6801',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20080725-181033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20080725-182212'
};
webappMappings['1002']=webappMappings['1002-7901aendu0in2sdm']={
webappId:    '1002',
documentId:  '7901',
internalId:  '7901aendu0in2sdm',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20080725-183640'
};
webappMappings['1010']=webappMappings['1010-_Ea_11b5c71397a']={
webappId:    '1010',
documentId:  '7301',
internalId:  '_Ea_11b5c71397a',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-11425671']={
webappId:    '1501',
documentId:  '3401',
internalId:  '11425671',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-7402']={
webappId:    '7008',
documentId:  '12415',
internalId:  '7402',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12415',
internalId:  '',
customField: '20080814-150401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12615',
internalId:  '',
customField: '20081014-150651'
};
webappMappings['7008']=webappMappings['7008-22067']={
webappId:    '7008',
documentId:  '16215',
internalId:  '22067',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16215',
internalId:  '',
customField: '20091015-182333'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN2SDM';
var companyName   = 'Diamondbax.com';
var htmlTitle	  = 'Diamondbax.com%3A+An+Arizona+Diamondbacks+fan+site+and+community';
var metaKeywords  = 'pressure+washing%2C+commercial+pressure+washing%2C+residential+pressure+washing%2C+blacktop+seal+coat%2C+blacktop+sealing%2C+parking+lot+sealing%2C+parking+lot+striping%2C+driveway+sealing%2C+pressure+washing+Alpharetta%2C+Johns+Creek%2C+Roswell%2C+Norcross%2C+Duluth%2C+Cumming%2C+More+than+256+characters+here%2C+pressure+washing%2C+commercial+pressure+washing%2C+residential+pressure+washing%2C+blacktop+seal+coat%2C+blacktop+sealing%2C+parking+lot+sealing%2C+parking+lot+striping%2C+driveway+sealing%2C+pressure+washing+Alpharetta%2C+Johns+Creek%2C+Roswell%2C+Norcross%2C+Duluth%2C+Cumming%2C+More+than+512+characters+here';
var metaContents  = 'Arizona+Diamondbacks+news+and+discussion%2C+updated+on+a+daily+basis.';
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();
};

