/* [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','401',jdecode('Inicial'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','452',jdecode('A+Cidade'),jdecode(''), jdecode('%2F452%2Findex.html'), 'true',[ 
		['PAGE','473',jdecode('Hist%C3%B3ria'),jdecode(''), jdecode('%2F452%2F473.html'), 'true',[],'',''],
		['PAGE','494',jdecode('Prefeitura'),jdecode(''), jdecode('%2F452%2F494.html'), 'true',[],'',''],
		['PAGE','704',jdecode('Telefones+%C3%9Ateis'),jdecode(''), jdecode('%2F452%2F704.html'), 'true',[],'',''],
		['PAGE','683',jdecode('Calend%C3%A1rio'),jdecode(''), jdecode('%2F452%2F683.html'), 'true',[],'','']
	],'',''],
	['PAGE','259701',jdecode('Informa%C3%A7%C3%B5es'),jdecode(''), jdecode('%2F259701%2Findex.html'), 'true',[ 
		['PAGE','620',jdecode('Como+chegar%3F'),jdecode(''), jdecode('%2F259701%2F620.html'), 'true',[],'',''],
		['PAGE','641',jdecode('Onde+ficar%3F'),jdecode(''), jdecode('%2F259701%2F641.html'), 'true',[],'',''],
		['PAGE','311001',jdecode('Onde+comer%3F'),jdecode(''), jdecode('%2F259701%2F311001.html'), 'true',[],'',''],
		['PAGE','662',jdecode('Onde+ir%3F'),jdecode(''), jdecode('%2F259701%2F662.html'), 'true',[],'',''],
		['PAGE','599',jdecode('Localiza%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F259701%2F599.html'), 'true',[],'',''],
		['PAGE','557',jdecode('Estrada+Real'),jdecode(''), jdecode('%2F259701%2F557.html'), 'true',[],'',''],
		['PAGE','578',jdecode('Terras+Altas'),jdecode(''), jdecode('%2F259701%2F578.html'), 'true',[],'',''],
		['PAGE','94101',jdecode('Queijo+Parmes%C3%A3o'),jdecode(''), jdecode('%2F259701%2F94101.html'), 'true',[],'',''],
		['PAGE','185801',jdecode('Produtos+d%26%23x27%3BAlagoa'),jdecode(''), jdecode('%2F259701%2F185801.html'), 'true',[],'',''],
		['PAGE','305401',jdecode('Ag%C3%AAncia+de+Turismo'),jdecode(''), jdecode('%2F259701%2F305401.html'), 'false',[],'','']
	],'',''],
	['PAGE','536',jdecode('Galeria+de+Fotos'),jdecode(''), jdecode('%2F536%2Findex.html'), 'true',[ 
		['PAGE','44501',jdecode('Cachoeiras'),jdecode(''), jdecode('%2F536%2F44501.html'), 'true',[],'',''],
		['PAGE','44543',jdecode('Enviadas+I'),jdecode(''), jdecode('%2F536%2F44543.html'), 'true',[],'',''],
		['PAGE','159501',jdecode('Enviadas+II'),jdecode(''), jdecode('%2F536%2F159501.html'), 'true',[],'',''],
		['PAGE','167601',jdecode('Especial'),jdecode(''), jdecode('%2F536%2F167601.html'), 'false',[],'',''],
		['PAGE','124601',jdecode('Flores'),jdecode(''), jdecode('%2F536%2F124601.html'), 'true',[],'',''],
		['PAGE','269901',jdecode('Inverno+e+Geada'),jdecode(''), jdecode('%2F536%2F269901.html'), 'true',[],'',''],
		['PAGE','333001',jdecode('Paisagens+I'),jdecode(''), jdecode('%2F536%2F333001.html'), 'true',[],'',''],
		['PAGE','6701',jdecode('Paisagens+II'),jdecode(''), jdecode('%2F536%2F6701.html'), 'true',[],'',''],
		['PAGE','346412',jdecode('Paisagens+III'),jdecode(''), jdecode('%2F536%2F346412.html'), 'true',[],'',''],
		['PAGE','31601',jdecode('Picos+e+Montanhas'),jdecode(''), jdecode('%2F536%2F31601.html'), 'true',[],'',''],
		['PAGE','32701',jdecode('Rapel'),jdecode(''), jdecode('%2F536%2F32701.html'), 'true',[],'',''],
		['PAGE','88901',jdecode('Sapos'),jdecode(''), jdecode('%2F536%2F88901.html'), 'true',[],'',''],
		['PAGE','44522',jdecode('Trilhas+de+Moto'),jdecode(''), jdecode('%2F536%2F44522.html'), 'true',[],'',''],
		['PAGE','23801',jdecode('V+Descida+de+B%C3%B3ia'),jdecode(''), jdecode('%2F536%2F23801.html'), 'false',[],'','']
	],'',''],
	['PAGE','6506',jdecode('Livro+de+Visitas'),jdecode(''), jdecode('%2F6506%2Findex.html'), 'false',[ 
		['PAGE','6501',jdecode('Coment%C3%A1rios'),jdecode(''), jdecode('%2F6506%2F6501.html'), 'true',[],'','']
	],'',''],
	['PAGE','725',jdecode('Fale+Conosco'),jdecode(''), jdecode('%2F725.html'), 'true',[],'',''],
	['PAGE','324101',jdecode('Parceiros'),jdecode(''), jdecode('%2F324101.html'), 'true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Anniversary';
theSitetree.paletteFamily='4F864E';
theSitetree.keyvisualId='3730';
theSitetree.keyvisualName='kv_3730.jpg';
theSitetree.fontsetId='10559';
theSitetree.graphicsetId='10945';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='F3EFDB';
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: 			'Anniversary',
				paletteFamily: 	'4F864E',
				keyvisualId: 	'3730',
				keyvisualName: 	'kv_3730.jpg',
				fontsetId: 		'10559',
				graphicsetId: 	'10945',
				contentColor: 	'A00000',
				contentBGColor: 'F3EFDB',
				a_color: 		'F7EFDE',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'828181',
				e_color: 		'828181',
				f_color: 		'828181',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2041985']={
webappId:    '1501',
documentId:  '401',
internalId:  '2041985',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-6506avec10ine7m3']={
webappId:    '1002',
documentId:  '6506',
internalId:  '6506avec10ine7m3',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-ed810cea2a700e00509d3c8569dfd989']={
webappId:    '7060',
documentId:  '6701',
internalId:  'ed810cea2a700e00509d3c8569dfd989',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-4d264e7175680a9845146b861fd0e38b']={
webappId:    '7060',
documentId:  '23801',
internalId:  '4d264e7175680a9845146b861fd0e38b',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-9afa99723d689e21841837b5210193be']={
webappId:    '7060',
documentId:  '31601',
internalId:  '9afa99723d689e21841837b5210193be',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-773101ed3a691a498c330d55c30726d9']={
webappId:    '7060',
documentId:  '32701',
internalId:  '773101ed3a691a498c330d55c30726d9',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '346412',
internalId:  '',
customField: '20110331-100019'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '269901',
internalId:  '',
customField: '20110607-084638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120131-105326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20120112-201740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20120112-202029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20110321-222425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20110324-144544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44543',
internalId:  '',
customField: '20081226-140720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185801',
internalId:  '',
customField: '20100810-131742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6506',
internalId:  '',
customField: '20070818-112506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20061216-130457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '333001',
internalId:  '',
customField: '20100818-092556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94101',
internalId:  '',
customField: '20120112-211947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159501',
internalId:  '',
customField: '20100210-083714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100818-080236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20070724-114955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44501',
internalId:  '',
customField: '20100601-132759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44522',
internalId:  '',
customField: '20091116-180305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32701',
internalId:  '',
customField: '20080703-144009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167601',
internalId:  '',
customField: '20080305-152758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '311001',
internalId:  '',
customField: '20110815-092532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20090423-091940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124601',
internalId:  '',
customField: '20080708-113427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88901',
internalId:  '',
customField: '20080324-125019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20100825-071053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20110901-100128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '305401',
internalId:  '',
customField: '20091112-132259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20101125-080447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20110901-095859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20111004-093914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20070117-181232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20110714-141308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '704',
internalId:  '',
customField: '20110321-222535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '725',
internalId:  '',
customField: '20100601-143616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '324101',
internalId:  '',
customField: '20110603-124331'
};
webappMappings['7008']=webappMappings['7008-2666']={
webappId:    '7008',
documentId:  '725',
internalId:  '2666',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '259701',
internalId:  '',
customField: '20120112-213204'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INE7M3';
var companyName   = 'Alagoa%2FMG++1962+-+2012';
var htmlTitle	  = 'Aventure-se+em+Alagoa+MG%3A+Um+para%C3%ADso+nas+Montanhas%21+%7C+Portal+do+Turismo';
var metaKeywords  = 'ALAGOA+SUL+DE+MINAS+ALAGOA+MG+ALAGOAS+LAGOA+ESTRADA+REAL+TERRAS+ALTAS+DA+MANTIQUEIRA+FOTOS+DE+PAISAGENS+TURISMO+ECOL%C3%93GICO+ALAGOAS+MG+ALAGOA+MG+ALAGOA+SUL+DE+MINAS+ALAGOAS++PREFEITURA+MUNICIPAL+ALAGOINHA+ALAGOAS+LAGOA+FOTOS+MARAVILHOSAS+QUEIJO+PARMES%C3%83O+PARA%C3%8DSO+MARAVILHA+CLIMA+LINDAS+ALAGOAS+alagoa+Alagoa+ALAGOA+estrada+real+sul+de+minas+TRILHAS+DE+MOTO%2C+FOTOS+LINDAS%2C+FOTOS+MARAVILHOSAS%2C+PAISAGENS+EXUBERANTES%2C+QUEIJO%2C+QUEJO%2C+PARA%C3%8DSO';
var metaContents  = 'ALAGOA+MINAS+GERAIS+ALAGOA+SUL+DE+MINAS++CIDADE+TUR%C3%8DSTICA++ALAGOA+MG+ALAGOAS+LAGOA+ALAGOINHA+CIDADE+MAIS+ALTA+TERRAS+ALTAS+DA+MANTIQUEIRA+ESTRADA+REAL+CIRCUITO+ESTRADA+REAL+CIRCUITO+TERRAS+ALTAS+CIRCUITOS+DE+TURISMO+HIST%C3%93RIA+DE+ALAGOA+CALEND%C3%81RIO+DE+FESTAS+DE+ALAGOA+INFORMA%C3%87%C3%95ES+DE+COMO+CHEGAR+EM+ALAGOA+MAPA+DE+ALAGOA+DADOS+DE+ALAGOA+FOTOS+DE+ALAGOA+MG+TURISMO+ECOL%C3%93GICO+ALAGOA+PREFEITURA+MUNICIPAL+DE+ALAGOA+FOTOS';
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();
};

