/* [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','801',jdecode('Home'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','852',jdecode('Empresa'),jdecode(''), jdecode('%2F852.html'), 'true',[],'',''],
	['PAGE','873',jdecode('Quem+somos'),jdecode(''), jdecode('%2F873.html'), 'true',[],'',''],
	['PAGE','50001',jdecode('Assessoria'),jdecode(''), jdecode('%2F50001.html'), 'true',[],'',''],
	['PAGE','894',jdecode('Treinamentos'),jdecode(''), jdecode('%2F894.html'), 'true',[],'',''],
	['PAGE','936',jdecode('T%C3%A9cnicas+para+Dinamizar+Grupos'),jdecode(''), jdecode('%2F936.html'), 'true',[],'',''],
	['PAGE','69401',jdecode('Um+passo+adiante...'),jdecode(''), jdecode('%2F69401.html'), 'true',[],'',''],
	['PAGE','62301',jdecode('Passos+Adiante...'),jdecode(''), jdecode('%2F62301.html'), 'true',[],'',''],
	['PAGE','78312',jdecode('N%C3%93S+NA+RODA'),jdecode(''), jdecode('%2F78312.html'), 'true',[],'',''],
	['PAGE','7701',jdecode('MBTI'),jdecode(''), jdecode('%2F7701.html'), 'true',[],'',''],
	['PAGE','28401',jdecode('Artigos'),jdecode(''), jdecode('%2F28401.html'), 'true',[],'',''],
	['PAGE','978',jdecode('Nossos+Clientes'),jdecode(''), jdecode('%2F978.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('Contato'),jdecode(''), jdecode('%2F7001.html'), 'true',[],'',''],
	['PAGE','1041',jdecode('Links+Interessantes'),jdecode(''), jdecode('%2F1041.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='FF9B5E';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='430';
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: 			'Seifenblase',
				paletteFamily: 	'FF9B5E',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'430',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'CC3300',
				e_color: 		'FF3300',
				f_color: 		'FF9966',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78312',
internalId:  '',
customField: '20110930-212726'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20110526-112812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20110123-210623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20110123-212549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '936',
internalId:  '',
customField: '20111130-052552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69401',
internalId:  '',
customField: '20110526-112204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20110526-104955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20110123-211152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62301',
internalId:  '',
customField: '20110526-112306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20110123-222942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20110123-223107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20110123-231308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20110123-223305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1041',
internalId:  '',
customField: '20110123-223218'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLRUY';
var companyName   = 'MAZZONI+%26+VALERIANO';
var htmlTitle	  = 'MAZZONI++VALERIANO';
var metaKeywords  = 'Lideran%C3%A7a%3B+Relacionamento%3B+Instrutores%3B+Criatividade%3B+Dinamiza%C3%A7%C3%A3o+de+Grupos%3B+Interpessoal%3B+MBTI%3BDin%C3%A2mica+de+Grupo%3B+Comunica%C3%A7%C3%A3o%3B+Sandra+Mazzoni%3B+Elizabeth+Valeriano%3B+Dinamizar%3B+Dinamiza%C3%A7%C3%A3o+de+Grupos%3B+Ana+L%C3%BAcia+P%C3%B3%3B+Gabriela+Bessa%3B+N%C3%B3s+na+Roda';
var metaContents  = 'Treinamento%3B+Coaching%3B+Dan%C3%A7as+Circulares%3B+MBTI%3B+Forma%C3%A7%C3%A3o+de+Dinamizadores+de+Grupos%3B+N%C3%B3s+na+Roda%3B+Dinamiza%C3%A7%C3%A3o+de+Grupos%3B+T%C3%A9cnicas+para+Dinamizar+Grupos';
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();
};

