/* [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','2747',jdecode('AC+Lorca'),jdecode(''), jdecode('%2F2747.html'), 'true',[],'',''],
	['PAGE','2799',jdecode('Fotos'),jdecode(''), jdecode('%2F2799.html'), 'true',[],'',''],
	['PAGE','2852',jdecode('Hazte+Socio'),jdecode(''), jdecode('%2F2852.html'), 'true',[],'',''],
	['PAGE','14401',jdecode('Nuestros+Pilotos'),jdecode(''), jdecode('%2F14401.html'), 'true',[],'',''],
	['PAGE','25201',jdecode('Cursos+de+conduccion'),jdecode(''), jdecode('%2F25201.html'), 'true',[],'',''],
	['PAGE','25222',jdecode('Contacto'),jdecode(''), jdecode('%2F25222.html'), 'true',[],'',''],
	['PAGE','25243',jdecode('calendario+farmu'),jdecode(''), jdecode('%2F25243.html'), 'true',[],'',''],
	['PAGE','25264',jdecode('resultados'),jdecode(''), jdecode('%2F25264.html'), 'true',[],'',''],
	['PAGE','2831',jdecode('Enlaces+de+Interes'),jdecode(''), jdecode('%2F2831.html'), 'true',[],'',''],
	['PAGE','49901',jdecode('FOTOS+Y+EVENTOS'),jdecode(''), jdecode('%2F49901.html'), 'true',[],'',''],
	['PAGE','61101',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''), jdecode('%2F61101%2Findex.html'), 'true',[ 
		['PAGE','61122',jdecode('Historia'),jdecode(''), jdecode('%2F61101%2F61122.html'), 'true',[],'',''],
		['PAGE','61143',jdecode('Nuestra+direcci%C3%B3n'),jdecode(''), jdecode('%2F61101%2F61143.html'), 'true',[],'',''],
		['PAGE','61164',jdecode('Estatutos'),jdecode(''), jdecode('%2F61101%2F61164.html'), 'true',[],'',''],
		['PAGE','61185',jdecode('Bolet%C3%ADn+del+club'),jdecode(''), jdecode('%2F61101%2F61185.html'), 'true',[],'',''],
		['PAGE','61206',jdecode('Nuestro+equipo'),jdecode(''), jdecode('%2F61101%2F61206.html'), 'true',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'piensa',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'290',
				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:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-b6df9ebf970e6908fd2d823b8fef4004']={
webappId:    '7060',
documentId:  '2799',
internalId:  'b6df9ebf970e6908fd2d823b8fef4004',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25243',
internalId:  '',
customField: '20111013-153647'
};
webappMappings['7002']=webappMappings['7002-4119']={
webappId:    '7002',
documentId:  '2831',
internalId:  '4119',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-4148']={
webappId:    '7008',
documentId:  '2852',
internalId:  '4148',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2747',
internalId:  '',
customField: '20120207-204950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25264',
internalId:  '',
customField: '20091109-184004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2799',
internalId:  '',
customField: '20111007-160047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25222',
internalId:  '',
customField: '20100826-170314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2831',
internalId:  '',
customField: '20111129-135316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2852',
internalId:  '',
customField: '20090620-071356'
};
webappMappings['1501']=webappMappings['1501-8554433']={
webappId:    '1501',
documentId:  '2747',
internalId:  '8554433',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2747',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20110606-155633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20091026-190451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20100826-185005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61122',
internalId:  '',
customField: '20100127-161157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49901',
internalId:  '',
customField: '20091110-144320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61143',
internalId:  '',
customField: '20100127-161157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61164',
internalId:  '',
customField: '20100127-161157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61185',
internalId:  '',
customField: '20100127-161157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61206',
internalId:  '',
customField: '20100127-161157'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INL053';
var companyName   = '+Automovil+Club+de+Lorca';
var htmlTitle	  = 'Automovil+Club+de+Lorca';
var metaKeywords  = 'rallye+auto+cross+lorca+campeonato+rally+region+murcia';
var metaContents  = 'automovil+club+de+lorca';
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();
};

