/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','3401',jdecode('Quem+somos'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','48428',jdecode('Viagens+%26+Aventuras'),jdecode(''),'/48428.html','true',[],'',''],
	['PAGE','3422',jdecode('Planejamento+da+viagem'),jdecode(''),'/3422.html','true',[],'',''],
	['PAGE','2006',jdecode('Livro+de+visitas'),jdecode(''),'/2006/index.html','true',[ 
		['PAGE','2001',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/2006/2001.html','false',[],'','']
	],'',''],
	['PAGE','2401',jdecode('Blog'),jdecode(''),'/2401.html','true',[],'',''],
	['PAGE','45117',jdecode('Nosso+outro+blog...'),jdecode(''),'/45117.html','true',[],'',''],
	['PAGE','3101',jdecode('%C3%81lbum+de+fotos'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','3443',jdecode('Links'),jdecode(''),'/3443.html','true',[],'',''],
	['PAGE','20701',jdecode('Arquivos'),jdecode(''),'/20701.html','true',[],'',''],
	['PAGE','46417',jdecode('Medicina+para+Viajantes'),jdecode(''),'/46417.html','true',[],'',''],
	['PAGE','3464',jdecode('Contato'),jdecode(''),'/3464.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Endless';
theSitetree.paletteFamily='749D64';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10629';
theSitetree.graphicsetId='11014';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FBFAFA';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Endless',
				paletteFamily: 	'749D64',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10629',
				graphicsetId: 	'11014',
				contentColor: 	'000000',
				contentBGColor: 'FBFAFA',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'749D64',
				e_color: 		'749D64',
				f_color: 		'749D64',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-2006avec10inlfvs']={
webappId:    '1002',
documentId:  '2006',
internalId:  '2006avec10inlfvs',
customField: 'icq=false'
};
webappMappings['7050']=webappMappings['7050-72']={
webappId:    '7050',
documentId:  '2401',
internalId:  '72',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-88df8df178f8ae5a6d70407c465d6dad']={
webappId:    '7060',
documentId:  '3101',
internalId:  '88df8df178f8ae5a6d70407c465d6dad',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100712-171309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20100524-161135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3422',
internalId:  '',
customField: '20091022-150959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2006',
internalId:  '',
customField: '20070926-175907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20070926-175907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20081210-101841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20091019-165414'
};
webappMappings['1501']=webappMappings['1501-14489868']={
webappId:    '1501',
documentId:  '301',
internalId:  '14489868',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3443',
internalId:  '',
customField: '20091112-123907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20100712-193028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45117',
internalId:  '',
customField: '20091113-171136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3464',
internalId:  '',
customField: '20091020-130438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46417',
internalId:  '',
customField: '20100410-201550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48428',
internalId:  '',
customField: '20100712-184249'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLFVS';
var companyName   = 'Expedi%C3%A7%C3%A3o+Cone+Sul+-+Viagens+de+Moto';
var htmlTitle	  = '';
var metaKeywords  = 'viagem+moto+conesul+argentia+chile+uruguai+v-strom+motociclismo+marcos+catania+antonela+siqueira+cone+sul+patag%C3%B4nia+ushuaia+peru+bolivia+machu+picchu+cusco+cuzco+nazca+titicaca+atacama+livro+mototurismo+iron+butt+na+garupa+de+um+motociclista+garupa+fim+mundo+sa%C3%BAde+aventura+consulta+m%C3%A9dica+consultoria+avalia%C3%A7%C3%A3o+jet+lag';
var metaContents  = 'Viagem+de+moto+pela+Am%C3%A9rica+do+Sul++-+Informa%C3%A7%C3%B5es+sobre+motociclismo+-+Livro+Na+Garupa+de+um+Motociclista...+At%C3%A9+o+fim+do+mundo.+Consultoria+m%C3%A9dica+para+viagens%2C+viajantes+e+aventureiros.+Sa%C3%BAde+e+bem-estar.';
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();
};
