/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],''],
	['PAGE','17101',jdecode('Localiza%C3%A7%C3%A3o'),jdecode(''),'/17101.html','true',[],''],
	['PAGE','9601',jdecode('Fotos+Internas'),jdecode(''),'/9601.html','true',[],''],
	['PAGE','9622',jdecode('Fotos+dos+animais+e+Plantas+'),jdecode(''),'/9622.html','true',[],''],
	['PAGE','9643',jdecode('Fotos+de+Eventos'),jdecode(''),'/9643.html','true',[],''],
	['PAGE','9664',jdecode('Not%C3%ADcias+Interessantes'),jdecode(''),'/9664.html','true',[],''],
	['PAGE','9685',jdecode('Links+com+Colaboradores'),jdecode(''),'/9685.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Flowers';
theSitetree.paletteFamily='1B5016';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10642';
theSitetree.graphicsetId='11026';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='AEC2AC';
var theTemplate={
				name: 			'Flowers',
				paletteFamily: 	'1B5016',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10642',
				graphicsetId: 	'11026',
				contentColor: 	'000000',
				contentBGColor: 'AEC2AC',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'365F32',
				e_color: 		'365F32',
				f_color: 		'365F32',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20081216-104609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20081216-110537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9622',
internalId:  '',
customField: '20081216-111708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9643',
internalId:  '',
customField: '20081216-105655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9664',
internalId:  '',
customField: '20081021-221744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9685',
internalId:  '',
customField: '20081021-221744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20081216-102415'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPRST';
var companyName   = 'PARA%C3%8DSO+EM+ATIBAIA+-+SP';
var htmlTitle	  = 'Pousada+Tabaporanga+um+para%C3%ADso+em+Atibaia+-+SP';
var metaKeywords  = 'EVENTOS%2C+FESTAS%2C+ANIVERSARIOS%2C+CASAMENTOS%2C+RETIRO%2C+RELIGIOSO%2C+CASAMENTO%2C+LAGO%2C+TRANQUILIDADE%2C+AR+PURO%2C+PEIXES%2C+CARPAS%2C+GANSOS%2C+PAV%C3%83O%2C+PATOS%2C+ATIBAIA%2C+PARAISO%2C+TABAPORANGA%2C+LAZER%2C+LOCA%C3%87%C3%83O%2C+ALUGUEL%2C+TREINAMENTO+PARA+EXECUTIVOS%2C+FUTEBOL%2C+IDOSOS%2C+MELHOR+IDADE%2C+EXCURS%C3%83O+DE+COLEGIO%2C+PASSEIOS%2C+LOCAL%2C+CAMPO+DE+FUTEBOL%2C+TENIS%2C+HELIPONTO%2C+HELIPORTO%2C+QUADRA+DE+TENIS%2C+CONFRATERNIZA%C3%87%C3%83O';
var metaContents  = 'Tabaporanga%21%21+O+lugar+ideal+para+eventos+%28festas+de+casamentos+absolutamente+diferentes+e+maravilhosas%2C+anivers%C3%A1rio+de+crian%C3%A7as+com+espa%C3%A7o+para+muitos+brinquedos+e+anima%C3%A7%C3%B5es%2C+ideal+para+retiro+espiritual+pela+localiza%C3%A7%C3%A3o+e+sossego%2C+sem+vizinhan%C3%A7a%2C+com+absoluta+privacidade%2C+excelente+para+treinamento+de+executivos%2C+confraterniza%C3%A7%C3%A3o+de+final+de+ano%2C+excurs%C3%A3o+de+col%C3%A9gios+e+da+melhor+idade%29+n%C3%A3o+tem+lugar+mais+bonito+e+gostoso+para+voce+relaxar+a+beira+de+um+lago+com+carpas+e+pedalinhos%2C+piscina%2C+sauna%2C+sal%C3%A3o+de+jogos%2C+lareira%2C+forno+a+lenha%2C+restaurante+com+fog%C3%A3o+a+lenha%2C+campo+de+futebol+gramado%2C+quadra+poliesportiva%2Ctrilha+ecol%C3%B3gica%2Cenfim%2C+todo+o+conforto+para+sua+fam%C3%ADlia+e+convidados+passarem+um+dia+inesquec%C3%ADvel%21%21Capacidade+para+400+pessoas+confortavelmente+em+evento+externo...+++Estamos+numa+%C3%A1rea+de+135mil+metros+quadrados%2C+com+muito+verde%2CRESPIRANDO+AR+PURO+TODO+O+TEMPO%2C+muita+%C3%A1gua+de+nascente%2C+3+lagos+com+peixes%2C+gansos%2C+patos+e+marrecos%2C+e+as+trilhas+ecol%C3%B3gicas+s%C3%A3o+muito+ricas+em+vegeta%C3%A7%C3%A3o+com+interessantes+esp%C3%A9cies.+Pode-se+passear+com+seguran%C3%A7a+por+todo+o+sitio.Estacionamento+interno+para+carros+e+onibus+e+capacidade+para+at%C3%A9+400+pessoas%2C+confortavelmente%2C+em+evento+externo.+++';
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();
};
