/* [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','1701',jdecode('Home'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','1752',jdecode('About+Us'),jdecode(''), jdecode('%2F1752.html'), 'true',[],'',''],
	['PAGE','57562',jdecode('BLOG+it%21'),jdecode(''), jdecode('%2F57562.html'), 'false',[],'',''],
	['PAGE','31201',jdecode('Testimonials'),jdecode(''), jdecode('%2F31201.html'), 'false',[],'',''],
	['PAGE','9301',jdecode('Why+Gymnastics%3F'),jdecode(''), jdecode('%2F9301.html'), 'true',[],'',''],
	['PAGE','1794',jdecode('Programs%2FPolicies'),jdecode(''), jdecode('%2F1794.html'), 'true',[],'',''],
	['PAGE','1836',jdecode('Fall+Schedule'),jdecode(''), jdecode('%2F1836.html'), 'true',[],'',''],
	['PAGE','37929',jdecode('Summer+Classes'),jdecode(''), jdecode('%2F37929.html'), 'false',[],'',''],
	['PAGE','33101',jdecode('Summer+Camp+Program'),jdecode(''), jdecode('%2F33101.html'), 'false',[],'',''],
	['PAGE','1857',jdecode('Afterschool+Care'),jdecode(''), jdecode('%2F1857.html'), 'true',[],'',''],
	['PAGE','1878',jdecode('Team+Wateree'),jdecode(''), jdecode('%2F1878.html'), 'true',[],'',''],
	['PAGE','65762',jdecode('Team+Sponsors'),jdecode(''), jdecode('%2F65762.html'), 'true',[],'',''],
	['PAGE','36929',jdecode('STORM+All-Star+Cheer'),jdecode(''), jdecode('%2F36929.html'), 'true',[],'',''],
	['PAGE','1899',jdecode('Birthday+Parties'),jdecode(''), jdecode('%2F1899.html'), 'true',[],'',''],
	['PAGE','1920',jdecode('Special+Events'),jdecode(''), jdecode('%2F1920.html'), 'true',[],'',''],
	['PAGE','1815',jdecode('Payment+Page'),jdecode(''), jdecode('%2F1815.html'), 'false',[],'',''],
	['PAGE','1773',jdecode('Our+Staff'),jdecode(''), jdecode('%2F1773.html'), 'false',[],'',''],
	['PAGE','1941',jdecode('Contact'),jdecode(''), jdecode('%2F1941.html'), 'true',[],'',''],
	['PAGE','9322',jdecode('Mailing+List'),jdecode(''), jdecode('%2F9322.html'), 'false',[],'',''],
	['PAGE','12901',jdecode('Forms'),jdecode(''), jdecode('%2F12901.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='12423';
theSitetree.keyvisualName='kv_12423.jpg';
theSitetree.fontsetId='33571';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C6E2FE';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNU'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'12423',
				keyvisualName: 	'kv_12423.jpg',
				fontsetId: 		'33571',
				graphicsetId: 	'10633',
				contentColor: 	'000000',
				contentBGColor: 'C6E2FE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20120130-175542'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20111226-210121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20111226-210734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20110821-172933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1815',
internalId:  '',
customField: '20090825-100816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1857',
internalId:  '',
customField: '20111227-102213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1920',
internalId:  '',
customField: '20111226-212556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1899',
internalId:  '',
customField: '20120118-125846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1836',
internalId:  '',
customField: '20110906-120454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20111226-212220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1941',
internalId:  '',
customField: '20090824-101633'
};
webappMappings['4001']=webappMappings['4001-21636682']={
webappId:    '4001',
documentId:  '1815',
internalId:  '21636682',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-20122']={
webappId:    '7008',
documentId:  '9322',
internalId:  '20122',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20110707-112857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20090824-162411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20091014-164152'
};
webappMappings['1501']=webappMappings['1501-22181572']={
webappId:    '1501',
documentId:  '1701',
internalId:  '22181572',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20100114-151532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33101',
internalId:  '',
customField: '20110518-194750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36929',
internalId:  '',
customField: '20110911-184115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37929',
internalId:  '',
customField: '20110317-215940'
};
webappMappings['7050']=webappMappings['7050-19098']={
webappId:    '7050',
documentId:  '57562',
internalId:  '19098',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57562',
internalId:  '',
customField: '20101205-125114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65762',
internalId:  '',
customField: '20111227-102411'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INV1ZT';
var companyName   = 'Wateree+Gymnastics+Center';
var htmlTitle	  = '%22We+are+committed+to+helping+children+feel+good+about+themselves+through+gymnastics%21%22';
var metaKeywords  = 'gymnastics%2C+tumbling%2C+afterschool+care+program%2C+competitive+teams%2C+USA+Gymnastics%2C+birthday+party%2C+clinics%2C+cheerleading';
var metaContents  = 'gymnastics+training+center%2C+offering+gymnastics+for+ages+18+months+and+up%2C+as+well+as+competitive+gymnastics+teams%2C+camps%2C+birthday+parties%2C+Afterschool+Care%2C+and+Parents+Night+Out.+';
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();
};

