/* [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','3601',jdecode('P%C3%A1gina+inicial'),jdecode(''),'/3601.html','true',[],'',''],
	['PAGE','3652',jdecode('Quem+somos'),jdecode(''),'/3652.html','true',[],'',''],
	['PAGE','1494',jdecode('Nossos+Conceitos'),jdecode(''),'/1494.html','true',[],'',''],
	['PAGE','3673',jdecode('Nossa+Equipe'),jdecode(''),'/3673.html','true',[],'',''],
	['PAGE','3715',jdecode('Servi%C3%A7os'),jdecode(''),'/3715/index.html','true',[ 
		['PAGE','1578',jdecode('Projetos+e+Consultoria'),jdecode(''),'/3715/1578.html','true',[],'',''],
		['PAGE','45201',jdecode('Servi%C3%A7os+de+Campo'),jdecode(''),'/3715/45201.html','true',[],'',''],
		['PAGE','45501',jdecode('Eng.+de+Campo+em+SE%C2%B4s'),jdecode(''),'/3715/45501.html','true',[],'',''],
		['PAGE','45522',jdecode('Comissionamento+e+Start-up'),jdecode(''),'/3715/45522.html','true',[],'',''],
		['PAGE','45543',jdecode('Full+Service'),jdecode(''),'/3715/45543.html','true',[],'',''],
		['PAGE','45564',jdecode('Gera%C3%A7%C3%A3o+de+Energia'),jdecode(''),'/3715/45564.html','true',[],'',''],
		['PAGE','45585',jdecode('Projetos+Especiais'),jdecode(''),'/3715/45585.html','true',[],'',''],
		['PAGE','45606',jdecode('Automa%C3%A7%C3%A3o+Industrial'),jdecode(''),'/3715/45606.html','true',[],'',''],
		['PAGE','3736',jdecode('NR10+e+Treinamentos'),jdecode(''),'/3715/3736.html','true',[],'',''],
		['PAGE','13301',jdecode('Calend%C3%A1rio'),jdecode(''),'/3715/13301.html','true',[],'','']
	],'',''],
	['PAGE','1473',jdecode('Clientes'),jdecode(''),'/1473.html','true',[],'',''],
	['PAGE','3694',jdecode('Onde+estamos'),jdecode(''),'/3694.html','true',[],'',''],
	['PAGE','3757',jdecode('Contato'),jdecode(''),'/3757.html','true',[],'',''],
	['PAGE','18206',jdecode('Livro+d+visitas%2FF%C3%B3rum'),jdecode(''),'/18206/index.html','true',[ 
		['PAGE','18201',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/18206/18201.html','false',[],'','']
	],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Disco';
theSitetree.paletteFamily='3D5465';
theSitetree.keyvisualId='1873';
theSitetree.keyvisualName='business.jpg';
theSitetree.fontsetId='307';
theSitetree.graphicsetId='364';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D5465';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Disco',
				paletteFamily: 	'3D5465',
				keyvisualId: 	'1873',
				keyvisualName: 	'business.jpg',
				fontsetId: 		'307',
				graphicsetId: 	'364',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D5465',
				a_color: 		'3D5465',
				b_color: 		'FFFFFF',
				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:  '3715',
internalId:  '',
customField: '20080222-141701'
};
webappMappings['1002']=webappMappings['1002-18206avec10inlaev']={
webappId:    '1002',
documentId:  '18206',
internalId:  '18206avec10inlaev',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-7832']={
webappId:    '7008',
documentId:  '3757',
internalId:  '7832',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1494',
internalId:  '',
customField: '20090901-202735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3673',
internalId:  '',
customField: '20090901-203433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20090902-140146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3652',
internalId:  '',
customField: '20090901-202517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1578',
internalId:  '',
customField: '20090901-210628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3736',
internalId:  '',
customField: '20080221-155240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20080221-155349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1473',
internalId:  '',
customField: '20080222-143633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3694',
internalId:  '',
customField: '20090902-140452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3757',
internalId:  '',
customField: '20090901-214646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18206',
internalId:  '',
customField: '20070902-201434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18201',
internalId:  '',
customField: '20070824-171106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45201',
internalId:  '',
customField: '20090901-212533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45501',
internalId:  '',
customField: '20090901-212755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45522',
internalId:  '',
customField: '20090901-212848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45543',
internalId:  '',
customField: '20090901-213440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45564',
internalId:  '',
customField: '20090901-213403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45585',
internalId:  '',
customField: '20090901-213131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45606',
internalId:  '',
customField: '20090901-213214'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLAEV';
var companyName   = '';
var htmlTitle	  = 'Chrismar+Engenharia';
var metaKeywords  = 'Engenharia%2CEletricidade%2CNR10%2CMaca%C3%A9%2CRJ%2CTreinamentos%2CProjetos%2CConsultoria%2COffshore%2Cestudos%2Cprote%C3%A7%C3%A3o%2Crel%C3%A9s%2Ccomissionamento%2Csubesta%C3%A7%C3%B5es%2Cgra%C3%A7%C3%A3o%2Cenergia%2Cgerador';
var metaContents  = 'A+CHRISMAR+ENGENHARIA+%C3%A9+uma+empresa+especializada+em+consultoria%2C+na+presta%C3%A7%C3%A3o+de+servi%C3%A7os+e+projetos+em+Engenharia+El%C3%A9trica+e+em+Treinamentos+voltados+para+trabalhos+com+eletricidade.';
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();
};
