/* [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','32',jdecode('La+Esquina'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','9601',jdecode('La+mujer+en+la+literatura'),jdecode(''),'/9601.html','true',[],'',''],
	['PAGE','53',jdecode('%22De+congo+y+de+caravali%22'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','143',jdecode('Los+Pinos+Nueveos'),jdecode(''),'/143/index.html','true',[ 
		['PAGE','2776',jdecode('El+Otono+Del+Patriarca'),jdecode(''),'/143/2776.html','true',[],'',''],
		['PAGE','10701',jdecode('EL+CHE+GUEVARA+AVENTURERO%2C+TERRORISTA'),jdecode(''),'/143/10701.html','true',[],'','']
	],'',''],
	['PAGE','107',jdecode('%22Cambalache%22'),jdecode(''),'/107.html','true',[],'',''],
	['PAGE','2630',jdecode('Fe-Martix'),jdecode(''),'/2630.html','true',[],'',''],
	['PAGE','71',jdecode('Mi+obra+literaria'),jdecode(''),'/71/index.html','true',[ 
		['PAGE','80',jdecode('Cuentos+infantiles'),jdecode(''),'/71/80.html','true',[],'',''],
		['PAGE','89',jdecode('Poesias'),jdecode(''),'/71/89.html','true',[],'',''],
		['PAGE','98',jdecode('Cuentos+y+Novelas'),jdecode(''),'/71/98.html','true',[],'','']
	],'',''],
	['PAGE','2172',jdecode('Al+pasito'),jdecode(''),'/2172.html','true',[],'',''],
	['PAGE','10901',jdecode('Esquina-Mirabal+Blog'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','1246',jdecode('Dejame+un+recado'),jdecode(''),'/1246/index.html','true',[ 
		['PAGE','1245',jdecode('Opinones'),jdecode(''),'/1246/1245.html','false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='50529E';
theSitetree.keyvisualId='4232';
theSitetree.keyvisualName='kv_4232.jpg';
theSitetree.fontsetId='10673';
theSitetree.graphicsetId='11188';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7B7CB4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Americanlife',
				paletteFamily: 	'50529E',
				keyvisualId: 	'4232',
				keyvisualName: 	'kv_4232.jpg',
				fontsetId: 		'10673',
				graphicsetId: 	'11188',
				contentColor: 	'FFFFFF',
				contentBGColor: '7B7CB4',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2776',
internalId:  '',
customField: '20090627-231353'
};
webappMappings['1002']=webappMappings['1002-1246AHW050IN3KUX']={
webappId:    '1002',
documentId:  '1246',
internalId:  '1246AHW050IN3KUX',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1453708']={
webappId:    '1501',
documentId:  '32',
internalId:  '1453708',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143',
internalId:  '',
customField: '20090627-231910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2630',
internalId:  '',
customField: '20090627-231623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20100506-205405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20090627-231643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20100425-133604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20070709-003538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98',
internalId:  '',
customField: '20080511-160725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20090627-231841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2172',
internalId:  '',
customField: '20100425-131543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20090627-232455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20070601-032520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1245',
internalId:  '',
customField: '20070528-033602'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20100125-232818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20100125-233601'
};
webappMappings['7050']=webappMappings['7050-2126']={
webappId:    '7050',
documentId:  '10901',
internalId:  '2126',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100506-210058'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3KUX';
var companyName   = 'ESQUINA+MIRABAL+++++++++++++';
var htmlTitle	  = 'Esquina+Mirabal';
var metaKeywords  = 'CUban+Literature%2C+literatura+cubana%2C+quentos+infantiles%2C+poesia%2C+novela%2C+Kazan%2C+%D0%9A%D0%93%D0%A3+%D0%9C%D0%B8%D1%80%D0%B8%D0%B0%D0%BC+%D0%9B%D0%BE%D0%BF%D0%B5%D1%81+%D0%9C%D0%B8%D1%80%D0%B0%D0%B1%D0%B0%D0%BB%D1%8C%2C+%D0%9A%D1%83%D0%B1%D0%B8%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D0%BF%D1%80%D0%BE%D0%B7%D0%B0%2C+%D0%9A%D1%83%D0%B1%D0%B8%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D0%BF%D0%BE%D1%8D%D0%B7%D0%B8%D1%8F+';
var metaContents  = 'Cuban+American+Literature';
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();
};
