/* [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 theSitetree=[ 
	['PAGE','601',jdecode('+NOSSO+S%C3%8DTIO'),jdecode(''),'/601.html','true',[],''],
	['PAGE','11101',jdecode('ACOMODA%C3%87%C3%95ES'),jdecode(''),'/11101.html','true',[],''],
	['PAGE','652',jdecode('COMO+CHEGAR'),jdecode(''),'/652.html','true',[],''],
	['PAGE','8401',jdecode('PASSEIOS+E+DICAS'),jdecode(''),'/8401.html','true',[],''],
	['PAGE','19501',jdecode('ALIMENTA%C3%87%C3%83O'),jdecode(''),'/19501.html','true',[],''],
	['PAGE','19522',jdecode('QUEM+SOU+EU'),jdecode(''),'/19522.html','true',[],''],
	['PAGE','15401',jdecode('%C3%81LBUM+DE+FOTOS'),jdecode(''),'/15401.html','true',[],''],
	['PAGE','757',jdecode('FALE+CONOSCO'),jdecode(''),'/757.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1990';
theSitetree.keyvisualName='strand.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1990',
				keyvisualName: 	'strand.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'383',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-a975f440ffd41cf34643da3b62ddca24']={
webappId:    '7060',
documentId:  '15401',
internalId:  'a975f440ffd41cf34643da3b62ddca24',
customField: 'language:pt;country:BR;'
};
webappMappings['7008']=webappMappings['7008-3608']={
webappId:    '7008',
documentId:  '757',
internalId:  '3608',
customField: 'language:pt;country:BR;'
};
webappMappings['7005']=webappMappings['7005-401']={
webappId:    '7005',
documentId:  '601',
internalId:  '401',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20080125-081318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20080124-215346'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZWTP';
var companyName   = 'S%C3%ADtio+Algod%C3%B5es+Guesthouse+-+Bahia+';
var htmlTitle	  = 'S%C3%ADtio+Algod%C3%B5es+Guesthouse+-+Pen%C3%ADnsula+de+Mara%C3%BA+-+Bahia+-+Brasil';
var metaKeywords  = 'sitioalgodoes%2C+Sitio+algodoes%2C+sitio+algodoes+bahia%2C+peninsula+de+marau%2C+pousada+%2C+pacotes+carnaval+e+reveillon%2C+ferias+na+bahia+%2C+praia+deserta+%2C+praias%2C+praia+dos+algodoes+%2C+sitio+algodoes+guesthouse+%2C+guesthouse+%2C+Barra+grande+%2C+Itacar%C3%A9+%2C+Bahia+%2C+taipus+de+fora+%2C+Saqua%C3%ADra%2C+piscina+de+corais+%2C+mergulho+%2C+surf+%2C+relaxamento%2C+relax+%2C+turismo+ecol%C3%B3gico+%2C+Ilh%C3%A9us+%2C+Itabuna+%2C+Mara%C3%BA+%2C+Camam%C3%BA+%2C+trememb%C3%A9+%2C+cachoeira+de+tremenb%C3%A9+%2C+www.sitioalgodoes+%2C+www.sitioalgodoes.com+%2C+Mangue+%2C+mangues+%2C+natureza+%2C+mata+atlantica%2C+estadia+na+bahia%2C+di%C3%A1rias+baratas%2C+di%C3%A1rias%2C+piscina+naturais%2C+coral+%2C+corais%2C+off-road+%2C+Baia+de+Camam%C3%BA+%2C++passeios+de+barco+%2C+f%C3%A9rias+na+bahia+%2C+Cassange+%2C+ilhas+desertas+%2C+pescaria%2C+';
var metaContents  = 'Sitio+Algod%C3%B5es+Guesthouse+hospeda+com+conforto+e+privacidade.+Nossas+su%C3%ADtes+s%C3%A3o+amplas++e+com+varanda+privativa+.Para+quem+gosta+de+praia+deserta%2C+natureza+e+tranquilidade.+A+Praia+dos+Algod%C3%B5es+est%C3%A1+longe+das+multid%C3%B5es+e+do+mundo+moderno.+Voc%C3%AA+vai+relaxar+na+rede+ao+som+do+mar%2C+sao+45+km+de+praia+deserta+venha+nos+conhecer.+Nossas+paisagens+figuram+entre+as+mais+belas+do+mundo';
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();
};
