/* [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','2801',jdecode('Home'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','2852',jdecode('About+TCM'),jdecode(''),'/2852.html','true',[],'',''],
	['PAGE','2873',jdecode('Clay+Court+Maintenance+Programs'),jdecode(''),'/2873.html','true',[],'',''],
	['PAGE','2894',jdecode('Contact+us'),jdecode(''),'/2894.html','true',[],'',''],
	['PAGE','17401',jdecode('Gallery'),jdecode(''),'/17401/index.html','true',[ 
		['PAGE','2915',jdecode('Gallery+hard+surface+courts'),jdecode(''),'/17401/2915.html','true',[],'',''],
		['PAGE','17422',jdecode('Golf+Greens+and+Cages'),jdecode(''),'/17401/17422.html','true',[],'','']
	],'',''],
	['PAGE','2936',jdecode('Laser+Paving'),jdecode(''),'/2936.html','true',[],'',''],
	['PAGE','2957',jdecode('Online+Catalog'),jdecode(''),'/2957/index.html','true',[ 
		['PAGE','7101',jdecode('Tennnis+Nets'),jdecode(''),'/2957/7101.html','true',[],'',''],
		['PAGE','6322',jdecode('Our+team'),jdecode(''),'/2957/6322.html','true',[],'',''],
		['PAGE','6343',jdecode('Our+team'),jdecode(''),'/2957/6343.html','true',[],'',''],
		['PAGE','6364',jdecode('Our+team'),jdecode(''),'/2957/6364.html','true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='1357';
theSitetree.keyvisualName='tennis.jpg';
theSitetree.fontsetId='232';
theSitetree.graphicsetId='292';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Startup',
				paletteFamily: 	'000066',
				keyvisualId: 	'1357',
				keyvisualName: 	'tennis.jpg',
				fontsetId: 		'232',
				graphicsetId: 	'292',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-27687']={
webappId:    '7008',
documentId:  '2894',
internalId:  '27687',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20110310-092528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2852',
internalId:  '',
customField: '20100427-125038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2873',
internalId:  '',
customField: '20100427-125321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2894',
internalId:  '',
customField: '20100427-125536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2915',
internalId:  '',
customField: '20110304-141255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2936',
internalId:  '',
customField: '20110304-114917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2957',
internalId:  '',
customField: '20110310-170225'
};
webappMappings['7060']=webappMappings['7060-684880f55af2fe523e594455c0df2229']={
webappId:    '7060',
documentId:  '2915',
internalId:  '684880f55af2fe523e594455c0df2229',
customField: 'language:en;country:US;'
};
webappMappings['4001']=webappMappings['4001-38057620']={
webappId:    '4001',
documentId:  '7101',
internalId:  '38057620',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20110304-144159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6343',
internalId:  '',
customField: '20110304-144159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6364',
internalId:  '',
customField: '20110304-144159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20110304-182329'
};
webappMappings['7060']=webappMappings['7060-59e5c265452cfe76990f9b9b5fb3a7f6']={
webappId:    '7060',
documentId:  '17422',
internalId:  '59e5c265452cfe76990f9b9b5fb3a7f6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17401',
internalId:  '',
customField: '20110310-102900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17422',
internalId:  '',
customField: '20110310-103247'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INL7DF';
var companyName   = 'TCM+of+Florida++++++++321-662-8913';
var htmlTitle	  = '';
var metaKeywords  = 'tennis+basketball+supplies+golf+greens+courts+bocci+ball+shuffleboard+netting+synthetic+turf+har-tru+tennis+courts+clay+tennis+courts';
var metaContents  = 'Tennis+court%2C+basketball+court%2C+shuffleboard+courts%2C+bocci+court%2C+construction+and+supplies%2C+synthetic+golf+greens+foul+ball+netting%2C+driving+rang+cages';
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();
};

