/* [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','801',jdecode('Inicio'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','13201',jdecode('Biograf%C3%ADa'),jdecode(''),'/13201.html','true',[],'',''],
	['PAGE','13243',jdecode('Obra'),jdecode(''),'/13243/index.html','true',[ 
		['PAGE','13264',jdecode('Dibujos+'),jdecode(''),'/13243/13264.html','true',[],'',''],
		['PAGE','13285',jdecode('Pinturas'),jdecode(''),'/13243/13285.html','true',[],'',''],
		['PAGE','13306',jdecode('Esculturas'),jdecode(''),'/13243/13306.html','true',[],'','']
	],'',''],
	['PAGE','13327',jdecode('Prensa'),jdecode(''),'/13327.html','true',[],'',''],
	['PAGE','13369',jdecode('Galer%C3%ADa+de+im%C3%A1genes'),jdecode(''),'/13369/index.html','true',[ 
		['PAGE','66301',jdecode('Cuba'),jdecode(''),'/13369/66301.html','true',[],'',''],
		['PAGE','13390',jdecode('San+Sebasti%C3%A1n'),jdecode(''),'/13369/13390.html','true',[],'',''],
		['PAGE','13411',jdecode('Madrid'),jdecode(''),'/13369/13411.html','true',[],'',''],
		['PAGE','13432',jdecode('Exposiciones+'),jdecode(''),'/13369/13432.html','true',[],'','']
	],'',''],
	['PAGE','13453',jdecode('Contacto'),jdecode(''),'/13453.html','true',[],'',''],
	['PAGE','111437',jdecode('Libro+de+visitas'),jdecode(''),'/111437.html','true',[],'',''],
	['PAGE','13474',jdecode('Aviso+legal'),jdecode(''),'/13474.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100511-130944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13327',
internalId:  '',
customField: '20100511-132922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20100511-131221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66301',
internalId:  '',
customField: '20090603-080026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13474',
internalId:  '',
customField: '20090601-194623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13453',
internalId:  '',
customField: '20100822-215919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13369',
internalId:  '',
customField: '20100901-235900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13390',
internalId:  '',
customField: '20100830-084503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13411',
internalId:  '',
customField: '20100830-085034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13243',
internalId:  '',
customField: '20100902-200534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13264',
internalId:  '',
customField: '20100822-123921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13285',
internalId:  '',
customField: '20100822-221200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13306',
internalId:  '',
customField: '20100822-223709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13432',
internalId:  '',
customField: '20100511-134455'
};
webappMappings['1002']=webappMappings['1002-111437aars20inve3p']={
webappId:    '1002',
documentId:  '111437',
internalId:  '111437aars20inve3p',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111437',
internalId:  '',
customField: '20100903-141156'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-a1a8b3ac116ca0e895f0ace041da4f28']={
webappId:    '7060',
documentId:  '13369',
internalId:  'a1a8b3ac116ca0e895f0ace041da4f28',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVE3P';
var companyName   = 'Gustavo+D%C3%ADaz+Sosa';
var htmlTitle	  = '';
var metaKeywords  = 'Gustavo+D%C3%ADaz+Sosa+artista+pl%C3%A1stico+cubano+arte+vanguardia+pintor+pintura+exposici%C3%B3n+actual+moderno+dibujo+carboncillo+lienzo+joven+nuevo+artes+pl%C3%A1sticas+bellas+artes+gustavo+diaz+sosa+dibujante+pinturas+art%C3%ADstico+premios+informaci%C3%B3n+obra+obras+exposiciones';
var metaContents  = 'P%C3%A1gina+oficial+del+artista+cubano+Gustavo+D%C3%ADaz+Sosa.+Toda+la+informaci%C3%B3n+acerca+de+su+obra+y+pr%C3%B3ximos+proyectos.+Biograf%C3%ADa.+Obra.+Galer%C3%ADa+de+im%C3%A1genes.+Cr%C3%ADticas+y+publicaciones.+Contacto.';
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();
};
