/* [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','14',jdecode('A+pousada'),jdecode(''),'/14.html','true',[],'',''],
	['PAGE','1017',jdecode('Localiza%C3%A7%C3%A3o'),jdecode(''),'/1017.html','true',[],'',''],
	['PAGE','1035',jdecode('Apartamentos'),jdecode(''),'/1035.html','true',[],'',''],
	['PAGE','50212',jdecode('Tarifas'),jdecode(''),'/50212.html','true',[],'',''],
	['PAGE','1026',jdecode('Lazer'),jdecode(''),'/1026.html','true',[],'',''],
	['PAGE','1044',jdecode('Informa%C3%A7%C3%B5es+%C3%BAteis'),jdecode(''),'/1044.html','true',[],'',''],
	['PAGE','17901',jdecode('Inf.+sobre+reservas'),jdecode(''),'/17901.html','true',[],'',''],
	['PAGE','3152',jdecode('Album+de+fotos'),jdecode(''),'/3152.html','true',[],'',''],
	['PAGE','1071',jdecode('Enquete'),jdecode(''),'/1071.html','true',[],'',''],
	['PAGE','17922',jdecode('Reservas'),jdecode(''),'/17922.html','true',[],'',''],
	['PAGE','77123',jdecode('Livro+de+visitantes'),jdecode(''),'/77123.html','true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Spanish';
theSitetree.paletteFamily='B5C4E2';
theSitetree.keyvisualId='11127';
theSitetree.keyvisualName='kv_11127.jpg';
theSitetree.fontsetId='32023';
theSitetree.graphicsetId='13848';
theSitetree.contentColor='1B1B1B';
theSitetree.contentBGColor='B5C4E2';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Spanish',
				paletteFamily: 	'B5C4E2',
				keyvisualId: 	'11127',
				keyvisualName: 	'kv_11127.jpg',
				fontsetId: 		'32023',
				graphicsetId: 	'13848',
				contentColor: 	'1B1B1B',
				contentBGColor: 'B5C4E2',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14',
internalId:  '1006',
customField: '1006'
};
webappMappings['7005']=webappMappings['7005-1465']={
webappId:    '7005',
documentId:  '1071',
internalId:  '1465',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77123',
internalId:  '',
customField: '20100419-090029'
};
webappMappings['7060']=webappMappings['7060-858fad616ed8f3d247632141d48bd576']={
webappId:    '7060',
documentId:  '3152',
internalId:  '858fad616ed8f3d247632141d48bd576',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-1168']={
webappId:    '7008',
documentId:  '17922',
internalId:  '1168',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14',
internalId:  '',
customField: '20100427-002305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1044',
internalId:  '',
customField: '20100719-183643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1017',
internalId:  '',
customField: '20100713-215646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1035',
internalId:  '',
customField: '20100427-004138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1026',
internalId:  '',
customField: '20100427-002939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20091208-213506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3152',
internalId:  '',
customField: '20061007-200653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1071',
internalId:  '',
customField: '20071012-222417'
};
webappMappings['1002']=webappMappings['1002-77123avec10in2v6v']={
webappId:    '1002',
documentId:  '77123',
internalId:  '77123avec10in2v6v',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50212',
internalId:  '',
customField: '20100719-184137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17922',
internalId:  '',
customField: '20091208-213820'
};
webappMappings['1501']=webappMappings['1501-12801593']={
webappId:    '1501',
documentId:  '14',
internalId:  '12801593',
customField: '1501'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2V6V';
var companyName   = 'Pousada+Salinas';
var htmlTitle	  = 'Pousada+Salinas+a+sua+casa+de+praia+em+Fortaleza';
var metaKeywords  = 'Pousada+Salinas%2C+Pousadas+em+Fortaleza%2C+Fortaleza%2C+Cear%C3%A1%2C+Praia+do+Futuro++praia%2C+mar%2C+sol%2C+salinas%2C+Brasil%2C+pousadas%2C+++';
var metaContents  = 'Pousada+Salinas+-+Frente+para+o+mar+na+Praia+do+Futuro%2C+tv%2C+frigobar%2C+telefone%2C+ventilador+ou+ar+condicionado%2C+estacionamento%2C+di%C3%A1ria+com+caf%C3%A9+self+service.+Endere%C3%A7o+Av.+Zez%C3%A9+Diogo%2C+3300+-+Fortaleza+-+Cear%C3%A1+-+Brasil+CEP%3A+60180-000...CE+-+POUSADA+SALINAS.+Endere%C3%A7o+na+web%3A+http%3A%5Cwww.pousadasalinas.com.br+-+reservas%40pousadasalinas.com.br...';
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();
};
