/* [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','14',jdecode('Home'),jdecode(''),'/14.html','true',[],'',''],
	['PAGE','35',jdecode('Carimbo+Auto-entintado'),jdecode(''),'/35.html','true',[],'',''],
	['PAGE','44',jdecode('Carimbos+Comuns'),jdecode(''),'/44.html','true',[],'',''],
	['PAGE','53',jdecode('Caneta+Carimbo'),jdecode(''),'/53.html','true',[],'',''],
	['PAGE','62',jdecode('Chancela'),jdecode(''),'/62/index.html','true',[ 
		['PAGE','1554',jdecode('Chancela+%28p%C3%A1gina+seguir%29'),jdecode(''),'/62/1554.html','false',[],'','']
	],'',''],
	['PAGE','1458',jdecode('Datadores%2FNumeradores'),jdecode(''),'/1458.html','true',[],'',''],
	['PAGE','80',jdecode('Facas+de+Corte+e+Vinco'),jdecode(''),'/80.html','true',[],'',''],
	['PAGE','89',jdecode('Clich%C3%AAs'),jdecode(''),'/89.html','true',[],'',''],
	['PAGE','98',jdecode('Or%C3%A7amento'),jdecode(''),'/98.html','true',[],'',''],
	['PAGE','107',jdecode('Promo%C3%A7%C3%B5es'),jdecode(''),'/107.html','true',[],'',''],
	['PAGE','16901',jdecode('VIDEO'),jdecode(''),'/16901.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11063';
theSitetree.keyvisualName='kv_11063.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='000000';
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: 	'11063',
				keyvisualName: 	'kv_11063.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13786',
				contentColor: 	'000000',
				contentBGColor: '426388',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14',
internalId:  '',
customField: '20081229-105011'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1121989']={
webappId:    '1501',
documentId:  '14',
internalId:  '1121989',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-2174']={
webappId:    '7008',
documentId:  '98',
internalId:  '2174',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35',
internalId:  '',
customField: '20081229-131752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20061021-124525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44',
internalId:  '',
customField: '20081229-115311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20081229-115426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1458',
internalId:  '',
customField: '20070713-083513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20081229-121401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20081229-123858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98',
internalId:  '',
customField: '20061208-083053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20081229-124158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20081229-125156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1554',
internalId:  '',
customField: '20060714-131655'
};
webappMappings['7008']=webappMappings['7008-14034']={
webappId:    '7008',
documentId:  '62',
internalId:  '14034',
customField: 'language:pt;country:BR;'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2322';
var companyName   = 'V+E+R+A+++C+R+U+Z+++B+R+A+S+I+L';
var htmlTitle	  = 'VERA+CRUZ+BRASIL';
var metaKeywords  = 'CHANCELA%2C+CHANCELAS%2C+CARIMBO%2C+CARIMBOS.+DATADOR%2C+NUMERADOR.+FACAS+DE+CORTE+E+VINCO%2C+CLICH%C3%8AS%2C+MARCA%C3%87%C3%83O+INDUSTRIAL%2C+IMPRESS%C3%83O+AUTO+RELEVO%2C+MARCA+DAGUA%2C+CARIMBO+DE+RELEVO%2C+SINETE%2C+STAMP+CARIMBO+DE+RELEVO%2C+seal%2C+pr%C3%A4gestempel%2C+timbre+sec%2C+sello+en+seco%2C+timbre%2C+sello%2C++s%C3%A3o+paulo%2C+flamengo%2C+santos%2C+panico%2C+Tradutor%2C+sacola%2C+SUPRIMENTO%2C+ESCRITORIO%2C+PAPELARIA+%2CCYREL%2C+POLIMERO%2C++CHANCELA%2C+CHANCELA%2C+CHANCELA%2C+CHANCELA%2C+FACAS+DE+CORTE+E+VINCO';
var metaContents  = 'CHANCELA%2C+CHANCELAS%2C+CARIMBO%2C+CARIMBOS.+DATADOR%2C+NUMERADOR.+FACAS+DE+CORTE+E+VINCO%2C+CLICH%C3%8AS%2C++IMPRESS%C3%83O+AUTO+RELEVO%2C+MARCA+DAGUA%2C+CARIMBO+DE+RELEVO%2C+SINETE%2C+STAMP%2C+CARIMBO+DE+RELEVO%2C+seal%2C+pr%C3%A4gestempel%2C+timbre+sec%2C+sello+en+seco%2C+mundo%2C+caixa%2C+sacola%2C+papel%2C+ps2%2C+xbox%2C+cartucho%2C+impressora%2C+PAPELARIA%2C+SUPRIMENTO%2C++CYREL%2C+POLIMERO';
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();
};
