/* [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','5622',jdecode('Empresa'),jdecode(''),'/5622.html','true',[],'',''],
	['PAGE','5643',jdecode('Miss%C3%A3o'),jdecode(''),'/5643/index.html','true',[ 
		['PAGE','5664',jdecode('Nossa+equipe'),jdecode(''),'/5643/5664.html','true',[],'','']
	],'',''],
	['PAGE','5706',jdecode('Servi%C3%A7os%2FProjetos'),jdecode(''),'/5706/index.html','true',[ 
		['PAGE','61101',jdecode('Geoprocessamento'),jdecode(''),'/5706/61101.html','true',[],'','']
	],'',''],
	['PAGE','5727',jdecode('Clientes'),jdecode(''),'/5727.html','true',[],'',''],
	['PAGE','5748',jdecode('Parcerias'),jdecode(''),'/5748.html','true',[],'',''],
	['PAGE','53701',jdecode('Legisla%C3%A7%C3%A3o'),jdecode(''),'/53701.html','true',[],'',''],
	['PAGE','5769',jdecode('Links+Ut%C3%A9is'),jdecode(''),'/5769.html','true',[],'',''],
	['PAGE','5790',jdecode('Contato'),jdecode(''),'/5790.html','true',[],'',''],
	['PAGE','5811',jdecode('Trabalhe+conosco'),jdecode(''),'/5811.html','true',[],'',''],
	['PAGE','83401',jdecode('Trabalhos+em+execu%C3%A7%C3%A3o'),jdecode(''),'/83401.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Padma';
theSitetree.paletteFamily='999999';
theSitetree.keyvisualId='1044';
theSitetree.keyvisualName='arzt_technik.jpg';
theSitetree.fontsetId='178';
theSitetree.graphicsetId='212';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='666666';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Padma',
				paletteFamily: 	'999999',
				keyvisualId: 	'1044',
				keyvisualName: 	'arzt_technik.jpg',
				fontsetId: 		'178',
				graphicsetId: 	'212',
				contentColor: 	'FFFFFF',
				contentBGColor: '666666',
				a_color: 		'999999',
				b_color: 		'000000',
				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:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1612']={
webappId:    '7008',
documentId:  '5790',
internalId:  '1612',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100428-074011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5643',
internalId:  '',
customField: '20071116-174557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20090602-085230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5622',
internalId:  '',
customField: '20091202-060423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20081013-132909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20071116-175003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5727',
internalId:  '',
customField: '20100226-092457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5748',
internalId:  '',
customField: '20100513-091952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53701',
internalId:  '',
customField: '20071116-175149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5769',
internalId:  '',
customField: '20071116-175241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5790',
internalId:  '',
customField: '20080225-051712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5811',
internalId:  '',
customField: '20071116-175405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83401',
internalId:  '',
customField: '20080820-122238'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZD3Q';
var companyName   = '++++++++++++Empresa+de+Projetos+T%C3%A9cnicos+e+Sociais+';
var htmlTitle	  = 'EMPROTEP-+Empresa+de+Projetos+T%C3%A9cnicos+e+Sociais+para+Prefeituras';
var metaKeywords  = 'geoprocessamento%2C+cadastro+multifinalit%C3%A1rio%2C+cadastro+imobili%C3%A1rio%2Cgerenciamento+de+res%C3%ADduos%2C+legisla%C3%A7%C3%A3o+ambiental%2C+legisla%C3%A7%C3%A3o+trabalhista%2Cconcursos+p%C3%BAblicos%2C+vestibulares%2Cpesquisas%2C+controle+de+qualidade%2Cprodutos+de+higiene+e+limpeza%2Cmateriais+de+inform%C3%A1tica%2C+produtos+hospitalares%2C+tratamento+de+esgoto%2C+gest%C3%A3o+p%C3%BAblica%2C';
var metaContents  = 'Somos+uma+empresa+especializada+em+Projetos+T%C3%A9cnicos+para+Prefeituras%2C+tais+como%3A+Cadastro+Imobili%C3%A1rio%2C+Planta+Gen%C3%A9rica+de+Valores+e+Projeto+Multifinalit%C3%A1rio.+Gostariamos+de+informar+tamb%C3%A9m%2C+que+elaboramos+e+executamos+Projetos+Sociais+em+Educa%C3%A7%C3%A3o+Ambiental%2C+com+a+participa%C3%A7%C3%A3o+da+Comunidade.+';
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();
};
