/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(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 POS_TARGET=8;
var theSitetree=[ 
	['PAGE','4606',jdecode('LA+CASA'),jdecode(''),'/4606/index.html','true',[ 
		['PAGE','62207',jdecode('LA+CASA+%28follow+up+page%29'),jdecode(''),'/4606/62207.html','false',[],'','']
	],'',''],
	['PAGE','6653',jdecode('DI+ALGO'),jdecode(''),'/6653/index.html','true',[ 
		['PAGE','6654',jdecode('Leer+el+libro+de+Visitas'),jdecode(''),'/6653/6654.html','false',[],'','']
	],'',''],
	['PAGE','10101',jdecode('+Pagina+de+huevos'),jdecode(''),'/10101/index.html','true',[ 
		['PAGE','10302',jdecode('Crear+p%C3%A1gina+%28follow+up+page%29'),jdecode(''),'/10101/10302.html','false',[],'','']
	],'',''],
	['PAGE','13001',jdecode('HISTORIAS'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','24301',jdecode('MAPA+DE+ACCESO'),jdecode(''),'/24301.html','true',[],'',''],
	['PAGE','38607',jdecode('C%C3%B3mo+encontrarnos'),jdecode(''),'/38607.html','true',[],'',''],
	['PAGE','48607',jdecode('ESCORSO'),jdecode(''),'/48607/index.html','true',[ 
		['PAGE','48628',jdecode('Deportes'),jdecode(''),'/48607/48628.html','true',[],'',''],
		['PAGE','48649',jdecode('M%C3%BAsica'),jdecode(''),'/48607/48649.html','true',[],'',''],
		['PAGE','48670',jdecode('Colecciones'),jdecode(''),'/48607/48670.html','true',[],'',''],
		['PAGE','48691',jdecode('Arte'),jdecode(''),'/48607/48691.html','true',[],'',''],
		['PAGE','53328',jdecode('Familia'),jdecode(''),'/48607/53328.html','true',[],'',''],
		['PAGE','53349',jdecode('Vacaciones'),jdecode(''),'/48607/53349.html','true',[],'','']
	],'',''],
	['PAGE','55107',jdecode('%C3%81lbum+de+foto'),jdecode(''),'/55107/index.html','true',[ 
		['PAGE','55128',jdecode('Familia'),jdecode(''),'/55107/55128.html','true',[],'',''],
		['PAGE','55149',jdecode('Vacaciones'),jdecode(''),'/55107/55149.html','true',[],'','']
	],'',''],
	['PAGE','59607',jdecode('Aficiones'),jdecode(''),'/59607/index.html','true',[ 
		['PAGE','59628',jdecode('Deportes'),jdecode(''),'/59607/59628.html','true',[],'',''],
		['PAGE','59649',jdecode('M%C3%BAsica'),jdecode(''),'/59607/59649.html','true',[],'',''],
		['PAGE','59670',jdecode('Colecciones'),jdecode(''),'/59607/59670.html','true',[],'',''],
		['PAGE','59691',jdecode('Arte'),jdecode(''),'/59607/59691.html','true',[],'','']
	],'',''],
	['PAGE','59712',jdecode('Nuestros+productos'),jdecode(''),'/59712.html','true',[],'',''],
	['PAGE','105440',jdecode('Reformes+Girona'),jdecode(''),'/105440.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Roadsign';
theSitetree.paletteFamily='FBFDC7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10741';
theSitetree.graphicsetId='10497';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Roadsign',
				paletteFamily: 	'FBFDC7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10741',
				graphicsetId: 	'10497',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'666666',
				e_color: 		'999999',
				f_color: 		'663300',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-6653aas010inegsz']={
webappId:    '1002',
documentId:  '6653',
internalId:  '6653aas010inegsz',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4606',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6654',
internalId:  '',
customField: '20060429-015925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20100201-023315'
};
webappMappings['1501']=webappMappings['1501-2569249']={
webappId:    '1501',
documentId:  '4606',
internalId:  '2569249',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62207',
internalId:  '',
customField: '20080421-021332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6653',
internalId:  '',
customField: '20060429-015925'
};
webappMappings['7008']=webappMappings['7008-6645']={
webappId:    '7008',
documentId:  '4606',
internalId:  '6645',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20090909-151706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10302',
internalId:  '',
customField: '20060505-103615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20101029-160129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20070625-140747'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '38607',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38607',
internalId:  '',
customField: '20080301-204911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48607',
internalId:  '',
customField: '20091023-084129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48628',
internalId:  '',
customField: '20080326-140726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48649',
internalId:  '',
customField: '20080326-140726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48670',
internalId:  '',
customField: '20080326-140726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48691',
internalId:  '',
customField: '20080326-140726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55128',
internalId:  '',
customField: '20080414-135858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53328',
internalId:  '',
customField: '20080413-105237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53349',
internalId:  '',
customField: '20080413-105237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55107',
internalId:  '',
customField: '20080417-131532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55149',
internalId:  '',
customField: '20080414-135858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59712',
internalId:  '',
customField: '20100217-133126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59607',
internalId:  '',
customField: '20080525-134853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59628',
internalId:  '',
customField: '20080519-231048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59649',
internalId:  '',
customField: '20080530-143442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59670',
internalId:  '',
customField: '20080420-230407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59691',
internalId:  '',
customField: '20090911-121618'
};
webappMappings['7008']=webappMappings['7008-6646']={
webappId:    '7008',
documentId:  '10101',
internalId:  '6646',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105440',
internalId:  '',
customField: '20091016-091340'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010INEGSZ';
var companyName   = 'CERVECERIA+UNICA';
var htmlTitle	  = '+++++++++++++++++++++++++++++CERVECERIA+UNICA';
var metaKeywords  = 'cerveceria+unica+salt';
var metaContents  = 'zona+wi-fi+salt';
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;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};

