/* [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','1701',jdecode('QUEM+SOMOS'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','1722',jdecode('NOSSA+POUSADA'),jdecode(''), jdecode('%2F1722.html'), 'true',[],'',''],
	['PAGE','2701',jdecode('APARTAMENTOS'),jdecode(''), jdecode('%2F2701.html'), 'true',[],'',''],
	['PAGE','3801',jdecode('RESTAURANTE'),jdecode(''), jdecode('%2F3801.html'), 'true',[],'',''],
	['PAGE','2722',jdecode('MUSEU+CASA+DE+TAIPA'),jdecode(''), jdecode('%2F2722.html'), 'true',[],'',''],
	['PAGE','1773',jdecode('COMO+CHEGAR...'),jdecode(''), jdecode('%2F1773.html'), 'true',[],'',''],
	['PAGE','1794',jdecode('CONTATO%2FPRE%C3%87OS%2FPGTO'),jdecode(''), jdecode('%2F1794.html'), 'true',[],'',''],
	['PAGE','4722',jdecode('FORMUL%C3%81RIO...'),jdecode(''), jdecode('%2F4722.html'), 'true',[],'',''],
	['PAGE','2743',jdecode('LIVRO+DE+VISITAS...'),jdecode(''), jdecode('%2F2743.html'), 'true',[],'',''],
	['PAGE','19901',jdecode('ENGLISH'),jdecode(''), jdecode('%2F19901.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('N%C3%93S+NA+M%C3%8DDIA%21%21%21'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Nucleus';
theSitetree.paletteFamily='FDE26B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33305';
theSitetree.graphicsetId='14180';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FDE26B';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'nomer',
  product: 'WSCSYSSSSLY0XW8H'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nucleus',
				paletteFamily: 	'FDE26B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33305',
				graphicsetId: 	'14180',
				contentColor: 	'000000',
				contentBGColor: 'FDE26B',
				a_color: 		'EBCC45',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Palatino Linotype, Book Antiqua, Palatino, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1722',
internalId:  '',
customField: '20111230-093349'
};
webappMappings['1002']=webappMappings['1002-2743adual0inxl1o']={
webappId:    '1002',
documentId:  '2743',
internalId:  '2743adual0inxl1o',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20120106-073707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20111219-110022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20111219-110446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20111230-093506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20111205-070447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20111219-110619'
};
webappMappings['7008']=webappMappings['7008-201']={
webappId:    '7008',
documentId:  '4722',
internalId:  '201',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20111219-111001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20111204-224138'
};
webappMappings['1501']=webappMappings['1501-1799410']={
webappId:    '1501',
documentId:  '1701',
internalId:  '1799410',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20111122-105402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20111219-111212'
};
var webAppHostname = 'nomer-cm4all-1a.nomer.com.br:80';
var canonHostname = 'nomer-cm4all-1a.nomer.com.br';
var accountId     = 'ADUAL0INXL1O';
var companyName   = 'Pousada+Casa+de+Taipa';
var htmlTitle	  = 'Pousada+Casa+de+Taipa';
var metaKeywords  = 'Pousada+Casa+de+Taipa%2C+Turismo%2C+Lazer%2C+praia%2C+piscina%2C+conforto%2C+arte%2C+artesanato%2C+museu%2C+afresco%2C+pintura%2C+miniatura%2C+S%C3%A3o+Miguel+do+Gostoso%2C+Rio+Grande+do+Norte%2C+Kite+Surf%2C+Wind+Surf%2C+simplicidade%2C+pescador%2C+rendeira';
var metaContents  = 'Ao+hospedar-se+na+Pousada+Casa+de+Taipa%2C+voc%C3%AA+ter%C3%A1+a+certeza+de+que+est%C3%A1+em+um+empreendimento+de+alto+padr%C3%A3o.+Dizemos+isto+porque+temos+sido+submetidos+desde+o+ano+de+2008+a+um+processo+profissional+de+certifica%C3%A7%C3%A3o%2C+onde+fomos+avaliados+por+auditores+independentes+cadastrados+pelas+empresas+formadoras%2C+s%C3%A3o+elas%3A+SEBRAE%2FRN%2C+SENAC%2FRN%2C+MPE+BRASIL+e+ABNT.';
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();
};

