/* [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','11',jdecode('P%C3%A1gina+inicial'),jdecode(''),'/11.html','true',[],'',''],
	['PAGE','5134',jdecode('*Diretoria'),jdecode(''),'/5134.html','true',[],'',''],
	['PAGE','32',jdecode('*Hist%C3%B3ria+%28som%29'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','84801',jdecode('*Trof%C3%A9us'),jdecode(''),'/84801.html','true',[],'',''],
	['PAGE','185001',jdecode('*Parque+Aqu%C3%A1tico'),jdecode(''),'/185001.html','true',[],'',''],
	['PAGE','41',jdecode('Progr.+Domingo-SET'),jdecode(''),'/41.html','true',[],'',''],
	['PAGE','1313',jdecode('*Progr.Qua.a+S%C3%A1b.2010'),jdecode(''),'/1313.html','true',[],'',''],
	['PAGE','5941',jdecode('*Progr.Co-irm%C3%A3os'),jdecode(''),'/5941.html','true',[],'',''],
	['PAGE','4924',jdecode('Aniversariantes-AGO+%28som%29'),jdecode(''),'/4924.html','true',[],'',''],
	['PAGE','6327',jdecode('%C3%81lbuns+de+eventos'),jdecode(''),'/6327.html','true',[],'',''],
	['PAGE','310571',jdecode('*+Anivers%C3%A1rio+do+Clube'),jdecode(''),'/310571.html','true',[],'',''],
	['PAGE','327382',jdecode('*+Baile+N.S.Gloria+%28novo%29'),jdecode(''),'/327382.html','true',[],'',''],
	['PAGE','279243',jdecode('*+Fotos+da+piscina'),jdecode(''),'/279243.html','true',[],'',''],
	['PAGE','5064',jdecode('*+Amigos+do+clube'),jdecode(''),'/5064.html','true',[],'',''],
	['PAGE','6087',jdecode('Mural'),jdecode(''),'/6087.html','true',[],'',''],
	['PAGE','5694',jdecode('Endere%C3%A7o'),jdecode(''),'/5694.html','true',[],'',''],
	['PAGE','5364',jdecode('*Central+de+atendimento'),jdecode(''),'/5364.html','true',[],'',''],
	['PAGE','1232',jdecode('Livro+de+visitas'),jdecode(''),'/1232/index.html','true',[ 
		['PAGE','1231',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/1232/1231.html','false',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='468';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'pt',
  country: 'BR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'468',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5134',
internalId:  '',
customField: '20100830-203021'
};
webappMappings['1002']=webappMappings['1002-1232AVEC10IN2SKO']={
webappId:    '1002',
documentId:  '1232',
internalId:  '1232AVEC10IN2SKO',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-1148483']={
webappId:    '1501',
documentId:  '11',
internalId:  '1148483',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11',
internalId:  '',
customField: '20100901-004716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20070207-134705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84801',
internalId:  '',
customField: '20070128-003600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185001',
internalId:  '',
customField: '20100426-170414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41',
internalId:  '',
customField: '20100901-005237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1313',
internalId:  '',
customField: '20100629-133507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5941',
internalId:  '',
customField: '20080825-234918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4924',
internalId:  '',
customField: '20100818-161301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6327',
internalId:  '',
customField: '20090604-191709'
};
webappMappings['7060']=webappMappings['7060-cc9af8c5bca69868fe420757b8d1737e']={
webappId:    '7060',
documentId:  '310571',
internalId:  'cc9af8c5bca69868fe420757b8d1737e',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5064',
internalId:  '',
customField: '20071010-175446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6087',
internalId:  '',
customField: '20080806-174503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5694',
internalId:  '',
customField: '20091031-094041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20091031-090719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1232',
internalId:  '',
customField: '20060825-202014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1231',
internalId:  '',
customField: '20060825-202014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '279243',
internalId:  '',
customField: '20090603-192500'
};
webappMappings['7060']=webappMappings['7060-bd2e27b61a56749959dac6f8162763c0']={
webappId:    '7060',
documentId:  '327382',
internalId:  'bd2e27b61a56749959dac6f8162763c0',
customField: 'language:pt;country:BR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '310571',
internalId:  '',
customField: '20100604-162456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '327382',
internalId:  '',
customField: '20100818-225403'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2SKO';
var companyName   = 'CLUBE+DOS+DEMOCR%C3%81TICOS';
var htmlTitle	  = 'Clube+dos+Democr%C3%A1ticos';
var metaKeywords  = 'dan%C3%A7a';
var metaContents  = 'Dan%C3%A7a+de+sal%C3%A3o%2C+lazer%2C+entretenimento.';
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();
};
