/* [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','501',jdecode('Bienvenido'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','218523',jdecode('Blog+Vida+a+Intervalos'),jdecode(''),'/218523/index.html','true',[ 
		['PAGE','208223',jdecode('Archivo+nov+2008-abril+2009'),jdecode(''),'/218523/208223.html','true',[],'',''],
		['PAGE','177812',jdecode('Archivo+enero-septiembre+2008'),jdecode(''),'/218523/177812.html','true',[],'',''],
		['PAGE','65206',jdecode('Comentar'),jdecode(''),'/218523/65206.html','true',[],'','']
	],'',''],
	['PAGE','57964',jdecode('Movimiento+Slow'),jdecode(''),'/57964.html','true',[],'',''],
	['PAGE','60511',jdecode('Enlaces'),jdecode(''),'/60511.html','true',[],'',''],
	['PAGE','60532',jdecode('Contacta'),jdecode(''),'/60532.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Clearline';
theSitetree.paletteFamily='B71602';
theSitetree.keyvisualId='3298';
theSitetree.keyvisualName='kv_3298.jpg';
theSitetree.fontsetId='10421';
theSitetree.graphicsetId='10715';
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: 			'Clearline',
				paletteFamily: 	'B71602',
				keyvisualId: 	'3298',
				keyvisualName: 	'kv_3298.jpg',
				fontsetId: 		'10421',
				graphicsetId: 	'10715',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'B71602',
				e_color: 		'989696',
				f_color: 		'989696',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-65206aars20in35rj']={
webappId:    '1002',
documentId:  '65206',
internalId:  '65206aars20in35rj',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100307-024426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '218523',
internalId:  '',
customField: '20090610-144627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60511',
internalId:  '',
customField: '20100327-181524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65206',
internalId:  '',
customField: '20071020-174140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '208223',
internalId:  '',
customField: '20090508-005030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57964',
internalId:  '',
customField: '20100327-181940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60532',
internalId:  '',
customField: '20100327-172813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177812',
internalId:  '',
customField: '20090609-152726'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN35RJ';
var companyName   = 'Ana+Isabel+Trigo+C%C3%A1ceres';
var htmlTitle	  = 'Ana+Isabel+Trigo';
var metaKeywords  = 'AnaIsabelTrigo+poes%C3%ADa+poemas+literatura+diario+blog+solidaridad+ecolog%C3%ADa';
var metaContents  = 'Ana+Isabel+Trigo+C%C3%A1ceres';
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();
};
