/* [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','12',jdecode('HOME'),jdecode(''),'/12/index.html','true',[ 
		['PAGE','6271',jdecode('Arquitetura'),jdecode(''),'/12/6271.html','true',[],'',''],
		['PAGE','6360',jdecode('Artes'),jdecode(''),'/12/6360.html','true',[],'',''],
		['PAGE','7415',jdecode('Bolsas'),jdecode(''),'/12/7415.html','true',[],'',''],
		['PAGE','6333',jdecode('Carro'),jdecode(''),'/12/6333.html','true',[],'',''],
		['PAGE','7424',jdecode('Cer%C3%A2mica'),jdecode(''),'/12/7424.html','true',[],'',''],
		['PAGE','6396',jdecode('Comportamento'),jdecode(''),'/12/6396.html','true',[],'',''],
		['PAGE','7433',jdecode('Cozinha'),jdecode(''),'/12/7433.html','true',[],'',''],
		['PAGE','6289',jdecode('Design+de+produtos'),jdecode(''),'/12/6289.html','true',[],'',''],
		['PAGE','7442',jdecode('Design+de+interiores'),jdecode(''),'/12/7442.html','true',[],'',''],
		['PAGE','6342',jdecode('Flores'),jdecode(''),'/12/6342.html','true',[],'',''],
		['PAGE','6262',jdecode('Fotografia'),jdecode(''),'/12/6262.html','true',[],'',''],
		['PAGE','6351',jdecode('Gastronomia'),jdecode(''),'/12/6351.html','true',[],'',''],
		['PAGE','7451',jdecode('Ilumina%C3%A7%C3%A3o'),jdecode(''),'/12/7451.html','true',[],'',''],
		['PAGE','6280',jdecode('Joalheria'),jdecode(''),'/12/6280.html','true',[],'',''],
		['PAGE','6324',jdecode('Jardinagem'),jdecode(''),'/12/6324.html','true',[],'',''],
		['PAGE','7460',jdecode('Lojas%2FVitrines'),jdecode(''),'/12/7460.html','true',[],'',''],
		['PAGE','7469',jdecode('Madeira'),jdecode(''),'/12/7469.html','true',[],'',''],
		['PAGE','6378',jdecode('Moda'),jdecode(''),'/12/6378.html','true',[],'',''],
		['PAGE','7478',jdecode('M%C3%BAsica'),jdecode(''),'/12/7478.html','true',[],'',''],
		['PAGE','7487',jdecode('Noiva%2FCasamento'),jdecode(''),'/12/7487.html','true',[],'',''],
		['PAGE','21001',jdecode('Paisagismo'),jdecode(''),'/12/21001.html','true',[],'',''],
		['PAGE','6387',jdecode('Quadrinhos'),jdecode(''),'/12/6387.html','true',[],'',''],
		['PAGE','7496',jdecode('Sapato'),jdecode(''),'/12/7496.html','true',[],'',''],
		['PAGE','7505',jdecode('Tecidos'),jdecode(''),'/12/7505.html','true',[],'',''],
		['PAGE','6369',jdecode('Turismo'),jdecode(''),'/12/6369.html','true',[],'',''],
		['PAGE','21022',jdecode('Urbanismo'),jdecode(''),'/12/21022.html','true',[],'',''],
		['PAGE','7514',jdecode('Vidro'),jdecode(''),'/12/7514.html','true',[],'','']
	],'',''],
	['PAGE','35901',jdecode('ICU+Eyewear'),jdecode(''),'/35901.html','true',[],'',''],
	['PAGE','39201',jdecode('PETER+PAUPER'),jdecode(''),'/39201/index.html','true',[ 
		['PAGE','53123',jdecode('Peter+Pauper'),jdecode(''),'/39201/53123.html','true',[],'','']
	],'',''],
	['PAGE','6227',jdecode('AGENDA'),jdecode(''),'/6227.html','false',[],'',''],
	['PAGE','78',jdecode('QUEM+SOMOS'),jdecode(''),'/78/index.html','true',[ 
		['PAGE','87',jdecode('Onde+estamos'),jdecode(''),'/78/87.html','true',[],'','']
	],'',''],
	['PAGE','69',jdecode('CONTATO'),jdecode(''),'/69/index.html','true',[ 
		['PAGE','6102',jdecode('EMPREGOS'),jdecode(''),'/69/6102.html','true',[],'','']
	],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Cuy';
theSitetree.paletteFamily='F3FAFB';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='386';
theSitetree.graphicsetId='437';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F3FAFB';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cuy',
				paletteFamily: 	'F3FAFB',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'386',
				graphicsetId: 	'437',
				contentColor: 	'000000',
				contentBGColor: 'F3FAFB',
				a_color: 		'F3FAFB',
				b_color: 		'A9C9CD',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-1387080']={
webappId:    '1501',
documentId:  '12',
internalId:  '1387080',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6360',
internalId:  '',
customField: '20080603-101535'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6271',
internalId:  '',
customField: '20080603-101052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12',
internalId:  '',
customField: '20090907-114358'
};
webappMappings['7008']=webappMappings['7008-10974']={
webappId:    '7008',
documentId:  '6102',
internalId:  '10974',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7415',
internalId:  '',
customField: '20080202-100207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6333',
internalId:  '',
customField: '20060216-111912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7424',
internalId:  '',
customField: '20060402-132221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6396',
internalId:  '',
customField: '20060216-111913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7433',
internalId:  '',
customField: '20060402-132221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6289',
internalId:  '',
customField: '20060216-111505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7442',
internalId:  '',
customField: '20060402-132221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6342',
internalId:  '',
customField: '20060216-111912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6262',
internalId:  '',
customField: '20080603-095335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6351',
internalId:  '',
customField: '20060216-111912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7451',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6280',
internalId:  '',
customField: '20060405-195404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6324',
internalId:  '',
customField: '20060216-111912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7460',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7469',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6378',
internalId:  '',
customField: '20060216-111913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7478',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7487',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20070717-190429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6387',
internalId:  '',
customField: '20060216-111913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7496',
internalId:  '',
customField: '20060403-185343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7505',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6369',
internalId:  '',
customField: '20060216-111913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21022',
internalId:  '',
customField: '20080605-133637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7514',
internalId:  '',
customField: '20060402-132222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6227',
internalId:  '',
customField: '20080202-090213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78',
internalId:  '',
customField: '20080128-190350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87',
internalId:  '',
customField: '20080128-190956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69',
internalId:  '',
customField: '20060216-114505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6102',
internalId:  '',
customField: '20060216-120329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53123',
internalId:  '',
customField: '20100307-111022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39201',
internalId:  '',
customField: '20090928-091352'
};
webappMappings['7008']=webappMappings['7008-15419']={
webappId:    '7008',
documentId:  '53123',
internalId:  '15419',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-10984']={
webappId:    '7008',
documentId:  '35901',
internalId:  '10984',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35901',
internalId:  '',
customField: '20090907-114906'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2PAZ';
var companyName   = 'LIVRARIA+HAIKAI+++++++++++++++++++++++++++++++++++++++++++++++++++++36634616++++++++++';
var htmlTitle	  = 'Livraria+Haikai';
var metaKeywords  = 'haikai%2C+livraria+haikai%2C+';
var metaContents  = 'Livraria+haikai+livraria+haikai+livros+importados+haikai';
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();
};
