/* [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 theSitetree=[ 
	['PAGE','14',jdecode('Home'),jdecode(''),'/14.html','true',[],''],
	['PAGE','1017',jdecode('P%C3%A1gina+inicial'),jdecode(''),'/1017.html','true',[],''],
	['PAGE','1026',jdecode('Quem+somos'),jdecode(''),'/1026/index.html','true',[ 
		['PAGE','1035',jdecode('Nossa+equipe'),jdecode(''),'/1026/1035.html','true',[],''],
		['PAGE','1044',jdecode('Onde+estamos'),jdecode(''),'/1026/1044.html','true',[],''],
		['PAGE','1053',jdecode('Parceiros'),jdecode(''),'/1026/1053.html','true',[],'']
	],''],
	['PAGE','1062',jdecode('Produtos'),jdecode(''),'/1062/index.html','true',[ 
		['PAGE','1453',jdecode('REPRESENTA%C3%87%C3%95ES'),jdecode(''),'/1062/1453.html','true',[],''],
		['PAGE','43101',jdecode('Corporativa'),jdecode(''),'/1062/43101.html','true',[],''],
		['PAGE','43122',jdecode('Residencial'),jdecode(''),'/1062/43122.html','true',[],'']
	],''],
	['PAGE','43185',jdecode('NOVIDADES+2008'),jdecode(''),'/43185.html','true',[],''],
	['PAGE','2072',jdecode('Servi%C3%A7os'),jdecode(''),'/2072.html','true',[],''],
	['PAGE','1080',jdecode('Refer%C3%AAncias'),jdecode(''),'/1080.html','true',[],''],
	['PAGE','1089',jdecode('Links'),jdecode(''),'/1089.html','true',[],''],
	['PAGE','1098',jdecode('Contato'),jdecode(''),'/1098.html','true',[],''],
	['PAGE','4038',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/4038/index.html','true',[ 
		['PAGE','4037',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/4038/4037.html','false',[],'']
	],'']];
var siteelementCount=17;
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={
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1045578']={
webappId:    '1501',
documentId:  '14',
internalId:  '1045578',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1017',
internalId:  '',
customField: '20090207-080253'
};
webappMappings['1002']=webappMappings['1002-4038AVEC10IN26KQ']={
webappId:    '1002',
documentId:  '4038',
internalId:  '4038AVEC10IN26KQ',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14',
internalId:  '',
customField: '20061229-141344'
};
webappMappings['1501']=webappMappings['1501-1869651']={
webappId:    '1501',
documentId:  '14',
internalId:  '1869651',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1026',
internalId:  '',
customField: '20090207-080133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1035',
internalId:  '',
customField: '20090207-080458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1044',
internalId:  '',
customField: '20060924-202225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1062',
internalId:  '',
customField: '20090207-083040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43101',
internalId:  '',
customField: '20090207-091650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43122',
internalId:  '',
customField: '20090207-083444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43185',
internalId:  '',
customField: '20080112-192725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2072',
internalId:  '',
customField: '20090207-084459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1080',
internalId:  '',
customField: '20060410-193424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1089',
internalId:  '',
customField: '20090207-084900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1053',
internalId:  '',
customField: '20060616-194327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1453',
internalId:  '',
customField: '20080113-130556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1098',
internalId:  '',
customField: '20060622-134720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4038',
internalId:  '',
customField: '20060924-203336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4037',
internalId:  '',
customField: '20060924-203336'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN26KQ';
var companyName   = 'Arquitetura+%26+Cia%C2%AE';
var htmlTitle	  = 'www.arquiteturaecia.com';
var metaKeywords  = 'Arquitetura%2C+Materiais+de+Acabamento%2C+Acabamentos%2C+Pisos%2C+Revestimentos%2C+Isolantes%2C+Isolantes+T%C3%A9rmicos%2C+Ac%C3%BAstica%2C+Isolantes+Ac%C3%BAsticos%2C+Lou%C3%A7as+Sanit%C3%A1rias%2C+Metais+Sanit%C3%A1rios%2C+Banheiras%2C+Revestimentos+Industriais%2C+Ilumina%C3%A7%C3%A3o%2C+Lumin%C3%A1rias%2C+Pisos+de+Madeira%2C+Laminados%2C+Pisos+Laminados%2C+Carpete+de+Madeira%2C+Cer%C3%A2micas%2C+Porcelanatos%2C+Pastilhas%2C+Pastilhas+de+Vidro%2C+Pastilhas+de+Porcelana%2C+Argamassas%2C+Fibras+Naturais%2C+Cortinas%2C+Persianas%2C+In%C3%B3x%2C+Pias+de+In%C3%B3x%2C+Cubas+de+In%C3%B3x%2C+Pastilhas+de+In%C3%B3x%2C+Revestimentos+de+In%C3%B3x%2C+Policarbonato%2C+ACM%2C+Alum%C3%ADnio+Composto%2C+Revestimento+em+Alum%C3%ADnio%2C+Fibrocimento%2C+Placas+Ciment%C3%ADcias%2C+Pain%C3%A9l+Wall%2C+Drywall%2C+Tubula%C3%A7%C3%A3o+Flex%C3%ADvel%2C+Acess%C3%B3rios+para+Drywall%2C+Hidr%C3%A1ulica%2C+Material+Hidr%C3%A1ulico%2C+Material+El%C3%A9trico%2C+Carpetes%2C+Cubas+de+Acr%C3%ADlico%2C+Cubas+de+Vidro%2C+Acr%C3%ADlico%2C+Vidro%2C+Cristal%2C+Cubas+de+Cristal%2C+Forros.';
var metaContents  = 'Empresa+especializada+em+Materiais+de+Acabamento+diferenciados.+Representa%C3%A7%C3%B5es+e+Revenda+das+marcas+mais+reconhecidas+nacional+e+internacionalmente.+Desde+revestimentos+cer%C3%A2micos+at%C3%A9+isolantes+t%C3%A9rmicos+e+ac%C3%BAsticos%2C+com+orienta%C3%A7%C3%B5es+para+sua+necessidade.';
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();
};
