/* [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','1152',jdecode('Home'),jdecode(''),'/1152.html','true',[],''],
	['PAGE','1205',jdecode('Thimble+Cottage+Photos'),jdecode(''),'/1205.html','true',[],''],
	['PAGE','29709',jdecode('Tweedle+Dee+Photos'),jdecode(''),'/29709.html','true',[],''],
	['PAGE','29736',jdecode('Tweedle+Dum+Photos'),jdecode(''),'/29736.html','true',[],''],
	['PAGE','90974',jdecode('Dawsons+Cottage+Photos'),jdecode(''),'/90974.html','true',[],''],
	['PAGE','78434',jdecode('Prospect++Photos'),jdecode(''),'/78434.html','true',[],''],
	['PAGE','73507',jdecode('Conifer+Cottage+Photos'),jdecode(''),'/73507.html','true',[],''],
	['PAGE','62587',jdecode('Fountainwell+Photos'),jdecode(''),'/62587.html','true',[],''],
	['PAGE','88574',jdecode('Italy+-+Coming+Soon'),jdecode(''),'/88574.html','true',[],''],
	['PAGE','21022',jdecode('+Availability++%26+Rates'),jdecode(''),'/21022.html','true',[],''],
	['PAGE','81836',jdecode('About+The+Cottages'),jdecode(''),'/81836.html','true',[],''],
	['PAGE','1274',jdecode('About+Youlgreave'),jdecode(''),'/1274.html','true',[],''],
	['PAGE','71394',jdecode('About+Wirksworth'),jdecode(''),'/71394.html','true',[],''],
	['PAGE','72211',jdecode('Peak+Attractions'),jdecode(''),'/72211.html','true',[],''],
	['PAGE','19009',jdecode('FAQ%26%23x27%3Bs'),jdecode(''),'/19009.html','true',[],''],
	['PAGE','1297',jdecode('Guest+Comments'),jdecode(''),'/1297.html','true',[],''],
	['PAGE','1320',jdecode('Contact+Us'),jdecode(''),'/1320/index.html','true',[ 
		['PAGE','88181',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/1320/88181.html','false',[],'']
	],''],
	['PAGE','59987',jdecode('Mangement+Service'),jdecode(''),'/59987.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Profile';
					                                                                    
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 */					                                                            
