/* [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','2601',jdecode('Home'),jdecode(''),'/2601.html','true',[],''],
	['PAGE','2652',jdecode('Opening+hours'),jdecode(''),'/2652.html','true',[],''],
	['PAGE','2673',jdecode('Our+team'),jdecode(''),'/2673.html','true',[],''],
	['PAGE','2694',jdecode('How+to+find+us'),jdecode(''),'/2694.html','true',[],''],
	['PAGE','2715',jdecode('The+studio'),jdecode(''),'/2715.html','true',[],''],
	['PAGE','2736',jdecode('News'),jdecode(''),'/2736.html','true',[],''],
	['PAGE','2757',jdecode('Course+plan'),jdecode(''),'/2757/index.html','true',[ 
		['PAGE','2778',jdecode('Aerobic'),jdecode(''),'/2757/2778.html','true',[],''],
		['PAGE','2799',jdecode('Legs%2FStomach%2FButtocks'),jdecode(''),'/2757/2799.html','true',[],''],
		['PAGE','2820',jdecode('Self+Defense'),jdecode(''),'/2757/2820.html','true',[],'']
	],''],
	['PAGE','18001',jdecode('2009+Tournament+Flyer'),jdecode(''),'/18001.html','true',[],''],
	['PAGE','18701',jdecode('2009+Tournament+Flyer+Pg.2'),jdecode(''),'/18701.html','true',[],''],
	['PAGE','2841',jdecode('Links'),jdecode(''),'/2841.html','true',[],''],
	['PAGE','2862',jdecode('Contact'),jdecode(''),'/2862.html','true',[],''],
	['PAGE','4001',jdecode('Pictures'),jdecode(''),'/4001.html','true',[],''],
	['PAGE','13101',jdecode('Pictures2'),jdecode(''),'/13101.html','true',[],''],
	['PAGE','13122',jdecode('Pictures+3'),jdecode(''),'/13122.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Solid';
theSitetree.paletteFamily='8396BA';
theSitetree.keyvisualId='4393';
theSitetree.keyvisualName='kv_4393.jpg';
theSitetree.fontsetId='10800';
theSitetree.graphicsetId='11232';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8396BA';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Solid',
				paletteFamily: 	'8396BA',
				keyvisualId: 	'4393',
				keyvisualName: 	'kv_4393.jpg',
				fontsetId: 		'10800',
				graphicsetId: 	'11232',
				contentColor: 	'FFFFFF',
				contentBGColor: '8396BA',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090908-152715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2652',
internalId:  '',
customField: '20090110-174542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2673',
internalId:  '',
customField: '20090820-114319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2736',
internalId:  '',
customField: '20091106-122622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2757',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2694',
internalId:  '',
customField: '20090820-114408'
};
webappMappings['7060']=webappMappings['7060-51c0e362083fb508d6f4f3f77bd6ee39']={
webappId:    '7060',
documentId:  '4001',
internalId:  '51c0e362083fb508d6f4f3f77bd6ee39',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2715',
internalId:  '',
customField: '20090820-114515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2778',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2799',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2820',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2841',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2862',
internalId:  '',
customField: '20090110-171517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20090112-150108'
};
webappMappings['1501']=webappMappings['1501-14839039']={
webappId:    '1501',
documentId:  '2601',
internalId:  '14839039',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-0df8550f8e12ea7a0f1737a25750b0e5']={
webappId:    '7060',
documentId:  '13101',
internalId:  '0df8550f8e12ea7a0f1737a25750b0e5',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-ee7ff75e280c8b36a5682ce5e35c6bdb']={
webappId:    '7060',
documentId:  '13122',
internalId:  'ee7ff75e280c8b36a5682ce5e35c6bdb',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090112-150148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13122',
internalId:  '',
customField: '20090112-150214'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090727-141813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20090820-115143'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEEZU';
var companyName   = 'Mr.+Barry%27s+Martial+Arts';
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();
};
