/* [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','6601',jdecode('Home'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','6652',jdecode('Mission'),jdecode(''),'/6652.html','true',[],'',''],
	['PAGE','6673',jdecode('Programs'),jdecode(''),'/6673.html','true',[],'',''],
	['PAGE','6694',jdecode('Our+Staff'),jdecode(''),'/6694.html','true',[],'',''],
	['PAGE','6736',jdecode('Martial+Arts'),jdecode(''),'/6736/index.html','true',[ 
		['PAGE','11501',jdecode('Forms'),jdecode(''),'/6736/11501.html','true',[],'',''],
		['PAGE','11522',jdecode('Terminology'),jdecode(''),'/6736/11522.html','true',[],'','']
	],'',''],
	['PAGE','11543',jdecode('Testing+Forms'),jdecode(''),'/11543.html','true',[],'',''],
	['PAGE','12101',jdecode('Curriculum'),jdecode(''),'/12101/index.html','true',[ 
		['PAGE','20701',jdecode('White+Belt'),jdecode(''),'/12101/20701.html','true',[],'',''],
		['PAGE','20722',jdecode('Blue-Stripe+White+Belt'),jdecode(''),'/12101/20722.html','true',[],'',''],
		['PAGE','20743',jdecode('Red-Stripe+White+Belt'),jdecode(''),'/12101/20743.html','true',[],'',''],
		['PAGE','20764',jdecode('Black-Stripe+White+Belt'),jdecode(''),'/12101/20764.html','true',[],'',''],
		['PAGE','22401',jdecode('Red%2FBlue+Belt'),jdecode(''),'/12101/22401.html','true',[],'',''],
		['PAGE','20785',jdecode('Red%2FBlue+1st+Degree'),jdecode(''),'/12101/20785.html','true',[],'',''],
		['PAGE','20806',jdecode('Red%2FBlue+2nd+Degree'),jdecode(''),'/12101/20806.html','true',[],'',''],
		['PAGE','20827',jdecode('Red%2FBlue+3rd+Degree'),jdecode(''),'/12101/20827.html','true',[],'',''],
		['PAGE','20848',jdecode('Red%2FBlue+4th+Degree'),jdecode(''),'/12101/20848.html','true',[],'',''],
		['PAGE','20869',jdecode('Red%2FBlue+5th+Degree'),jdecode(''),'/12101/20869.html','true',[],'',''],
		['PAGE','20890',jdecode('Red%2FBlue+6th+Degree'),jdecode(''),'/12101/20890.html','true',[],'',''],
		['PAGE','20911',jdecode('Red%2FBlue+7th+Degree'),jdecode(''),'/12101/20911.html','true',[],'',''],
		['PAGE','20932',jdecode('Red%2FBlue+8th+Degree'),jdecode(''),'/12101/20932.html','true',[],'',''],
		['PAGE','20953',jdecode('Black+Belt+%281st+Degree%29'),jdecode(''),'/12101/20953.html','true',[],'','']
	],'',''],
	['PAGE','6757',jdecode('Contact'),jdecode(''),'/6757.html','true',[],'',''],
	['PAGE','6778',jdecode('Schedule'),jdecode(''),'/6778.html','true',[],'',''],
	['PAGE','6799',jdecode('Student+Pictures'),jdecode(''),'/6799.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Cube';
theSitetree.paletteFamily='154186';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10354';
theSitetree.graphicsetId='10488';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cube',
				paletteFamily: 	'154186',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10354',
				graphicsetId: 	'10488',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '6601',
internalId:  '',
customField: '20100526-191746'
};
webappMappings['7060']=webappMappings['7060-4778aee8f3cf4a2b673bed6463a69860']={
webappId:    '7060',
documentId:  '6799',
internalId:  '4778aee8f3cf4a2b673bed6463a69860',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6652',
internalId:  '',
customField: '20100526-191030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6673',
internalId:  '',
customField: '20100526-191241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6694',
internalId:  '',
customField: '20100526-191229'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '6601',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6736',
internalId:  '',
customField: '20100526-191218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6757',
internalId:  '',
customField: '20100526-191429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6778',
internalId:  '',
customField: '20100419-172224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6799',
internalId:  '',
customField: '20100419-172333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20100526-191340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11522',
internalId:  '',
customField: '20100526-191353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11543',
internalId:  '',
customField: '20100526-191832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20100419-173506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20722',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20743',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20764',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20785',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20806',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20827',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20848',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20869',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20890',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20911',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20932',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20953',
internalId:  '',
customField: '20100526-190840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20100527-124823'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZG47';
var companyName   = 'Welcome+to+King+Tiger+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();
};
