/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','3801',jdecode('Quienes+Somos'),jdecode(''),'/3801/index.html','true',[ 
		['PAGE','4101',jdecode('Una+Iglesia+que+Impacta+la+Ciudad'),jdecode(''),'/3801/4101.html','true',[],''],
		['PAGE','4122',jdecode('Iglesia+Celular'),jdecode(''),'/3801/4122.html','true',[],'']
	],''],
	['PAGE','3822',jdecode('Nuestros+Pastores'),jdecode(''),'/3822.html','true',[],''],
	['PAGE','3843',jdecode('En+Qu%C3%A9+Creemos'),jdecode(''),'/3843.html','true',[],''],
	['PAGE','3864',jdecode('Nuestra+Misi%C3%B3n'),jdecode(''),'/3864/index.html','true',[ 
		['PAGE','4143',jdecode('Nuestra+Visi%C3%B3n'),jdecode(''),'/3864/4143.html','true',[],''],
		['PAGE','4164',jdecode('Nuestro+Objetivo'),jdecode(''),'/3864/4164.html','true',[],''],
		['PAGE','4185',jdecode('Nuestro+Prop%C3%B3sito'),jdecode(''),'/3864/4185.html','true',[],''],
		['PAGE','4206',jdecode('Nuestra+Estrategia'),jdecode(''),'/3864/4206.html','true',[],'']
	],''],
	['PAGE','3885',jdecode('Nuestras+Reuniones'),jdecode(''),'/3885/index.html','true',[ 
		['PAGE','4227',jdecode('Reuniones+Generales'),jdecode(''),'/3885/4227.html','true',[],''],
		['PAGE','4248',jdecode('Reuniones+de+J%C3%B3venes'),jdecode(''),'/3885/4248.html','true',[],''],
		['PAGE','4269',jdecode('Reuniones+de+C%C3%A9lula'),jdecode(''),'/3885/4269.html','true',[],'']
	],''],
	['PAGE','23712',jdecode('Nuevo+Vivir+TV'),jdecode(''),'/23712.html','true',[],''],
	['PAGE','20412',jdecode('Videos'),jdecode(''),'/20412.html','true',[],''],
	['PAGE','3927',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/3927.html','true',[],''],
	['PAGE','3948',jdecode('Local%C3%ADcenos'),jdecode(''),'/3948.html','true',[],''],
	['PAGE','8501',jdecode('Noticias'),jdecode(''),'/8501/index.html','true',[ 
		['PAGE','8522',jdecode('Eventos'),jdecode(''),'/8501/8522.html','true',[],'']
	],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20091224-191946'
};
webappMappings['7008']=webappMappings['7008-2798']={
webappId:    '7008',
documentId:  '3927',
internalId:  '2798',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3948',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20080430-145317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20080924-200857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4122',
internalId:  '',
customField: '20080924-201319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3822',
internalId:  '',
customField: '20090126-182905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3843',
internalId:  '',
customField: '20080924-195113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3864',
internalId:  '',
customField: '20080924-195330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4143',
internalId:  '',
customField: '20080924-195400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4164',
internalId:  '',
customField: '20080924-195423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4185',
internalId:  '',
customField: '20080924-195450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4206',
internalId:  '',
customField: '20080924-195529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3885',
internalId:  '',
customField: '20090819-154955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4227',
internalId:  '',
customField: '20081028-173824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4248',
internalId:  '',
customField: '20090126-182202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4269',
internalId:  '',
customField: '20091224-192256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3927',
internalId:  '',
customField: '20080924-200527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3948',
internalId:  '',
customField: '20090324-203515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20091224-192119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20100310-145424'
};
webappMappings['1501']=webappMappings['1501-12247084']={
webappId:    '1501',
documentId:  '1801',
internalId:  '12247084',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20412',
internalId:  '',
customField: '20091201-184553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23712',
internalId:  '',
customField: '20091231-190151'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2GJJ';
var companyName   = 'Ministerios+Nuevo+Vivir+';
var htmlTitle	  = 'Ministerios+Nuevo+Vivir';
var metaKeywords  = 'Ministerios%2C+Nuevo%2C+Vivir%2C+Celulas%2C+Grupos+celulares%2C+Impacto+en+la+ciudad%2C+celebracion';
var metaContents  = 'Ministerios+Nuevo+Vivir+Iglesia+Nuevo+VivirNuevo+Vivir';
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();
};
