/* [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','601',jdecode('CPHB'),jdecode(''), jdecode('%2F601%2Findex.html'), 'true',[ 
		['PAGE','254312',jdecode('Instala%C3%A7%C3%B5es'),jdecode(''), jdecode('%2F601%2F254312.html'), 'true',[],'',''],
		['PAGE','74801',jdecode('+-+Mapa+do+Site'),jdecode(''), jdecode('%2F601%2F74801.html'), 'false',[],'','']
	],'',''],
	['PAGE','4843',jdecode('QUEM+SOMOS'),jdecode(''), jdecode('%2F4843.html'), 'true',[],'',''],
	['PAGE','73001',jdecode('ATIVIDADES'),jdecode(''), jdecode('%2F73001.html'), 'true',[],'',''],
	['PAGE','58201',jdecode('%3EPsicoterapia'),jdecode(''), jdecode('%2F58201.html'), 'true',[],'',''],
	['PAGE','312823',jdecode('%3EPlant%C3%A3o+Psicol%C3%B3gico'),jdecode(''), jdecode('%2F312823.html'), 'false',[],'',''],
	['PAGE','4948',jdecode('%3ECursos+Forma%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F4948%2Findex.html'), 'true',[ 
		['PAGE','4990',jdecode('%3E%3E+Forma%C3%A7%C3%A3o+ACP'),jdecode(''), jdecode('%2F4948%2F4990.html'), 'true',[],'',''],
		['PAGE','5011',jdecode('%3E%3E+Ludoterapia'),jdecode(''), jdecode('%2F4948%2F5011.html'), 'true',[],'',''],
		['PAGE','305923',jdecode('%3E%3E+Fac+Grupos'),jdecode(''), jdecode('%2F4948%2F305923.html'), 'false',[],'','']
	],'',''],
	['PAGE','297512',jdecode('Workshop'),jdecode(''), jdecode('%2F297512.html'), 'false',[],'',''],
	['PAGE','80622',jdecode('Workshop'),jdecode(''), jdecode('%2F80622%2Findex.html'), 'false',[ 
		['PAGE','300312',jdecode('Pr%C3%A9-Inscri%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F80622%2F300312.html'), 'false',[],'','']
	],'',''],
	['PAGE','279412',jdecode('Col%C3%B3quios+2010'),jdecode(''), jdecode('%2F279412.html'), 'true',[],'',''],
	['PAGE','246301',jdecode('Col%C3%B3quios+2009'),jdecode(''), jdecode('%2F246301.html'), 'true',[],'',''],
	['PAGE','246343',jdecode('%3ELivro'),jdecode(''), jdecode('%2F246343.html'), 'true',[],'',''],
	['PAGE','249712',jdecode('%3ESemin%C3%A1rios+'),jdecode(''), jdecode('%2F249712.html'), 'true',[],'',''],
	['PAGE','260012',jdecode('%3EParcerias'),jdecode(''), jdecode('%2F260012%2Findex.html'), 'true',[ 
		['PAGE','163501',jdecode('%3EPr%C3%B3ximo'),jdecode(''), jdecode('%2F260012%2F163501.html'), 'false',[],'',''],
		['PAGE','245422',jdecode('Encontros+Regionais'),jdecode(''), jdecode('%2F260012%2F245422.html'), 'false',[],'',''],
		['PAGE','246385',jdecode('F%C3%B3runs+Brasileiros'),jdecode(''), jdecode('%2F260012%2F246385.html'), 'false',[],'',''],
		['PAGE','246406',jdecode('Encontros+Internacionais'),jdecode(''), jdecode('%2F260012%2F246406.html'), 'true',[],'','']
	],'',''],
	['PAGE','41601',jdecode('EVENTOS+'),jdecode(''), jdecode('%2F41601.html'), 'true',[],'',''],
	['PAGE','168501',jdecode('PSI+Humanista'),jdecode(''), jdecode('%2F168501%2Findex.html'), 'true',[ 
		['PAGE','19001',jdecode('%3E+ACP'),jdecode(''), jdecode('%2F168501%2F19001.html'), 'true',[],'',''],
		['PAGE','4864',jdecode('%3ECarl+Rogers+'),jdecode(''), jdecode('%2F168501%2F4864.html'), 'true',[],'',''],
		['PAGE','102101',jdecode('%3EAlberto+Segrera'),jdecode(''), jdecode('%2F168501%2F102101.html'), 'true',[],'','']
	],'',''],
	['PAGE','5368',jdecode('ACP+no+Mundo'),jdecode(''), jdecode('%2F5368.html'), 'true',[],'',''],
	['PAGE','5389',jdecode('Fale+conosco'),jdecode(''), jdecode('%2F5389.html'), 'true',[],'',''],
	['PAGE','34301',jdecode('Passei+por+aqui'),jdecode(''), jdecode('%2F34301.html'), 'true',[],'',''],
	['PAGE','82201',jdecode('Deixe+seu+recado%21'),jdecode(''), jdecode('%2F82201%2Findex.html'), 'false',[ 
		['PAGE','151301',jdecode('Projetos+Sociais'),jdecode(''), jdecode('%2F82201%2F151301.html'), 'false',[],'',''],
		['PAGE','151322',jdecode('Nosso+Lar'),jdecode(''), jdecode('%2F82201%2F151322.html'), 'false',[],'','']
	],'','']];
var siteelementCount=34;
theSitetree.topTemplateName='Pixelportal';
theSitetree.paletteFamily='FE8800';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10375';
theSitetree.graphicsetId='10538';
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: 			'Pixelportal',
				paletteFamily: 	'FE8800',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10375',
				graphicsetId: 	'10538',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2576']={
webappId:    '7008',
documentId:  '82201',
internalId:  '2576',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '260012',
internalId:  '',
customField: '20100711-013158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163501',
internalId:  '',
customField: '20100929-140440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151322',
internalId:  '',
customField: '20091229-185414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20111107-214530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74801',
internalId:  '',
customField: '20100711-195631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '279412',
internalId:  '',
customField: '20110710-234417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20111107-211042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '249712',
internalId:  '',
customField: '20100918-231922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '297512',
internalId:  '',
customField: '20100929-140440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4864',
internalId:  '',
customField: '20061117-070035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19001',
internalId:  '',
customField: '20100629-010805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80622',
internalId:  '',
customField: '20110710-212058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20111107-213805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5368',
internalId:  '',
customField: '20100203-123918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73001',
internalId:  '',
customField: '20111107-211233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58201',
internalId:  '',
customField: '20110804-000031'
};
webappMappings['7008']=webappMappings['7008-20115']={
webappId:    '7008',
documentId:  '300312',
internalId:  '20115',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4948',
internalId:  '',
customField: '20111107-212331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4990',
internalId:  '',
customField: '20111107-213113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151301',
internalId:  '',
customField: '20091121-174516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5011',
internalId:  '',
customField: '20111107-212705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '305923',
internalId:  '',
customField: '20110213-165258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5389',
internalId:  '',
customField: '20100711-202555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20100711-183426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82201',
internalId:  '',
customField: '20100711-202708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102101',
internalId:  '',
customField: '20100711-010231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '312823',
internalId:  '',
customField: '20111107-213914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '300312',
internalId:  '',
customField: '20100929-143740'
};
webappMappings['7008']=webappMappings['7008-12971']={
webappId:    '7008',
documentId:  '4990',
internalId:  '12971',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-12973']={
webappId:    '7008',
documentId:  '5011',
internalId:  '12973',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-21471']={
webappId:    '7008',
documentId:  '305923',
internalId:  '21471',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '246301',
internalId:  '',
customField: '20110710-212625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168501',
internalId:  '',
customField: '20100711-181600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '254312',
internalId:  '',
customField: '20100710-021240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '246343',
internalId:  '',
customField: '20110710-212831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '245422',
internalId:  '',
customField: '20100706-123722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '246385',
internalId:  '',
customField: '20100707-231741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '246406',
internalId:  '',
customField: '20100707-231741'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN22RD';
var companyName   = 'Por+um+ser+humano+pleno%2C+livre+e+feliz';
var htmlTitle	  = 'CPHB+-+Centro+de+Psicologia+Humanista+de+Bras%C3%ADlia';
var metaKeywords  = 'Psicologia+Humanista%3B+Abordagem+Centrada+na+Pessoa%3B+Psicologia+Rogeriana%3B++Cursos+de+Forma%C3%A7%C3%A3o%3B+Workshop%3B+Ludoterapia%3B+Psicoterapia%3B+Psicologia+Infantil';
var metaContents  = 'Psicologia+Humanista%3B++Abordagem+Centrada+na+Pessoa%3B++Psicologia+Rogeriana%3B++Cursos+de+Forma%C3%A7%C3%A3o%3B++Workshop%3B+Ludoterapia%3B+Psicoterapia%3B+Conv%C3%AAnios%3B+Humanismo%3B+Psicologia+Human%C3%ADstica%3B+Psicologia+Infantil';
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();
};

