/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return unescape(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','29',jdecode('Home'),jdecode(''),'/29.html','true',[],''],
	['PAGE','50',jdecode('P%C3%A1gina+inicial'),jdecode(''),'/50.html','true',[],''],
	['PAGE','59',jdecode('Quem+somos'),jdecode(''),'/59/index.html','true',[ 
		['PAGE','68',jdecode('Hist%C3%B3ria'),jdecode(''),'/59/68.html','true',[],''],
		['PAGE','77',jdecode('A+Dire%C3%A7%C3%A3o'),jdecode(''),'/59/77.html','true',[],''],
		['PAGE','86',jdecode('Nossa+equipe'),jdecode(''),'/59/86.html','true',[],'']
	],''],
	['PAGE','95',jdecode('Not%C3%ADcias'),jdecode(''),'/95.html','true',[],''],
	['PAGE','104',jdecode('Links+interessantes'),jdecode(''),'/104.html','true',[],''],
	['PAGE','113',jdecode('Curr%C3%ADculo'),jdecode(''),'/113.html','true',[],''],
	['PAGE','122',jdecode('Imprensa'),jdecode(''),'/122.html','true',[],''],
	['PAGE','1205',jdecode('Contato'),jdecode(''),'/1205.html','true',[],''],
	['PAGE','1244',jdecode('Livro+de+visitas%2FF%C3%B3rum'),jdecode(''),'/1244/index.html','true',[ 
		['PAGE','1243',jdecode('Servi%C3%A7o+de+bilhetes'),jdecode(''),'/1244/1243.html','true',[],'']
	],''],
	['PAGE','1347',jdecode('%C3%81lbum+de+fotos'),jdecode(''),'/1347/index.html','true',[ 
		['PAGE','1356',jdecode('Fam%C3%ADlia'),jdecode(''),'/1347/1356.html','true',[],''],
		['PAGE','1365',jdecode('F%C3%A9rias+fotos'),jdecode(''),'/1347/1365.html','true',[],'']
	],''],
	['PAGE','2610',jdecode('Blog'),jdecode(''),'/2610.html','true',[],''],
	['PAGE','2619',jdecode('Servi%C3%A7os'),jdecode(''),'/2619.html','true',[],''],
	['PAGE','2628',jdecode('Refer%C3%AAncias'),jdecode(''),'/2628.html','true',[],''],
	['PAGE','2637',jdecode('Pre%C3%A7os'),jdecode(''),'/2637.html','true',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Moonflight';
					                                                                    
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;                                                                     
	};                                                                               
/* EOF */					                                                            
