/* [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','1001',jdecode('Pagina+Inicial'),jdecode(''),'/1001.html','true',[],''],
	['PAGE','1073',jdecode('Quem+Somos'),jdecode(''),'/1073.html','true',[],''],
	['PAGE','1094',jdecode('O+que+fazemos'),jdecode(''),'/1094.html','true',[],''],
	['PAGE','1115',jdecode('Obras+em+Drywall'),jdecode(''),'/1115.html','true',[],''],
	['PAGE','26201',jdecode('Obras+em+Steel+Frame'),jdecode(''),'/26201.html','true',[],''],
	['PAGE','1157',jdecode('Not%C3%ADcias+Drycon'),jdecode(''),'/1157.html','true',[],''],
	['PAGE','27101',jdecode('Galeria+de+Obras'),jdecode(''),'/27101.html','true',[],''],
	['PAGE','1136',jdecode('Loja+de+Materias+'),jdecode(''),'/1136.html','true',[],''],
	['PAGE','1178',jdecode('Fale+Conosco'),jdecode(''),'/1178.html','true',[],''],
	['PAGE','1052',jdecode('Localiza%C3%A7%C3%A3o'),jdecode(''),'/1052.html','true',[],''],
	['PAGE','38901',jdecode('Links+Relacionados'),jdecode(''),'/38901.html','true',[],''],
	['PAGE','38922',jdecode('V%C3%ADdeos'),jdecode(''),'/38922.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Fluent';
theSitetree.paletteFamily='4971AD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10363';
theSitetree.graphicsetId='10523';
theSitetree.contentColor='757675';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Fluent',
				paletteFamily: 	'4971AD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10363',
				graphicsetId: 	'10523',
				contentColor: 	'757675',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'A4A5A4',
				e_color: 		'4971AD',
				f_color: 		'26487C',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6444042']={
webappId:    '1501',
documentId:  '1001',
internalId:  '6444042',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20090823-213829'
};
webappMappings['7060']=webappMappings['7060-c0078a8c00d161bb93d1668a900fe5ad']={
webappId:    '7060',
documentId:  '27101',
internalId:  'c0078a8c00d161bb93d1668a900fe5ad',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-7409']={
webappId:    '7008',
documentId:  '1178',
internalId:  '7409',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1073',
internalId:  '',
customField: '20090823-213915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20090822-101638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20090823-205936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1136',
internalId:  '',
customField: '20070909-142805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20090822-103450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20090823-210236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1178',
internalId:  '',
customField: '20071008-202516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20071214-202150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1052',
internalId:  '',
customField: '20071214-202100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20090823-214016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38922',
internalId:  '',
customField: '20090823-213042'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INL6DA';
var companyName   = 'Excel%C3%AAncia+em+Constru%C3%A7%C3%A3o+a+Seco';
var htmlTitle	  = 'Drycon+-+Drywall%2CSteel+Frame%2CStands%2CForros+Gesso+e+Mineral';
var metaKeywords  = 'DRYWALL%2CGESSO+ACARTONADO%2C+PAREDES%2C+FORROS%2CDIVIS%C3%93RIAS%2C+AC%C3%9ASTICA%2C+FORROS+MINERAIS%2C+DRYCON%2C+OBRAS%2C+STEEL+FRAME%2C+CHAPAS+DE+GESSO+ACARTONADO%2C+constru%C3%A7%C3%A3o+a+seco%2CMOLDURAS+DE+POLIURETANO%2C+ISOPOR%2C+MOLDURAS+DE+ISOPOR%2C+LIGHT+STEEL+FRAME%2C+LSF%2C+STEEL+FRAMING%2CGYPSUM';
var metaContents  = 'DRYCON%2CDRYWALL%2C+OBRAS%2C+FORROS%2C+Steel+frame%2Cgesso+acartonado%2Cparedes+drywall%2C+divis%C3%B3rias+drywall%2C+divis%C3%B3rias+gypsum%2Cplco%2Cplacocenter%2Clafarge%2Cknauf%2Cgypsum%2Clygth+steell+framing%2Cstell+framing%2Cgesso%2C+armazem+do+gesso%2C+brasfor%2Cartesana%2Cplanan%2Cciasul%2C+casa+do+drywall%2Cwalltech%2Cforro+de+gesso+parede+de+gesso%2C+constru%C3%A7a%C3%B5+a+seco%2C+constru%C3%A7%C3%A3o+leve%2C+greem+building+contruction%2Cgreem+building%2Cmassa+para+drywall%2C+placas+para+drywall%2C+chapas+para+drywall%2Cchapas%2C+placas%2Cacustica%2C+forro+acustico%2Cparede+acustica%2Cisolamento+acustico%2Cl%C3%A3+de+vidro%2C+l%C3%A3+de+rocha%2C+l%C3%A3+mineral%2C+forro+mineral%2C+MOLDURAS+DE+ISOPOR%2C+ISOPOR%2C+POLIURETANO%2CMOLDURAS+DE+POLIURETANO';
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();
};
