/* [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','1801',jdecode('Principal'),jdecode(''), jdecode('%2F1801.html'), 'true',[],'',''],
	['PAGE','2601',jdecode('Quem+somos'),jdecode(''), jdecode('%2F2601.html'), 'true',[],'',''],
	['PAGE','85112',jdecode('Boletim'),jdecode(''), jdecode('%2F85112.html'), 'true',[],'',''],
	['PAGE','2622',jdecode('Artigos'),jdecode(''), jdecode('%2F2622.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('Jornalismo'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','2643',jdecode('Frank+Duff'),jdecode(''), jdecode('%2F2643.html'), 'true',[],'',''],
	['PAGE','5001',jdecode('Alfie+Lambe'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','5022',jdecode('Edel+Quinn'),jdecode(''), jdecode('%2F5022.html'), 'true',[],'',''],
	['PAGE','2664',jdecode('Fotos'),jdecode(''), jdecode('%2F2664.html'), 'true',[],'',''],
	['PAGE','2685',jdecode('Senatus'),jdecode(''), jdecode('%2F2685.html'), 'true',[],'',''],
	['PAGE','5801',jdecode('Dom+Edson'),jdecode(''), jdecode('%2F5801.html'), 'true',[],'',''],
	['PAGE','2706',jdecode('Regia'),jdecode(''), jdecode('%2F2706.html'), 'true',[],'',''],
	['PAGE','2727',jdecode('Link'),jdecode(''), jdecode('%2F2727.html'), 'true',[],'',''],
	['PAGE','2748',jdecode('Contato'),jdecode(''), jdecode('%2F2748.html'), 'true',[],'',''],
	['PAGE','2769',jdecode('Documentos+'),jdecode(''), jdecode('%2F2769.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Tendril';
theSitetree.paletteFamily='FEEEEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33095';
theSitetree.graphicsetId='14059';
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: 			'Tendril',
				paletteFamily: 	'FEEEEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33095',
				graphicsetId: 	'14059',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20111210-135225'
};
webappMappings['7060']=webappMappings['7060-58436040e74c13b7482f5135fab81ae9']={
webappId:    '7060',
documentId:  '2664',
internalId:  '58436040e74c13b7482f5135fab81ae9',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090812-110456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20111116-090609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20090813-075603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2664',
internalId:  '',
customField: '20090813-082115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2685',
internalId:  '',
customField: '20091008-181606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2706',
internalId:  '',
customField: '20100831-181720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2727',
internalId:  '',
customField: '20090826-125548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2748',
internalId:  '',
customField: '20090724-111203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2769',
internalId:  '',
customField: '20110705-150602'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20090723-095353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5022',
internalId:  '',
customField: '20091008-182527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20110525-123751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20111210-135038'
};
webappMappings['7008']=webappMappings['7008-9384']={
webappId:    '7008',
documentId:  '2748',
internalId:  '9384',
customField: 'language:pt;country:BR;'
};
webappMappings['1501']=webappMappings['1501-14579304']={
webappId:    '1501',
documentId:  '1801',
internalId:  '14579304',
customField: '1501'
};
webappMappings['7005']=webappMappings['7005-1114']={
webappId:    '7005',
documentId:  '1801',
internalId:  '1114',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85112',
internalId:  '',
customField: '20111004-175022'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH84E';
var companyName   = 'Legi%C3%A3o+de+Maria';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

