/* [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','4517',jdecode('Home'),jdecode(''),'/4517.html','true',[],''],
	['PAGE','10303',jdecode('Personal+Licence+NCPLH+'),jdecode(''),'/10303/index.html','true',[ 
		['PAGE','45771',jdecode('Course+Synopsis'),jdecode(''),'/10303/45771.html','true',[],'']
	],''],
	['PAGE','53948',jdecode('Scottish+Personal+Licence+'),jdecode(''),'/53948.html','true',[],''],
	['PAGE','97248',jdecode('NCPLH+DATES'),jdecode(''),'/97248.html','true',[],''],
	['PAGE','98050',jdecode('SCPLH+DATES'),jdecode(''),'/98050.html','true',[],''],
	['PAGE','19944',jdecode('Door+Supervisor+Training'),jdecode(''),'/19944/index.html','true',[ 
		['PAGE','45798',jdecode('Course+Synopsis'),jdecode(''),'/19944/45798.html','true',[],'']
	],''],
	['PAGE','53448',jdecode('Door+Stewards+Scotland'),jdecode(''),'/53448/index.html','true',[ 
		['PAGE','53508',jdecode('Door+Steward+Synopsis'),jdecode(''),'/53448/53508.html','true',[],'']
	],''],
	['PAGE','25142',jdecode('Food+Hygiene+Training'),jdecode(''),'/25142/index.html','true',[ 
		['PAGE','45744',jdecode('Course+Synopsis'),jdecode(''),'/25142/45744.html','true',[],'']
	],''],
	['PAGE','8990',jdecode('Health+and+Safety+'),jdecode(''),'/8990/index.html','true',[ 
		['PAGE','45717',jdecode('Course+Synopsis'),jdecode(''),'/8990/45717.html','true',[],'']
	],''],
	['PAGE','58948',jdecode('First+Aid'),jdecode(''),'/58948.html','true',[],''],
	['PAGE','52342',jdecode('Retail+Alcohol+Responsibly'),jdecode(''),'/52342.html','true',[],''],
	['PAGE','52042',jdecode('Marketing'),jdecode(''),'/52042.html','true',[],''],
	['PAGE','9484',jdecode('Managing+your+HR'),jdecode(''),'/9484/index.html','true',[ 
		['PAGE','45825',jdecode('Course+Synopsis'),jdecode(''),'/9484/45825.html','true',[],'']
	],''],
	['PAGE','10357',jdecode('About+Us'),jdecode(''),'/10357.html','true',[],''],
	['PAGE','9125',jdecode('Contact'),jdecode(''),'/9125.html','true',[],''],
	['PAGE','52097',jdecode('Biographies'),jdecode(''),'/52097.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Collage';
					                                                                    
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 */					                                                            

