/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],'',''],
	['PAGE','1273',jdecode('Contato'),jdecode(''),'/1273.html','true',[],'',''],
	['PAGE','77601',jdecode('Bolsas'),jdecode(''),'/77601.html','true',[],'',''],
	['PAGE','104012',jdecode('Malas'),jdecode(''),'/104012.html','true',[],'',''],
	['PAGE','104033',jdecode('Mochilas'),jdecode(''),'/104033.html','true',[],'',''],
	['PAGE','105812',jdecode('Luvas'),jdecode(''),'/105812.html','true',[],'',''],
	['PAGE','6543',jdecode('Customizados'),jdecode(''),'/6543.html','true',[],'',''],
	['PAGE','43201',jdecode('Estojos+instrumentos'),jdecode(''),'/43201.html','true',[],'',''],
	['PAGE','98101',jdecode('Produtos+T%C3%A9rmicos'),jdecode(''),'/98101.html','true',[],'',''],
	['PAGE','94701',jdecode('Consertos+e+Reformas'),jdecode(''),'/94701.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Ragtime';
theSitetree.paletteFamily='B3CA99';
theSitetree.keyvisualId='3579';
theSitetree.keyvisualName='kv_3579.jpg';
theSitetree.fontsetId='10737';
theSitetree.graphicsetId='10852';
theSitetree.contentColor='5D6B55';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Ragtime',
				paletteFamily: 	'B3CA99',
				keyvisualId: 	'3579',
				keyvisualName: 	'kv_3579.jpg',
				fontsetId: 		'10737',
				graphicsetId: 	'10852',
				contentColor: 	'5D6B55',
				contentBGColor: 'FFFFFF',
				a_color: 		'B3CA99',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'747475',
				e_color: 		'899D75',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20090727-115228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94701',
internalId:  '',
customField: '20090812-111004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20080917-115728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20100111-124721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6543',
internalId:  '',
customField: '20090917-151752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20100614-130716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98101',
internalId:  '',
customField: '20100111-125002'
};
webappMappings['7060']=webappMappings['7060-2c184c2a2d3d74f4ef5c9978516403cc']={
webappId:    '7060',
documentId:  '104012',
internalId:  '2c184c2a2d3d74f4ef5c9978516403cc',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-fae89b95b20b5361d877d69c32d711b5']={
webappId:    '7060',
documentId:  '77601',
internalId:  'fae89b95b20b5361d877d69c32d711b5',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-18fb80987be4a45c450a7e8b7e80ae10']={
webappId:    '7060',
documentId:  '104033',
internalId:  '18fb80987be4a45c450a7e8b7e80ae10',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104012',
internalId:  '',
customField: '20100111-124758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104033',
internalId:  '',
customField: '20100111-124831'
};
webappMappings['7060']=webappMappings['7060-6f83e660d98a154c5776bf212ee716ad']={
webappId:    '7060',
documentId:  '105812',
internalId:  '6f83e660d98a154c5776bf212ee716ad',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105812',
internalId:  '',
customField: '20100111-125356'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZ2F6';
var companyName   = 'COVERPLAST+IND%C3%9ASTRIA+E+COM%C3%89RCIO+LTDA';
var htmlTitle	  = 'Malas+e+Etojos+para+Equipamentos+Eletr%C3%B4nicos.';
var metaKeywords  = '';
var metaContents  = '';
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();
};
