/* [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','6401',jdecode('Inicial'),jdecode(''), jdecode('%2F6401.html'), 'true',[],'',''],
	['PAGE','6494',jdecode('Servi%C3%A7o'),jdecode(''), jdecode('%2F6494.html'), 'true',[],'',''],
	['PAGE','6452',jdecode('Gest%C3%A3o+Atual'),jdecode(''), jdecode('%2F6452.html'), 'true',[],'',''],
	['PAGE','6515',jdecode('Profissionais'),jdecode(''), jdecode('%2F6515.html'), 'true',[],'',''],
	['PAGE','6473',jdecode('Conv%C3%AAnios'),jdecode(''), jdecode('%2F6473.html'), 'true',[],'',''],
	['PAGE','26144',jdecode('Parceiros'),jdecode(''), jdecode('%2F26144.html'), 'true',[],'',''],
	['PAGE','6536',jdecode('Contato'),jdecode(''), jdecode('%2F6536.html'), 'true',[],'',''],
	['PAGE','26123',jdecode('Artigos'),jdecode(''), jdecode('%2F26123%2Findex.html'), 'true',[ 
		['PAGE','23123',jdecode('Artigo+1'),jdecode(''), jdecode('%2F26123%2F23123.html'), 'true',[],'',''],
		['PAGE','22412',jdecode('Artigo+2'),jdecode(''), jdecode('%2F26123%2F22412.html'), 'true',[],'',''],
		['PAGE','6557',jdecode('Artigo+3'),jdecode(''), jdecode('%2F26123%2F6557.html'), 'true',[],'',''],
		['PAGE','18101',jdecode('Artigo+4'),jdecode(''), jdecode('%2F26123%2F18101.html'), 'true',[],'',''],
		['PAGE','19601',jdecode('Artigo+5'),jdecode(''), jdecode('%2F26123%2F19601.html'), 'true',[],'','']
	],'',''],
	['PAGE','15301',jdecode('Links+%C3%BAteis'),jdecode(''), jdecode('%2F15301.html'), 'true',[],'',''],
	['PAGE','27723',jdecode('Sele%C3%A7%C3%A3o+de+Psic%C3%B3logos'),jdecode(''), jdecode('%2F27723.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Trade';
theSitetree.paletteFamily='4D8DBD';
theSitetree.keyvisualId='12107';
theSitetree.keyvisualName='kv_12107.jpg';
theSitetree.fontsetId='33299';
theSitetree.graphicsetId='14174';
theSitetree.contentColor='666666';
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: 			'Trade',
				paletteFamily: 	'4D8DBD',
				keyvisualId: 	'12107',
				keyvisualName: 	'kv_12107.jpg',
				fontsetId: 		'33299',
				graphicsetId: 	'14174',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20110810-122604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6452',
internalId:  '',
customField: '20120206-152448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6473',
internalId:  '',
customField: '20110126-135512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6494',
internalId:  '',
customField: '20100520-133107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6515',
internalId:  '',
customField: '20120206-152534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6536',
internalId:  '',
customField: '20111214-125218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6557',
internalId:  '',
customField: '20100706-160058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20110810-123419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20100825-082305'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20101201-132950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22412',
internalId:  '',
customField: '20110810-124412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23123',
internalId:  '',
customField: '20110810-124155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26144',
internalId:  '',
customField: '20111208-133714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26123',
internalId:  '',
customField: '20110814-165256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27723',
internalId:  '',
customField: '20111214-124829'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7CELZ';
var companyName   = 'Unipsico+Vale+do+Sinos';
var htmlTitle	  = 'UNIPSICO+VALE+DO+SINOS';
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();
};

