/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','43817',jdecode('Karate+Classes'),jdecode(''),'/43817.html','true',[],'',''],
	['PAGE','42062',jdecode('Weapons+Classes'),jdecode(''),'/42062.html','true',[],'',''],
	['PAGE','48834',jdecode('Women%26%23x27%3Bs+Self+Defense'),jdecode(''),'/48834.html','true',[],'',''],
	['PAGE','45567',jdecode('Membership+Options'),jdecode(''),'/45567.html','true',[],'',''],
	['PAGE','6801',jdecode('Schedule%2FCalendar'),jdecode(''),'/6801.html','true',[],'',''],
	['PAGE','42071',jdecode('Sensei%26%23x27%3Bs+Corner'),jdecode(''),'/42071.html','true',[],'',''],
	['PAGE','552',jdecode('Instructors'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','51134',jdecode('Community+%26+Wellness'),jdecode(''),'/51134.html','true',[],'',''],
	['PAGE','45482',jdecode('Contact+Us'),jdecode(''),'/45482.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Japanese';
theSitetree.paletteFamily='384B5A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11135';
theSitetree.graphicsetId='11937';
theSitetree.contentColor='1C2934';
theSitetree.contentBGColor='BDC1B4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Japanese',
				paletteFamily: 	'384B5A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11135',
				graphicsetId: 	'11937',
				contentColor: 	'1C2934',
				contentBGColor: 'BDC1B4',
				a_color: 		'384B5A',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7050']=webappMappings['7050-1391']={
webappId:    '7050',
documentId:  '42071',
internalId:  '1391',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100707-210812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42062',
internalId:  '',
customField: '20100513-230146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20100707-205332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45482',
internalId:  '',
customField: '20100513-231604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43817',
internalId:  '',
customField: '20100605-195747'
};
webappMappings['7008']=webappMappings['7008-4399']={
webappId:    '7008',
documentId:  '45482',
internalId:  '4399',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100707-204824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42071',
internalId:  '',
customField: '20100505-230814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45567',
internalId:  '',
customField: '20100707-211052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48834',
internalId:  '',
customField: '20100505-225552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51134',
internalId:  '',
customField: '20100505-231739'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050IN30AI';
var companyName   = 'Goju+Ryu+Karate-Do+of+Vancouver';
var htmlTitle	  = 'Goju+Ryu+Karate-Do+of+Vancouver';
var metaKeywords  = 'karate%2C+okinawa%2C+japanese%2C+karate+school%2C+traditional%2C++training%2C+goju-ryu+karate%2C+kobudo%2C+sports%2C+dojo%2C+self-defense%2C+fitness%2C+health%2C+wellness%2C+training%2C+ogrkk%2C+the+pfendler+family%2C+karate+in+vancouver+washington%2C+okinawan%2C+japanese+styles%2C+karate+school%2C+traditional+training%2C+goju-ryu+karate%2C+kobudo%2C+sports%2C+dojo%2C+self-defense%2C+fitness%2C+health%2C+wellness%2C+training%2C+ogrkk%2C+the+pfendler+family%2C+salmon+creek%2C+sports%2C+sport%2C+family%2C+defense%2C+self-defense%2C+karate+style%2C+goju%2C+ryu+styles%2C++';
var metaContents  = 'karate%2C+karate+in+vancouver+washington%2C+okinawan%2C+japanese%2C+karate+school%2C+traditional+training%2C+goju-ryu+karate%2C+kobudo%2C+sports%2C+dojo%2C+self-defense%2C+fitness%2C+health%2C+wellness%2C+training%2C+ogrkk%2C+the+pfendler+family%2C+salmon+creek%2C+sports%2C+sport%2C+family%2C+defense%2Cwomens+self-defense%2Cwomens+self+defense%2C+vancouver+karate%2C+karate+vancouver%2C+martial+arts%2C+goju+ryu%2C+goju%2C+kids+karate%2C+kids+classes%2C+massage%2C+yoga%2C+ballaties%2C+nutrition%2C+traditional+karate%2C+fighting%2C+jujitsu%2C+weapons%2C+boxing%2C+wrestling++';
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();
};
