/* [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','4650',jdecode('INICIO'),jdecode(''),'/4650.html','true',[],'',''],
	['PAGE','39401',jdecode('EL+CLUB'),jdecode(''),'/39401/index.html','true',[ 
		['PAGE','39428',jdecode('%C2%BFD%C3%93NDE+ESTAMOS%3F'),jdecode(''),'/39401/39428.html','true',[],'',''],
		['PAGE','148282',jdecode('%C2%BFC%C3%93MO+LLEGAR%3F'),jdecode(''),'/39401/148282.html','true',[],'',''],
		['PAGE','41527',jdecode('LA+SALA'),jdecode(''),'/39401/41527.html','true',[],'',''],
		['PAGE','39509',jdecode('EL+T%C3%89CNICO'),jdecode(''),'/39401/39509.html','true',[],'','']
	],'',''],
	['PAGE','49032',jdecode('CLASES+Y+HORARIOS'),jdecode(''),'/49032/index.html','true',[ 
		['PAGE','39536',jdecode('DE+5+A+7+A%C3%91OS'),jdecode(''),'/49032/39536.html','true',[],'',''],
		['PAGE','101282',jdecode('DE+8+A+12+A%C3%91OS'),jdecode(''),'/49032/101282.html','true',[],'',''],
		['PAGE','44001',jdecode('JUVENILES'),jdecode(''),'/49032/44001.html','true',[],'',''],
		['PAGE','43974',jdecode('ADULTOS'),jdecode(''),'/49032/43974.html','true',[],'',''],
		['PAGE','152882',jdecode('POULES'),jdecode(''),'/49032/152882.html','true',[],'','']
	],'',''],
	['PAGE','112882',jdecode('LOS+BLASONES'),jdecode(''),'/112882.html','true',[],'',''],
	['PAGE','49059',jdecode('CLASIFICACIONES'),jdecode(''),'/49059/index.html','true',[ 
		['PAGE','84184',jdecode('NACIONAL'),jdecode(''),'/49059/84184.html','true',[],'',''],
		['PAGE','84491',jdecode('REGIONAL'),jdecode(''),'/49059/84491.html','true',[],'',''],
		['PAGE','112582',jdecode('SALA'),jdecode(''),'/49059/112582.html','true',[],'','']
	],'',''],
	['PAGE','152903',jdecode('CALENDARIO'),jdecode(''),'/152903.html','true',[],'',''],
	['PAGE','39806',jdecode('ENLACES'),jdecode(''),'/39806.html','true',[],'',''],
	['PAGE','47610',jdecode('FOTOS+Y+VIDEOS'),jdecode(''),'/47610.html','true',[],'',''],
	['PAGE','65864',jdecode('LIBRO+DE+VISITAS'),jdecode(''),'/65864/index.html','true',[ 
		['PAGE','65865',jdecode('LEER+LIBRO'),jdecode(''),'/65864/65865.html','false',[],'','']
	],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-35aba461d1c2dc8d292acb72a9bd52fa']={
webappId:    '7060',
documentId:  '47610',
internalId:  '35aba461d1c2dc8d292acb72a9bd52fa',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4650',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-65864aas010in2y0f']={
webappId:    '1002',
documentId:  '65864',
internalId:  '65864aas010in2y0f',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65865',
internalId:  '',
customField: '20050416-102645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4650',
internalId:  '',
customField: '20100307-192231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65864',
internalId:  '',
customField: '20050416-102645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20080502-105719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39428',
internalId:  '',
customField: '20080501-033052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41527',
internalId:  '',
customField: '20080514-120608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39509',
internalId:  '',
customField: '20080502-104601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49032',
internalId:  '',
customField: '20080501-163221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47610',
internalId:  '',
customField: '20100212-034039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39536',
internalId:  '',
customField: '20081022-123026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101282',
internalId:  '',
customField: '20081022-123231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20090205-115912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43974',
internalId:  '',
customField: '20090205-120458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112882',
internalId:  '',
customField: '20100210-183404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49059',
internalId:  '',
customField: '20090210-115636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84184',
internalId:  '',
customField: '20100219-083317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84491',
internalId:  '',
customField: '20100219-194455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112582',
internalId:  '',
customField: '20090308-194941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39806',
internalId:  '',
customField: '20090909-170238'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '148282',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148282',
internalId:  '',
customField: '20080502-202011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152882',
internalId:  '',
customField: '20081022-124003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152903',
internalId:  '',
customField: '20100219-083638'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010IN2Y0F';
var companyName   = 'CLUB+ESGRIMA+LEGIO+VII';
var htmlTitle	  = 'CLUB+DE+ESGRIMA+LEGIO+VII+-+LE%C3%93N';
var metaKeywords  = '';
var metaContents  = 'Esgrima+Legio+VII+se+encuentra+en+el+centro+de+Le%C3%B3n%2C+en+la+calle+Col%C3%B3n%2C+17.';
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();
};
