/* [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','4394',jdecode('Home'),jdecode(''),'/4394.html','true',[],'',''],
	['PAGE','95001',jdecode('TODO+CyL+n%C2%BA16'),jdecode(''),'/95001.html','true',[],'',''],
	['PAGE','89901',jdecode('TODO+CyL+n%C2%BA+15'),jdecode(''),'/89901.html','true',[],'',''],
	['PAGE','87601',jdecode('TODO+CyL+n%C2%BA14'),jdecode(''),'/87601.html','true',[],'',''],
	['PAGE','84901',jdecode('TODO+CyL+n%C2%BA13'),jdecode(''),'/84901.html','true',[],'',''],
	['PAGE','72601',jdecode('TODO+CyL+n%C2%BA12'),jdecode(''),'/72601.html','true',[],'',''],
	['PAGE','65701',jdecode('TODO+CyL+n%C2%BA11'),jdecode(''),'/65701.html','true',[],'',''],
	['PAGE','50401',jdecode('TODO+CyL+n%C2%BA10'),jdecode(''),'/50401.html','true',[],'',''],
	['PAGE','46701',jdecode('TODO+CyL+n%C2%BA9'),jdecode(''),'/46701.html','true',[],'',''],
	['PAGE','35601',jdecode('TODO+CyL+n%C2%BA8'),jdecode(''),'/35601.html','true',[],'',''],
	['PAGE','21202',jdecode('TODO+CyL+n%C2%BA7'),jdecode(''),'/21202.html','true',[],'',''],
	['PAGE','19602',jdecode('TODO+CyL+n%C2%BA6'),jdecode(''),'/19602.html','true',[],'',''],
	['PAGE','18102',jdecode('TODO+CyL+n%C2%BA5'),jdecode(''),'/18102.html','true',[],'',''],
	['PAGE','16702',jdecode('TODO+CyL+n%C2%BA4'),jdecode(''),'/16702.html','true',[],'',''],
	['PAGE','8502',jdecode('TODO+CyL+n%C2%BA3'),jdecode(''),'/8502.html','true',[],'',''],
	['PAGE','7002',jdecode('TODO+CyL+N%C2%BA2'),jdecode(''),'/7002.html','true',[],'',''],
	['PAGE','4451',jdecode('TODO+CyL+N%C2%BA1'),jdecode(''),'/4451.html','true',[],'',''],
	['PAGE','15902',jdecode('FOROS'),jdecode(''),'/15902.html','true',[],'',''],
	['PAGE','4478',jdecode('Publicidad'),jdecode(''),'/4478.html','true',[],'',''],
	['PAGE','8051',jdecode('Suscripciones'),jdecode(''),'/8051.html','true',[],'',''],
	['PAGE','16002',jdecode('Galer%C3%ADa+de+Fotos'),jdecode(''),'/16002.html','true',[],'',''],
	['PAGE','19054',jdecode('Libro+de+visitas'),jdecode(''),'/19054/index.html','true',[ 
		['PAGE','19055',jdecode('Leer+el+libro+de+Visitas'),jdecode(''),'/19054/19055.html','false',[],'','']
	],'',''],
	['PAGE','20602',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''),'/20602.html','true',[],'',''],
	['PAGE','45801',jdecode('C%C3%B3mo+encontrarnos'),jdecode(''),'/45801.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Streamline';
theSitetree.paletteFamily='AC6EFD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10454';
theSitetree.graphicsetId='10862';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Streamline',
				paletteFamily: 	'AC6EFD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10454',
				graphicsetId: 	'10862',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5D0ACC',
				e_color: 		'ACABAB',
				f_color: 		'626161',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4394',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4394',
internalId:  '',
customField: '20100324-135229'
};
webappMappings['7060']=webappMappings['7060-2eb7c223280f8551b8b50f7e2cfb9be2']={
webappId:    '7060',
documentId:  '16002',
internalId:  '2eb7c223280f8551b8b50f7e2cfb9be2',
customField: 'language:es;country:ES;'
};
webappMappings['1003']=webappMappings['1003-aas010in2hdv108c35bfdbc']={
webappId:    '1003',
documentId:  '15902',
internalId:  'aas010in2hdv108c35bfdbc',
customField: 'es:ES:'
};
webappMappings['1002']=webappMappings['1002-19054aas010in2hdv']={
webappId:    '1002',
documentId:  '19054',
internalId:  '19054aas010in2hdv',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '45801',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20071123-142153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46701',
internalId:  '',
customField: '20080512-092455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21202',
internalId:  '',
customField: '20070904-101956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19602',
internalId:  '',
customField: '20070514-115905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18102',
internalId:  '',
customField: '20070320-180204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16702',
internalId:  '',
customField: '20061113-130033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8502',
internalId:  '',
customField: '20060126-191848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7002',
internalId:  '',
customField: '20060113-113617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4451',
internalId:  '',
customField: '20051014-190742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15902',
internalId:  '',
customField: '20060131-124933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4478',
internalId:  '',
customField: '20051017-122557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8051',
internalId:  '',
customField: '20060127-111712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16002',
internalId:  '',
customField: '20060131-130051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19054',
internalId:  '',
customField: '20061113-140445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95001',
internalId:  '',
customField: '20100324-142440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20602',
internalId:  '',
customField: '20090817-093247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45801',
internalId:  '',
customField: '20070904-120503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50401',
internalId:  '',
customField: '20080808-123942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65701',
internalId:  '',
customField: '20081121-125434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72601',
internalId:  '',
customField: '20090402-134433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84901',
internalId:  '',
customField: '20090629-090817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87601',
internalId:  '',
customField: '20091118-104308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89901',
internalId:  '',
customField: '20100324-135417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19055',
internalId:  '',
customField: '20061113-140445'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010IN2HDV';
var companyName   = 'La+revista+de+Castilla+y+Le%C3%B3n';
var htmlTitle	  = 'TODO+Castilla+y+Le%C3%B3n.+Revista+de+informaci%C3%B3n+de+Castilla+y+Le%C3%B3n';
var metaKeywords  = 'Todo+Castilla+y+Le%EF%BF%BDnInformaci%EF%BF%BDn+Castilla+y+Le%EF%BF%BDnNoticias+Castilla+y+Le%EF%BF%BDnReportajes+de+Castilla+y+Le%EF%BF%BDnBodegaVinosTurismoRegi%EF%BF%BDnSanidadDeportesSaludEmpresaPatrimonio';
var metaContents  = 'Todo+Castilla+y+Le%EF%BF%BDnInformaci%EF%BF%BDn+Castilla+y+Le%EF%BF%BDnNoticias+Castilla+y+Le%EF%BF%BDnReportajes+de+Castilla+y+Le%EF%BF%BDnBodegaVinosTurismoRegi%EF%BF%BDnSanidadDeportes';
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();
};
