/* [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','1508',jdecode('Home'),jdecode(''),'/1508.html','true',[],''],
	['PAGE','1565',jdecode('About+us'),jdecode(''),'/1565.html','true',[],''],
	['PAGE','6979',jdecode('Products'),jdecode(''),'/6979/index.html','true',[ 
		['PAGE','7087',jdecode('aluminium+shopfronts'),jdecode(''),'/6979/7087.html','true',[],''],
		['PAGE','7033',jdecode('internal+doors'),jdecode(''),'/6979/7033.html','true',[],''],
		['PAGE','7060',jdecode('mirror+wardrobes'),jdecode(''),'/6979/7060.html','true',[],''],
		['PAGE','7114',jdecode('glass+%26+glazing'),jdecode(''),'/6979/7114.html','true',[],''],
		['PAGE','7006',jdecode('picture+framing'),jdecode(''),'/6979/7006.html','true',[],''],
		['PAGE','19801',jdecode('mirrors'),jdecode(''),'/6979/19801.html','true',[],''],
		['PAGE','41101',jdecode('unframed+stock+mirrors'),jdecode(''),'/6979/41101.html','true',[],'']
	],''],
	['PAGE','19101',jdecode('Download+Catalogues'),jdecode(''),'/19101/index.html','true',[ 
		['PAGE','19128',jdecode('crystal+cut+doors'),jdecode(''),'/19101/19128.html','true',[],''],
		['PAGE','19182',jdecode('lead+doors'),jdecode(''),'/19101/19182.html','true',[],''],
		['PAGE','19155',jdecode('brilliant+cut+designs'),jdecode(''),'/19101/19155.html','true',[],''],
		['PAGE','50501',jdecode('products+%26+sevices+'),jdecode(''),'/19101/50501.html','true',[],'']
	],''],
	['PAGE','6925',jdecode('Jobs'),jdecode(''),'/6925.html','true',[],''],
	['PAGE','6952',jdecode('Latest+News%2FProducts'),jdecode(''),'/6952.html','true',[],''],
	['PAGE','7141',jdecode('Branches'),jdecode(''),'/7141/index.html','true',[ 
		['PAGE','7168',jdecode('Tobago+St%2C+Glasgow'),jdecode(''),'/7141/7168.html','true',[],''],
		['PAGE','20528',jdecode('Gt+Western+Rd%2C+Glasgow'),jdecode(''),'/7141/20528.html','true',[],'']
	],''],
	['PAGE','22701',jdecode('Links'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','30801',jdecode('Contact+Us'),jdecode(''),'/30801/index.html','true',[ 
		['PAGE','31002',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/30801/31002.html','false',[],'']
	],''],
	['PAGE','37602',jdecode('Glass+Samples'),jdecode(''),'/37602.html','true',[],''],
	['PAGE','23502',jdecode('Framed+Mirror+Gallery'),jdecode(''),'/23502.html','true',[],''],
	['PAGE','24502',jdecode('Door+Gallery'),jdecode(''),'/24502.html','true',[],''],
	['PAGE','29902',jdecode('Frame+Samples'),jdecode(''),'/29902.html','true',[],''],
	['PAGE','35102',jdecode('Aluminium+Gallery'),jdecode(''),'/35102.html','true',[],'']];
var siteelementCount=28;
theSitetree.topTemplateName='Surround';
					                                                                    
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 */					                                                            
