/* [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('Home'),jdecode(''), jdecode('%2F801.html'), 'true',[],'',''],
	['PAGE','140437',jdecode('Preface'),jdecode(''), jdecode('%2F140437.html'), 'true',[],'',''],
	['PAGE','13201',jdecode('CV+%26+Bio'),jdecode(''), jdecode('%2F13201%2Findex.html'), 'true',[ 
		['PAGE','148837',jdecode('Biography'),jdecode(''), jdecode('%2F13201%2F148837.html'), 'true',[],'','']
	],'',''],
	['PAGE','13243',jdecode('Work'),jdecode(''), jdecode('%2F13243%2Findex.html'), 'true',[ 
		['PAGE','13264',jdecode('works+on+paper'),jdecode(''), jdecode('%2F13243%2F13264.html'), 'true',[],'',''],
		['PAGE','13285',jdecode('works+on+canvas'),jdecode(''), jdecode('%2F13243%2F13285.html'), 'true',[],'',''],
		['PAGE','143837',jdecode('notebooks'),jdecode(''), jdecode('%2F13243%2F143837.html'), 'true',[],'',''],
		['PAGE','13306',jdecode('sculptures'),jdecode(''), jdecode('%2F13243%2F13306.html'), 'true',[],'','']
	],'',''],
	['PAGE','13369',jdecode('Dossier'),jdecode(''), jdecode('%2F13369%2Findex.html'), 'true',[ 
		['PAGE','119258',jdecode('studio'),jdecode(''), jdecode('%2F13369%2F119258.html'), 'true',[],'',''],
		['PAGE','125737',jdecode('published+books'),jdecode(''), jdecode('%2F13369%2F125737.html'), 'true',[],'',''],
		['PAGE','119237',jdecode('events'),jdecode(''), jdecode('%2F13369%2F119237.html'), 'true',[],'','']
	],'',''],
	['ITEM','142958',jdecode('Blog'),jdecode(''), jdecode('http%3A%2F%2Fwww.gustavodiazsosa.blogspot.com'), 'true',[],'','_blank'],
	['PAGE','13327',jdecode('News'),jdecode(''), jdecode('%2F13327.html'), 'true',[],'',''],
	['PAGE','13453',jdecode('Contact'),jdecode(''), jdecode('%2F13453.html'), 'true',[],'',''],
	['PAGE','13474',jdecode('Legal+Notice'),jdecode(''), jdecode('%2F13474.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10893';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'arsys_mb',
  product: 'WSCSYSSSSLYTC2IR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20111016-004535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13327',
internalId:  '',
customField: '20120126-065807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13201',
internalId:  '',
customField: '20111021-085021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13474',
internalId:  '',
customField: '20111018-071621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13453',
internalId:  '',
customField: '20111022-100129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13369',
internalId:  '',
customField: '20111019-062852'
};
webappMappings['7008']=webappMappings['7008-14263']={
webappId:    '7008',
documentId:  '13453',
internalId:  '14263',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13243',
internalId:  '',
customField: '20111128-085225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13264',
internalId:  '',
customField: '20111018-092143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13285',
internalId:  '',
customField: '20111018-092227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13306',
internalId:  '',
customField: '20111018-091802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119237',
internalId:  '',
customField: '20111019-063206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119258',
internalId:  '',
customField: '20111019-061951'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-cf10e0962e9033b47c06c1f9bcf4a965']={
webappId:    '7060',
documentId:  '13285',
internalId:  'cf10e0962e9033b47c06c1f9bcf4a965',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-97eaf50a457811cf586cc05ceccf338c']={
webappId:    '7060',
documentId:  '13264',
internalId:  '97eaf50a457811cf586cc05ceccf338c',
customField: 'language:es;country:ES;'
};
webappMappings['7060']=webappMappings['7060-ae5482097afd57b32e42180eee00f52c']={
webappId:    '7060',
documentId:  '143837',
internalId:  'ae5482097afd57b32e42180eee00f52c',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125737',
internalId:  '',
customField: '20111019-062528'
};
webappMappings['7060']=webappMappings['7060-75f3e38b021e24ea43f65a0b02feb652']={
webappId:    '7060',
documentId:  '13264',
internalId:  '75f3e38b021e24ea43f65a0b02feb652',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '140437',
internalId:  '',
customField: '20111019-054656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143837',
internalId:  '',
customField: '20111019-074213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148837',
internalId:  '',
customField: '20111021-090111'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INVE3P';
var companyName   = 'Gustavo+D%C3%ADaz+Sosa';
var htmlTitle	  = 'Gustavo+D%C3%ADaz+Sosa';
var metaKeywords  = 'Gustavo+D%C3%ADaz+Sosa+cuban+artist+painter+painting+drawings+art+emergente+emergent+espa%C3%B1ol+spanish+art+cuba+modern+contemporaneo+fine+art+san+alejandro+havana+habana+small+man+web+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+novel+new';
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();
};

