/* [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','401',jdecode('Inicio'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','31101',jdecode('D%C3%B3nde+estamos'),jdecode(''), jdecode('%2F31101.html'), 'true',[],'',''],
	['PAGE','35601',jdecode('Director+Espiritual'),jdecode(''), jdecode('%2F35601%2Findex.html'), 'true',[ 
		['PAGE','32701',jdecode('Ven+Khen+Rimpoche+'),jdecode(''), jdecode('%2F35601%2F32701.html'), 'true',[],'',''],
		['PAGE','34801',jdecode('Ven+Gueshe+Tenzing'),jdecode(''), jdecode('%2F35601%2F34801.html'), 'true',[],'','']
	],'',''],
	['PAGE','2043',jdecode('Linaje'),jdecode(''), jdecode('%2F2043.html'), 'true',[],'',''],
	['PAGE','2064',jdecode('Programa+de+Estudios'),jdecode(''), jdecode('%2F2064.html'), 'true',[],'',''],
	['PAGE','31143',jdecode('Programa+extenso+Estudios'),jdecode(''), jdecode('%2F31143%2Findex.html'), 'false',[ 
		['PAGE','63912',jdecode('Retiros+Realizados'),jdecode(''), jdecode('%2F31143%2F63912.html'), 'true',[],'',''],
		['PAGE','63933',jdecode('Pr%C3%B3ximo+Retiro'),jdecode(''), jdecode('%2F31143%2F63933.html'), 'true',[],'','']
	],'',''],
	['PAGE','31164',jdecode('Centros+del+Ven.G.Tenzing'),jdecode(''), jdecode('%2F31164.html'), 'true',[],'',''],
	['PAGE','56101',jdecode('Fundaci%C3%B3n+Chop+Sup+Tsang'),jdecode(''), jdecode('%2F56101.html'), 'true',[],'',''],
	['PAGE','40601',jdecode('BLOG+V.Gueshe+Tenzing'),jdecode(''), jdecode('%2F40601.html'), 'true',[],'',''],
	['PAGE','40622',jdecode('BLOG+Chop+Sup+Tsang'),jdecode(''), jdecode('%2F40622.html'), 'true',[],'',''],
	['PAGE','40643',jdecode('BLOG+N.Tritul+Rimpoche'),jdecode(''), jdecode('%2F40643.html'), 'true',[],'',''],
	['PAGE','58801',jdecode('BLOG+Jardin+Darma'),jdecode(''), jdecode('%2F58801.html'), 'false',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Speed';
theSitetree.paletteFamily='920000';
theSitetree.keyvisualId='2342';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='373';
theSitetree.graphicsetId='424';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='920000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Speed',
				paletteFamily: 	'920000',
				keyvisualId: 	'2342',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'373',
				graphicsetId: 	'424',
				contentColor: 	'FFFFFF',
				contentBGColor: '920000',
				a_color: 		'920000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111017-005005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2064',
internalId:  '',
customField: '20100521-182308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20100521-182222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2043',
internalId:  '',
customField: '20100521-182248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20091130-221349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31101',
internalId:  '',
customField: '20111017-011130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31164',
internalId:  '',
customField: '20091201-001723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20091129-204836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20091129-200905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31143',
internalId:  '',
customField: '20100521-182348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40601',
internalId:  '',
customField: '20100924-003804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40622',
internalId:  '',
customField: '20091130-224445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40643',
internalId:  '',
customField: '20091130-230929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20091130-233954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63933',
internalId:  '',
customField: '20100522-114108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63912',
internalId:  '',
customField: '20100522-123334'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INLUEK';
var companyName   = 'C.B.T.+SHEDRUB+CHOELING';
var htmlTitle	  = 'shedrubchoeling.org';
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();
};

