/* [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 theSitetree=[ 
	['PAGE','501',jdecode('INICIO'),jdecode(''),'/501.html','true',[],''],
	['PAGE','573',jdecode('APLICACIONES'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','552',jdecode('PORTAL+WEB+DE+DESPACHO'),jdecode(''),'/573/552.html','true',[],''],
		['PAGE','783',jdecode('PORTAL+WEB+M%C3%93VIL'),jdecode(''),'/573/783.html','true',[],''],
		['PAGE','6701',jdecode('ADMIN+PWD'),jdecode(''),'/573/6701.html','true',[],''],
		['PAGE','6722',jdecode('GUIAS'),jdecode(''),'/573/6722.html','true',[],''],
		['PAGE','16201',jdecode('MI-AUTO'),jdecode(''),'/573/16201.html','true',[],''],
		['PAGE','20901',jdecode('ONLINE-TRACK'),jdecode(''),'/573/20901.html','true',[],'']
	],''],
	['PAGE','720',jdecode('EQUIPOS+GPS'),jdecode(''),'/720/index.html','true',[ 
		['PAGE','6743',jdecode('SKYPATROL'),jdecode(''),'/720/6743.html','true',[],''],
		['PAGE','20922',jdecode('DCT'),jdecode(''),'/720/20922.html','true',[],''],
		['PAGE','20943',jdecode('PROTOS'),jdecode(''),'/720/20943.html','true',[],'']
	],''],
	['PAGE','741',jdecode('EQUIPOS+COMUNICACI%C3%93N'),jdecode(''),'/741/index.html','true',[ 
		['PAGE','762',jdecode('WESTINGHOUSE'),jdecode(''),'/741/762.html','true',[],'']
	],''],
	['PAGE','5201',jdecode('CONT%C3%81CTANOS'),jdecode(''),'/5201.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2446';
theSitetree.keyvisualName='business.jpg';
theSitetree.fontsetId='405';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2446',
				keyvisualName: 	'business.jpg',
				fontsetId: 		'405',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2118']={
webappId:    '7008',
documentId:  '5201',
internalId:  '2118',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20081227-175040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20081227-172355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20070724-165743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '783',
internalId:  '',
customField: '20070724-165646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20070724-165608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20070724-170231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20081227-170710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20081227-174005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20081227-171008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20081227-152515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20081227-164725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20943',
internalId:  '',
customField: '20081227-164637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '741',
internalId:  '',
customField: '20070724-180304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20080707-220610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20081227-173608'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INL16L';
var companyName   = 'Soluciones+en+Comunicaci%C3%B3n';
var htmlTitle	  = 'avilSAT';
var metaKeywords  = 'LOCALIZACI%C3%93N%2C+MAPAS%2C+VISUALIZACION%2C++VEHICULAR%2C+TRANSPORTE%2C+GPS%2C+SATELITAL%2C+TELECOMUNICACIONES%2C+RASTREO%2C+TECNOLOG%C3%8DA%2C+MOVIL%2C+++DESARROLLO%2C+SISTEMAS%2C+ENFORA%2CSKYPATROL%2C+WESCOR%2C++WESTINGHOUSE%2C+DECA%2C+AVILSAT%2C+PROTOS%2C+ALCOM%2C+HANDHELP%2C+CONTROL+DE+RUTAS%2C++CONTROL+DE+TRANSPORTE%2C++CONTROL+DE+MOVIL%2C+EQUIPO%2C+SENSOR%2C+';
var metaContents  = 'LOCALIZACI%C3%93N%2C+MAPAS%2C+VISUALIZACION%2C++VEHICULAR%2C+TRANSPORTE%2C+GPS%2C+SATELITAL%2C+TELECOMUNICACIONES%2C+RASTREO%2C+TECNOLOG%C3%8DA%2C+MOVIL%2C+++DESARROLLO%2C+SISTEMAS%2C+ENFORA%2CSKYPATROL%2C+WESCOR%2C++WESTINGHOUSE%2C+DECA%2C+AVILSAT%2C+PROTOS%2C+ALCOM%2C+HANDHELP%2C+CONTROL+DE+RUTAS%2C++CONTROL+DE+TRANSPORTE%2C++CONTROL+DE+MOVIL%2C+EQUIPO%2C+SENSOR%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();
};
