/* [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','701',jdecode('Walm+Lab'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','6722',jdecode('Servi%C3%A7os'),jdecode(''),'/6722/index.html','true',[ 
		['PAGE','17101',jdecode('Eletricidade'),jdecode(''),'/6722/17101.html','true',[],'',''],
		['PAGE','17122',jdecode('Temperatura+Umidade'),jdecode(''),'/6722/17122.html','true',[],'',''],
		['PAGE','38401',jdecode('Ac%C3%BAstica+eletroac%C3%BAstica'),jdecode(''),'/6722/38401.html','true',[],'',''],
		['PAGE','17143',jdecode('Vibra%C3%A7%C3%A3o'),jdecode(''),'/6722/17143.html','true',[],'',''],
		['PAGE','17164',jdecode('Iluminamento'),jdecode(''),'/6722/17164.html','true',[],'',''],
		['PAGE','17185',jdecode('Gases+e+poeira'),jdecode(''),'/6722/17185.html','true',[],'',''],
		['PAGE','28001',jdecode('Anemometria'),jdecode(''),'/6722/28001.html','true',[],'',''],
		['PAGE','17701',jdecode('Tempo+e+frequ%C3%AAncia'),jdecode(''),'/6722/17701.html','true',[],'','']
	],'',''],
	['PAGE','35801',jdecode('Nossa+hist%C3%B3ria'),jdecode(''),'/35801.html','true',[],'',''],
	['PAGE','6701',jdecode('Perguntas+frequentes'),jdecode(''),'/6701.html','true',[],'',''],
	['PAGE','6743',jdecode('Pol%C3%ADtica+da+qualidade'),jdecode(''),'/6743.html','true',[],'',''],
	['PAGE','6764',jdecode('Instrumentos+calibrados'),jdecode(''),'/6764.html','true',[],'',''],
	['PAGE','6785',jdecode('Links+interessantes'),jdecode(''),'/6785.html','true',[],'',''],
	['PAGE','6806',jdecode('Artigos+t%C3%A9cnicos'),jdecode(''),'/6806.html','true',[],'',''],
	['PAGE','6827',jdecode('Fale+conosco'),jdecode(''),'/6827.html','true',[],'',''],
	['PAGE','31301',jdecode('Trabalhe+conosco'),jdecode(''),'/31301.html','true',[],'',''],
	['PAGE','13901',jdecode('Usados+para+venda'),jdecode(''),'/13901/index.html','true',[ 
		['PAGE','14301',jdecode('Ofertas+-+Usados'),jdecode(''),'/13901/14301.html','true',[],'','']
	],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Trend';
theSitetree.paletteFamily='3F70CF';
theSitetree.keyvisualId='7953';
theSitetree.keyvisualName='kv_7953.jpg';
theSitetree.fontsetId='16911';
theSitetree.graphicsetId='12323';
theSitetree.contentColor='163D88';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Trend',
				paletteFamily: 	'3F70CF',
				keyvisualId: 	'7953',
				keyvisualName: 	'kv_7953.jpg',
				fontsetId: 		'16911',
				graphicsetId: 	'12323',
				contentColor: 	'163D88',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6030145']={
webappId:    '1501',
documentId:  '701',
internalId:  '6030145',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-2058']={
webappId:    '7008',
documentId:  '6827',
internalId:  '2058',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100220-203236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20071021-171751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20091230-145138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20071229-162648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20071223-174157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17122',
internalId:  '',
customField: '20080110-185738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17143',
internalId:  '',
customField: '20100220-205249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17164',
internalId:  '',
customField: '20100220-213540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17185',
internalId:  '',
customField: '20071229-163152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28001',
internalId:  '',
customField: '20071229-144906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20071229-145431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20071022-045517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20071026-110431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6764',
internalId:  '',
customField: '20091230-151355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6785',
internalId:  '',
customField: '20100215-093558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6806',
internalId:  '',
customField: '20100215-094137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6827',
internalId:  '',
customField: '20071026-105536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20100215-093349'
};
webappMappings['7060']=webappMappings['7060-60b5536ebdba1c0ae31a1cc8011c0de2']={
webappId:    '7060',
documentId:  '35801',
internalId:  '60b5536ebdba1c0ae31a1cc8011c0de2',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20100213-184603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20100220-213157'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INL7QH';
var companyName   = 'Laborat%C3%B3rio+de+Metrologia+Cient%C3%ADfica';
var htmlTitle	  = 'Walm+Lab+-+Laborat%C3%B3rio+de+Metrologia';
var metaKeywords  = 'Certificado+de+calibra%C3%A7%C3%A3o+Metrologia+Minipa+Eletroteste+Teknikao+Megabras';
var metaContents  = 'Calibra%C3%A7%C3%A3o+de+instrumentos+de+medi%C3%A7%C3%A3o+com+rastreabilidade+ao+INMETRO.+Conserto+de+instrumentos+de+medi%C3%A7%C3%A3o+Minipa%2C+Eletroteste%2C+Teknikao+e+Megabras.';
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();
};
