/* [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','12499',jdecode('Inicio+y+novedades'),jdecode(''),'/12499.html','true',[],''],
	['PAGE','2601',jdecode('Conozca+a+Letra+2'),jdecode(''),'/2601.html','true',[],''],
	['PAGE','3301',jdecode('Cat%C3%A1logo'),jdecode(''),'/3301/index.html','true',[ 
		['PAGE','3322',jdecode('Narrativa'),jdecode(''),'/3301/3322.html','true',[],''],
		['PAGE','3343',jdecode('Poes%C3%ADa'),jdecode(''),'/3301/3343.html','true',[],''],
		['PAGE','3364',jdecode('Ensayo'),jdecode(''),'/3301/3364.html','true',[],''],
		['PAGE','3385',jdecode('Inter%C3%A9s+general'),jdecode(''),'/3301/3385.html','true',[],''],
		['PAGE','3406',jdecode('Derecho'),jdecode(''),'/3301/3406.html','true',[],'']
	],''],
	['PAGE','12550',jdecode('Autores'),jdecode(''),'/12550/index.html','true',[ 
		['PAGE','13062',jdecode('AlbertoBio'),jdecode(''),'/12550/13062.html','false',[],''],
		['PAGE','13083',jdecode('BrendaBio'),jdecode(''),'/12550/13083.html','false',[],''],
		['PAGE','13041',jdecode('GermanBio'),jdecode(''),'/12550/13041.html','false',[],''],
		['PAGE','12999',jdecode('HiramBio'),jdecode(''),'/12550/12999.html','false',[],''],
		['PAGE','13020',jdecode('HiramcitoBio'),jdecode(''),'/12550/13020.html','false',[],''],
		['PAGE','13104',jdecode('LaurentBio'),jdecode(''),'/12550/13104.html','false',[],'']
	],''],
	['PAGE','3427',jdecode('Eventos+recientes'),jdecode(''),'/3427.html','true',[],''],
	['PAGE','6001',jdecode('Prensa+y+otros+medios'),jdecode(''),'/6001.html','true',[],''],
	['PAGE','3469',jdecode('Blog'),jdecode(''),'/3469.html','true',[],''],
	['PAGE','3448',jdecode('Compras+en+l%C3%ADnea'),jdecode(''),'/3448.html','true',[],''],
	['PAGE','3511',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/3511.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Unity';
theSitetree.paletteFamily='678C3C';
theSitetree.keyvisualId='11822';
theSitetree.keyvisualName='kv_11822.jpg';
theSitetree.fontsetId='33135';
theSitetree.graphicsetId='14074';
theSitetree.contentColor='363636';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Unity',
				paletteFamily: 	'678C3C',
				keyvisualId: 	'11822',
				keyvisualName: 	'kv_11822.jpg',
				fontsetId: 		'33135',
				graphicsetId: 	'14074',
				contentColor: 	'363636',
				contentBGColor: 'FFFFFF',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20101227-154704'
};
webappMappings['4001']=webappMappings['4001-17979509']={
webappId:    '4001',
documentId:  '3448',
internalId:  '17979509',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-368']={
webappId:    '7050',
documentId:  '3469',
internalId:  '368',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-1754']={
webappId:    '7008',
documentId:  '3511',
internalId:  '1754',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3301',
internalId:  '',
customField: '20100112-002015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3322',
internalId:  '',
customField: '20101227-153522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3343',
internalId:  '',
customField: '20100114-140823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3364',
internalId:  '',
customField: '20100114-140842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3385',
internalId:  '',
customField: '20100215-201522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3406',
internalId:  '',
customField: '20100121-135133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3427',
internalId:  '',
customField: '20100114-141043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3448',
internalId:  '',
customField: '20100211-161103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3469',
internalId:  '',
customField: '20100109-043651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12499',
internalId:  '',
customField: '20110515-132000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3511',
internalId:  '',
customField: '20100109-131042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20101227-153932'
};
webappMappings['7060']=webappMappings['7060-6a84b0b2c0e2a395407cf7383c8d556c']={
webappId:    '7060',
documentId:  '3427',
internalId:  '6a84b0b2c0e2a395407cf7383c8d556c',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12550',
internalId:  '',
customField: '20101227-154616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13062',
internalId:  '',
customField: '20100217-152211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13083',
internalId:  '',
customField: '20100114-130329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12999',
internalId:  '',
customField: '20110117-020203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13020',
internalId:  '',
customField: '20100111-052232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13104',
internalId:  '',
customField: '20100121-134214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13041',
internalId:  '',
customField: '20100207-220241'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INLEG9';
var companyName   = 'Letra+2+Editores';
var htmlTitle	  = 'Letra+2+Editores';
var metaKeywords  = 'editorial%2C+Puerto+Rico%2C+libros%2C+puertorrique%C3%B1o%2C+puertorrique%C3%B1a%2C+Arte+del+cocinao%2C+Ave+del+amanecer%2C+Primer+viernes%2C+Marido+de+su+amante%2C+editores%2C+Al+otro+lado+del+mundo%2C+Medinaciones%2C+Alberto+Medina+Carrero%2C+Hiram+S%C3%A1nchez+Mart%C3%ADnez%2C+Cuesta+de+los+jud%C3%ADos+n%C3%BAmero+8%2C+Invenci%C3%B3n+del+desencanto%2C+Amsterdam+a+Viena';
var metaContents  = 'P%C3%A1gina+web+de+Letra+2+Editores%2C+joven+editorial+puertorrique%C3%B1a+de+Alberto+Medina+Carrero+e+Hiram+S%C3%A1nchez+Mart%C3%ADnez';
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();
};

