/* [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','4559',jdecode('Cuan+Siar'),jdecode(''),'/4559.html','true',[],''],
	['PAGE','14202',jdecode('Eriskay'),jdecode(''),'/14202.html','true',[],''],
	['PAGE','6303',jdecode('Accommodation'),jdecode(''),'/6303.html','true',[],''],
	['PAGE','17502',jdecode('Road+to+the+Isles'),jdecode(''),'/17502/index.html','true',[ 
		['PAGE','66302',jdecode('Eriskay+directions'),jdecode(''),'/17502/66302.html','true',[],'']
	],''],
	['PAGE','69902',jdecode('Holiday+activities'),jdecode(''),'/69902.html','true',[],''],
	['PAGE','5030',jdecode('Eriskay+%26+Uist+Links'),jdecode(''),'/5030/index.html','true',[ 
		['PAGE','19710',jdecode('Mainland+Transport'),jdecode(''),'/5030/19710.html','true',[],''],
		['PAGE','19737',jdecode('Local+Transport'),jdecode(''),'/5030/19737.html','true',[],''],
		['PAGE','19683',jdecode('Taxis'),jdecode(''),'/5030/19683.html','true',[],''],
		['PAGE','19629',jdecode('Food+%26+drinks'),jdecode(''),'/5030/19629.html','true',[],''],
		['PAGE','19602',jdecode('Music'),jdecode(''),'/5030/19602.html','true',[],''],
		['PAGE','19656',jdecode('Fishing'),jdecode(''),'/5030/19656.html','true',[],''],
		['PAGE','20102',jdecode('Other+accommodation'),jdecode(''),'/5030/20102.html','true',[],'']
	],''],
	['PAGE','23902',jdecode('Gaelic+%26+culture'),jdecode(''),'/23902/index.html','true',[ 
		['PAGE','65802',jdecode('Ann+an+Gaidhlig'),jdecode(''),'/23902/65802.html','true',[],'']
	],''],
	['PAGE','21002',jdecode('Outer++Hebrides'),jdecode(''),'/21002/index.html','true',[ 
		['PAGE','22302',jdecode('South+Uist'),jdecode(''),'/21002/22302.html','true',[],''],
		['PAGE','22356',jdecode('Benbecula'),jdecode(''),'/21002/22356.html','true',[],''],
		['PAGE','22329',jdecode('Barra'),jdecode(''),'/21002/22329.html','true',[],''],
		['PAGE','22518',jdecode('Vatersay'),jdecode(''),'/21002/22518.html','true',[],''],
		['PAGE','22410',jdecode('Mingulay'),jdecode(''),'/21002/22410.html','true',[],''],
		['PAGE','22383',jdecode('North+Uist'),jdecode(''),'/21002/22383.html','true',[],''],
		['PAGE','22437',jdecode('Berneray'),jdecode(''),'/21002/22437.html','true',[],''],
		['PAGE','22491',jdecode('Harris'),jdecode(''),'/21002/22491.html','true',[],''],
		['PAGE','22464',jdecode('Lewis'),jdecode(''),'/21002/22464.html','true',[],''],
		['PAGE','22802',jdecode('Saint+Kilda'),jdecode(''),'/21002/22802.html','true',[],'']
	],''],
	['PAGE','99602',jdecode('Eriskay+Ponies'),jdecode(''),'/99602.html','true',[],''],
	['PAGE','69002',jdecode('Hebridean+Climate'),jdecode(''),'/69002.html','true',[],''],
	['PAGE','13802',jdecode('Enquiries'),jdecode(''),'/13802.html','true',[],'']];
var siteelementCount=30;
theSitetree.topTemplateName='Cable';
					                                                                    
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 */					                                                            
