/* [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','701',jdecode('Enrique+de+Le%C3%B3n'),jdecode(''),'/701.html','true',[],'',''],
	['PAGE','13401',jdecode('Curr%C3%ADculum'),jdecode(''),'/13401/index.html','true',[ 
		['PAGE','24901',jdecode('Curr%C3%ADculum+r%C3%A1pido'),jdecode(''),'/13401/24901.html','true',[],'','']
	],'',''],
	['PAGE','752',jdecode('%C2%BFQu%C3%A9+ofrecemos%3F'),jdecode(''),'/752.html','true',[],'',''],
	['PAGE','13043',jdecode('Multimedia'),jdecode(''),'/13043/index.html','true',[ 
		['PAGE','16401',jdecode('FOTOS'),jdecode(''),'/13043/16401.html','true',[],'',''],
		['PAGE','13001',jdecode('NOTICIAS%2CPRENSA'),jdecode(''),'/13043/13001.html','true',[],'','']
	],'',''],
	['PAGE','13022',jdecode('Pr%C3%B3ximas+actuaciones'),jdecode(''),'/13022.html','true',[],'',''],
	['PAGE','773',jdecode('Contacto'),jdecode(''),'/773/index.html','true',[ 
		['PAGE','5901',jdecode('Contacto+%28follow+up+page%29'),jdecode(''),'/773/5901.html','false',[],'','']
	],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Popart';
theSitetree.paletteFamily='B4AB19';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10731';
theSitetree.graphicsetId='10454';
theSitetree.contentColor='B4AB19';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Popart',
				paletteFamily: 	'B4AB19',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10731',
				graphicsetId: 	'10454',
				contentColor: 	'B4AB19',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100208-113118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '752',
internalId:  '',
customField: '20080918-125145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20080917-200425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20080229-235442'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20081108-082201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20100203-022943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13043',
internalId:  '',
customField: '20090203-021358'
};
webappMappings['7060']=webappMappings['7060-db1c9769686e8220323e16e3695d3bd4']={
webappId:    '7060',
documentId:  '16401',
internalId:  'db1c9769686e8220323e16e3695d3bd4',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20080917-200556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13022',
internalId:  '',
customField: '20091117-005817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20100203-023205'
};
webappMappings['7008']=webappMappings['7008-6442']={
webappId:    '7008',
documentId:  '773',
internalId:  '6442',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwd718.servidoresdns.net';
var accountId     = 'AARS20IN3I23';
var companyName   = 'ENRIQUE+DE+LE%C3%93N';
var htmlTitle	  = '';
var metaKeywords  = 'magos+murcia+mago+magia+enrique+arte+ilusion+de+leon+show+magic+grandes+ilusiones+teatro+cumplea%C3%B1os+despedida+show+comunion+celebracionesspain+efecto+espectaculos+eventos+empresas+empresa+evento+comuniones+celebraciones+cumplea%C3%B1os+bodas+animacion+entretenimiento+teatros+soltero+espectaculo+comunion+boda+cumplea%C3%B1os+truco+juego+illusion+espa%C3%B1a+murcia+alicante+madrid+teatro+unico+imposible+sue%C3%B1os++murcia+madrid+';
var metaContents  = 'Magia+e+ilusionismo%2C+el+arte+de+hacer+realidad+lo+imposible+de+la+mano+de+uno+de+los+mayores+profesionales+del+pa%C3%ADs.+Crea+lo+imposible%2C+sue%C3%B1os+hechos+realidad+en+un+solo+espectaculo%2C+show+de+magia+con+grandes+ilusiones%2C+escapismos%2Canimales%2Cpara+cualquier+tipo+de+evento%3A+comuniones+cumplea%C3%B1os+teatro+bodas%2C+cena+de+empresa%2C+presentacion+de+productos%2C+publicidad%2C+television...+y+mucho+m%C3%A1s.+';
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();
};
