/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('Opening+hours'),jdecode(''),'/452.html','true',[],''],
	['PAGE','473',jdecode('How+to+find+us'),jdecode(''),'/473.html','true',[],''],
	['PAGE','494',jdecode('Menu'),jdecode(''),'/494.html','true',[],''],
	['PAGE','515',jdecode('Upcoming+events'),jdecode(''),'/515.html','true',[],''],
	['PAGE','536',jdecode('Coupons'),jdecode(''),'/536.html','true',[],''],
	['PAGE','620',jdecode('Press'),jdecode(''),'/620.html','true',[],''],
	['PAGE','641',jdecode('Contact'),jdecode(''),'/641.html','true',[],''],
	['PAGE','662',jdecode('About+us'),jdecode(''),'/662.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Capri';
theSitetree.paletteFamily='385CA9';
theSitetree.keyvisualId='7213';
theSitetree.keyvisualName='kv_7213.jpg';
theSitetree.fontsetId='16413';
theSitetree.graphicsetId='12134';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Capri',
				paletteFamily: 	'385CA9',
				keyvisualId: 	'7213',
				keyvisualName: 	'kv_7213.jpg',
				fontsetId: 		'16413',
				graphicsetId: 	'12134',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
var canonHostname = 'wsc01.cm4all.affinity.com';
var accountId     = 'AAFF10INV29H';
var companyName   = 'Sam%27s+Roadhouse+Diner';
var htmlTitle	  = 'Sams+Roadhouse+Diner';
var metaKeywords  = 'Sams%2C+Sams+Roadhouse%2C+Sams+Roadhouse%2C+Sams+Road+House%2C+Sams+Roadhouse+Diner%2C+Marin+Dinning%2C+American+Food%2C+Senior+Special%2C+Breakfast%2C+Lunch%2C+Dinner%2C+Wine+Tasting%2C+Sam+Jarjoura%2C+Novato%2C+restaurant%2C+food%2C+San+Rafael%2C+Appitizers%2C+Beverage%2C+Eating+out%2C+Roast+House%2C+Roast+Haus%2C+coupon%2C+discount%2C+specials';
var metaContents  = 'Sams%2C+Sams+Roadhouse%2C+Sams+Roadhouse%2C+Sams+Road+House%2C+Sams+Roadhouse+Diner%2C+Marin+Dinning%2C+American+Food%2C+Senior+Special%2C+Breakfast%2C+Lunch%2C+Dinner%2C+Wine+Tasting%2C+Sam+Jarjoura%2C+Novato%2C+restaurant%2C+food%2C+San+Rafael%2C+Appitizers%2C+Beverage%2C+Eating+out%2C+Roast+House%2C+Roast+Haus%2C+coupon%2C+discount%2C+specials%2C+';
					                                                                    
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 */					                                                            
