/* [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','501',jdecode('HOME'),jdecode(''),'/501/index.html','true',[ 
		['PAGE','11701',jdecode('FOUNDER'),jdecode(''),'/501/11701.html','true',[],''],
		['PAGE','13301',jdecode('YOUTH+PROGRAM'),jdecode(''),'/501/13301.html','true',[],''],
		['PAGE','13322',jdecode('ADULT+PROGRAM'),jdecode(''),'/501/13322.html','true',[],''],
		['PAGE','25701',jdecode('WOMEN+COURSE'),jdecode(''),'/501/25701.html','true',[],'']
	],''],
	['PAGE','2143',jdecode('BRANCHES'),jdecode(''),'/2143.html','true',[],''],
	['PAGE','18606',jdecode('Guestbook'),jdecode(''),'/18606/index.html','true',[ 
		['PAGE','18601',jdecode('Read+Guestbook'),jdecode(''),'/18606/18601.html','false',[],'']
	],''],
	['PAGE','23301',jdecode('Interesting+links'),jdecode(''),'/23301.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Zoe';
theSitetree.paletteFamily='243356';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='415';
theSitetree.graphicsetId='456';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Zoe',
				paletteFamily: 	'243356',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'415',
				graphicsetId: 	'456',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'1B2B52',
				e_color: 		'676F74',
				f_color: 		'FE7F01',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-18606abri10ine4y2']={
webappId:    '1002',
documentId:  '18606',
internalId:  '18606abri10ine4y2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090904-123648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11701',
internalId:  '',
customField: '20090830-032318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20090919-133326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20090830-024841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20100609-035310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18606',
internalId:  '',
customField: '20080504-040230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20080504-040230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20090830-031652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20090919-124443'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INE4Y2';
var companyName   = 'ADVANCED+KEMPO+KARATE+SYSTEM';
var htmlTitle	  = 'Hawaii-+Advanced+Kempo+Karate%2FMartial+Arts+%26+Self+Defense+Instructions+in+Kailua+Kona%2CHilo%2CPearl+City';
var metaKeywords  = 'Hawaii+Kempo-Karate%2CChinese+Kempo-Karate%2CMartial+Arts++Self+Defense+Instruction+in+Kailua+Kona%2C+Hilo%2C+Pearl+City++Hawaii%2CWalter+Godin%2CReality+Street+Self+Defense%2C96740%2C96720%2C96701%2C%28808%29+Kealakehe%2CPractical+Self+defense%2CLife+Skills%2CPhysical+fitness%2CFREE%2CWeapon+disarm%2FForms%2Cjujitsu%2Cjudo%2Cgrappling.Phsical+Fitness';
var metaContents  = 'Advanced+Kempo%2CReality+Street+Self+Defense++Martial+Arts+Instruction+in+Kailua+Kona+Hilo+Pearl+City%2CChinese+Kempo-Karate%2C+Professor+Johnathan+L.+Vance%2C+Youth+Program%2C+Adult+Program.+So+Look+no+Further%21+%231+Phsical+Fitness%2CBranches+Kailua-Kona%2CAiea%2C+Hilo%2C+Hawaii+Aloha%21+Teaching+you+and+your+family+what+we+do+best..+++meta+name%3Dverify-v1+content%3Dt%2FDIuQrLn5JeVAPF4ZVHrJoxD1uD92Wfh%2FfbVYAoeRA%3D+%2F+';
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();
};

