/* [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','11',jdecode('Home'),jdecode(''),'/11.html','true',[],'',''],
	['PAGE','2005',jdecode('Servi%C3%A7os'),jdecode(''),'/2005/index.html','true',[ 
		['PAGE','7777',jdecode('Consultoria+%26+Audioria'),jdecode(''),'/2005/7777.html','true',[],'',''],
		['PAGE','7786',jdecode('Treinamento'),jdecode(''),'/2005/7786.html','true',[],'','']
	],'',''],
	['PAGE','7577',jdecode('Clientes+-+Exterior'),jdecode(''),'/7577.html','true',[],'',''],
	['PAGE','6656',jdecode('Clientes+-+Brasil+'),jdecode(''),'/6656/index.html','true',[ 
		['PAGE','6555',jdecode('Regi%C3%A3o+Norte'),jdecode(''),'/6656/6555.html','true',[],'',''],
		['PAGE','6665',jdecode('Regi%C3%A3o+Nordeste'),jdecode(''),'/6656/6665.html','true',[],'',''],
		['PAGE','6564',jdecode('Regi%C3%A3o+Centro+Oeste'),jdecode(''),'/6656/6564.html','true',[],'',''],
		['PAGE','6573',jdecode('Regi%C3%A3o+Sudeste+'),jdecode(''),'/6656/6573.html','true',[],'',''],
		['PAGE','6515',jdecode('Regi%C3%A3o+Sul'),jdecode(''),'/6656/6515.html','true',[],'','']
	],'',''],
	['PAGE','6958',jdecode('Fale+Conosco'),jdecode(''),'/6958/index.html','true',[ 
		['PAGE','7341',jdecode('Fale+Conosco+%28p%C3%A1gina+seguir%29'),jdecode(''),'/6958/7341.html','false',[],'','']
	],'',''],
	['PAGE','7037',jdecode('Cadastro'),jdecode(''),'/7037.html','true',[],'',''],
	['PAGE','7046',jdecode('Cursos+Abertos'),jdecode(''),'/7046.html','true',[],'',''],
	['PAGE','56901',jdecode('Conte%C3%BAdo+dos+cursos++'),jdecode(''),'/56901.html','true',[],'',''],
	['PAGE','8410',jdecode('Registro+de+Eventos'),jdecode(''),'/8410.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Stripes';
theSitetree.paletteFamily='CC0066';
theSitetree.keyvisualId='1547';
theSitetree.keyvisualName='agentur.jpg';
theSitetree.fontsetId='247';
theSitetree.graphicsetId='320';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FCFCFB';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stripes',
				paletteFamily: 	'CC0066',
				keyvisualId: 	'1547',
				keyvisualName: 	'agentur.jpg',
				fontsetId: 		'247',
				graphicsetId: 	'320',
				contentColor: 	'A00000',
				contentBGColor: 'FCFCFB',
				a_color: 		'CC0066',
				b_color: 		'DEDECA',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-b2b8e7c8e7ab165375895d964843545d']={
webappId:    '7060',
documentId:  '8410',
internalId:  'b2b8e7c8e7ab165375895d964843545d',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-1172855']={
webappId:    '1501',
documentId:  '11',
internalId:  '1172855',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11',
internalId:  '',
customField: '20100725-103650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20080620-142657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7046',
internalId:  '',
customField: '20100712-135304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2005',
internalId:  '',
customField: '20060919-211451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7777',
internalId:  '',
customField: '20100314-110508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7786',
internalId:  '',
customField: '20080601-181708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7577',
internalId:  '',
customField: '20100314-110637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6656',
internalId:  '',
customField: '20060927-160356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6555',
internalId:  '',
customField: '20060220-114440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6665',
internalId:  '',
customField: '20070410-194816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6564',
internalId:  '',
customField: '20060220-115433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6573',
internalId:  '',
customField: '20080601-184317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20070411-061341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6958',
internalId:  '',
customField: '20100725-103943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7341',
internalId:  '',
customField: '20060217-172241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7037',
internalId:  '',
customField: '20070312-075841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8410',
internalId:  '',
customField: '20060927-164239'
};
webappMappings['7008']=webappMappings['7008-15562']={
webappId:    '7008',
documentId:  '6958',
internalId:  '15562',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2PI8';
var companyName   = '++++++++++';
var htmlTitle	  = '';
var metaKeywords  = 'treinamento+-++meio+ambiente-+consultoria+-++auditoria+-+seguran%C3%A7a+e+sa%C3%BAde+ocupacional+-++recursos+humanos+++IMPLANTA%C3%87%C3%83O%2C+MELHORIA%2C+DIAGN%C3%93STICOS+E+AUDITORIAS+DE+SISTEMAS+DE+GEST%C3%83O+QUALIDADE++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++MEIO+AMBIENTE++-+SEGURAN%C3%87A+E+SA%C3%9ADE+OCUPACIONAL++-+RESPONSABILIDADE+SOCIAL++-+INTEGRADOS';
var metaContents  = 'A+QUALITYMASTER+%C3%A9+uma+organiza%C3%A7%C3%A3o+que+presta+servi%C3%A7os+de+consultoria%2C+assessoria%2C+terceiriza%C3%A7%C3%A3o+especializada%2C+eventos+gerenciais%2C+treinamentos+abertos+e+in+company%2C+diagn%C3%B3sticos+e+auditorias+diversas.+++';
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();
};
