/* [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','4001',jdecode('Home'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','4052',jdecode('Log+In'),jdecode(''),'/4052.html','true',[],''],
	['PAGE','4157',jdecode('About+Us'),jdecode(''),'/4157.html','true',[],''],
	['PAGE','4073',jdecode('Class+Descriptions'),jdecode(''),'/4073/index.html','true',[ 
		['PAGE','4601',jdecode('Gymnastics'),jdecode(''),'/4073/4601.html','true',[],''],
		['PAGE','4622',jdecode('Dance'),jdecode(''),'/4073/4622.html','true',[],''],
		['PAGE','4643',jdecode('Cheer+%26+Tumbling'),jdecode(''),'/4073/4643.html','true',[],''],
		['PAGE','6101',jdecode('Combo+Classes'),jdecode(''),'/4073/6101.html','true',[],'']
	],''],
	['PAGE','11101',jdecode('TNT+Cheer+'),jdecode(''),'/11101/index.html','true',[ 
		['PAGE','11122',jdecode('Competition+Squad'),jdecode(''),'/11101/11122.html','true',[],''],
		['PAGE','11143',jdecode('Exhibition+Squad'),jdecode(''),'/11101/11143.html','true',[],''],
		['PAGE','11164',jdecode('Special+Needs+Squad'),jdecode(''),'/11101/11164.html','true',[],''],
		['PAGE','11185',jdecode('Private+Lessons'),jdecode(''),'/11101/11185.html','true',[],''],
		['PAGE','11206',jdecode('Coaches'),jdecode(''),'/11101/11206.html','true',[],'']
	],''],
	['PAGE','12501',jdecode('TNT+Dance'),jdecode(''),'/12501/index.html','true',[ 
		['PAGE','16601',jdecode('Competition+Calendar'),jdecode(''),'/12501/16601.html','true',[],''],
		['PAGE','23701',jdecode('2010+Recital'),jdecode(''),'/12501/23701.html','true',[],'']
	],''],
	['PAGE','12522',jdecode('Gymnastics+Team'),jdecode(''),'/12522/index.html','true',[ 
		['PAGE','20201',jdecode('Meet+Info+%26+Directions'),jdecode(''),'/12522/20201.html','true',[],'']
	],''],
	['PAGE','13001',jdecode('Adult+Fitness'),jdecode(''),'/13001/index.html','true',[ 
		['PAGE','13022',jdecode('Personal+Training'),jdecode(''),'/13001/13022.html','true',[],'']
	],''],
	['PAGE','4094',jdecode('Birthday+Parties'),jdecode(''),'/4094.html','true',[],''],
	['PAGE','4115',jdecode('Clinics+%26+Overnighters'),jdecode(''),'/4115.html','true',[],''],
	['PAGE','25201',jdecode('Open+Gym'),jdecode(''),'/25201.html','true',[],''],
	['PAGE','4136',jdecode('Session+Schedule'),jdecode(''),'/4136.html','true',[],''],
	['PAGE','27501',jdecode('SUMMER+CAMPS+2010'),jdecode(''),'/27501.html','true',[],''],
	['PAGE','10101',jdecode('Tuition+Prices'),jdecode(''),'/10101.html','true',[],''],
	['PAGE','4664',jdecode('Gym+Policies'),jdecode(''),'/4664/index.html','true',[ 
		['PAGE','10901',jdecode('Dress+Code'),jdecode(''),'/4664/10901.html','true',[],'']
	],''],
	['PAGE','6801',jdecode('Waiver+Form'),jdecode(''),'/6801.html','true',[],''],
	['PAGE','4685',jdecode('Employment'),jdecode(''),'/4685.html','true',[],''],
	['PAGE','4706',jdecode('Contact+Us'),jdecode(''),'/4706.html','true',[],'']];
var siteelementCount=32;
theSitetree.topTemplateName='Sportfan2';
theSitetree.paletteFamily='D4E8AB';
theSitetree.keyvisualId='10139';
theSitetree.keyvisualName='kv_10139.jpg';
theSitetree.fontsetId='21087';
theSitetree.graphicsetId='13184';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Sportfan2',
				paletteFamily: 	'D4E8AB',
				keyvisualId: 	'10139',
				keyvisualName: 	'kv_10139.jpg',
				fontsetId: 		'21087',
				graphicsetId: 	'13184',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100217-120632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4052',
internalId:  '',
customField: '20091023-140756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4157',
internalId:  '',
customField: '20091110-112540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4073',
internalId:  '',
customField: '20091026-170822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20091116-163959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4622',
internalId:  '',
customField: '20091116-164309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4643',
internalId:  '',
customField: '20091116-164518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20091116-164608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4094',
internalId:  '',
customField: '20091026-172432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4664',
internalId:  '',
customField: '20091019-202611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4115',
internalId:  '',
customField: '20100121-155552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4136',
internalId:  '',
customField: '20100210-130250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20091019-203734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4706',
internalId:  '',
customField: '20091021-135744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20091021-143451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20091023-142906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20091116-164931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11122',
internalId:  '',
customField: '20100125-154119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11143',
internalId:  '',
customField: '20091023-150537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11164',
internalId:  '',
customField: '20091110-113607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11185',
internalId:  '',
customField: '20091023-152106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11206',
internalId:  '',
customField: '20091023-153348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12501',
internalId:  '',
customField: '20100210-130646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4685',
internalId:  '',
customField: '20091023-160904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20091023-163745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13022',
internalId:  '',
customField: '20091023-163613'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12522',
internalId:  '',
customField: '20100125-123844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20100210-130735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20100104-170450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20100111-140517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100125-133619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20100217-122247'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INVQWR';
var companyName   = 'CAGE+Gymnastics';
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();
};
