/* [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','901',jdecode('Biograf%C3%ADa'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','12401',jdecode('Conciertos'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','70501',jdecode('Escucha+mis+temas'),jdecode(''),'/70501.html','true',[],'',''],
	['PAGE','72322',jdecode('El+rinconcito'),jdecode(''),'/72322/index.html','true',[ 
		['PAGE','110801',jdecode('Millana'),jdecode(''),'/72322/110801.html','true',[],'',''],
		['PAGE','110822',jdecode('Monasterio'),jdecode(''),'/72322/110822.html','true',[],'',''],
		['PAGE','110843',jdecode('La+ricarda'),jdecode(''),'/72322/110843.html','true',[],'',''],
		['PAGE','141901',jdecode('Coru%C3%B1a+%26+Call%C3%B3n'),jdecode(''),'/72322/141901.html','true',[],'','']
	],'',''],
	['PAGE','166501',jdecode('Club+de+fans'),jdecode(''),'/166501.html','true',[],'',''],
	['PAGE','74201',jdecode('Votar'),jdecode(''),'/74201.html','true',[],'',''],
	['PAGE','72343',jdecode('Enlaces'),jdecode(''),'/72343.html','true',[],'',''],
	['PAGE','23001',jdecode('Contrataci%C3%B3n'),jdecode(''),'/23001.html','true',[],'',''],
	['PAGE','70306',jdecode('Leer+comentarios'),jdecode(''),'/70306.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='A4C6C6';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10350';
theSitetree.graphicsetId='10476';
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: 			'cutout',
				paletteFamily: 	'A4C6C6',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10350',
				graphicsetId: 	'10476',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100406-093442'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100127-204037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20100201-093224'
};
webappMappings['1002']=webappMappings['1002-70306aars20invh1f']={
webappId:    '1002',
documentId:  '70306',
internalId:  '70306aars20invh1f',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166501',
internalId:  '',
customField: '20100201-123644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70306',
internalId:  '',
customField: '20090526-185421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70501',
internalId:  '',
customField: '20100201-122826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72343',
internalId:  '',
customField: '20091026-155838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110801',
internalId:  '',
customField: '20100127-204521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72322',
internalId:  '',
customField: '20100127-204331'
};
webappMappings['1501']=webappMappings['1501-8532186']={
webappId:    '1501',
documentId:  '901',
internalId:  '8532186',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74201',
internalId:  '',
customField: '20090526-214743'
};
webappMappings['7005']=webappMappings['7005-20']={
webappId:    '7005',
documentId:  '74201',
internalId:  '20',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141901',
internalId:  '',
customField: '20100127-204737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110822',
internalId:  '',
customField: '20100201-122946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110843',
internalId:  '',
customField: '20100131-221441'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVH1F';
var companyName   = 'David+Land+';
var htmlTitle	  = 'www.davidland.es';
var metaKeywords  = 'www.davidland.es%2C+www.Davidland.es%2C+davidland.es%2C+davidland%2C+cantautor%2C+m%C3%BAsico%2C+david+land%2C+david+gled%2C+guitarra%2C+instrumentos+musicales%2C+canciones%2C+amor%2C+vida%2C+sociedad%2C+fuego%2C+pasi%C3%B3n';
var metaContents  = 'davidnland.es%2C+david+land%2C+davidgled%2C+david+gled%2C+la+puerta+david+land%2C+vale+la+pena+david+land%2C+cantautor%2C+musico%2C+cantante%2C+canciones%2C+musica+y+fotograf%C3%ADa.+Instrumentos+musicales+y+biograf%C3%ADa.';
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();
};
