/* [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('Inicio'),jdecode(''),'/4394.html','true',[],'',''],
	['PAGE','24362',jdecode('Novedades'),jdecode(''),'/24362.html','true',[],'',''],
	['PAGE','128830',jdecode('Compra+-+Venda'),jdecode(''),'/128830.html','true',[],'',''],
	['PAGE','129830',jdecode('Brico-Restauracion'),jdecode(''),'/129830.html','true',[],'',''],
	['PAGE','110730',jdecode('GPS'),jdecode(''),'/110730/index.html','true',[ 
		['PAGE','111130',jdecode('Curso+GPS'),jdecode(''),'/110730/111130.html','true',[],'',''],
		['PAGE','41068',jdecode('Tracks+%26+Waypoints'),jdecode(''),'/110730/41068.html','true',[],'',''],
		['PAGE','125730',jdecode('Mapas'),jdecode(''),'/110730/125730.html','true',[],'','']
	],'',''],
	['PAGE','12209',jdecode('Proximas+Salidas'),jdecode(''),'/12209.html','true',[],'',''],
	['PAGE','76327',jdecode('Hoteles'),jdecode(''),'/76327.html','true',[],'',''],
	['PAGE','128230',jdecode('Foro'),jdecode(''),'/128230.html','true',[],'',''],
	['PAGE','41041',jdecode('Area+de+descarga'),jdecode(''),'/41041/index.html','true',[ 
		['PAGE','35810',jdecode('Videos'),jdecode(''),'/41041/35810.html','true',[],'',''],
		['PAGE','44994',jdecode('Programas'),jdecode(''),'/41041/44994.html','true',[],'','']
	],'',''],
	['PAGE','73036',jdecode('Fotos'),jdecode(''),'/73036.html','true',[],'',''],
	['PAGE','4756',jdecode('El+Equipo'),jdecode(''),'/4756.html','true',[],'',''],
	['PAGE','105906',jdecode('Relatos'),jdecode(''),'/105906.html','true',[],'',''],
	['PAGE','12317',jdecode('Links'),jdecode(''),'/12317.html','true',[],'',''],
	['PAGE','32262',jdecode('Libro+de+Visitas'),jdecode(''),'/32262/index.html','true',[ 
		['PAGE','32263',jdecode('Lleer+el+Libro+de+Visitas'),jdecode(''),'/32262/32263.html','false',[],'','']
	],'',''],
	['PAGE','4783',jdecode('Contactar'),jdecode(''),'/4783/index.html','true',[ 
		['PAGE','71016',jdecode('Contactar+%28follow+up+page%29'),jdecode(''),'/4783/71016.html','false',[],'','']
	],'',''],
	['PAGE','117630',jdecode('Advertencia+Legal'),jdecode(''),'/117630.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Caribic';
theSitetree.paletteFamily='1F7E8F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10419';
theSitetree.graphicsetId='10712';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='B63636';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Caribic',
				paletteFamily: 	'1F7E8F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10419',
				graphicsetId: 	'10712',
				contentColor: 	'FFFFFF',
				contentBGColor: 'B63636',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				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:  '41068',
internalId:  '',
customField: '20090602-121242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35810',
internalId:  '',
customField: '20090602-121721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125730',
internalId:  '',
customField: '20090602-121354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12209',
internalId:  '',
customField: '20090602-121419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24362',
internalId:  '',
customField: '20090602-120637'
};
webappMappings['1002']=webappMappings['1002-32262aas010in2xs7']={
webappId:    '1002',
documentId:  '32262',
internalId:  '32262aas010in2xs7',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41041',
internalId:  '',
customField: '20090602-121648'
};
webappMappings['1003']=webappMappings['1003-aas010in2xs7106b35d51a6']={
webappId:    '1003',
documentId:  '128230',
internalId:  'aas010in2xs7106b35d51a6',
customField: 'es:ES:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4394',
internalId:  '',
customField: '20090605-175353'
};
webappMappings['1501']=webappMappings['1501-1263345']={
webappId:    '1501',
documentId:  '4394',
internalId:  '1263345',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76327',
internalId:  '',
customField: '20090602-121559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44994',
internalId:  '',
customField: '20090602-122041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73036',
internalId:  '',
customField: '20090603-213953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4756',
internalId:  '',
customField: '20090602-122253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105906',
internalId:  '',
customField: '20090602-122315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12317',
internalId:  '',
customField: '20090609-201652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32262',
internalId:  '',
customField: '20090602-122904'
};
webappMappings['7008']=webappMappings['7008-7754']={
webappId:    '7008',
documentId:  '4783',
internalId:  '7754',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4783',
internalId:  '',
customField: '20090602-123002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71016',
internalId:  '',
customField: '20051003-224516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110730',
internalId:  '',
customField: '20090602-120905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111130',
internalId:  '',
customField: '20090602-120953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117630',
internalId:  '',
customField: '20090602-123328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128230',
internalId:  '',
customField: '20090602-121632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128830',
internalId:  '',
customField: '20090602-120731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129830',
internalId:  '',
customField: '20090602-120751'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010IN2XS7';
var companyName   = 'VA+ANEM+TRAIL+GROUP';
var htmlTitle	  = '';
var metaKeywords  = 'va+anem+trail+group+rutas+tunez+quad+4x4+motos+enduro+catalunya+tunissia+tunisia+africa+pirineus+rutes+tunez+aventura+dunas+dunes+rutes+bardenas+reales+cambrils+tortosa+beceite+sant+feliu+de+codines+gps+tracks+waypoints+mapes+garmin+ports+de+beceite+red-racing+red+racing+mipcre+garmin+mapsourse+oziexplorer+red+racing+sabadell+ktm+bombardier+marroc+marruecos+morrocco++bmw+r80+r100+gs+f800+gs++ktm+maroc+redracing+24h+montmelo+apphoto+mipcre+';
var metaContents  = 'Benvinguts+a+Va+Anem%2C+una+pagina+dedicada+al+Off-Road+i+creada+por+un+grup+d%EF%BF%BDamics+amants+de+la+olor+a+gasolina.+Es+poden+trovar+rutes%2C+fotografies%2C+mapes%2C+programes%2C...';
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();
};
