/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','11033',jdecode('Nuestros+logos'),jdecode(''),'/11033.html','true',[],'',''],
	['PAGE','11126',jdecode('Servicios'),jdecode(''),'/11126.html','true',[],'','']];
var siteelementCount=3;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1982';
theSitetree.keyvisualName='microchips.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1982',
				keyvisualName: 	'microchips.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'383',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11126',
internalId:  '',
customField: '20070525-112248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11033',
internalId:  '',
customField: '20070525-112248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20070525-100822'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INE809';
var companyName   = 'INAPEL+INGENIER%C3%8DA+S.A.+DE+C.V.';
var htmlTitle	  = 'INAPEL+INGENIER%C3%8DA+S.A.+DE+C.V.';
var metaKeywords  = 'INAPEL+servicios+y+equipos+en+media+y+baja+tensi%C3%B3n%2C+subestaciones+el%C3%A9ctricas%2C+transformadores+de+potencia%2C+centros+de+control+de+motores%2C+contactores%2C+arrancadores%2C+interruptores+termomagn%C3%A9ticos+y+electromagn%C3%A9ticos%2C+dise%C3%B1o+de+l%C3%B3gicas+de+control+y+protecci%C3%B3n+optimizaci%C3%B3n+de+los+procesos+productivos+SIEMENS+asesor%C3%ADas%2C+proyectos+y+dise%C3%B1os+de+ingenier%C3%ADa%2C+instalaciones+el%C3%A9ctricas+de+fuerza+y+alumbrado%2C+mantenimiento+preventivo+y+correctivo+a+transformadores%2C+subestaciones%2C+interruptores+electromagn%C3%A9ticos%2C+estudios+y+peritajes+el%C3%A9ctricos%2C+tr%C3%A1mites+ante+compa%C3%B1%C3%ADa+de+CFE%2C+estudios+y+an%C3%A1lisis+de+la+calidad+de+la+energ%C3%ADa%2C+correcci%C3%B3n+del+factor+de+potencia%2C+termograf%C3%ADas+y+vibraciones';
var metaContents  = 'INAPEL+servicios+y+equipos+en+media+y+baja+tensi%C3%B3n%2C+subestaciones+el%C3%A9ctricas%2C+transformadores+de+potencia%2C+centros+de+control+de+motores%2C+contactores%2C+arrancadores%2C+interruptores+termomagn%C3%A9ticos+y+electromagn%C3%A9ticos%2C+dise%C3%B1o+de+l%C3%B3gicas+de+control+y+protecci%C3%B3n+optimizaci%C3%B3n+de+los+procesos+productivos+SIEMENS+asesor%C3%ADas%2C+proyectos+y+dise%C3%B1os+de+ingenier%C3%ADa%2C+instalaciones+el%C3%A9ctricas+de+fuerza+y+alumbrado%2C+mantenimiento+preventivo+y+correctivo+a+transformadores%2C+subestaciones%2C+interruptores+electromagn%C3%A9ticos%2C+estudios+y+peritajes+el%C3%A9ctricos%2C+tr%C3%A1mites+ante+compa%C3%B1%C3%ADa+de+CFE%2C+estudios+y+an%C3%A1lisis+de+la+calidad+de+la+energ%C3%ADa%2C+correcci%C3%B3n+del+factor+de+potencia%2C+termograf%C3%ADas+y+vibraciones';
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();
};
