/* [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('Portada'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('Oficina+On-line'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','557',jdecode('Lecturas'),jdecode(''),'/452/557.html','true',[],''],
		['PAGE','620',jdecode('Aver%C3%ADas'),jdecode(''),'/452/620.html','true',[],''],
		['PAGE','641',jdecode('Reclamaciones'),jdecode(''),'/452/641.html','true',[],''],
		['PAGE','10701',jdecode('Aviso+Legal'),jdecode(''),'/452/10701.html','true',[],'']
	],''],
	['PAGE','662',jdecode('Zonas+Distribuci%C3%B3n'),jdecode(''),'/662.html','true',[],''],
	['PAGE','36301',jdecode('Bono+Social'),jdecode(''),'/36301.html','true',[],''],
	['PAGE','704',jdecode('Calidad+Servicio'),jdecode(''),'/704.html','true',[],''],
	['PAGE','725',jdecode('Energ%C3%ADa+distribuida'),jdecode(''),'/725.html','true',[],''],
	['PAGE','746',jdecode('Contacto'),jdecode(''),'/746.html','true',[],''],
	['PAGE','16601',jdecode('Enlaces'),jdecode(''),'/16601.html','true',[],''],
	['PAGE','37601',jdecode('Comercializadoras'),jdecode(''),'/37601.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Ragtime';
theSitetree.paletteFamily='B3CA99';
theSitetree.keyvisualId='3571';
theSitetree.keyvisualName='kv_3571.jpg';
theSitetree.fontsetId='10737';
theSitetree.graphicsetId='10852';
theSitetree.contentColor='5D6B55';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Ragtime',
				paletteFamily: 	'B3CA99',
				keyvisualId: 	'3571',
				keyvisualName: 	'kv_3571.jpg',
				fontsetId: 		'10737',
				graphicsetId: 	'10852',
				contentColor: 	'5D6B55',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'B3CA99',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'747475',
				e_color: 		'899D75',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
webappMappings['1008']={
webappId:    '1008',
documentId:  '746',
internalId:  '128128',
customField: 'es:ES:'
};
webappMappings['1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1008']={
webappId:    '1008',
documentId:  '557',
internalId:  '128851',
customField: 'es:ES:'
};
webappMappings['1008']={
webappId:    '1008',
documentId:  '641',
internalId:  '157369',
customField: 'es:ES:'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090610-095219'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20070419-141233'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20070215-110922'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20070507-143551'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20070227-101852'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20070215-111813'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20070419-141308'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '704',
internalId:  '',
customField: '20080502-134725'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '725',
internalId:  '',
customField: '20080502-134929'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '746',
internalId:  '',
customField: '20070419-141505'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20070419-141843'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20080630-154538'
};
webappMappings['5000']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20080930-115321'
};
var canonHostname = 'localhost';
var accountId     = 'AAK020INXPSY';
var companyName   = 'Energ%C3%ADa+El%C3%A9ctrica';
var htmlTitle	  = 'Epresa%2C+Servicios+El%C3%A9ctricos+de+Puerto+Real';
var metaKeywords  = 'Epresa%2C+Servicios+El%C3%A9ctricos+de+Puerto+Real';
var metaContents  = 'Epresa%2C+Servicios+El%C3%A9ctricos+de+Puerto+Real';
					                                                                    
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 */					                                                            
