/* [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','501',jdecode('Santa+Cruz'),jdecode(''), jdecode('%2F501%2Findex.html'), 'true',[ 
		['PAGE','12101',jdecode('Fotos+Povoado'),jdecode(''), jdecode('%2F501%2F12101.html'), 'true',[],'','']
	],'',''],
	['PAGE','44801',jdecode('Reservas+Ambientais'),jdecode(''), jdecode('%2F44801.html'), 'true',[],'',''],
	['PAGE','4743',jdecode('SOS++Meio+Ambiente'),jdecode(''), jdecode('%2F4743%2Findex.html'), 'true',[ 
		['PAGE','36301',jdecode('SOS+%C3%BAltimas+not%C3%ADcias'),jdecode(''), jdecode('%2F4743%2F36301.html'), 'true',[],'',''],
		['PAGE','9901',jdecode('Rio+Piraquea%C3%A7u'),jdecode(''), jdecode('%2F4743%2F9901.html'), 'true',[],'',''],
		['PAGE','5601',jdecode('Fotos+Rio+'),jdecode(''), jdecode('%2F4743%2F5601.html'), 'true',[],'','']
	],'',''],
	['PAGE','4701',jdecode('Hist%C3%B3rias'),jdecode(''), jdecode('%2F4701%2Findex.html'), 'true',[ 
		['PAGE','24501',jdecode('Onde+ficar'),jdecode(''), jdecode('%2F4701%2F24501.html'), 'true',[],'','']
	],'',''],
	['PAGE','4722',jdecode('Imigra%C3%A7%C3%A3o+Italiana'),jdecode(''), jdecode('%2F4722%2Findex.html'), 'true',[ 
		['PAGE','6301',jdecode('Expedi%C3%A7%C3%A3o+Tabachi'),jdecode(''), jdecode('%2F4722%2F6301.html'), 'true',[],'',''],
		['PAGE','19901',jdecode('Origens+autora+site'),jdecode(''), jdecode('%2F4722%2F19901.html'), 'true',[],'','']
	],'',''],
	['PAGE','22901',jdecode('Aldeias+Ind%C3%ADgenas'),jdecode(''), jdecode('%2F22901%2Findex.html'), 'true',[ 
		['PAGE','42801',jdecode('Lutas+por+terras'),jdecode(''), jdecode('%2F22901%2F42801.html'), 'true',[],'','']
	],'',''],
	['PAGE','15001',jdecode('Expo+Arte+e+Poesia+'),jdecode(''), jdecode('%2F15001%2Findex.html'), 'true',[ 
		['PAGE','28901',jdecode('Poesia'),jdecode(''), jdecode('%2F15001%2F28901.html'), 'true',[],'',''],
		['PAGE','28922',jdecode('Links+Aquarelas'),jdecode(''), jdecode('%2F15001%2F28922.html'), 'true',[],'',''],
		['PAGE','32501',jdecode('Aquarelas+de+Walewska'),jdecode(''), jdecode('%2F15001%2F32501.html'), 'true',[],'','']
	],'',''],
	['PAGE','13401',jdecode('Links+Favoritos'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='FFFF00';
theSitetree.keyvisualId='876';
theSitetree.keyvisualName='duenen.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='190';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
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: 			'Neon',
				paletteFamily: 	'FFFF00',
				keyvisualId: 	'876',
				keyvisualName: 	'duenen.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'190',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-b02063ea879a80e8dea30c148d65c696']={
webappId:    '7060',
documentId:  '5601',
internalId:  'b02063ea879a80e8dea30c148d65c696',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-cec459cc45b014bf3d846cfdc74b0f7a']={
webappId:    '7060',
documentId:  '12101',
internalId:  'cec459cc45b014bf3d846cfdc74b0f7a',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20111215-192022'
};
webappMappings['1501']=webappMappings['1501-12836712']={
webappId:    '1501',
documentId:  '501',
internalId:  '12836712',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20080902-122151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100223-090050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24501',
internalId:  '',
customField: '20081022-134538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20110314-100207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20110314-100050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20081204-081107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20111215-190154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100223-091000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080829-190022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20100223-091206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20110425-164405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20081120-115844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28922',
internalId:  '',
customField: '20101023-145325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20081028-181540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20101023-203026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20100315-195935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20101110-152632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44801',
internalId:  '',
customField: '20111215-191452'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPJVS';
var companyName   = 'gr%C3%A3o+de+areia';
var htmlTitle	  = '';
var metaKeywords  = 'Gr%C3%A3o+de+Areia%2C+Santa+Cruz+%2C++Aracruz%2C++Imigra%C3%A7%C3%A3o+italiana%2C++aquarela%2C+fotografia%2C+poesia%2C++rio+piraquea%C3%A7u%2C++';
var metaContents  = 'Website+sobre+o+pvoado+Santa+Cruz%2C+suas+hist%C3%B3rias%2C+a+imigra%C3%A7%C3%A3o+italiana+no+ES%2C+o+rio+Piraquea%C3%A7u%2C+suas+aldeias+ind%C3%ADgenas%2C+fotografia%2C+e+segue+passeando+pela+arte%2C+aquarela%2C+poesia....';
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();
};

