/* [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','4556',jdecode('HOME+%26+NEWS'),jdecode(''),'/4556.html','true',[],''],
	['PAGE','4829',jdecode('DIVING+COURSES'),jdecode(''),'/4829/index.html','true',[ 
		['PAGE','4856',jdecode('PADI+Discover+Scuba+Diving'),jdecode(''),'/4829/4856.html','true',[],''],
		['PAGE','4883',jdecode('PADI+Open+Water+Diver+'),jdecode(''),'/4829/4883.html','true',[],''],
		['PAGE','4910',jdecode('PADI+Advanced+Open+Water+'),jdecode(''),'/4829/4910.html','true',[],''],
		['PAGE','4937',jdecode('PADI+Emergency+1st+Response'),jdecode(''),'/4829/4937.html','true',[],''],
		['PAGE','4964',jdecode('PADI+Rescue+Diver+'),jdecode(''),'/4829/4964.html','true',[],''],
		['PAGE','4991',jdecode('PADI+Divemaster+'),jdecode(''),'/4829/4991.html','true',[],''],
		['PAGE','5018',jdecode('Shore+and+Boat+Dives+'),jdecode(''),'/4829/5018.html','true',[],''],
		['PAGE','21781',jdecode('PADI+Specialty+courses'),jdecode(''),'/4829/21781.html','true',[],'']
	],''],
	['PAGE','30674',jdecode('DIVING+HOLIDAYS'),jdecode(''),'/30674.html','true',[],''],
	['PAGE','5207',jdecode('COURSE+DATES'),jdecode(''),'/5207.html','true',[],''],
	['PAGE','42558',jdecode('SDMEC'),jdecode(''),'/42558.html','true',[],''],
	['PAGE','4613',jdecode('CONSERVATION+'),jdecode(''),'/4613.html','true',[],''],
	['PAGE','5045',jdecode('Marine+Life+Research'),jdecode(''),'/5045.html','true',[],''],
	['PAGE','33746',jdecode('DOLPHIN+PROJECTS'),jdecode(''),'/33746.html','true',[],''],
	['PAGE','35946',jdecode('VISITOR+CENTRE'),jdecode(''),'/35946.html','true',[],''],
	['PAGE','36773',jdecode('C+M+L+R+'),jdecode(''),'/36773.html','true',[],''],
	['PAGE','37546',jdecode('SHARKS'),jdecode(''),'/37546.html','true',[],''],
	['PAGE','34746',jdecode('Education+Programme+'),jdecode(''),'/34746.html','true',[],''],
	['PAGE','27268',jdecode('SHOP'),jdecode(''),'/27268.html','true',[],''],
	['PAGE','24968',jdecode('FIRST+AID'),jdecode(''),'/24968.html','true',[],''],
	['PAGE','5180',jdecode('LATEST+SIGHTINGS'),jdecode(''),'/5180.html','true',[],''],
	['PAGE','5126',jdecode('BOOKING+FORM+'),jdecode(''),'/5126.html','true',[],''],
	['PAGE','25268',jdecode('ACCOMMODATION'),jdecode(''),'/25268.html','true',[],''],
	['PAGE','5234',jdecode('OTHER+LINKS+'),jdecode(''),'/5234.html','true',[],'']];
var siteelementCount=26;
theSitetree.topTemplateName='Architekt';
					                                                                    
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 */					                                                            
