/* [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','573',jdecode('A+Pousada'),jdecode(''), jdecode('%2F573%2Findex.html'), 'true',[ 
		['PAGE','615',jdecode('O+restaurante'),jdecode(''), jdecode('%2F573%2F615.html'), 'true',[],'',''],
		['PAGE','657',jdecode('Servi%C3%A7o'),jdecode(''), jdecode('%2F573%2F657.html'), 'true',[],'','']
	],'',''],
	['PAGE','50401',jdecode('Caf%C3%A9+da+manh%C3%A3'),jdecode(''), jdecode('%2F50401.html'), 'true',[],'',''],
	['PAGE','501',jdecode('+Para%C3%ADso+intocado'),jdecode(''), jdecode('%2F501.html'), 'false',[],'',''],
	['PAGE','522',jdecode('Localiza%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F522.html'), 'true',[],'',''],
	['PAGE','699',jdecode('Contato'),jdecode(''), jdecode('%2F699.html'), 'true',[],'',''],
	['PAGE','12101',jdecode('Tarif%C3%A1rio+e+Pacotes'),jdecode(''), jdecode('%2F12101.html'), 'true',[],'',''],
	['PAGE','8601',jdecode('Fotos+da+Pousada'),jdecode(''), jdecode('%2F8601.html'), 'false',[],'',''],
	['PAGE','36901',jdecode('hor%C3%A1rios+de+barco'),jdecode(''), jdecode('%2F36901.html'), 'true',[],'',''],
	['PAGE','38906',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''), jdecode('%2F38906%2Findex.html'), 'false',[ 
		['PAGE','38901',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''), jdecode('%2F38906%2F38901.html'), 'false',[],'','']
	],'',''],
	['PAGE','41501',jdecode('Fotos'),jdecode(''), jdecode('%2F41501.html'), 'false',[],'',''],
	['PAGE','68601',jdecode('Parcerias'),jdecode(''), jdecode('%2F68601.html'), 'true',[],'',''],
	['PAGE','80312',jdecode('Links'),jdecode(''), jdecode('%2F80312.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Vienna';
theSitetree.paletteFamily='D6D2C5';
theSitetree.keyvisualId='11878';
theSitetree.keyvisualName='kv_11878.jpg';
theSitetree.fontsetId='33180';
theSitetree.graphicsetId='14088';
theSitetree.contentColor='696146';
theSitetree.contentBGColor='ebe8df';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Vienna',
				paletteFamily: 	'D6D2C5',
				keyvisualId: 	'11878',
				keyvisualName: 	'kv_11878.jpg',
				fontsetId: 		'33180',
				graphicsetId: 	'14088',
				contentColor: 	'696146',
				contentBGColor: 'ebe8df',
				a_color: 		'EBE8DF',
				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['7060']=webappMappings['7060-a47350dee3a9c4be878b43f9b9a1dd6b']={
webappId:    '7060',
documentId:  '8601',
internalId:  'a47350dee3a9c4be878b43f9b9a1dd6b',
customField: 'language:pt;country:BR;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '573',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-38906avec10in3tx6']={
webappId:    '1002',
documentId:  '38906',
internalId:  '38906avec10in3tx6',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-1b05927247c6a067c480a255d9b351cf']={
webappId:    '7060',
documentId:  '41501',
internalId:  '1b05927247c6a067c480a255d9b351cf',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '615',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20101217-095537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20110705-183055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20071105-112133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20090108-150404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50401',
internalId:  '',
customField: '20090109-093151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20071023-214120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20071022-122933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20081207-192805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '522',
internalId:  '',
customField: '20101219-103558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20101115-093921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20101115-093509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38906',
internalId:  '',
customField: '20080326-100329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20080326-100329'
};
webappMappings['1501']=webappMappings['1501-15298483']={
webappId:    '1501',
documentId:  '573',
internalId:  '15298483',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68601',
internalId:  '',
customField: '20110902-154858'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '573',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '657',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '50401',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '501',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '522',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '699',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12101',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '8601',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '36901',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '38906',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '38901',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '41501',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '68601',
internalId:  '',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80312',
internalId:  '',
customField: '20110127-104411'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN3TX6';
var companyName   = 'Pousada+Marhesias';
var htmlTitle	  = 'POUSADA+MARHESIAS+ALGODOAL';
var metaKeywords  = 'amaz%C3%B4nia%2C+hospedagem+em+algodoal%2C+pousada+maresias%2C+bel%C3%A9m%2C+par%C3%A1%2C+eco+turismo%2C+APA+de+algodoal+maiandeua%2C+algodoal%2C+chal%C3%A9s+confortaveis%2C+restaurante+marhesias%2Cguide+du+routard%2C+michelin%2Clonely+planet%2Cchal%C3%A9s+algodoal%2C';
var metaContents  = 'Rusticidade+e+conforto%2C+A+Pousada+da+vila+mais+pr%C3%B3xima+da+praia+mais+famosa%2C+card%C3%A1pio+exclusivo+para+hospedes%2C+pizzas+e+massas+aliadas+%C3%A0+comida+regional+paraense.+Pizza+de+pato+no+tucupi+nova+cria%C3%A7%C3%A3o+da+pizzaria+da+pousada+marhesias.+';
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();
};

