/* [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','24',jdecode('%E3%83%9B%E3%83%BC%E3%83%A0'),jdecode(''),'/24.html','true',[],''],
	['PAGE','1034',jdecode('%E7%AB%B6%E4%BA%89%E5%85%A5%E6%9C%AD%E5%8F%82%E5%8A%A0%E8%B3%87%E6%A0%BC'),jdecode(''),'/1034/index.html','true',[ 
		['PAGE','2114',jdecode('+%E5%85%AC%E7%A4%BA'),jdecode(''),'/1034/2114.html','true',[],''],
		['PAGE','2123',jdecode('%E7%94%B3%E8%AB%8B%E6%A7%98%E5%BC%8F%E3%81%AE%E8%AB%8B%E6%B1%82'),jdecode(''),'/1034/2123/index.html','true',[ 
			['PAGE','2192',jdecode('%E7%94%B3%E8%AB%8B%E6%A7%98%E5%BC%8F+%28%E3%83%95%E3%82%A9%E3%83%AD%E3%83%BC%E3%82%A2%E3%83%83%E3%83%97%E3%81%AE%E3%83%9A%E3%83%BC%E3%82%B8%29'),jdecode(''),'/1034/2123/2192.html','false',[],'']
		],'']
	],''],
	['PAGE','1052',jdecode('%E6%8E%A1%E7%94%A8%E6%83%85%E5%A0%B1'),jdecode(''),'/1052.html','true',[],''],
	['PAGE','2256',jdecode('%E3%81%8A%E7%9F%A5%E3%82%89%E3%81%9B'),jdecode(''),'/2256.html','true',[],''],
	['PAGE','2310',jdecode('%E3%83%AA%E3%83%B3%E3%82%AF'),jdecode(''),'/2310.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Natural';
					                                                                    
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 */					                                                            
