/* [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','601',jdecode('Presentaci%C3%B3n'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','15301',jdecode('Fines'),jdecode(''),'/15301.html','true',[],'',''],
	['PAGE','30501',jdecode('Beneficiarios'),jdecode(''),'/30501.html','true',[],'',''],
	['PAGE','28501',jdecode('Actividades'),jdecode(''),'/28501.html','true',[],'',''],
	['PAGE','12901',jdecode('Origen'),jdecode(''),'/12901/index.html','false',[ 
		['PAGE','19901',jdecode('Carta'),jdecode(''),'/12901/19901.html','true',[],'',''],
		['PAGE','13201',jdecode('Firmantes'),jdecode(''),'/12901/13201.html','true',[],'','']
	],'',''],
	['PAGE','11001',jdecode('Patronato'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','14843',jdecode('Donaciones'),jdecode(''),'/14843.html','true',[],'',''],
	['PAGE','11301',jdecode('Documentos'),jdecode(''),'/11301/index.html','false',[ 
		['PAGE','14801',jdecode('Sobre+un+nuevo+Concilio'),jdecode(''),'/11301/14801.html','true',[],'','']
	],'',''],
	['PAGE','11322',jdecode('Enlaces'),jdecode(''),'/11322/index.html','false',[ 
		['PAGE','11901',jdecode('Mediaci%C3%B3n+social'),jdecode(''),'/11322/11901.html','true',[],'',''],
		['PAGE','12201',jdecode('Di%C3%A1logo+interreligioso'),jdecode(''),'/11322/12201.html','true',[],'',''],
		['PAGE','12222',jdecode('Ecumenismo'),jdecode(''),'/11322/12222.html','true',[],'','']
	],'',''],
	['PAGE','13701',jdecode('Contactar'),jdecode(''),'/13701/index.html','true',[ 
		['PAGE','14101',jdecode('Contactar+%28follow+up+page%29'),jdecode(''),'/13701/14101.html','false',[],'','']
	],'',''],
	['PAGE','21101',jdecode('Blogs'),jdecode(''),'/21101.html','false',[],'',''],
	['PAGE','21604',jdecode('Hecho+Religioso'),jdecode(''),'/21604.html','false',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Stinger';
theSitetree.paletteFamily='E8D9A4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10516';
theSitetree.graphicsetId='11127';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E8D9A4';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stinger',
				paletteFamily: 	'E8D9A4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10516',
				graphicsetId: 	'11127',
				contentColor: 	'000000',
				contentBGColor: 'E8D9A4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'494A49',
				e_color: 		'494A49',
				f_color: 		'494A49',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100128-144002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100128-134541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11322',
internalId:  '',
customField: '20090524-115427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090713-113412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20090524-150319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20090524-150452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12222',
internalId:  '',
customField: '20090524-150452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20100128-133157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20090525-171027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20090524-154159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20100128-140222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20090524-153232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20090713-210116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28501',
internalId:  '',
customField: '20100128-140607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14843',
internalId:  '',
customField: '20090525-161755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20100128-134108'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21604',
internalId:  '',
customField: '20090531-125519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20090904-173232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20090525-165305'
};
webappMappings['7008']=webappMappings['7008-6430']={
webappId:    '7008',
documentId:  '13701',
internalId:  '6430',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwd718.servidoresdns.net';
var accountId     = 'AARS20INVFN8';
var companyName   = 'PROCONCIL%2C+FUNDACI%C3%93N+PARA+LA+MEDIACI%C3%93N';
var htmlTitle	  = 'Fundaci%C3%B3n+Proconcil';
var metaKeywords  = 'mediaci%C3%B3n+social%2C+di%C3%A1logo+interreligioso%2C+ecumenismo%2C+proceso+conciliar%2C+concilio%2C+iglesia%2C+religiones%2C+religi%C3%B3n';
var metaContents  = 'Web+de+la+Fundaci%C3%B3n+Proconcil.+Informaci%C3%B3n+sobre+mediaci%C3%B3n+social%2C+di%C3%A1logo+interreligioso+y+ecumenismo.';
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();
};
