/* [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','5601',jdecode('Inicial'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','5652',jdecode('Quem+Somos'),jdecode(''), jdecode('%2F5652.html'), 'true',[],'',''],
	['PAGE','5673',jdecode('Estrutura+de+Opera%C3%A7%C3%A3o'),jdecode(''), jdecode('%2F5673.html'), 'true',[],'',''],
	['PAGE','5694',jdecode('Atividades+e+Cursos'),jdecode(''), jdecode('%2F5694.html'), 'false',[],'',''],
	['PAGE','95123',jdecode('Cursos+CMAS'),jdecode(''), jdecode('%2F95123%2Findex.html'), 'true',[ 
		['PAGE','5715',jdecode('B%C3%A1sico+*'),jdecode(''), jdecode('%2F95123%2F5715.html'), 'true',[],'',''],
		['PAGE','5736',jdecode('Avan%C3%A7ado+**'),jdecode(''), jdecode('%2F95123%2F5736.html'), 'true',[],'',''],
		['PAGE','5757',jdecode('Guia+de+Mergulho+***'),jdecode(''), jdecode('%2F95123%2F5757.html'), 'true',[],'',''],
		['PAGE','94565',jdecode('Reciclagem'),jdecode(''), jdecode('%2F95123%2F94565.html'), 'true',[],'','']
	],'',''],
	['PAGE','94523',jdecode('Batismo'),jdecode(''), jdecode('%2F94523.html'), 'true',[],'',''],
	['PAGE','94544',jdecode('Sa%C3%ADdas+de+Mergulho'),jdecode(''), jdecode('%2F94544.html'), 'true',[],'',''],
	['PAGE','5778',jdecode('Galerias+Foto+%2F+Video'),jdecode(''), jdecode('%2F5778.html'), 'true',[],'',''],
	['PAGE','98323',jdecode('Bonaire+2011'),jdecode(''), jdecode('%2F98323.html'), 'false',[],'',''],
	['PAGE','16701',jdecode('Cabo+Frio'),jdecode(''), jdecode('%2F16701.html'), 'false',[],'',''],
	['PAGE','16722',jdecode('I.+dos+Papagaios+-+oeste'),jdecode(''), jdecode('%2F16722.html'), 'false',[],'',''],
	['PAGE','27501',jdecode('I.+dos+Papagaios+-+leste'),jdecode(''), jdecode('%2F27501.html'), 'false',[],'',''],
	['PAGE','16743',jdecode('Bonaire+-+2008'),jdecode(''), jdecode('%2F16743.html'), 'false',[],'',''],
	['PAGE','49601',jdecode('Bonaire+2009'),jdecode(''), jdecode('%2F49601.html'), 'false',[],'',''],
	['PAGE','35201',jdecode('Garoupa+Gata+'),jdecode(''), jdecode('%2F35201.html'), 'false',[],'',''],
	['PAGE','59601',jdecode('Bonaire+2010'),jdecode(''), jdecode('%2F59601.html'), 'false',[],'',''],
	['PAGE','30501',jdecode('Pontos+de+Mergulho'),jdecode(''), jdecode('%2F30501.html'), 'true',[],'',''],
	['PAGE','5799',jdecode('Page+in+English'),jdecode(''), jdecode('%2F5799.html'), 'true',[],'',''],
	['PAGE','37901',jdecode('CMAS'),jdecode(''), jdecode('%2F37901.html'), 'false',[],'',''],
	['PAGE','60701',jdecode('Ofertas+%2F+Equipamentos'),jdecode(''), jdecode('%2F60701.html'), 'false',[],'',''],
	['PAGE','90423',jdecode('Viagem+de+Mergulho'),jdecode(''), jdecode('%2F90423.html'), 'false',[],'',''],
	['PAGE','91123',jdecode('Staff'),jdecode(''), jdecode('%2F91123.html'), 'false',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='000099';
theSitetree.keyvisualId='9240';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12755';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var prodDef={
  wl_name: 'brazilprod',
  product: 'WSCSYSSSSLY0X9A9'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'000099',
				keyvisualId: 	'9240',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12755',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-26dc8f2b4cf337182cae8c9551212fef']={
webappId:    '7060',
documentId:  '5778',
internalId:  '26dc8f2b4cf337182cae8c9551212fef',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20120110-132258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20111227-092236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5694',
internalId:  '',
customField: '20111106-102801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20120110-125607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5715',
internalId:  '',
customField: '20120105-120219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20120105-120316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5757',
internalId:  '',
customField: '20120105-120901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5778',
internalId:  '',
customField: '20111207-165647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5799',
internalId:  '',
customField: '20120110-132948'
};
webappMappings['7060']=webappMappings['7060-842ab13a468bbe360e732c4a86769e84']={
webappId:    '7060',
documentId:  '49601',
internalId:  '842ab13a468bbe360e732c4a86769e84',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20110813-160352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16722',
internalId:  '',
customField: '20090618-210118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16743',
internalId:  '',
customField: '20090716-131059'
};
webappMappings['7060']=webappMappings['7060-69321f04a7a2db09195f248388ddd4e4']={
webappId:    '7060',
documentId:  '16701',
internalId:  '69321f04a7a2db09195f248388ddd4e4',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-b6df760472159f8d29dfd64f05d37752']={
webappId:    '7060',
documentId:  '16722',
internalId:  'b6df760472159f8d29dfd64f05d37752',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-30ac7fb20d3b58d3eac70cc93e52095f']={
webappId:    '7060',
documentId:  '16743',
internalId:  '30ac7fb20d3b58d3eac70cc93e52095f',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20110514-084634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27501',
internalId:  '',
customField: '20090618-205950'
};
webappMappings['7060']=webappMappings['7060-86c6b57f1e143ba028729e6ad6a10866']={
webappId:    '7060',
documentId:  '27501',
internalId:  '86c6b57f1e143ba028729e6ad6a10866',
customField: 'language:pt;country:BR;'
};
webappMappings['7060']=webappMappings['7060-b30f7cc44bf539fba5ce24bfa4a0f90d']={
webappId:    '7060',
documentId:  '35201',
internalId:  'b30f7cc44bf539fba5ce24bfa4a0f90d',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35201',
internalId:  '',
customField: '20090701-193612'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20111106-161911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49601',
internalId:  '',
customField: '20120102-174730'
};
webappMappings['7060']=webappMappings['7060-8d72cef08295ce5cc89df3e0ba8c3929']={
webappId:    '7060',
documentId:  '59601',
internalId:  '8d72cef08295ce5cc89df3e0ba8c3929',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59601',
internalId:  '',
customField: '20101004-202215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60701',
internalId:  '',
customField: '20111023-122634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90423',
internalId:  '',
customField: '20110912-144233'
};
webappMappings['1501']=webappMappings['1501-15376557']={
webappId:    '1501',
documentId:  '5601',
internalId:  '15376557',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91123',
internalId:  '',
customField: '20120101-093032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94523',
internalId:  '',
customField: '20120102-164509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94544',
internalId:  '',
customField: '20120122-114315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94565',
internalId:  '',
customField: '20111106-175332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95123',
internalId:  '',
customField: '20120101-095256'
};
webappMappings['7060']=webappMappings['7060-49be3619282d1caa051c942ef2ecfc14']={
webappId:    '7060',
documentId:  '98323',
internalId:  '49be3619282d1caa051c942ef2ecfc14',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98323',
internalId:  '',
customField: '20111207-142233'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH7DS';
var companyName   = 'BARRACUDA-CABO+FRIO';
var htmlTitle	  = 'Barracuda-Cabo+Frio+-+-+Escola+de+Mergulho';
var metaKeywords  = '';
var metaContents  = '';
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();
};

