/* [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','194916',jdecode('INICIO'),jdecode(''),'/194916.html','true',[],''],
	['PAGE','4672',jdecode('USADAS'),jdecode(''),'/4672.html','true',[],''],
	['PAGE','211716',jdecode('PROMO%C3%87%C3%95ES'),jdecode(''),'/211716.html','true',[],''],
	['PAGE','210316',jdecode('CONTACTOS'),jdecode(''),'/210316.html','true',[],''],
	['PAGE','218216',jdecode('COMPETI%C3%87%C3%83O'),jdecode(''),'/218216.html','true',[],''],
	['PAGE','222516',jdecode('CALENDARIOS'),jdecode(''),'/222516.html','true',[],''],
	['PAGE','211121',jdecode('Livro+de+visitas'),jdecode(''),'/211121/index.html','true',[ 
		['PAGE','211116',jdecode('Entradas'),jdecode(''),'/211121/211116.html','true',[],'']
	],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var theTemplate={
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
webappMappings['1006']={
webappId:    '1006',
documentId:  '194916',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '218216',
internalId:  '',
customField: '20090527-180750'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '222516',
internalId:  '',
customField: '20090623-125324'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '4672',
internalId:  '',
customField: '20100302-185547'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '211121',
internalId:  '',
customField: '20091111-130756'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '211116',
internalId:  '',
customField: '20090115-114754'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '211716',
internalId:  '',
customField: '20091010-122827'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '194916',
internalId:  '',
customField: '20091111-133255'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '210316',
internalId:  '',
customField: '20090623-111957'
};
webappMappings['1002']={
webappId:    '1002',
documentId:  '211121',
internalId:  '211121aam010inv0yi',
customField: 'action=form&icq=false'
};
webappMappings['1002']={
webappId:    '1002',
documentId:  '211116',
internalId:  '211121aam010inv0yi',
customField: 'action=list'
};
var canonHostname = 'creator.amenworld.com';
var accountId     = 'AAM010INV0YI';
var companyName   = 'Yamaha+Coimbra';
var htmlTitle	  = 'www.motoenergia.pt';
var metaKeywords  = 'motos%2C+ciclomotores%2C+usadas%2C+novas%2C+pe%EF%BF%BDas%2C+equipamentos%2C+scooters%2C+motas%2C+suzuki%2C+honda%2C+yamaha%2C+kawasaki%2C+husqvarna%2C+ktm%2C+mv+agusta%2C+cagiva%2C+bmw%2C+arai%2C+dainese%2C+agv%2C+mds%2C+nexx%2C+cms%2C+nau%2C+capacetes%2C+bering%2CGIVI';
var metaContents  = 'YAMAHA%2CKAWASAKI%2C+motos+novas%2C+usadas%2C+acessorios%2C+pe%EF%BF%BDas%2C+equipamentos';
					                                                                    
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 */					                                                            
