/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','473',jdecode('NICI'),jdecode(''),'/473.html','true',[],''],
	['PAGE','90201',jdecode('Eudactica'),jdecode(''),'/90201.html','true',[],''],
	['PAGE','90222',jdecode('Asterix'),jdecode(''),'/90222.html','true',[],''],
	['PAGE','59201',jdecode('Compre+Portugu%C3%AAs'),jdecode(''),'/59201.html','true',[],''],
	['PAGE','97001',jdecode('Livros'),jdecode(''),'/97001.html','true',[],''],
	['PAGE','536',jdecode('Contactos'),jdecode(''),'/536.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Simple';
theSitetree.paletteFamily='DAFADA';
theSitetree.keyvisualId='2577';
theSitetree.keyvisualName='schule.jpg';
theSitetree.fontsetId='10753';
theSitetree.graphicsetId='10461';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='dafada';
var theTemplate={
				name: 			'Simple',
				paletteFamily: 	'DAFADA',
				keyvisualId: 	'2577',
				keyvisualName: 	'schule.jpg',
				fontsetId: 		'10753',
				graphicsetId: 	'10461',
				contentColor: 	'000000',
				contentBGColor: 'dafada',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'857157',
				e_color: 		'AAAAAA',
				f_color: 		'817E7E',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
webappMappings['5000']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091022-182156'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20090806-205054'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '90201',
internalId:  '',
customField: '20090202-220746'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '90222',
internalId:  '',
customField: '20081031-121026'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20091022-182335'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '97001',
internalId:  '',
customField: '20081031-123424'
};
webappMappings['1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '59201',
internalId:  '',
customField: '20081031-200735'
};
var canonHostname = 'creator.amenworld.com';
var accountId     = 'AAM010INLRKT';
var companyName   = 'Papelaria+Livraria+L%C3%A1pis+Laz%C3%BAli';
var htmlTitle	  = 'Livraria+Papelaria+Lapis+Lazuli';
var metaKeywords  = 'papelaria%2C+livraria%2Cmanuais+escolares%2C+livros%2C+artigos+escolares%2C+economato%2C+livros+escolares%2C+plano+nacional+de+leitura%2C+provas+de+aferi%C3%A7%C3%A3o%2C+artigos+escrit%C3%B3rio%2C+brindes%2C+NICI%2C+Ast%C3%A9rix%2C+did%C3%A1ctico%2C+Plastoy%2C+Bullyland%2C+Wissner%2C+Viarco%2C+Ramirex%2C+ambar%2C+Compro+o+que+%C3%A9+nosso%2CMacmillan%2C+Oxford+university%2C+Mac+Graw+Hill%2C+Hueber%2C+Edi+numen%2C+eudactica%2C+supertmatik';
var metaContents  = 'papelaria%2C+livraria%2Cmanuais+escolares%2C+livros%2C+artigos+escolares%2C+economato%2C+livros+escolares%2C+plano+nacional+de+leitura%2C+provas+de+aferi%C3%A7%C3%A3o%2C+artigos+escrit%C3%B3rio%2C+brindes%2C+NICI%2C+Ast%C3%A9rix%2C+did%C3%A1ctico%2C+Plastoy%2C+Bullyland%2C+Wissner%2C+Viarco%2C+Ramirex%2C+ambar%2C+Compro+o+que+%C3%A9+nosso%2CMacmillan%2C+Oxford+university%2C+Mac+Graw+Hill%2C+Hueber%2C+Edi+numen%2C+eudactica%2C+supertmatik';
					                                                                    
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 */					                                                            
