/* [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','11',jdecode('Home'),jdecode(''),'/11.html','true',[],''],
	['PAGE','1104',jdecode('Pisos+e+Len%C3%A7ois'),jdecode(''),'/1104.html','true',[],''],
	['PAGE','2416',jdecode('Mangueiras+'),jdecode(''),'/2416.html','true',[],''],
	['PAGE','12366',jdecode('Correia'),jdecode(''),'/12366.html','true',[],''],
	['PAGE','12384',jdecode('Tarugos'),jdecode(''),'/12384.html','true',[],''],
	['PAGE','12149',jdecode('Veda%C3%A7%C3%A3o'),jdecode(''),'/12149.html','true',[],''],
	['PAGE','4645',jdecode('Pl%C3%A1sticos+Industriais'),jdecode(''),'/4645.html','true',[],''],
	['PAGE','1176',jdecode('Gaxetas'),jdecode(''),'/1176.html','true',[],''],
	['PAGE','35901',jdecode('Pe%C3%A7as+especiais'),jdecode(''),'/35901.html','true',[],''],
	['PAGE','12393',jdecode('Perfil+de+Borracha'),jdecode(''),'/12393.html','true',[],''],
	['PAGE','15476',jdecode('Prote%C3%A7%C3%A3o+sanfonada'),jdecode(''),'/15476.html','true',[],''],
	['PAGE','50',jdecode('Revestimentos'),jdecode(''),'/50.html','true',[],''],
	['PAGE','12485',jdecode('Roletes'),jdecode(''),'/12485.html','true',[],''],
	['PAGE','12375',jdecode('Rodas+e+Rodizios'),jdecode(''),'/12375.html','true',[],''],
	['PAGE','59',jdecode('Contato'),jdecode(''),'/59/index.html','true',[ 
		['PAGE','2379',jdecode('Servi%C3%A7o+%28p%C3%A1gina+seguir%29'),jdecode(''),'/59/2379.html','false',[],'']
	],''],
	['PAGE','12463',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/12463.html','true',[],''],
	['PAGE','12462',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/12462.html','false',[],''],
	['PAGE','13475',jdecode('Quem+somos'),jdecode(''),'/13475/index.html','true',[ 
		['PAGE','13484',jdecode('Localiza%C3%A7%C3%A3o%2FRegi%C3%A3o'),jdecode(''),'/13475/13484.html','true',[],'']
	],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='2A7871';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='473';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2A7871';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Logg',
				paletteFamily: 	'2A7871',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'473',
				contentColor: 	'FFFFFF',
				contentBGColor: '2A7871',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'2A7871',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-1140361']={
webappId:    '1501',
documentId:  '11',
internalId:  '1140361',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-12463AVEC10IN262G']={
webappId:    '1002',
documentId:  '12463',
internalId:  '12463AVEC10IN262G',
customField: 'icq=false'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN262G';
var companyName   = 'KNALL+Produtos+de+Borrachas+e+Pl%C3%A1sticos+Ltda.';
var htmlTitle	  = 'Manuten%C3%A7%C3%A3o+Industrial';
var metaKeywords  = 'borrachas%2C+plasticos%2C+veda%C3%A7%C3%B5es';
var metaContents  = 'mangueira%2C+correia%2C+len%C3%A7ol+de+borracha%2C+gaxetas%2C+aneis%2C+veda%C3%A7%C3%B5es%2C+guarni%C3%A7%C3%B5es%2C+perfil+de+borracha%2C+placas+e+tarugos%2C+nylon%2C+pvc%2C+uhmw%2C+acrilico%2C+sanfona+de+borracha%2C+capachos%2C+pisos+e+passadeiras+de+borracha%2C+fitas+auto-adesivas%2C+tubos+e+mangueiras+especiais%2C+poliuretano%2C+sacos+plasticos%2C+adesivos%2C+abra%C3%A7adeiras%2C+correias+sincronizadas%2C+gaxetas+de+amianto%2C+teflon%2C+cola%2C+gaxetas+de+amianto%2C+viton%2C+perfil%2C+veda%C3%A7%C3%A3o%2C+mangote%2C+revestimento+de+rodas+em+borrachas+e+pu';
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();
};
