/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','42501',jdecode('PROMO%C3%87%C3%83O+DO+M%C3%8AS'),jdecode(''),'/42501.html','false',[],'',''],
	['PAGE','34701',jdecode('Bobinas+PDV+%2F+ECF'),jdecode(''),'/34701.html','true',[],'',''],
	['PAGE','494',jdecode('Onde+estamos'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','29901',jdecode('DICAS'),jdecode(''),'/29901.html','true',[],'',''],
	['PAGE','41401',jdecode('TESTE+SUA+VELOCIDADE'),jdecode(''),'/41401.html','true',[],'',''],
	['PAGE','599',jdecode('Contato'),jdecode(''),'/599.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1994';
theSitetree.keyvisualName='waage2.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1994',
				keyvisualName: 	'waage2.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'383',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2667020']={
webappId:    '1501',
documentId:  '401',
internalId:  '2667020',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-14600']={
webappId:    '7008',
documentId:  '599',
internalId:  '14600',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100130-064056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42501',
internalId:  '',
customField: '20100130-063518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20100130-063936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20070227-074832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29901',
internalId:  '',
customField: '20070312-081007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41401',
internalId:  '',
customField: '20080331-190048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20100130-064714'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN31OA';
var companyName   = '3D+GR%C3%81FICA';
var htmlTitle	  = '';
var metaKeywords  = 'etiquetas%2C+adesivas%2C+adesivos%2C+rotulos%2C+r%C3%B3tulos%2C+off-set%2C+impressos%2C+impress%C3%A3o%2C+gr%C3%A1fica%2C+grafica%2C+salvador%2C+bahia%2C+folhetos%2C+fly%2C+bloco%2C+blocos%2C+flays%2C+folder%2C+folderes%2C++panfletos%2C+garcia%2C+congelados%2C+congelamento%2C+ingressos%2C+pulseiras%2C+cart%C3%A3o%2C+visita%2C+cartao%2C+tal%C3%A3o%2C+tal%C3%B5es%2C+talao%2C+taloes%2C+nota+fiscal%2C+tags%2C+servi%C3%A7os%2C+gr%C3%A1ficos%2C+graficas%2C+3dgrafica%2C+grafica3d%2C+bobina%2C+bobinas%2C+cupom+fiscal%2C+ecf%2C+pdv%2C+gr%C3%A1fica3d%2C+3d%2C+servi%C3%A7os%2C+servicos%2C+qualidade%2C+cartaz%2C+cartazes%2C++velocidade%2C+conex%C3%A3o%2C+silfer%2C+bignardi%2C+regispel%2C+n%C3%A3o+fiscal';
var metaContents  = 'etiquetas%2C+adesivas%2C+adesivos%2C+rotulos%2C+r%C3%B3tulos%2C+off-set%2C+impressos%2C+impress%C3%A3o%2C+gr%C3%A1fica%2C+grafica%2C+salvador%2C+bahia%2C+folhetos%2C+fly%2C+bloco%2C+blocos%2C+flays%2C+folder%2C+folderes%2C++panfletos%2C+garcia%2C+congelados%2C+congelamento%2C+ingressos%2C+pulseiras%2C+cart%C3%A3o%2C+visita%2C+cartao%2C+tal%C3%A3o%2C+tal%C3%B5es%2C+talao%2C+taloes%2C+nota+fiscal%2C+tags%2C+servi%C3%A7os%2C+gr%C3%A1ficos%2C+graficas%2C+3dgrafica%2C+grafica3d%2C+gr%C3%A1fica3d%2C+3d%2C+servi%C3%A7os%2C+bobina%2C+bobinas%2C+ecf%2C+pdv%2C+cupom+fiscal%2C+servicos%2C+qualidade%2C+cartaz%2C+cartazes%2C+velocidade%2C+conex%C3%A3o%2C+silfer%2C+bignardi%2C+regispel%2C+n%C3%A3o+fiscal%2Ctermico%2C+t%C3%A9rmica%2C+amarela%2C+amarelo%2C+2+vias%2C+3+vias%2C+autocopiativo%2C+grafica3d+silfer%2C+bignardi%2C+regispel%2C+bobina+cart%C3%A3o+de+cr%C3%A9dito';
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();
};
