/* [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','4598',jdecode('Inicio'),jdecode(''),'/4598.html','true',[],''],
	['PAGE','4655',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''),'/4655.html','true',[],''],
	['PAGE','6203',jdecode('Productos'),jdecode(''),'/6203.html','true',[],''],
	['PAGE','6230',jdecode('Servicios'),jdecode(''),'/6230.html','true',[],''],
	['PAGE','6257',jdecode('Aduana+M%C3%A9xico'),jdecode(''),'/6257.html','true',[],''],
	['PAGE','6284',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/6284.html','true',[],''],
	['PAGE','7302',jdecode('Galer%C3%ADa+Portuaria'),jdecode(''),'/7302.html','true',[],''],
	['PAGE','10584',jdecode('Leyes+Federales+Vigentes'),jdecode(''),'/10584.html','true',[],''],
	['PAGE','10724',jdecode('Informaci%C3%B3n%3A+Comercio+Exterior'),jdecode(''),'/10724.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1751';
theSitetree.keyvisualName='gericht.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='353';
theSitetree.contentColor='70A3FF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1751',
				keyvisualName: 	'gericht.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'353',
				contentColor: 	'70A3FF',
				contentBGColor: '003390',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003390',
				b_color: 		'000000',
				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:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-7fadd677897e470eeefb8657bc74c6bf']={
webappId:    '7060',
documentId:  '7302',
internalId:  '7fadd677897e470eeefb8657bc74c6bf',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20060519-131014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20060519-131728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6203',
internalId:  '',
customField: '20060418-101721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6230',
internalId:  '',
customField: '20060519-131821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6257',
internalId:  '',
customField: '20081202-183347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6284',
internalId:  '',
customField: '20081128-150254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7302',
internalId:  '',
customField: '20081204-085057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10584',
internalId:  '',
customField: '20081202-164535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10724',
internalId:  '',
customField: '20081202-104244'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INXLRK';
var companyName   = 'ASESORIA+ADUANAL+';
var htmlTitle	  = 'BIENVENIDOS+ASESORIA+ADUANAL+DE+VERACRUZ';
var metaKeywords  = 'ASESORIA%2CADUANAL%2CADUANAS%2CAGENCIAS%2CADUANALES%2CSERVICIOS%2CCOMERCIO+EXTERIOR%2CLOGISTICA%2CTRANSPORTE%2CMARITIMO%2CNAVIERO%2CAEREO%2CCERTIFICADOS%2CTRAMITES%2CAGENCIA%2CVERACRUZ%2CAGENTE%2CAEREO%2CFERROVIARIO%2CNORMAS%2CLEGISLACION%2CADUANERA%2CEXPORTACION%2CIMPORTACION%2C';
var metaContents  = 'ASESORIA+ADUANAL+DE+SERVICIOS+DE+COMERCIO+EXTERIOR%2C+AGENCIA+ADUANAL';
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();
};
