/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'']];
var siteelementCount=1;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='339966';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='491';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='72c6a1';
var theTemplate={
				name: 			'Round',
				paletteFamily: 	'339966',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'491',
				contentColor: 	'000000',
				contentBGColor: '72c6a1',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'72c6a1',
				b_color: 		'339966',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12'
			  };
var webappMappings = {};
webappMappings['5000']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20081226-165548'
};
var canonHostname = 'creator.amenworld.com';
var accountId     = 'AAM010INZK1M';
var companyName   = 'toralla.net';
var htmlTitle	  = 'TORALLA%3ANET';
var metaKeywords  = '';
var metaContents  = 'iframe+width%3D425+height%3D350+frameborder%3D0+scrolling%3Dno+marginheight%3D0+marginwidth%3D0+src%3Dhttp%3A%2F%2Fmaps.google.es%2Fmaps%3Ff%3Dqamp%3Bhl%3Dcaamp%3Bgeocode%3Damp%3Bq%3DToralla%2C%2BConca%2Bde%2BDaltamp%3Bsll%3D40.396764%2C-3.713379amp%3Bsspn%3D11.674551%2C19.6875amp%3Bie%3DUTF8amp%3Bll%3D42.326062%2C0.953751amp%3Bspn%3D0.354691%2C0.615234amp%3Bz%3D11amp%3Boutput%3Dembedamp%3Bs%3DAARTsJpU22jpgE90iU81Y1ay80t05621kg%2Fiframebr+%2Fsmalla+href%3Dhttp%3A%2F%2Fmaps.google.es%2Fmaps%3Ff%3Dqamp%3Bhl%3Dcaamp%3Bgeocode%3Damp%3Bq%3DToralla%2C%2BConca%2Bde%2BDaltamp%3Bsll%3D40.396764%2C-3.713379amp%3Bsspn%3D11.674551%2C19.6875amp%3Bie%3DUTF8amp%3Bll%3D42.326062%2C0.953751amp%3Bspn%3D0.354691%2C0.615234amp%3Bz%3D11amp%3Bsource%3Dembed+style%3Dcolor%3A%230000FF%3Btext-align%3AleftMostra+un+mapa+m%C3%A9s+gran%2Fa%2Fsmall';
					                                                                    
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 */					                                                            
