/* [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','4599',jdecode('Empresa'),jdecode(''),'/4599.html','true',[],''],
	['PAGE','64102',jdecode('Clientes'),jdecode(''),'/64102.html','true',[],''],
	['PAGE','4902',jdecode('Contactos'),jdecode(''),'/4902.html','true',[],''],
	['PAGE','65302',jdecode('Artigos'),jdecode(''),'/65302.html','true',[],'']];
var siteelementCount=4;
theSitetree.topTemplateName='Moonflight';
theSitetree.paletteFamily='5B7A93';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='447';
theSitetree.graphicsetId='499';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Moonflight',
				paletteFamily: 	'5B7A93',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'447',
				graphicsetId: 	'499',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'2C5574',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
webappMappings['1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20080525-180507'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '64102',
internalId:  '',
customField: '20070727-134916'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '4902',
internalId:  '',
customField: '20060920-183155'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '65302',
internalId:  '',
customField: '20070129-185322'
};
var canonHostname = 'creator.amenworld.com';
var accountId     = 'AAM010IN30UC';
var companyName   = 'FULCRAL+-+Consultoria+de+Gest%C3%A3o';
var htmlTitle	  = 'FULCRAL+-+Consultoria+de+Gest%C3%A3o';
var metaKeywords  = 'Fulcral%3B+reduzir+custos%3B+gest%C3%A3o+compras%3B+custo%3B+custos%3B+compras%3B+redu%C3%A7%C3%A3o%3B+gest%C3%A3o%3B+racionaliza%C3%A7%C3%A3o%3B+optimiza%C3%A7%C3%A3o%3B+consultoria';
var metaContents  = 'A+FULCRAL+est%C3%A1+especializada+em+consultoria+de+gest%C3%A3o+de+custos%2C+reconhecida+n%C3%A3o+apenas+pelos+seus+servi%C3%A7os+de+valor+acrescentado%2C+mas+tamb%C3%A9m+pela+estreita+colabora%C3%A7%C3%A3o+que+desenvolve+com+os+seus+clientes.';
					                                                                    
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 */					                                                            
