/* [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%A1gina+Principal'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','5201',jdecode('Produtos'),jdecode(''),'/5201/index.html','true',[ 
		['PAGE','5222',jdecode('Caf%C3%A9+Expresso'),jdecode(''),'/5201/5222.html','true',[],'',''],
		['PAGE','5243',jdecode('Caf%C3%A9+Moido'),jdecode(''),'/5201/5243.html','true',[],'','']
	],'',''],
	['PAGE','415',jdecode('M%C3%A1quinas+de+Caf%C3%A9'),jdecode(''),'/415/index.html','true',[ 
		['PAGE','56101',jdecode('Aluguel+de+M%C3%A1quinas'),jdecode(''),'/415/56101.html','true',[],'',''],
		['PAGE','56122',jdecode('M%C3%A1quinas+%C3%A1+Venda'),jdecode(''),'/415/56122.html','true',[],'','']
	],'',''],
	['PAGE','394',jdecode('Fotos'),jdecode(''),'/394/index.html','true',[ 
		['PAGE','47301',jdecode('Fotos+Safra+2008'),jdecode(''),'/394/47301.html','true',[],'','']
	],'',''],
	['PAGE','9501',jdecode('Conhecendo+o+Caf%C3%A9'),jdecode(''),'/9501.html','true',[],'',''],
	['PAGE','352',jdecode('Nossa+Hist%C3%B3ria'),jdecode(''),'/352.html','true',[],'',''],
	['PAGE','67701',jdecode('Barista'),jdecode(''),'/67701/index.html','true',[ 
		['PAGE','13401',jdecode('Dicas+de+preparo'),jdecode(''),'/67701/13401.html','true',[],'','']
	],'',''],
	['PAGE','436',jdecode('Contato'),jdecode(''),'/436.html','true',[],'',''],
	['PAGE','67722',jdecode('Nossa+Equipe'),jdecode(''),'/67722.html','true',[],'',''],
	['PAGE','16006',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/16006/index.html','true',[ 
		['PAGE','16001',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/16006/16001.html','false',[],'','']
	],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='F0DCB8';
theSitetree.keyvisualId='11282';
theSitetree.keyvisualName='kv_11282.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13934';
theSitetree.contentColor='907954';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vita02',
				paletteFamily: 	'F0DCB8',
				keyvisualId: 	'11282',
				keyvisualName: 	'kv_11282.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13934',
				contentColor: 	'907954',
				contentBGColor: 'F6FBFE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-16006avec10inlia4']={
webappId:    '1002',
documentId:  '16006',
internalId:  '16006avec10inlia4',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100209-073551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20090910-074925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20090629-130827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20091007-094343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20090910-090230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5243',
internalId:  '',
customField: '20090910-090310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20090910-090642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '415',
internalId:  '',
customField: '20100209-072528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20090629-131534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20090629-132932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20090629-133515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47301',
internalId:  '',
customField: '20090629-134055'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16006',
internalId:  '',
customField: '20090629-135012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20070828-145854'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '301',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56122',
internalId:  '',
customField: '20090910-085729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67722',
internalId:  '',
customField: '20100209-080647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67701',
internalId:  '',
customField: '20100209-074556'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLIA4';
var companyName   = 'BEM+VINDOS+A+FAM%C3%8DLIA+NONO+PIETRO';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = 'Caf%C3%A9+Expresso++Caf%C3%A9+Moido++Torrefa%C3%A7%C3%A3o+Mineira++Caf%C3%A9+Nonno+Pietro++Caf%C3%A9+Nono+Pietro++Sul+de+minas++Ouro+Fino';
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();
};
