/* [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','4498',jdecode('Inicio'),jdecode(''),'/4498.html','true',[],''],
	['PAGE','49292',jdecode('%BFQuienes+somos%3F'),jdecode(''),'/49292/index.html','true',[ 
		['PAGE','49319',jdecode('Nuestros+vinos'),jdecode(''),'/49292/49319.html','true',[],'']
	],''],
	['PAGE','49589',jdecode('Notas+de+cata'),jdecode(''),'/49589.html','true',[],''],
	['PAGE','92003',jdecode('Nuestra+Marca'),jdecode(''),'/92003.html','true',[],''],
	['PAGE','49373',jdecode('Los+vinos+de+Rioja'),jdecode(''),'/49373.html','true',[],''],
	['PAGE','50164',jdecode('Cont%E1ctenos'),jdecode(''),'/50164/index.html','true',[ 
		['PAGE','49562',jdecode('D%F3nde+encontrarnos'),jdecode(''),'/50164/49562.html','true',[],''],
		['PAGE','89419',jdecode('Mapa+de+acceso'),jdecode(''),'/50164/89419.html','true',[],'']
	],''],
	['PAGE','91377',jdecode('Alojamiento'),jdecode(''),'/91377.html','true',[],''],
	['PAGE','91404',jdecode('D.O.C.R'),jdecode(''),'/91404.html','true',[],''],
	['PAGE','90189',jdecode('Calendario+del+Vi%F1edo'),jdecode(''),'/90189.html','true',[],''],
	['PAGE','91721',jdecode('Paseo+recomendado'),jdecode(''),'/91721.html','true',[],''],
	['PAGE','90542',jdecode('Votar'),jdecode(''),'/90542.html','true',[],''],
	['PAGE','35337',jdecode('Libro+de+visitas'),jdecode(''),'/35337/index.html','true',[ 
		['PAGE','35338',jdecode('Leer+el+libro+de+Visitas'),jdecode(''),'/35337/35338.html','true',[],'']
	],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Stripes';
					                                                                    
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 */					                                                            
