/* [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','4476',jdecode('Inicio'),jdecode(''),'/4476.html','true',[],'',''],
	['PAGE','58862',jdecode('Noticias'),jdecode(''),'/58862.html','true',[],'',''],
	['PAGE','48931',jdecode('Judo'),jdecode(''),'/48931/index.html','true',[ 
		['PAGE','59668',jdecode('Competiciones+2005'),jdecode(''),'/48931/59668.html','true',[],'',''],
		['PAGE','48985',jdecode('Competiciones+2004'),jdecode(''),'/48931/48985.html','true',[],'','']
	],'',''],
	['PAGE','50495',jdecode('Def.+Personal'),jdecode(''),'/50495.html','true',[],'',''],
	['PAGE','50522',jdecode('Aikido'),jdecode(''),'/50522.html','true',[],'',''],
	['PAGE','50549',jdecode('Karate'),jdecode(''),'/50549/index.html','true',[ 
		['PAGE','131123',jdecode('Enlaces'),jdecode(''),'/50549/131123.html','true',[],'','']
	],'',''],
	['PAGE','58362',jdecode('Gimnasio'),jdecode(''),'/58362.html','true',[],'',''],
	['PAGE','50576',jdecode('Horarios'),jdecode(''),'/50576.html','true',[],'',''],
	['PAGE','116594',jdecode('Fotos'),jdecode(''),'/116594/index.html','true',[ 
		['PAGE','161260',jdecode('Cena+Dic.+2010'),jdecode(''),'/116594/161260.html','true',[],'',''],
		['PAGE','164660',jdecode('Compe.+Dic.+2010'),jdecode(''),'/116594/164660.html','true',[],'',''],
		['PAGE','166060',jdecode('Alumnos'),jdecode(''),'/116594/166060.html','true',[],'','']
	],'',''],
	['PAGE','61562',jdecode('Videos'),jdecode(''),'/61562.html','true',[],'',''],
	['PAGE','59162',jdecode('Sitios+interesantes'),jdecode(''),'/59162.html','true',[],'',''],
	['PAGE','41890',jdecode('Donde+estamos'),jdecode(''),'/41890.html','true',[],'',''],
	['PAGE','49701',jdecode('Instalaciones'),jdecode(''),'/49701.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Triangle';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='12015';
theSitetree.keyvisualName='kv_12015.jpg';
theSitetree.fontsetId='33260';
theSitetree.graphicsetId='14139';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Triangle',
				paletteFamily: 	'000000',
				keyvisualId: 	'12015',
				keyvisualName: 	'kv_12015.jpg',
				fontsetId: 		'33260',
				graphicsetId: 	'14139',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58862',
internalId:  '',
customField: '20101214-230919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4476',
internalId:  '',
customField: '20101222-171735'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4476',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '41890',
internalId:  'location',
customField: 'language:es;country:ES;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-793079']={
webappId:    '1501',
documentId:  '4476',
internalId:  '793079',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166060',
internalId:  '',
customField: '20101223-041840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48931',
internalId:  '',
customField: '20070625-220926'
};
webappMappings['7060']=webappMappings['7060-630a433579800c3cb6c80f4a9afa6728']={
webappId:    '7060',
documentId:  '166060',
internalId:  '630a433579800c3cb6c80f4a9afa6728',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59668',
internalId:  '',
customField: '20070623-231755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48985',
internalId:  '',
customField: '20080930-001255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50495',
internalId:  '',
customField: '20050416-094257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50522',
internalId:  '',
customField: '20050715-233118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50549',
internalId:  '',
customField: '20101222-234601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58362',
internalId:  '',
customField: '20070625-220351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50576',
internalId:  '',
customField: '20101222-234249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131123',
internalId:  '',
customField: '20090217-092618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61562',
internalId:  '',
customField: '20110127-013222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116594',
internalId:  '',
customField: '20110127-005923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59162',
internalId:  '',
customField: '20110127-012121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41890',
internalId:  '',
customField: '20041217-213728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49701',
internalId:  '',
customField: '20050106-234352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161260',
internalId:  '',
customField: '20101222-180937'
};
webappMappings['7060']=webappMappings['7060-5747f22ec8445e29dcc67fe24b563fb5']={
webappId:    '7060',
documentId:  '161260',
internalId:  '5747f22ec8445e29dcc67fe24b563fb5',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-3d501d90f006e90e01a88c03e45f30dc']={
webappId:    '7060',
documentId:  '164660',
internalId:  '3d501d90f006e90e01a88c03e45f30dc',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '164660',
internalId:  '',
customField: '20101222-232610'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010IN27KL';
var companyName   = 'GIMNASIO+ESPORTIU+VALENCIA';
var htmlTitle	  = 'Esportiu+Valencia.+Club+de+Artes+Marciales.';
var metaKeywords  = 'judo%2C+aikido%2C+defensa+personal%2C+karate%2C+artes+marciales';
var metaContents  = 'Club+de+judo';
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();
};

