/* [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','1801',jdecode('Inicial'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1852',jdecode('Quem+somos'),jdecode(''),'/1852.html','true',[],'',''],
	['PAGE','2901',jdecode('Card%C3%A1pio'),jdecode(''),'/2901.html','true',[],'',''],
	['PAGE','2922',jdecode('Hist%C3%B3ria+do+restaurante'),jdecode(''),'/2922.html','true',[],'',''],
	['PAGE','2943',jdecode('Espa%C3%A7o+cultural'),jdecode(''),'/2943.html','true',[],'',''],
	['PAGE','2964',jdecode('Fotos'),jdecode(''),'/2964.html','true',[],'',''],
	['PAGE','9334',jdecode('GASTRONOMIA'),jdecode(''),'/9334.html','true',[],'',''],
	['PAGE','9355',jdecode('ARTE+EM+TELAS'),jdecode(''),'/9355.html','true',[],'',''],
	['PAGE','9376',jdecode('ARTE+EM+PRANCHAS+SURF'),jdecode(''),'/9376.html','true',[],'',''],
	['PAGE','9397',jdecode('ARTE+PRANCHAS+MDF'),jdecode(''),'/9397.html','true',[],'',''],
	['PAGE','13545',jdecode('Esculturas+Afro+mdf+decora%C3%A7%C3%A3o.'),jdecode(''),'/13545.html','true',[],'',''],
	['PAGE','13566',jdecode('Esculturas+Afro+mdf+decora%C3%A7%C3%A3o.'),jdecode(''),'/13566.html','true',[],'',''],
	['PAGE','15445',jdecode('Arte+Afro-ind%C3%ADgena+Tela'),jdecode(''),'/15445.html','true',[],'',''],
	['PAGE','15466',jdecode('Arte+Afro-ind%C3%ADgena+Tela'),jdecode(''),'/15466.html','true',[],'',''],
	['PAGE','16245',jdecode('Arte+Digitalizada'),jdecode(''),'/16245.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Tide';
theSitetree.paletteFamily='C04B0B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13626';
theSitetree.graphicsetId='12063';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Tide',
				paletteFamily: 	'C04B0B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13626',
				graphicsetId: 	'12063',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-9dcfff84e74e8700dabc001dc81939a7']={
webappId:    '7060',
documentId:  '2943',
internalId:  '9dcfff84e74e8700dabc001dc81939a7',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100427-203203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20100421-120443'
};
webappMappings['7060']=webappMappings['7060-1d4db68ccba662fd38df28a42176af01']={
webappId:    '7060',
documentId:  '2964',
internalId:  '1d4db68ccba662fd38df28a42176af01',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20100421-124130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2922',
internalId:  '',
customField: '20100421-130342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2943',
internalId:  '',
customField: '20100421-124342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2964',
internalId:  '',
customField: '20100420-230441'
};
webappMappings['1501']=webappMappings['1501-1877865']={
webappId:    '1501',
documentId:  '1801',
internalId:  '1877865',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9334',
internalId:  '',
customField: '20100427-210839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9355',
internalId:  '',
customField: '20100427-222947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9376',
internalId:  '',
customField: '20100427-225640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9397',
internalId:  '',
customField: '20100427-230245'
};
webappMappings['7060']=webappMappings['7060-b6b006574a818df5b4c531a0b556c8b6']={
webappId:    '7060',
documentId:  '9334',
internalId:  'b6b006574a818df5b4c531a0b556c8b6',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-305b7e74d604d91a0964ac4c268976c1']={
webappId:    '7060',
documentId:  '13545',
internalId:  '305b7e74d604d91a0964ac4c268976c1',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-f24e6d2f8dac3a86a6df49d575b8250e']={
webappId:    '7060',
documentId:  '13566',
internalId:  'f24e6d2f8dac3a86a6df49d575b8250e',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13545',
internalId:  '',
customField: '20100428-163510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13566',
internalId:  '',
customField: '20100428-164440'
};
webappMappings['7060']=webappMappings['7060-eb1caf7e9cb364527f2ae3d64c9aad2c']={
webappId:    '7060',
documentId:  '15445',
internalId:  'eb1caf7e9cb364527f2ae3d64c9aad2c',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-0ecd8442386eee110cc1bbe73ecf6ed9']={
webappId:    '7060',
documentId:  '15466',
internalId:  '0ecd8442386eee110cc1bbe73ecf6ed9',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15445',
internalId:  '',
customField: '20100501-202631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15466',
internalId:  '',
customField: '20100501-202742'
};
webappMappings['7060']=webappMappings['7060-3624bc252584b9ba1b3af1ed53e7a1ef']={
webappId:    '7060',
documentId:  '16245',
internalId:  '3624bc252584b9ba1b3af1ed53e7a1ef',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16245',
internalId:  '',
customField: '20100502-081755'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7C6NE';
var companyName   = 'RESTAURANTE+GAROUP%C3%83O';
var htmlTitle	  = 'RESTAURANTE+GAROUP%C3%83O';
var metaKeywords  = 'restaurante+em+Barra+de+Guaratiba%3Bfrutos+do+mar+em+Barra+de+Guaratiba%3BBarra+de+Guaratiba%3BGuaratiba+RJ%3Brestaurante+Garoup%C3%A3o%3Brestaurante+especializado+em+frutos+do+mar%3Barte+em+Guaratiba%3BGastronomia+e+Arte%3Bharoldo+Lousada%3Bartes+pl%C3%A1sticas+em+Guaratiba%3Bpranchas+coloridas%3Barte+afro+ind%C3%ADgena%3Bpranchas+coloridas%3BBeco+de+Artes.';
var metaContents  = 'restaurante+em+Barra+de+Guaratiba%3Bfrutos+do+mar+em+Barra+de+Guaratiba%3BBarra+de+Guaratiba%3BGuaratiba+RJ%3Brestaurante+Garoup%C3%A3o%3Brestaurante+especializado+em+frutos+do+mar%3Barte+em+Guaratiba%3BGastronomia+e+Arte%3Bharoldo+Lousada%3Bartes+pl%C3%A1sticas+em+Guaratiba%3Bpranchas+coloridas%3Barte+afro+ind%C3%ADgena%3Bpranchas+coloridas%3BBeco+de+Artes.';
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();
};

