/* [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','312',jdecode('Inicio%2FHome'),jdecode(''),'/312.html','true',[],''],
	['PAGE','622',jdecode('Conocenos'),jdecode(''),'/622/index.html','true',[ 
		['PAGE','601',jdecode('Declaracion+de+Fe'),jdecode(''),'/622/601.html','true',[],''],
		['PAGE','643',jdecode('Ministerios'),jdecode(''),'/622/643.html','true',[],''],
		['PAGE','28801',jdecode('Donaciones'),jdecode(''),'/622/28801.html','true',[],''],
		['PAGE','14501',jdecode('Noticias%2FEventos'),jdecode(''),'/622/14501.html','true',[],'']
	],''],
	['PAGE','664',jdecode('Palabras+para+tu+Vida'),jdecode(''),'/664/index.html','true',[ 
		['PAGE','685',jdecode('Lee+la+Biblia'),jdecode(''),'/664/685.html','true',[],''],
		['PAGE','706',jdecode('Questionario'),jdecode(''),'/664/706.html','true',[],''],
		['PAGE','10801',jdecode('Testimonios'),jdecode(''),'/664/10801.html','true',[],'']
	],''],
	['PAGE','727',jdecode('Arte'),jdecode(''),'/727/index.html','true',[ 
		['PAGE','748',jdecode('Poemas+'),jdecode(''),'/727/748.html','true',[],''],
		['PAGE','769',jdecode('Pensamientos'),jdecode(''),'/727/769.html','true',[],''],
		['PAGE','790',jdecode('Otros'),jdecode(''),'/727/790.html','true',[],'']
	],''],
	['PAGE','39785',jdecode('Fotos'),jdecode(''),'/39785/index.html','true',[ 
		['PAGE','14101',jdecode('FOTOS+DE+IGLESIA'),jdecode(''),'/39785/14101.html','true',[],''],
		['PAGE','14201',jdecode('FOTOS+DE+JOVENES'),jdecode(''),'/39785/14201.html','true',[],'']
	],''],
	['PAGE','3806',jdecode('Libro+de+Visitas'),jdecode(''),'/3806.html','true',[],''],
	['PAGE','3801',jdecode('Leer+Libro+de+Visitas'),jdecode(''),'/3801.html','false',[],''],
	['PAGE','811',jdecode('Contactanos'),jdecode(''),'/811/index.html','true',[ 
		['PAGE','3901',jdecode('Mapa'),jdecode(''),'/811/3901.html','true',[],'']
	],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Atmosphere';
theSitetree.paletteFamily='003333';
theSitetree.keyvisualId='202';
theSitetree.keyvisualName='traum.jpg';
theSitetree.fontsetId='8';
theSitetree.graphicsetId='5';
theSitetree.contentColor='006633';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Atmosphere',
				paletteFamily: 	'003333',
				keyvisualId: 	'202',
				keyvisualName: 	'traum.jpg',
				fontsetId: 		'8',
				graphicsetId: 	'5',
				contentColor: 	'006633',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003333',
				b_color: 		'669999',
				c_color: 		'000000',
				d_color: 		'',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '312',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '312',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2261307']={
webappId:    '1501',
documentId:  '312',
internalId:  '2261307',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-3806ahw050inv400']={
webappId:    '1002',
documentId:  '3806',
internalId:  '3806ahw050inv400',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-afddcb69dce2302708371c66e3d1f78d']={
webappId:    '7060',
documentId:  '14101',
internalId:  'afddcb69dce2302708371c66e3d1f78d',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-a20c2e0b491e1c1087b9208902238873']={
webappId:    '7060',
documentId:  '14201',
internalId:  'a20c2e0b491e1c1087b9208902238873',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-ahw050inv40011bd8618ce6']={
webappId:    '1003',
documentId:  '664',
internalId:  'ahw050inv40011bd8618ce6',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '312',
internalId:  '',
customField: '20100127-235110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100127-163604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '622',
internalId:  '',
customField: '20090924-014129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '643',
internalId:  '',
customField: '20100127-163721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20100126-005334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20080820-025519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '664',
internalId:  '',
customField: '20080901-021055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '685',
internalId:  '',
customField: '20080901-020730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '706',
internalId:  '',
customField: '20080820-012722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '727',
internalId:  '',
customField: '20080831-202935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '748',
internalId:  '',
customField: '20080820-030725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '769',
internalId:  '',
customField: '20080820-033747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '790',
internalId:  '',
customField: '20080820-033949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20090924-021003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20080820-052147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3806',
internalId:  '',
customField: '20080831-203222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20080831-203133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '811',
internalId:  '',
customField: '20080831-203245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20080820-022554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20080901-000944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39785',
internalId:  '',
customField: '20100125-004907'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INV400';
var companyName   = 'MinisterioNuevaJerusalem.com';
var htmlTitle	  = 'Ministerio+Nueva+Jerusalem';
var metaKeywords  = 'Ministerio+Nueva+Jerusalem%2C+Pastor+Salomon+Garcia%2C+Iglesia+Nueva+Jerusalem%2C+Josue+Lopez%2C+Fransisco+Vargas%2C+Grupo+Nueva+Jerusalem%2C+Sioux+Falls%2C+South+Dakota';
var metaContents  = 'Ministerio+Nueva+Jerusalem%2C+Pastor+Salomon+Garcia%2C+Iglesia+Nueva+Jerusalem%2C+Josue+Lopez%2C+Fransisco+Vargas%2C+Grupo+Nueva+Jerusalem%2C+Sioux+Falls%2C+South+Dakota';
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();
};

