/* [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','11',jdecode('PRINCIPAL'),jdecode(''), jdecode('%2F11.html'), 'true',[],'',''],
	['PAGE','32',jdecode('Trajet%C3%B3ria'),jdecode(''), jdecode('%2F32.html'), 'true',[],'',''],
	['PAGE','68',jdecode('Curr%C3%ADculo'),jdecode(''), jdecode('%2F68.html'), 'true',[],'',''],
	['PAGE','91801',jdecode('FOLCLORE'),jdecode(''), jdecode('%2F91801.html'), 'true',[],'',''],
	['PAGE','41',jdecode('GALERIA'),jdecode(''), jdecode('%2F41%2Findex.html'), 'true',[ 
		['PAGE','59',jdecode('pinturas'),jdecode(''), jdecode('%2F41%2F59.html'), 'true',[],'',''],
		['PAGE','50',jdecode('esculturas+'),jdecode(''), jdecode('%2F41%2F50.html'), 'true',[],'',''],
		['PAGE','2059',jdecode('objetos+m%C3%ADticos'),jdecode(''), jdecode('%2F41%2F2059.html'), 'true',[],'',''],
		['PAGE','2236',jdecode('gravuras'),jdecode(''), jdecode('%2F41%2F2236.html'), 'true',[],'',''],
		['PAGE','1085',jdecode('arte+p%C3%BAblica'),jdecode(''), jdecode('%2F41%2F1085.html'), 'true',[],'',''],
		['PAGE','1094',jdecode('cultura+popular'),jdecode(''), jdecode('%2F41%2F1094.html'), 'true',[],'','']
	],'',''],
	['PAGE','19901',jdecode('Sal%C3%B5es+2011'),jdecode(''), jdecode('%2F19901.html'), 'true',[],'',''],
	['PAGE','86',jdecode('Not%C3%ADcias'),jdecode(''), jdecode('%2F86.html'), 'true',[],'',''],
	['PAGE','2339',jdecode('LINKS'),jdecode(''), jdecode('%2F2339.html'), 'true',[],'',''],
	['PAGE','1292',jdecode('Cursos'),jdecode(''), jdecode('%2F1292.html'), 'true',[],'',''],
	['PAGE','77',jdecode('contato'),jdecode(''), jdecode('%2F77%2Findex.html'), 'true',[ 
		['PAGE','1737',jdecode('Contato+%28p%C3%A1gina+seguir%29'),jdecode(''), jdecode('%2F77%2F1737.html'), 'false',[],'','']
	],'',''],
	['PAGE','1751',jdecode('LIVRO+VISITAS'),jdecode(''), jdecode('%2F1751%2Findex.html'), 'true',[ 
		['PAGE','1750',jdecode('+bilhetes'),jdecode(''), jdecode('%2F1751%2F1750.html'), 'false',[],'','']
	],'',''],
	['PAGE','71701',jdecode('FOTOS+Rev.SP'),jdecode(''), jdecode('%2F71701.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Akropolis';
theSitetree.paletteFamily='4A587F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10554';
theSitetree.graphicsetId='10449';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4A587F';
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: 			'Akropolis',
				paletteFamily: 	'4A587F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10554',
				graphicsetId: 	'10449',
				contentColor: 	'FFFFFF',
				contentBGColor: '4A587F',
				a_color: 		'4A587F',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11',
internalId:  '',
customField: '20120110-135946'
};
webappMappings['1002']=webappMappings['1002-1751AVEC10IN2SU2']={
webappId:    '1002',
documentId:  '1751',
internalId:  '1751AVEC10IN2SU2',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1163077']={
webappId:    '1501',
documentId:  '11',
internalId:  '1163077',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-6734a9c6be75577b5da374c39e022b42']={
webappId:    '7060',
documentId:  '71701',
internalId:  '6734a9c6be75577b5da374c39e022b42',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20101101-201959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68',
internalId:  '',
customField: '20100103-202033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41',
internalId:  '',
customField: '20080120-194807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59',
internalId:  '',
customField: '20080120-195139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50',
internalId:  '',
customField: '20070422-173833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2059',
internalId:  '',
customField: '20080120-194920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20070422-170816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1085',
internalId:  '',
customField: '20070422-165916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20070422-181703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1292',
internalId:  '',
customField: '20110106-190421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91801',
internalId:  '',
customField: '20110316-190456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86',
internalId:  '',
customField: '20111002-172138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20110301-164316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2339',
internalId:  '',
customField: '20110110-163717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77',
internalId:  '',
customField: '20070422-170942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1737',
internalId:  '',
customField: '20060724-180007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1751',
internalId:  '',
customField: '20061105-221823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1750',
internalId:  '',
customField: '20070804-125017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71701',
internalId:  '',
customField: '20080330-125100'
};
webappMappings['7008']=webappMappings['7008-7661']={
webappId:    '7008',
documentId:  '77',
internalId:  '7661',
customField: 'language:pt;country:BR;'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2SU2';
var companyName   = 'EDGARD+SANTO+MORETTI';
var htmlTitle	  = 'edgardsantomoretti.com';
var metaKeywords  = 'ArteS+Pl%C3%A1sticaS%2C+ArtE%2C+PinturA%2C+CulturA%2C++Exposi%C3%A7%C3%B5eS%2C+Sal%C3%B5eS+de+ArtE%2C++sucatas%2C+ImagenS%2C+GravurA%2C+BienaL%2C+ArtistaS%2C+Inscri%C3%A7%C3%B5eS%2C+Belas+ArteS%2C';
var metaContents  = 'edgardsantomoretti.com+-++Edgard+Santo+Moretti%3BCultura+popular%3BArte+Contempor%C3%A2nea%3BArtesanato%3BRevelando+S%C3%A3o+Paulo%3BEsculturas%3BPinturas%3BArtes+Pl%C3%A1sticas%3Bgravuras%3BGrafite%3Bfotografia%3Bcultura%3Bboibumb%C3%A1%2Cfolclore%3BBienal%3BExposi%C3%A7%C3%B5es%3BSal%C3%B5es+de+Arte%3BCr%C3%ADticos+de+Arte%3BInscri%C3%A7%C3%B5es+Sal%C3%B5es+de+Arte%3BAgenda%3BEventos%3Bpremia%C3%A7%C3%B5es%3BCursos+de+Arte%3BBarueri%2C';
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();
};

