/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],''],
	['PAGE','4655',jdecode('Constructores'),jdecode(''),'/4655/index.html','true',[ 
		['PAGE','10422',jdecode('Cofrad%EDas+de+constructores'),jdecode(''),'/4655/10422.html','true',[],''],
		['PAGE','10449',jdecode('Sto+Domingo+de+la+Calzada'),jdecode(''),'/4655/10449.html','true',[],''],
		['PAGE','10476',jdecode('San+Juan+de+Ortega'),jdecode(''),'/4655/10476.html','true',[],''],
		['PAGE','10503',jdecode('Mateo'),jdecode(''),'/4655/10503.html','true',[],'']
	],''],
	['PAGE','4682',jdecode('Grandes+Obras'),jdecode(''),'/4682/index.html','true',[ 
		['PAGE','10530',jdecode('San+Juan+de+la+Pe%F1a'),jdecode(''),'/4682/10530.html','true',[],''],
		['PAGE','10557',jdecode('Ntra+Sra+de+Eunate'),jdecode(''),'/4682/10557.html','true',[],''],
		['PAGE','10584',jdecode('Torres+del+R%EDo'),jdecode(''),'/4682/10584.html','true',[],''],
		['PAGE','10611',jdecode('Ntra+Sra+de+Sang%FCesa'),jdecode(''),'/4682/10611.html','true',[],''],
		['PAGE','10638',jdecode('San+Miguel+de+Escalada'),jdecode(''),'/4682/10638.html','true',[],''],
		['PAGE','10665',jdecode('Ntra+Sra+de+Fromista'),jdecode(''),'/4682/10665.html','true',[],''],
		['PAGE','10692',jdecode('Villafranca+del+Bierzo'),jdecode(''),'/4682/10692.html','true',[],''],
		['PAGE','10719',jdecode('Santiago+de+Compostela'),jdecode(''),'/4682/10719.html','true',[],'']
	],''],
	['PAGE','4709',jdecode('Marcas'),jdecode(''),'/4709.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Startup';
					                                                                    
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 */					                                                            
