/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','752',jdecode('Curr%C3%ADculo'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','55801',jdecode('Sobre+Estresse'),jdecode(''),'/55801.html','true',[],'',''],
	['PAGE','24201',jdecode('Emo%C3%A7%C3%B5es+e+Doen%C3%A7as'),jdecode(''),'/24201.html','true',[],'',''],
	['PAGE','773',jdecode('Terapias'),jdecode(''),'/773.html','true',[],'',''],
	['PAGE','794',jdecode('Servi%C3%A7os'),jdecode(''),'/794.html','true',[],'',''],
	['PAGE','56101',jdecode('Imprensa'),jdecode(''),'/56101.html','true',[],'',''],
	['PAGE','71701',jdecode('Cursos'),jdecode(''),'/71701.html','true',[],'',''],
	['PAGE','857',jdecode('Contato'),jdecode(''),'/857.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='FFD375';
theSitetree.keyvisualId='1963';
theSitetree.keyvisualName='blumen.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='385';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'FFD375',
				keyvisualId: 	'1963',
				keyvisualName: 	'blumen.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'385',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFD375',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2883308']={
webappId:    '1501',
documentId:  '701',
internalId:  '2883308',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100803-124307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20100805-205718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20100803-125734'
};
webappMappings['7008']=webappMappings['7008-2331']={
webappId:    '7008',
documentId:  '857',
internalId:  '2331',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100803-125912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55801',
internalId:  '',
customField: '20100430-163526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '794',
internalId:  '',
customField: '20100803-130107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71701',
internalId:  '',
customField: '20100803-130359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20100803-130557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20100803-130207'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INEFZS';
var companyName   = 'Prof.+Armando+Ribeiro';
var htmlTitle	  = 'Prof.+Armando+Ribeiro+-+Psicologia%2C+Psicoterapia+e+Redu%C3%A7%C3%A3o+do+Estresse';
var metaKeywords  = 'Estresse%2C+Stress%2C+Psicologia%2C+Psychology%2C+Psicoterapia%2C+Psychotherapy%2C+Terapia+Complementar%2C+Complementary+Therapy%2C+Terapia+Cognitiva%2C+Terapia+Comportamental%2C+Terapia+Cognitivo-Comportamental%2C+Biofeedback%2C+Hipnose%2C+Medita%C3%A7%C3%A3o%2C+Acupuntura%2C+Medicina+Comportamental%2C+Behavioral+Medicine%2C+Mind-Body%2C+Auriculoterapia%2C+Qualidade+de+Vida%2C+SPA%2C+Bem-estar%2C+Armando+Ribeiro+das+Neves+Neto%2C+Imagina%C3%A7%C3%A3o+Guiada%2C+Visualiza%C3%A7%C3%A3o+Criativa%2C+Mente%2C+Corpo%2C+Doen%C3%A7as+Psicossom%C3%A1ticas%2C+Psicofisiologia%2C+Disfun%C3%A7%C3%B5es+Psicofisiol%C3%B3gicas%2C+Avalia%C3%A7%C3%A3o%2C+Preven%C3%A7%C3%A3o%2C+Tratamento%2C+Psicologia+Cl%C3%ADnica%2C+Psicologia+da+Sa%C3%BAde%2C+Psicologia+Hospitalar%2C+Psico-oncologia%2C+S%C3%ADndrome+do+Intestino+Irrit%C3%A1vel%2C+SII%2C+Ansiedade%2C+Depress%C3%A3o%2C+P%C3%A2nico%2C+Terapia+Alternativa%2C+Medicina+Integrativa.+';
var metaContents  = 'Este+%C3%A9+a+home-page+do+psic%C3%B3logo+prof.+Armando+Ribeiro+das+Neves+Neto++e+tem+como+objetivos+apresentar+informa%C3%A7%C3%B5es+atualizadas+sobre+Stress%2C+Estresse%2C+Psicologia%2C+Psicoterapia%2C+Terapias+Complementares%2C+Medicina+Comportamental%2C+Psicossom%C3%A1tica%2C+Biofeedback%2C+Hipnose%2C+Medita%C3%A7%C3%A3o%2C+Psicologia+Cl%C3%ADnica%2C+Psicologia+Hospitalar%2C+Acupuntura%2C+Terapia+Cognitiva%2C+Terapia+Comportamental%2C+Terapia+Cognitivo-Comportamental.';
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();
};
