/* [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','4555',jdecode('Tr1Xal'),jdecode(''),'/4555.html','true',[],'',''],
	['PAGE','5502',jdecode('Mas+que+Trixal'),jdecode(''),'/5502.html','true',[],'',''],
	['PAGE','5902',jdecode('24+a%C3%B1os+24...'),jdecode(''),'/5902.html','true',[],'',''],
	['PAGE','5929',jdecode('Soporte+T%C3%A9cnico+OK'),jdecode(''),'/5929.html','true',[],'',''],
	['PAGE','5983',jdecode('Aliados+y+Amigos'),jdecode(''),'/5983.html','true',[],'',''],
	['PAGE','6010',jdecode('Radio+Pasillo+XT'),jdecode(''),'/6010.html','true',[],'',''],
	['PAGE','5956',jdecode('M%C3%A1s+datos...y+vota'),jdecode(''),'/5956.html','true',[],'',''],
	['PAGE','15210',jdecode('Mundo+WebTx'),jdecode(''),'/15210.html','true',[],'',''],
	['PAGE','141501',jdecode('Tx+cercas...'),jdecode(''),'/141501.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='View';
theSitetree.paletteFamily='ACC0FF';
theSitetree.keyvisualId='11409';
theSitetree.keyvisualName='kv_11409.jpg';
theSitetree.fontsetId='32031';
theSitetree.graphicsetId='13852';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='ACC0FF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'View',
				paletteFamily: 	'ACC0FF',
				keyvisualId: 	'11409',
				keyvisualName: 	'kv_11409.jpg',
				fontsetId: 		'32031',
				graphicsetId: 	'13852',
				contentColor: 	'FFFFFF',
				contentBGColor: 'ACC0FF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-1acfab8645f39726bf77106b5ba22556']={
webappId:    '7060',
documentId:  '141501',
internalId:  '1acfab8645f39726bf77106b5ba22556',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4555',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-16715']={
webappId:    '1501',
documentId:  '4555',
internalId:  '16715',
customField: '1501'
};
webappMappings['7005']=webappMappings['7005-194']={
webappId:    '7005',
documentId:  '5956',
internalId:  '194',
customField: 'language:es;country:ES;'
};
webappMappings['7008']=webappMappings['7008-1780']={
webappId:    '7008',
documentId:  '5929',
internalId:  '1780',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4555',
internalId:  '',
customField: '20100402-211131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5502',
internalId:  '',
customField: '20100402-214938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5902',
internalId:  '',
customField: '20090404-160832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5929',
internalId:  '',
customField: '20100402-212247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5983',
internalId:  '',
customField: '20090303-125552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6010',
internalId:  '',
customField: '20090303-125706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5956',
internalId:  '',
customField: '20090306-215909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15210',
internalId:  '',
customField: '20090404-161410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141501',
internalId:  '',
customField: '20090303-130513'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXSUQ';
var companyName   = 'TRIATLON+XALIXCO...24+a%C3%B1os+y+seguimos%21%21%21';
var htmlTitle	  = 'TRIXAL';
var metaKeywords  = 'trixal%2C+triatlon+xalixco%2C+xalixco%2C+triatlon%2C+triathlon%2C+tx%2C+gustavo+nu%C3%B1o%2C+Trixal%2C+Mexico%2C+mexico%2C+jalisco%2C+Jalisco%2C+guadalajara%2CGuadalajara+2011%2C+trialon';
var metaContents  = 'triatlon+xalixco.+academia+y+elite+triatlon%2C+trixal%2C+mexico%2C+triatlon+M%C3%A9xico';
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();
};
