/* [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','501',jdecode('P%C3%A1gina+inicial'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','26701',jdecode('Produtos'),jdecode(''),'/26701/index.html','true',[ 
		['PAGE','59401',jdecode('Animais+Marinho'),jdecode(''),'/26701/59401.html','true',[],'',''],
		['PAGE','91623',jdecode('Avi%C3%A3o%2FCarro%2FMotos%2F+E+...'),jdecode(''),'/26701/91623.html','true',[],'',''],
		['PAGE','26722',jdecode('Barcos'),jdecode(''),'/26701/26722.html','true',[],'',''],
		['PAGE','84123',jdecode('Chaveiros'),jdecode(''),'/26701/84123.html','true',[],'',''],
		['PAGE','59422',jdecode('Farol'),jdecode(''),'/26701/59422.html','true',[],'',''],
		['PAGE','46801',jdecode('Homens+do+Mar'),jdecode(''),'/26701/46801.html','true',[],'',''],
		['PAGE','50301',jdecode('Instrumentos+Dec.'),jdecode(''),'/26701/50301.html','true',[],'',''],
		['PAGE','45001',jdecode('P.+objetos%2Fchaves'),jdecode(''),'/26701/45001.html','true',[],'',''],
		['PAGE','35501',jdecode('Quadros+de+n%C3%B3'),jdecode(''),'/26701/35501.html','true',[],'',''],
		['PAGE','26785',jdecode('Segura+Garrafa+E+Kit+Chu'),jdecode(''),'/26701/26785.html','true',[],'',''],
		['PAGE','84144',jdecode('Sinos'),jdecode(''),'/26701/84144.html','true',[],'',''],
		['PAGE','36701',jdecode('Tim%C3%A3o'),jdecode(''),'/26701/36701.html','true',[],'','']
	],'',''],
	['PAGE','66701',jdecode('Quem+somos'),jdecode(''),'/66701.html','true',[],'',''],
	['PAGE','75401',jdecode('Contato'),jdecode(''),'/75401.html','true',[],'',''],
	['PAGE','66722',jdecode('Onde+estamos'),jdecode(''),'/66722.html','true',[],'',''],
	['PAGE','112023',jdecode('Pedidos'),jdecode(''),'/112023.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Nature';
theSitetree.paletteFamily='1503FF';
theSitetree.keyvisualId='3640';
theSitetree.keyvisualName='kv_3640.jpg';
theSitetree.fontsetId='10717';
theSitetree.graphicsetId='10879';
theSitetree.contentColor='1503FF';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nature',
				paletteFamily: 	'1503FF',
				keyvisualId: 	'3640',
				keyvisualName: 	'kv_3640.jpg',
				fontsetId: 		'10717',
				graphicsetId: 	'10879',
				contentColor: 	'1503FF',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'1503FF',
				e_color: 		'1503FF',
				f_color: 		'1503FF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-11710510']={
webappId:    '1501',
documentId:  '501',
internalId:  '11710510',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100518-125539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66701',
internalId:  '',
customField: '20100806-132259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20100720-153329'
};
webappMappings['7008']=webappMappings['7008-634']={
webappId:    '7008',
documentId:  '75401',
internalId:  '634',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75401',
internalId:  '',
customField: '20100807-085030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59401',
internalId:  '',
customField: '20100806-131304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26722',
internalId:  '',
customField: '20100806-131442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20100806-131659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59422',
internalId:  '',
customField: '20100824-123323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50301',
internalId:  '',
customField: '20100806-131754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20100806-131848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20100806-132028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20100806-132218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26785',
internalId:  '',
customField: '20100806-132109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66722',
internalId:  '',
customField: '20081110-135000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84123',
internalId:  '',
customField: '20100806-131519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84144',
internalId:  '',
customField: '20100806-132146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91623',
internalId:  '',
customField: '20100806-131339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112023',
internalId:  '',
customField: '20100809-104738'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPASF';
var companyName   = 'M%26S+Decora%C3%A7%C3%A3o+N%C3%A1utica+e+Presentes+LTDA';
var htmlTitle	  = 'msdecora';
var metaKeywords  = 'tim%C3%A3o%2C+quadro+de+n%C3%B3%2C+barcos%2C+caravelas%2C+fragatas%2C+veleiros%2C+traineiras%2C+chaveiros+motivos+n%C3%A1uticos%2C+abajur%2C+b%C3%BAssola%2C+term%C3%B4metros%2C+bar%C3%B4metros%2C+higr%C3%B4metros%2C+rel%C3%B3gios+com+motivos+n%C3%A1uticos%2C+est%C3%A1tuas+de+capit%C3%A3o%2C+est%C3%A1tuas+de+marinheiro%2C+est%C3%A1tuas+de+pirata%2C+est%C3%A1tuas+de+animais+marinhos%2C+remos+decorativos%2C+b%C3%B3ias+com+espelho%2C+far%C3%B3l+decorativo%2C+peixes+de+resina%2C+tartarugas+de+resina%2C+golfinho+de+resinas%2C+marlim-azul+de+resina%2Cetc...++';
var metaContents  = 'MS+loja+de+decora%C3%A7%C3%A3o+n%C3%A1utica+e+presentes%2C+tim%C3%A3o%2C+barcos%28+caravelas%2C+fragatas%2C++veleiros%2C+traineiras%2Cetc.%29%2C+chaveiros+com+motivos+n%C3%A1uticos%2C+abajur%2C+b%C3%B3ias+com+espelhos%2C+remos%2C+term%C3%B4metros%2C+higr%C3%B4metros%2C+bar%C3%B4metros%2C+quadro+de+n%C3%B3%2C+porta-retrato%2C+porta-chaves%2C+porta-garrafa%2C+est%C3%A1tuas+de+capit%C3%A3es%2C+marinheiros%2C+piratas+e+animais+marinhos%2C+far%C3%B3l%2C+kit-churrasqueiros%2C+copos+decorativos%2C+remos%2Cetc...';
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();
};
