/* [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','301',jdecode('Inicio'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','23401',jdecode('EDITORIAL'),jdecode(''),'/23401/index.html','true',[ 
		['PAGE','4801',jdecode('LOS+PAPELES+DEL+SITIO'),jdecode(''),'/23401/4801.html','true',[],'',''],
		['PAGE','6201',jdecode('1.+La+superstici%C3%B3n+del+divorcio'),jdecode(''),'/23401/6201.html','true',[],'',''],
		['PAGE','6222',jdecode('2.+Puntos+suspensivos'),jdecode(''),'/23401/6222.html','true',[],'',''],
		['PAGE','6243',jdecode('3.+Escolios+escogidos'),jdecode(''),'/23401/6243.html','true',[],'',''],
		['PAGE','9901',jdecode('4.+Virutas+de+taller'),jdecode(''),'/23401/9901.html','true',[],'',''],
		['PAGE','52001',jdecode('5.+M%C3%A1s+virutas+de+taller'),jdecode(''),'/23401/52001.html','true',[],'',''],
		['PAGE','23422',jdecode('OTROS+T%C3%8DTULOS'),jdecode(''),'/23401/23422.html','true',[],'',''],
		['PAGE','23443',jdecode('-+Las+ni%C3%B1as+de+%22El+Altillo%22'),jdecode(''),'/23401/23443.html','true',[],'',''],
		['PAGE','28401',jdecode('-+Una+vida+en+Do%C3%B1ana'),jdecode(''),'/23401/28401.html','true',[],'',''],
		['PAGE','40201',jdecode('-+En+la+cabellera+de+un+cometa'),jdecode(''),'/23401/40201.html','true',[],'',''],
		['PAGE','45101',jdecode('CUADERNOS+DE+POEMAS'),jdecode(''),'/23401/45101.html','true',[],'',''],
		['PAGE','45501',jdecode('-+Ap%C3%B3crifo+alem%C3%A1n'),jdecode(''),'/23401/45501.html','true',[],'',''],
		['PAGE','45122',jdecode('COLECCI%C3%93N+HAIKU'),jdecode(''),'/23401/45122.html','true',[],'','']
	],'',''],
	['PAGE','4822',jdecode('SERVICIOS+EDITORIALES'),jdecode(''),'/4822.html','true',[],'',''],
	['PAGE','32201',jdecode('LIBRER%C3%8DA'),jdecode(''),'/32201/index.html','true',[ 
		['PAGE','36501',jdecode('JACINTO+CHOZA'),jdecode(''),'/32201/36501.html','true',[],'',''],
		['PAGE','36522',jdecode('La+danza+de+los+%C3%A1rboles'),jdecode(''),'/32201/36522.html','true',[],'','']
	],'',''],
	['PAGE','9243',jdecode('-++-++-++-++-++-++-++-++-++-'),jdecode(''),'/9243.html','true',[],'',''],
	['PAGE','4843',jdecode('Condiciones+de+venta'),jdecode(''),'/4843.html','true',[],'',''],
	['PAGE','8401',jdecode('Distribuci%C3%B3n+a+librer%C3%ADas'),jdecode(''),'/8401.html','true',[],'',''],
	['PAGE','4885',jdecode('Contacto'),jdecode(''),'/4885.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10893';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100327-182406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23401',
internalId:  '',
customField: '20100327-005523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100327-175331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23422',
internalId:  '',
customField: '20080916-002910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23443',
internalId:  '',
customField: '20080916-005945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20080916-010054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20080916-005640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6222',
internalId:  '',
customField: '20080916-005723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6243',
internalId:  '',
customField: '20090319-080435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100326-215524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20090219-071002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20080115-034647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36501',
internalId:  '',
customField: '20080807-175606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20070912-125143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20080115-032124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4885',
internalId:  '',
customField: '20071015-121204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20090219-011416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36522',
internalId:  '',
customField: '20080807-174823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20080916-010243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45101',
internalId:  '',
customField: '20080917-131013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45501',
internalId:  '',
customField: '20080917-133054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45122',
internalId:  '',
customField: '20090219-013016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52001',
internalId:  '',
customField: '20100327-174935'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN3513';
var companyName   = 'LOS+PAPELES+DEL+SITIO';
var htmlTitle	  = 'Los+Papeles+del+Sitio';
var metaKeywords  = '';
var metaContents  = '';
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();
};
