/* [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','4520',jdecode('Historic+Motor+Racing+in+Wales'),jdecode(''),'/4520.html','true',[],''],
	['PAGE','59668',jdecode('SPRINTING+mainly+in+Wales'),jdecode(''),'/59668.html','true',[],''],
	['PAGE','4577',jdecode('Aberavon+1929'),jdecode(''),'/4577.html','true',[],''],
	['PAGE','4604',jdecode('Cefn+Sidan+1927'),jdecode(''),'/4604.html','true',[],''],
	['PAGE','4631',jdecode('Oxwich+1931'),jdecode(''),'/4631.html','true',[],''],
	['PAGE','4685',jdecode('Fairwood+1952'),jdecode(''),'/4685.html','true',[],''],
	['PAGE','17811',jdecode('Jack+Daniels+fm+1937'),jdecode(''),'/17811.html','true',[],''],
	['PAGE','4712',jdecode('Penclawdd+1966'),jdecode(''),'/4712.html','true',[],''],
	['PAGE','5907',jdecode('Pendine+Djelmo+%26+ON%21'),jdecode(''),'/5907.html','true',[],''],
	['PAGE','14665',jdecode('Pendine+Races+True++FALSE'),jdecode(''),'/14665.html','true',[],''],
	['PAGE','43768',jdecode('Pembrokeshire+Automobile+Club+1907'),jdecode(''),'/43768.html','true',[],''],
	['PAGE','50268',jdecode('Pembroke+Docks+Flying+Boats'),jdecode(''),'/50268.html','true',[],''],
	['PAGE','44668',jdecode('PAGE+to+SEND+Contents+For+'),jdecode(''),'/44668.html','true',[],''],
	['PAGE','45668',jdecode('Kidston+Scramble'),jdecode(''),'/45668.html','true',[],''],
	['PAGE','44368',jdecode('EDDIE+STEPHENS'),jdecode(''),'/44368.html','true',[],''],
	['PAGE','45868',jdecode('LINKS'),jdecode(''),'/45868.html','true',[],''],
	['PAGE','38250',jdecode('Guestbook'),jdecode(''),'/38250/index.html','true',[ 
		['PAGE','38251',jdecode('Read+Guestbook'),jdecode(''),'/38250/38251.html','true',[],'']
	],''],
	['PAGE','53568',jdecode('Aberdare+%26+Other'),jdecode(''),'/53568.html','true',[],''],
	['PAGE','55968',jdecode('Liverpool+Sand+Race+1926'),jdecode(''),'/55968.html','true',[],''],
	['PAGE','60068',jdecode('Please+Help+IDENTIFY'),jdecode(''),'/60068.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Zoe';
					                                                                    
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 */					                                                            
