/* [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','4901',jdecode('Inicio'),jdecode(''),'/4901.html','true',[],''],
	['PAGE','20001',jdecode('Sistemas+ERP'),jdecode(''),'/20001.html','true',[],''],
	['PAGE','13701',jdecode('Soluciones'),jdecode(''),'/13701/index.html','true',[ 
		['PAGE','19301',jdecode('Soluciones+ERP'),jdecode(''),'/13701/19301.html','true',[],''],
		['PAGE','19322',jdecode('Soluciones+CRM+y+POS'),jdecode(''),'/13701/19322.html','true',[],''],
		['PAGE','33701',jdecode('Soluciones+MED+y+MLM'),jdecode(''),'/13701/33701.html','true',[],''],
		['PAGE','19343',jdecode('Servicios'),jdecode(''),'/13701/19343.html','true',[],''],
		['PAGE','19801',jdecode('Giros+e+Industrias'),jdecode(''),'/13701/19801.html','true',[],''],
		['PAGE','19822',jdecode('Garant%C3%ADa'),jdecode(''),'/13701/19822.html','true',[],'']
	],''],
	['PAGE','33501',jdecode('%2B+Informaci%C3%B3n'),jdecode(''),'/33501/index.html','true',[ 
		['PAGE','19501',jdecode('Documentaci%C3%B3n'),jdecode(''),'/33501/19501.html','true',[],''],
		['PAGE','35001',jdecode('Datos+T%C3%A9cnicos'),jdecode(''),'/33501/35001.html','true',[],'']
	],''],
	['PAGE','13722',jdecode('Soporte'),jdecode(''),'/13722/index.html','true',[ 
		['PAGE','28701',jdecode('Solicitud+de+Soporte'),jdecode(''),'/13722/28701.html','true',[],''],
		['PAGE','19522',jdecode('Solicitud+de+Demo'),jdecode(''),'/13722/19522.html','true',[],'']
	],''],
	['PAGE','13785',jdecode('Empresa'),jdecode(''),'/13785/index.html','true',[ 
		['PAGE','13827',jdecode('Nuestro+Equipo'),jdecode(''),'/13785/13827.html','true',[],''],
		['PAGE','13806',jdecode('Historia'),jdecode(''),'/13785/13806.html','true',[],''],
		['PAGE','19543',jdecode('Como+Contactarnos'),jdecode(''),'/13785/19543.html','true',[],''],
		['PAGE','19843',jdecode('T%C3%A9rminos+de+Uso'),jdecode(''),'/13785/19843.html','true',[],'']
	],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1753';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1753',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20090905-081735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20090820-081606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20090905-063850'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20090905-061147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13722',
internalId:  '',
customField: '20090905-053740'
};
webappMappings['7008']=webappMappings['7008-4468']={
webappId:    '7008',
documentId:  '19522',
internalId:  '4468',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19522',
internalId:  '',
customField: '20090827-115829'
};
webappMappings['1002']=webappMappings['1002-28701ahw050inlb5l']={
webappId:    '1002',
documentId:  '28701',
internalId:  '28701ahw050inlb5l',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20090905-060954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20090831-140858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19322',
internalId:  '',
customField: '20090825-135737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19343',
internalId:  '',
customField: '20090829-075831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20090905-053548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19822',
internalId:  '',
customField: '20090820-080758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13785',
internalId:  '',
customField: '20090826-205741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13827',
internalId:  '',
customField: '20090905-065956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13806',
internalId:  '',
customField: '20090825-132451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19543',
internalId:  '',
customField: '20090905-081623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19843',
internalId:  '',
customField: '20090820-002022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20090827-115017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20090905-062037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20090822-091206'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLB5L';
var companyName   = 'ERP+Visual+Infinnity';
var htmlTitle	  = 'ERP+Visual+Infinnity+Empresarial';
var metaKeywords  = 'ERP%2C+MRP%2C+CRM%2C+BI%2C+POS%2C+SQL%2C+VFP%2C++Visual+Infinnity+Empresarial%2C+ERP+Visual+Infinnity%2C+Adria+CRM%2C+ERP+para+PYMES%2C+ERP+Guadalajara%2C+ERP+Mexico%2C+Soluciones+POS+de+Punto+de+Venta%2C+desarrollos+a+la+medida+y+programaci%C3%B3n+web.';
var metaContents  = 'Visual+Infinnity+Empresarial%2C+el+mejor+sistema+de+gesti%C3%B3n+ERP+para+la+Administraci%C3%B3n+Exitosa+de+Empresas+PYME.+Es+un+ERP+que+cubre+todas+las+operaciones+de+la+organizaci%C3%B3n%3A+finanzas%2C+contabilidad%2C+manejo+de+inventarios%2C+procesos+de+manufactura%2C+recursos+humanos%2C+comercializaci%C3%B3n%2C+distribuci%C3%B3n+entre+otros%2C+que+le+permite+al+empresario+y+directivos%2C+conocer+en+cualquier+momento+el+estado+del+negocio+%28cuenta+con+m%C3%A1s+de+38+m%C3%B3dulos%29.+Dise%C3%B1ado+para+la+empresa+PyMe+mexicana.';
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();
};
