/* [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','5101',jdecode('Inicial'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','17001',jdecode('Gest%C3%A3o'),jdecode(''),'/17001/index.html','true',[ 
		['PAGE','5322',jdecode('Servi%C3%A7os+Peri%C3%B3dicos'),jdecode(''),'/17001/5322.html','true',[],''],
		['PAGE','16101',jdecode('Projetos'),jdecode(''),'/17001/16101.html','true',[],'']
	],''],
	['PAGE','5364',jdecode('Treinamento'),jdecode(''),'/5364.html','true',[],''],
	['PAGE','5427',jdecode('Como+trabalhamos'),jdecode(''),'/5427.html','true',[],''],
	['PAGE','5448',jdecode('Quem+somos'),jdecode(''),'/5448.html','true',[],''],
	['PAGE','30801',jdecode('Clientes'),jdecode(''),'/30801.html','true',[],''],
	['PAGE','5490',jdecode('Fale+conosco'),jdecode(''),'/5490.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='7A2E25';
theSitetree.keyvisualId='11063';
theSitetree.keyvisualName='kv_11063.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13787';
theSitetree.contentColor='300000';
theSitetree.contentBGColor='7A2E25';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Champagne',
				paletteFamily: 	'7A2E25',
				keyvisualId: 	'11063',
				keyvisualName: 	'kv_11063.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13787',
				contentColor: 	'300000',
				contentBGColor: '7A2E25',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20091110-171637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20090720-184747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20090809-095111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20090809-095313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20090809-095744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20090728-114744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5427',
internalId:  '',
customField: '20090720-185555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5448',
internalId:  '',
customField: '20090720-190855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5490',
internalId:  '',
customField: '20090703-120134'
};
webappMappings['7008']=webappMappings['7008-8970']={
webappId:    '7008',
documentId:  '5490',
internalId:  '8970',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHG18';
var companyName   = '++++++++++++++++++++GEST%C3%83O+DE+NEG%C3%93CIOS+%26+TREINAMENTO';
var htmlTitle	  = 'PECIX+Gest%C3%A3o+de+Neg%C3%B3cios+%26+Treinamento';
var metaKeywords  = 'gest%C3%A3o%2C+comercial%2C+marketing%2C+administrativo%2C+financeiro%2C+qualidade%2C+assessoria%2C+consultoria%2C+vendas%2C+treinamento%2C+planejamento%2C+plano%2C+an%C3%A1lise%2C+resultado%2C+meta%2C+efici%C3%AAncia%2C+agilidade%2C+baixo+custo%2C+investimento%2C+campanha+de+incentivo.';
var metaContents  = 'Solu%C3%A7%C3%B5es+em+gest%C3%A3o+de+neg%C3%B3cios%2C+treinamento%2C+marketing%2C+planejamento+estrat%C3%A9gico%2C+assessoria+e+consultoria+empresarial.+Gest%C3%A3o+comercial%2C+marketing%2C+administrativa%2C+an%C3%A1lise+financeira+de+resultados%2C+gest%C3%A3o+de+qualidade%2C+assessoria+e+consultoria+em+vendas+e+treinamento%2C+planejamentos+diversos%2C+desenvolvimento+de+planos+e+an%C3%A1lises%2C+foco+em+resultados+e+metas%2C+efici%C3%AAncia%2C+agilidade%2C+baixo+custo%2C+investimento+e+cria%C3%A7%C3%A3o+de+campanhas+de+incentivos.';
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();
};
