/* [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','20601',jdecode('Home'),jdecode(''),'/20601.html','true',[],'',''],
	['PAGE','452',jdecode('About+ECS'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','23701',jdecode('Mission+Statement'),jdecode(''),'/452/23701.html','true',[],'','']
	],'',''],
	['PAGE','21301',jdecode('ECS+Programs'),jdecode(''),'/21301.html','true',[],'',''],
	['PAGE','21601',jdecode('What+is+Sambo%3F'),jdecode(''),'/21601.html','true',[],'',''],
	['PAGE','23101',jdecode('Schedule%2FPricing'),jdecode(''),'/23101.html','true',[],'',''],
	['PAGE','4901',jdecode('Instructors'),jdecode(''),'/4901/index.html','true',[ 
		['PAGE','30301',jdecode('Grant+Gilliam'),jdecode(''),'/4901/30301.html','true',[],'',''],
		['PAGE','30322',jdecode('Marie+Gilliam'),jdecode(''),'/4901/30322.html','true',[],'','']
	],'',''],
	['PAGE','28101',jdecode('Team+Hall+of+Fame'),jdecode(''),'/28101.html','true',[],'',''],
	['PAGE','21501',jdecode('Location+%26+Map'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','21643',jdecode('Instructor+Testimonials'),jdecode(''),'/21643.html','true',[],'',''],
	['PAGE','42001',jdecode('Student+Testimonials'),jdecode(''),'/42001.html','true',[],'',''],
	['PAGE','22101',jdecode('Contact+Us'),jdecode(''),'/22101.html','true',[],'',''],
	['PAGE','24401',jdecode('Photos'),jdecode(''),'/24401.html','true',[],'',''],
	['PAGE','34701',jdecode('Videos'),jdecode(''),'/34701.html','true',[],'',''],
	['PAGE','28122',jdecode('Links'),jdecode(''),'/28122.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FB0505';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10561',
				contentColor: 	'FB0505',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '20601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20091028-064847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21643',
internalId:  '',
customField: '20100711-151933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20100607-155350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20100711-134710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20091029-175903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091028-075641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20091209-190446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20100711-134550'
};
webappMappings['7060']=webappMappings['7060-73591ee2f7ce46e22fc5f88195e04e67']={
webappId:    '7060',
documentId:  '24401',
internalId:  '73591ee2f7ce46e22fc5f88195e04e67',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22101',
internalId:  '',
customField: '20090214-152032'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '21501',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-181']={
webappId:    '7008',
documentId:  '22101',
internalId:  '181',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20100607-151717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20090207-211416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20100711-142553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28122',
internalId:  '',
customField: '20100711-150815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100711-135816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30322',
internalId:  '',
customField: '20090822-130735'
};
webappMappings['7060']=webappMappings['7060-46b4b5ad1e31e102cef95cdde6df38d6']={
webappId:    '7060',
documentId:  '34701',
internalId:  '46b4b5ad1e31e102cef95cdde6df38d6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20090822-140255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20100711-151827'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INLYGS';
var companyName   = 'ECLECTIC+COMBAT+SYSTEMS';
var htmlTitle	  = 'Eclectic+Combat+Systems';
var metaKeywords  = 'MMA%2C+Jiu-Jitsu%2C+Jujitsu%2C+Kickboxing%2C+Sambo%2C+Mixed+Martial+Arts%2C+Fighting%2C+Grappling';
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();
};
