/* [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','301',jdecode('P%C3%81GINA+INICIAL'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','57701',jdecode('COMERCIAL'),jdecode(''),'/57701.html','true',[],'',''],
	['PAGE','64301',jdecode('RESIDENCIAL'),jdecode(''),'/64301/index.html','true',[ 
		['PAGE','95301',jdecode('Arm%C3%A1rios'),jdecode(''),'/64301/95301.html','true',[],'',''],
		['PAGE','99501',jdecode('Home+Theaters'),jdecode(''),'/64301/99501.html','true',[],'',''],
		['PAGE','95322',jdecode('Cozinhas'),jdecode(''),'/64301/95322.html','true',[],'',''],
		['PAGE','95343',jdecode('Banheiros'),jdecode(''),'/64301/95343.html','true',[],'',''],
		['PAGE','95364',jdecode('Churrasqueiras'),jdecode(''),'/64301/95364.html','true',[],'','']
	],'',''],
	['PAGE','394',jdecode('LINHA+PET'),jdecode(''),'/394.html','true',[],'',''],
	['PAGE','77001',jdecode('CLIENTES'),jdecode(''),'/77001/index.html','true',[ 
		['PAGE','76301',jdecode('Cantareira'),jdecode(''),'/77001/76301.html','true',[],'',''],
		['PAGE','77501',jdecode('Piratininga'),jdecode(''),'/77001/77501.html','true',[],'',''],
		['PAGE','78201',jdecode('Mau%C3%A1'),jdecode(''),'/77001/78201.html','true',[],'',''],
		['PAGE','78701',jdecode('S%C3%A3o+Miguel'),jdecode(''),'/77001/78701.html','true',[],'','']
	],'',''],
	['PAGE','81701',jdecode('EVENTOS'),jdecode(''),'/81701.html','true',[],'',''],
	['PAGE','16622',jdecode('EMPRESA'),jdecode(''),'/16622.html','true',[],'',''],
	['PAGE','583',jdecode('CONTATO'),jdecode(''),'/583.html','true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Sense';
theSitetree.paletteFamily='CE3000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10522';
theSitetree.graphicsetId='11108';
theSitetree.contentColor='A11E1E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sense',
				paletteFamily: 	'CE3000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10522',
				graphicsetId: 	'11108',
				contentColor: 	'A11E1E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-5273166']={
webappId:    '1501',
documentId:  '301',
internalId:  '5273166',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95322',
internalId:  '',
customField: '20100120-142738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95343',
internalId:  '',
customField: '20100120-143335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100814-105634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95301',
internalId:  '',
customField: '20100120-133030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57701',
internalId:  '',
customField: '20090113-074855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64301',
internalId:  '',
customField: '20100623-192739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20100616-084154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77001',
internalId:  '',
customField: '20081117-191846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76301',
internalId:  '',
customField: '20081008-120414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77501',
internalId:  '',
customField: '20081008-110052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78201',
internalId:  '',
customField: '20081008-110408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78701',
internalId:  '',
customField: '20081008-110809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81701',
internalId:  '',
customField: '20090621-155509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20100623-191249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '583',
internalId:  '',
customField: '20100623-193513'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95364',
internalId:  '',
customField: '20100120-143128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99501',
internalId:  '',
customField: '20100123-094942'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVZWH';
var companyName   = 'IGS+MARCENARIA';
var htmlTitle	  = 'IGS+MARCENARIA+3435-4311+%2F+7318-8036';
var metaKeywords  = 'm%C3%B3veis%2C+moveis%2C+comercial%2C+comerciais%2C+m%C3%B3vel%2C+movel%2C+marcenaria%2C+marcenarias%2C+igs%2C+pet%2C+box%2C+shop%2C+ra%C3%A7%C3%A3o%2C+Guarulhos%2C+guarulhos%2C+S%C3%A3o+Paulo%2C+s%C3%A3o+paulo%2C+mdf%2C+madeira%2Cp%C3%BAlpito%2C+religioso%2Cbanco%2Ccozinha%2C+planejado%2C+arm%C3%A1rio%2C+escrit%C3%B3rio%2C+residencial%2C+ind%C3%BAstria%2Cigreja%2C+alimento%2C+animal%2C+home+theater%2C+sala%2C+banheiro%2C+%C3%A1rea+de+servi%C3%A7o%2C+lavanderia%2C+quarto%2C+beb%C3%AA%2C+crian%C3%A7a%2C+mulher%2C+homem%2C+marceneiro%2Ccart%C3%A3o+de+cr%C3%A9dito%2C+dinheiro%2C+menino%2C+menina%2C+adolescente%2C+su%C3%ADte%2C+sala+de+estar%2C+sala+de+espera%2C+consult%C3%B3rio%2C+escola%2C+sal%C3%A3o%2C+imobili%C3%A1ria%2C+loja%2C+shopping%2C+estande%2C+stand%2C++show+room%2C+f%C3%A1brica';
var metaContents  = 'm%C3%B3veis%2C+moveis%2C+comercial%2C+comerciais%2C+m%C3%B3vel%2C+movel%2C+marcenaria%2C+marcenarias%2C+igs%2C+pet%2C+box%2C+shop%2C+ra%C3%A7%C3%A3o%2C+Guarulhos%2C+guarulhos%2C+S%C3%A3o+Paulo%2C+s%C3%A3o+paulo%2C+mdf%2C+madeira%2Cp%C3%BAlpito%2C+religioso%2Cbanco%2Ccozinha%2C+planejado%2C+arm%C3%A1rio%2C+escrit%C3%B3rio%2C+residencial%2C+ind%C3%BAstria%2Cigreja%2C+alimento%2C+animal%2C+home+theater%2C+sala%2C+banheiro%2C+%C3%A1rea+de+servi%C3%A7o%2C+lavanderia%2C+quarto%2C+beb%C3%AA%2C+crian%C3%A7a%2C+mulher%2C+homem%2C+marceneiro%2Ccart%C3%A3o+de+cr%C3%A9dito%2C+dinheiro%2C+menino%2C+menina%2C+adolescente%2C+su%C3%ADte%2C+sala+de+estar%2C+sala+de+espera%2C+consult%C3%B3rio%2C+escola%2C+sal%C3%A3o%2C+imobili%C3%A1ria%2C+loja%2C+shopping%2C+estande%2C+stand%2C+show+room%2C+f%C3%A1brica';
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();
};
