/* [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','10701',jdecode('Home'),jdecode(''),'/10701.html','true',[],''],
	['PAGE','11301',jdecode('Wutai+Mountain+Books'),jdecode(''),'/11301.html','true',[],''],
	['PAGE','17101',jdecode('Texts+and+Talks'),jdecode(''),'/17101.html','true',[],''],
	['PAGE','15601',jdecode('Wutai+Kansas'),jdecode(''),'/15601.html','true',[],''],
	['PAGE','24553',jdecode('China+and+Tibet+Photos++'),jdecode(''),'/24553.html','true',[],''],
	['PAGE','24574',jdecode('The+Wisdom+of+Manjushri'),jdecode(''),'/24574.html','true',[],''],
	['PAGE','15622',jdecode('Japanese+Temples++'),jdecode(''),'/15622.html','true',[],''],
	['PAGE','30023',jdecode('Our+Tibetan+Teachers'),jdecode(''),'/30023.html','true',[],''],
	['PAGE','17201',jdecode('Contact+Us'),jdecode(''),'/17201.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1737';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1737',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-4188']={
webappId:    '7050',
documentId:  '17101',
internalId:  '4188',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20100504-202625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15622',
internalId:  '',
customField: '20100505-164636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20090709-133021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100505-161326'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10701',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-8573']={
webappId:    '7008',
documentId:  '17201',
internalId:  '8573',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20081030-180542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20081208-192725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24574',
internalId:  '',
customField: '20100504-190110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24553',
internalId:  '',
customField: '20090812-102919'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10701',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '11301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '17101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15601',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '24553',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '24574',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15622',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '17201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30023',
internalId:  '',
customField: '20090416-124935'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2HHF';
var companyName   = 'Wutai+Mountain';
var htmlTitle	  = '';
var metaKeywords  = 'Buddha%2C+Buddhist%2C+Buddhists%2C+Buddhism%2C+Wutai%2C+Wutai+Mountain%2C+Kansas%2C+Kansas+City%2C+Lawrence%2C+Lawrence+Kansas%2C+Mahayana+Buddhism%2C+Yogacara%2C+Yogachara%2C+Dzogchen%2C+Tibetan+Buddhism%2C+Nyingma%2C+Nyingma+Dzogchen%2C+Buddhist+study%2C+Buddhist+practice%2C+Buddhist+charities%2C+Tibetan+charities%2C+Tibet+Education+Project%2C+Tibetan+schools%2C+Buddhist+deities%2C+Buddhist+deity+practice%2C+Buddhist+art%2C+Buddhism+in+America%2C+American+Buddhism%2C+Manjushri%2C+Tara%2C+Maitreya%2C+Vajrakilaya%2C+Vajrasattva%2C+Chenrezig%2C+Medicine+Buddha%2C+Amitabha+Buddha%2C+Shakyamuni+Buddha%2C+Encyclopedia+of+Subtle+Instruction%2C+Buddhist+study+and+practice%2C+retreat+center%2C+retreat+centers%2C+Buddhist+retreat+centers%2C+Buddhist+yoga%2C+meditation%2C+Buddhist+meditation%2C+Buddhist+meditation+centers%2C+sitting+meditation%2C+meditation+instruction%2C+Buddhist+meditation+instruction%2C+Buddhist+classes%2C+Buddhist+workshops%2C+Buddhist+retreats%2C+Buddhist+sadhana+practice%2C+Vasubandu%2C+Asanga%2C+Padmasambhava%2C+Guru+Rinpoche%2C+Garab+Dorje%2C+Longchenpa%2C+Longchen+Rabjam%2C+Jigme+Lingpa%2C+Yeshe+Tsogyal%2C+awareness%2C+pure+consciousness%2C+Encyclopedia+of+Subtle+Instruction%2C+Wutai+Mountain+Books%2C+Buddhist+publishers%2C+Tibet%2C+China%2C+Asian+Studies%2C+Tibetan+language%2C+Golok%2C+Unity+Temple%2C+Temple+Buddhism%2C+Buddhist+philosophy%2C+tantra%2C+Vajrayana+Buddhism%2C+wisdom%2C+wisdom+and+compassion%2C+emptiness%2C+goodness%2C+Zen%2C+Pure+Land+Buddhism';
var metaContents  = 'Wutai.org+is+the+website+for+Wutai+Mountain%2C+a+small+Buddhist+retreat+center+in+Eastern+Kansas.+The+retreat+center+is+named+after+a+famous+Buddhist+site+in+China%2C+home+of+Manjushri%2C+the+Bodhisattva+of+Enlightened+Wisdom.+Our+retreat+center+draws+on+the+full+tradition+of+Asian+Buddhism+with+a+special+emphasis+on+the+Tibetan+Dzogchen+tradition.++Over+the+years+we+have+hosted+many+Tibetan+Buddhist+teachers+and+have+held+numerous+group+retreats.We+hosted+the+first+Buddhist+empowerment+ceremonies+in+Kansas+City+and+Lawrence%2C+and+this+year+launched+Wutai+Mountain+Books%2C+making+us+the+first+Buddhist+publisher+in+the+area.+We+teach++an+ongoing+workshop+on+Dzogchen+twice+a+month+at+Unity+Temple+in+Kansas+City.+We+have+our+own+501+%28c%29+3+Tibetan+charity%2C+the+Tibet+Education+Project%2C+that+aids+Tibetan+Schools+in+India+and+China.+All+donations+and+proceeds+from+our+activities+support+native+Tibetans.+Over+the+years+we+have+raised+tens+of+thousands+of+dollars+for+this+purpose.+We+are+also+active+supporters+of+other+Kansas+City+area+Buddhist+charities%2C+educational+institutions+supporting+Asian+studies%2C+and+local+Buddhist+groups.';
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();
};
