/* [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','1001',jdecode('P%C3%81GINA+INCIAL'),jdecode(''), jdecode('%2F1001.html'), 'true',[],'',''],
	['PAGE','1073',jdecode('QUEM+SOMOS'),jdecode(''), jdecode('%2F1073.html'), 'true',[],'',''],
	['PAGE','33701',jdecode('TREINAMENTO+CORPORATIVO'),jdecode(''), jdecode('%2F33701.html'), 'true',[],'',''],
	['PAGE','1157',jdecode('SONS+%26+V%C3%8DNCULOS'),jdecode(''), jdecode('%2F1157.html'), 'true',[],'',''],
	['PAGE','1178',jdecode('CAPACITA%C3%87%C3%83O+PEDAG%C3%93GICA'),jdecode(''), jdecode('%2F1178.html'), 'true',[],'',''],
	['PAGE','1094',jdecode('PRODU%C3%87%C3%83O+CULTURAL'),jdecode(''), jdecode('%2F1094.html'), 'true',[],'',''],
	['PAGE','35301',jdecode('Saber+2009'),jdecode(''), jdecode('%2F35301.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('ATELI%C3%8A+MUSICAL'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','21301',jdecode('CLIENTES'),jdecode(''), jdecode('%2F21301.html'), 'true',[],'',''],
	['PAGE','1115',jdecode('CONTATO'),jdecode(''), jdecode('%2F1115.html'), 'true',[],'',''],
	['PAGE','1136',jdecode('FOTOS+SONS+%26+V%C3%8DNCULOS'),jdecode(''), jdecode('%2F1136.html'), 'true',[],'',''],
	['PAGE','23801',jdecode('FOTOS+TREINAMENTOS'),jdecode(''), jdecode('%2F23801.html'), 'true',[],'',''],
	['PAGE','23822',jdecode('FOTOS+CAPACITA%C3%87%C3%83O'),jdecode(''), jdecode('%2F23822.html'), 'true',[],'',''],
	['PAGE','23843',jdecode('FOTOS+PRODU%C3%87%C3%83O+CULTURAL'),jdecode(''), jdecode('%2F23843.html'), 'true',[],'',''],
	['PAGE','23864',jdecode('FOTOS+ATELI%C3%8A+MUSICAL'),jdecode(''), jdecode('%2F23864.html'), 'true',[],'',''],
	['PAGE','30601',jdecode('V%C3%8DDEOS'),jdecode(''), jdecode('%2F30601.html'), 'true',[],'',''],
	['PAGE','31606',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''), jdecode('%2F31606%2Findex.html'), 'true',[ 
		['PAGE','31601',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''), jdecode('%2F31606%2F31601.html'), 'false',[],'','']
	],'',''],
	['PAGE','31701',jdecode('Fotos+Sons+%26+V%C3%ADnculos'),jdecode(''), jdecode('%2F31701.html'), 'true',[],'',''],
	['PAGE','32001',jdecode('Blog'),jdecode(''), jdecode('%2F32001.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9WF'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'290',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-31606avec10inllw8']={
webappId:    '1002',
documentId:  '31606',
internalId:  '31606avec10inllw8',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-4318e80adb1d2cf7f6060e7c00284e82']={
webappId:    '7060',
documentId:  '31701',
internalId:  '4318e80adb1d2cf7f6060e7c00284e82',
customField: 'language:pt;country:BR;'
};
webappMappings['7050']=webappMappings['7050-1673']={
webappId:    '7050',
documentId:  '32001',
internalId:  '1673',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20110106-173011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20090421-164216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20110106-173432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1178',
internalId:  '',
customField: '20090421-171658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20090421-171906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1136',
internalId:  '',
customField: '20081123-131124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23801',
internalId:  '',
customField: '20090421-172409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20101105-122936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20081123-124021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23822',
internalId:  '',
customField: '20090421-172747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23843',
internalId:  '',
customField: '20100603-214923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23864',
internalId:  '',
customField: '20080714-080654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20081123-131029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31606',
internalId:  '',
customField: '20081123-125239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20081123-132157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20100603-102920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1073',
internalId:  '',
customField: '20110105-214128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21301',
internalId:  '',
customField: '20101105-123043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20081123-125239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20090919-162352'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLLW8';
var companyName   = 'Z.R.G.+SONS+%26+V%C3%8DNCULOS';
var htmlTitle	  = 'ZRG+SONS++V%C3%8DNCULOS';
var metaKeywords  = 'Sons++V%C3%ADnculos++Din%C3%A2micas+++Musicais++Capacita%C3%A7%C3%A3o++Projetos++Produ%C3%A7%C3%A3o++ZRG++Ara%C3%A7atuba++M%C3%BAsica++equipe++lideran%C3%A7a++instrumental++violeiro++ensino+++escola+produ%C3%A7%C3%B5es+culturais+zrg+RH+Recursos+Humanos+++++';
var metaContents  = 'Sons+e+V%C3%ADnculos++Sons++V%C3%ADnculos++M%C3%BAsica+na+Escola++Produ%C3%A7%C3%A3o+Cultural++Duo+portal++Duoportal++Ateli%C3%AA+Musical++Z%C3%A9+Renato+Gimenes+++Jos%C3%A9+Renato+Gimenes++M%C3%BAsica+em+treinamento+empresarial++Consultoria++M%C3%BAsica++Cultural++Din%C3%A2micas+Musicais++Projetos+Culturais++Capcita%C3%A7%C3%A3o+Educacional++ZRG++M%C3%BAsica+para+treinamento++fortalecimento+de+equipe++m%C3%BAsica+instrumental++ensino+musical+produ%C3%A7%C3%B5es+producoes+zrg+z.r.g.+RH+Recursos+Humanos';
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();
};

