/* [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','1401',jdecode('Empresa'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','60344',jdecode('Servi%C3%A7os'),jdecode(''),'/60344/index.html','true',[ 
		['PAGE','1473',jdecode('Controle+de+Pragas'),jdecode(''),'/60344/1473.html','false',[],'',''],
		['PAGE','63854',jdecode('Controle+de+P%C3%A1ssaros+e+Morcegos'),jdecode(''),'/60344/63854.html','false',[],'',''],
		['PAGE','65654',jdecode('Desinsetiza%C3%A7%C3%A3o'),jdecode(''),'/60344/65654.html','false',[],'',''],
		['PAGE','65675',jdecode('Desratiza%C3%A7%C3%A3o'),jdecode(''),'/60344/65675.html','false',[],'',''],
		['PAGE','65696',jdecode('Descupiniza%C3%A7%C3%A3o'),jdecode(''),'/60344/65696.html','false',[],'',''],
		['PAGE','57644',jdecode('Limpeza+T%C3%A9cnica'),jdecode(''),'/60344/57644.html','false',[],'','']
	],'',''],
	['PAGE','1494',jdecode('Produtos'),jdecode(''),'/1494.html','true',[],'',''],
	['PAGE','1801',jdecode('Informativos'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','22816',jdecode('P%C3%BAblico+Alvo'),jdecode(''),'/22816.html','true',[],'',''],
	['PAGE','1822',jdecode('Legisla%C3%A7%C3%A3o'),jdecode(''),'/1822.html','true',[],'',''],
	['PAGE','1843',jdecode('Pragas'),jdecode(''),'/1843/index.html','true',[ 
		['PAGE','31916',jdecode('Mosca'),jdecode(''),'/1843/31916.html','false',[],'',''],
		['PAGE','32216',jdecode('Mosquitos'),jdecode(''),'/1843/32216.html','false',[],'',''],
		['PAGE','32237',jdecode('Baratas'),jdecode(''),'/1843/32237.html','false',[],'',''],
		['PAGE','36844',jdecode('Formigas'),jdecode(''),'/1843/36844.html','false',[],'',''],
		['PAGE','38644',jdecode('Cupim'),jdecode(''),'/1843/38644.html','false',[],'',''],
		['PAGE','37744',jdecode('Tra%C3%A7a'),jdecode(''),'/1843/37744.html','false',[],'',''],
		['PAGE','37765',jdecode('Piolho'),jdecode(''),'/1843/37765.html','false',[],'',''],
		['PAGE','32258',jdecode('Aranhas'),jdecode(''),'/1843/32258.html','false',[],'',''],
		['PAGE','32279',jdecode('Escorpi%C3%B5es'),jdecode(''),'/1843/32279.html','false',[],'',''],
		['PAGE','40344',jdecode('Roedores'),jdecode(''),'/1843/40344.html','false',[],'',''],
		['PAGE','32816',jdecode('Cobras'),jdecode(''),'/1843/32816.html','false',[],'',''],
		['PAGE','41444',jdecode('Morcegos'),jdecode(''),'/1843/41444.html','false',[],'','']
	],'',''],
	['PAGE','1515',jdecode('Contato'),jdecode(''),'/1515.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20100406-095634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1515',
internalId:  '',
customField: '20100426-153157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1473',
internalId:  '',
customField: '20100427-114257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36844',
internalId:  '',
customField: '20090427-174551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100427-114912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1843',
internalId:  '',
customField: '20090427-221433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1822',
internalId:  '',
customField: '20091208-134350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1494',
internalId:  '',
customField: '20100406-095348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32258',
internalId:  '',
customField: '20090427-190235'
};
webappMappings['7008']=webappMappings['7008-6788']={
webappId:    '7008',
documentId:  '1515',
internalId:  '6788',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22816',
internalId:  '',
customField: '20090427-220023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31916',
internalId:  '',
customField: '20090427-165217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32237',
internalId:  '',
customField: '20090427-172731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37744',
internalId:  '',
customField: '20090427-184250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37765',
internalId:  '',
customField: '20090427-183616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38644',
internalId:  '',
customField: '20090427-184914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32279',
internalId:  '',
customField: '20090427-190829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40344',
internalId:  '',
customField: '20090427-192931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32816',
internalId:  '',
customField: '20090427-195421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41444',
internalId:  '',
customField: '20090427-200316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32216',
internalId:  '',
customField: '20090427-134116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60344',
internalId:  '',
customField: '20100603-103750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65654',
internalId:  '',
customField: '20091217-140448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57644',
internalId:  '',
customField: '20100425-111612'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63854',
internalId:  '',
customField: '20100425-110927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65675',
internalId:  '',
customField: '20091223-074338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65696',
internalId:  '',
customField: '20100426-090823'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHA5R';
var companyName   = 'Atendimento+%2873%29+3288-3400';
var htmlTitle	  = 'MC+Ambiental++Tecnologia+em+Servi%C3%A7os';
var metaKeywords  = 'Controle+de+Pragas%2C+Desinsetiza%C3%A7%C3%A3o%2C+Desratiza%C3%A7%C3%A3o%2C+Descupiniza%C3%A7%C3%A3o%2C+P%C3%A1ssaros%2C+Morcegos%2C+Ratos%2C+baratas%2C+formigas';
var metaContents  = 'MC+Ambiental+Tecnologia+em+Controle+de+Pragas';
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();
};
