/* [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','501',jdecode('A+E+5'),jdecode(''), jdecode('%2F501%2Findex.html'), 'true',[ 
		['PAGE','552',jdecode('HIST%C3%93RICO'),jdecode(''), jdecode('%2F501%2F552.html'), 'true',[],'',''],
		['PAGE','573',jdecode('LOCALIZA%C3%87%C3%83O'),jdecode(''), jdecode('%2F501%2F573.html'), 'true',[],'',''],
		['PAGE','8401',jdecode('POLITICA'),jdecode(''), jdecode('%2F501%2F8401.html'), 'true',[],'','']
	],'',''],
	['PAGE','8422',jdecode('SERVI%C3%87OS+'),jdecode(''), jdecode('%2F8422%2Findex.html'), 'true',[ 
		['PAGE','37301',jdecode('AUTOMA%C3%87%C3%83O+INDUSTRIAL'),jdecode(''), jdecode('%2F8422%2F37301.html'), 'true',[],'',''],
		['PAGE','10201',jdecode('OTIMIZA%C3%87%C3%83O+DE+ENERGIA'),jdecode(''), jdecode('%2F8422%2F10201.html'), 'true',[],'',''],
		['PAGE','10222',jdecode('P%C3%81RA-RAIOS'),jdecode(''), jdecode('%2F8422%2F10222.html'), 'true',[],'',''],
		['PAGE','10243',jdecode('ILUMINA%C3%87%C3%83O'),jdecode(''), jdecode('%2F8422%2F10243.html'), 'true',[],'',''],
		['PAGE','10285',jdecode('CONTRATOS'),jdecode(''), jdecode('%2F8422%2F10285.html'), 'true',[],'','']
	],'',''],
	['PAGE','21322',jdecode('LINKS'),jdecode(''), jdecode('%2F21322.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='F9C116';
theSitetree.keyvisualId='2459';
theSitetree.keyvisualName='industrie.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='459';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'F9C116',
				keyvisualId: 	'2459',
				keyvisualName: 	'industrie.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'459',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'F9C116',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-6319705']={
webappId:    '1501',
documentId:  '501',
internalId:  '6319705',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20090325-090016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090325-084108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090325-084505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20090325-085820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8422',
internalId:  '',
customField: '20090325-084929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20090325-085117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20081224-095051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10222',
internalId:  '',
customField: '20081224-101030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10243',
internalId:  '',
customField: '20081224-102711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10285',
internalId:  '',
customField: '20081224-103042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21322',
internalId:  '',
customField: '20081224-083354'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVLMI';
var companyName   = 'A+E+5+-+COMERCIAL+EL%C3%89TRICA+++++++++++++';
var htmlTitle	  = 'AE5+-+UMA+EMPRESA+DO+GRUPO+HEXAGONO';
var metaKeywords  = 'El%C3%A9trica%2C+Eletrot%C3%A9cnico%2C+Eletrot%C3%A9cnica%2C+Engenheiro%2C+Engenharia%2C+Eletricista%2C+Instala%C3%A7%C3%A3o%2C+Montagem%2C+Disjuntor%2C+Transformador%2C+Comando%2C+Automa%C3%A7%C3%A3o%2C+Cabina%2C+Prim%C3%A1ria%2C+Contrato%2C+Entrada%2C+Assist%C3%AAncia%2C+T%C3%A9cnica%2C+Para-Raio%2C+Ilumina%C3%A7%C3%A3o%2C+Servi%C3%A7os%2C+AE5%2C+Hexagono%2C+Paulo+Rog%C3%A9rio+Aleixo+Coli%2C+Paulo+Coli%2C+Otimiza%C3%A7%C3%A3o%2C+Energia%2C+Economia+de+Energia%2C+Eletricista';
var metaContents  = 'El%C3%A9trica%2C+Eletrot%C3%A9cnico%2C+Eletrot%C3%A9cnica%2C+Engenheiro%2C+Engenharia%2C+Eletricista%2C+Instala%C3%A7%C3%A3o%2C+Montagem%2C+Disjuntor%2C+Transformador%2C+Comando%2C+Automa%C3%A7%C3%A3o%2C+Cabina%2C+Prim%C3%A1ria%2C+Contrato%2C+Entrada%2C+Assist%C3%AAncia%2C+T%C3%A9cnica%2C+Para-Raio%2C+Ilumina%C3%A7%C3%A3o%2C+Servi%C3%A7os%2C+AE5%2C+Hexagono%2C+Paulo+Rog%C3%A9rio+Aleixo+Coli%2C+Paulo+Coli%2C+Otimiza%C3%A7%C3%A3o%2C+Energia%2C+Economia+de+Energia%2C+Eletricista';
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();
};

