/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','1701',jdecode('Quem+somos'),jdecode(''),'/1701.html','true',[],'',''],
	['PAGE','1722',jdecode('Equipamentos+Alimenta%C3%A7%C3%A3o'),jdecode(''),'/1722/index.html','true',[ 
		['PAGE','3601',jdecode('M%C3%A1quina+de+Algod%C3%A3o+Doce'),jdecode(''),'/1722/3601.html','true',[],'',''],
		['PAGE','48999',jdecode('Carrinho+-+Algod%C3%A3o+Doce'),jdecode(''),'/1722/48999.html','true',[],'',''],
		['PAGE','3622',jdecode('Divisoras+de+Massa'),jdecode(''),'/1722/3622.html','true',[],'',''],
		['PAGE','34601',jdecode('TD-30+Super'),jdecode(''),'/1722/34601.html','false',[],'',''],
		['PAGE','34622',jdecode('TD-30+CL'),jdecode(''),'/1722/34622.html','false',[],'',''],
		['PAGE','34643',jdecode('TD-30+C'),jdecode(''),'/1722/34643.html','false',[],'',''],
		['PAGE','33501',jdecode('Informa%C3%A7%C3%B5es+Gerais+TD30'),jdecode(''),'/1722/33501.html','false',[],'',''],
		['PAGE','3643',jdecode('Multifuncional+para+Alimentos'),jdecode(''),'/1722/3643.html','true',[],'','']
	],'',''],
	['PAGE','1764',jdecode('Contato'),jdecode(''),'/1764.html','true',[],'',''],
	['PAGE','3664',jdecode('Representantes'),jdecode(''),'/3664/index.html','true',[ 
		['PAGE','39901',jdecode('Contato+Representante'),jdecode(''),'/3664/39901.html','false',[],'','']
	],'',''],
	['PAGE','47699',jdecode('Revendas'),jdecode(''),'/47699.html','true',[],'',''],
	['PAGE','40301',jdecode('Trabalhe+Conosco'),jdecode(''),'/40301.html','true',[],'',''],
	['PAGE','42699',jdecode('Eventos'),jdecode(''),'/42699/index.html','true',[ 
		['PAGE','42720',jdecode('Minas+P%C3%A3o+2008'),jdecode(''),'/42699/42720.html','true',[],'',''],
		['PAGE','42741',jdecode('Feira+do+Empreendedor+2008'),jdecode(''),'/42699/42741.html','true',[],'',''],
		['PAGE','42762',jdecode('Produtos+-+Fotos'),jdecode(''),'/42699/42762.html','true',[],'',''],
		['PAGE','44699',jdecode('Minas+P%C3%A3o+2009'),jdecode(''),'/42699/44699.html','true',[],'','']
	],'',''],
	['PAGE','50699',jdecode('Cancelar+Newsletter'),jdecode(''),'/50699.html','false',[],'',''],
	['PAGE','50720',jdecode('Loja+Virtual'),jdecode(''),'/50720.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11360';
theSitetree.keyvisualName='kv_11360.jpg';
theSitetree.fontsetId='31945';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='213245';
theSitetree.contentBGColor='426388';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Champagne',
				paletteFamily: 	'426388',
				keyvisualId: 	'11360',
				keyvisualName: 	'kv_11360.jpg',
				fontsetId: 		'31945',
				graphicsetId: 	'13786',
				contentColor: 	'213245',
				contentBGColor: '426388',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-2502']={
webappId:    '7008',
documentId:  '1764',
internalId:  '2502',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20090921-085428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20091119-073632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1722',
internalId:  '',
customField: '20090112-161532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20090112-162901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20090416-151646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3643',
internalId:  '',
customField: '20090708-074342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1764',
internalId:  '',
customField: '20081009-090138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3664',
internalId:  '',
customField: '20090416-143013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33501',
internalId:  '',
customField: '20090108-135443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20090112-163229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34622',
internalId:  '',
customField: '20090112-163313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34643',
internalId:  '',
customField: '20090108-134902'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-6545']={
webappId:    '7008',
documentId:  '39901',
internalId:  '6545',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39901',
internalId:  '',
customField: '20090416-143954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40301',
internalId:  '',
customField: '20090416-145927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50720',
internalId:  '',
customField: '20100705-072855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42699',
internalId:  '',
customField: '20090425-163431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42741',
internalId:  '',
customField: '20090425-162314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42762',
internalId:  '',
customField: '20090425-162425'
};
webappMappings['7060']=webappMappings['7060-8271fe46b87fdafcc1eec37975ff540f']={
webappId:    '7060',
documentId:  '42720',
internalId:  '8271fe46b87fdafcc1eec37975ff540f',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-7aafbaebd78d0b0da51a6f084d2f3848']={
webappId:    '7060',
documentId:  '42741',
internalId:  '7aafbaebd78d0b0da51a6f084d2f3848',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-88345fd991450e9796078b70ac3d54fa']={
webappId:    '7060',
documentId:  '42762',
internalId:  '88345fd991450e9796078b70ac3d54fa',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42720',
internalId:  '',
customField: '20090425-161459'
};
webappMappings['7060']=webappMappings['7060-e3e5be35508615afa9356d897501f436']={
webappId:    '7060',
documentId:  '44699',
internalId:  'e3e5be35508615afa9356d897501f436',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44699',
internalId:  '',
customField: '20090706-110103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47699',
internalId:  '',
customField: '20090730-101649'
};
webappMappings['7008']=webappMappings['7008-17927']={
webappId:    '7008',
documentId:  '50699',
internalId:  '17927',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48999',
internalId:  '',
customField: '20090921-084527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50699',
internalId:  '',
customField: '20100621-140105'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPOGK';
var companyName   = 'Produzindo+e+Distribuindo+Qualidade';
var htmlTitle	  = 'Tekyus+-+Produzindo+e+Distribuindo+Qualidade';
var metaKeywords  = 'Algod%C3%A3o+doce%2C+Divisora%2C+P%C3%A3o%2C+Dividir+p%C3%A3o%2C+Padaria%2C+Equipamentos+para+padaria%2C+Panifica%C3%A7%C3%A3o%2C+Festas%2C+Equipamentos+para+festas%2C+cilindro%2C+desfiar+frango%2C+salgadeiras%2C+Salgados%2C+Equipamentos+para+salgados%2C+F%C3%A1brica+de+salgados.';
var metaContents  = 'M%C3%A1quina+de+algod%C3%A3o+doce%2C+Divisora%2C+Cilindro%2C+Masseira%2C+Amassadeira%2C+multifuncional';
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();
};
