/* [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','4659',jdecode('Field+Marketing+Ltd'),jdecode(''),'/4659/index.html','true',[ 
		['PAGE','18501',jdecode('The+Company'),jdecode(''),'/4659/18501.html','true',[],'']
	],''],
	['PAGE','9501',jdecode('Retail+Business+Sector'),jdecode(''),'/9501/index.html','true',[ 
		['PAGE','18619',jdecode('Field+Sales'),jdecode(''),'/9501/18619.html','true',[],''],
		['PAGE','18557',jdecode('Merchandising'),jdecode(''),'/9501/18557.html','true',[],''],
		['PAGE','18588',jdecode('Mystery+Shopping'),jdecode(''),'/9501/18588.html','true',[],''],
		['PAGE','18712',jdecode('Demonstrating'),jdecode(''),'/9501/18712.html','true',[],'']
	],''],
	['PAGE','9532',jdecode('Business+2+Business+Sector'),jdecode(''),'/9532/index.html','true',[ 
		['PAGE','18901',jdecode('B2B+%26+Retail+Channel+Sales'),jdecode(''),'/9532/18901.html','true',[],''],
		['PAGE','18650',jdecode('Marketing+Mentor'),jdecode(''),'/9532/18650.html','true',[],''],
		['PAGE','18681',jdecode('Telesales'),jdecode(''),'/9532/18681.html','true',[],'']
	],''],
	['PAGE','9563',jdecode('Start-up+Business+Sector'),jdecode(''),'/9563/index.html','true',[ 
		['PAGE','18743',jdecode('Market+Evaluation'),jdecode(''),'/9563/18743.html','true',[],''],
		['PAGE','18963',jdecode('Sales+Development'),jdecode(''),'/9563/18963.html','true',[],'']
	],''],
	['PAGE','18401',jdecode('UK+Channel+Development'),jdecode(''),'/18401/index.html','true',[ 
		['PAGE','18932',jdecode('UK+Market+Development'),jdecode(''),'/18401/18932.html','true',[],''],
		['PAGE','109637',jdecode('USA+Market+Development'),jdecode(''),'/18401/109637.html','true',[],'']
	],''],
	['PAGE','110118',jdecode('Introductions'),jdecode(''),'/110118.html','true',[],''],
	['PAGE','19204',jdecode('Sales+Process++Management'),jdecode(''),'/19204.html','true',[],''],
	['PAGE','18994',jdecode('Contact'),jdecode(''),'/18994.html','true',[],'']];
var siteelementCount=20;
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 */					                                                            
