/* [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('P%C3%A1gina+Principal'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','773',jdecode('Noticias+Locais'),jdecode(''),'/773.html','true',[],'',''],
	['PAGE','15201',jdecode('Noticias+Gerais'),jdecode(''),'/15201.html','true',[],'',''],
	['PAGE','148501',jdecode('Noticias+Regionais'),jdecode(''),'/148501.html','true',[],'',''],
	['PAGE','391534',jdecode('Nossa+Cidade+-+Fotos'),jdecode(''),'/391534.html','true',[],'',''],
	['PAGE','380734',jdecode('Na+Balada'),jdecode(''),'/380734.html','true',[],'',''],
	['PAGE','14201',jdecode('Editorial'),jdecode(''),'/14201.html','true',[],'',''],
	['PAGE','166501',jdecode('Rowan+Ara%C3%BAjo.Net'),jdecode(''),'/166501.html','true',[],'',''],
	['PAGE','303723',jdecode('Jorginho+Pires'),jdecode(''),'/303723.html','true',[],'',''],
	['PAGE','19101',jdecode('Entrevista'),jdecode(''),'/19101.html','true',[],'',''],
	['PAGE','290812',jdecode('Espa%C3%A7o+do+Leitor'),jdecode(''),'/290812.html','true',[],'',''],
	['PAGE','5806',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/5806/index.html','true',[ 
		['PAGE','5801',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/5806/5801.html','false',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Rectangle';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='2508';
theSitetree.keyvisualName='communication.jpg';
theSitetree.fontsetId='451';
theSitetree.graphicsetId='506';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rectangle',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'2508',
				keyvisualName: 	'communication.jpg',
				fontsetId: 		'451',
				graphicsetId: 	'506',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5806avec10inlua8']={
webappId:    '1002',
documentId:  '5806',
internalId:  '5806avec10inlua8',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20100317-161512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100413-180213'
};
webappMappings['7005']=webappMappings['7005-158']={
webappId:    '7005',
documentId:  '701',
internalId:  '158',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15201',
internalId:  '',
customField: '20090513-193340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148501',
internalId:  '',
customField: '20090722-173826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '380734',
internalId:  '',
customField: '20100412-110855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '391534',
internalId:  '',
customField: '20100407-200727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20081221-091342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166501',
internalId:  '',
customField: '20090429-200105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '303723',
internalId:  '',
customField: '20090507-183812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090109-100424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '290812',
internalId:  '',
customField: '20080709-072054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5806',
internalId:  '',
customField: '20070830-165024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20070830-165024'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLUA8';
var companyName   = 'Nova+Era+On+Line';
var htmlTitle	  = 'Nova+Era+on+line+-+muito+mais+informa%C3%A7%C3%A3o+e+cultura%21';
var metaKeywords  = 'novaerense';
var metaContents  = 'nova+era';
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();
};

