/* [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','16785',jdecode('INICIO'),jdecode(''), jdecode('%2F16785%2Findex.html'), 'true',[ 
		['PAGE','783',jdecode('%C2%BFQUIENES+SOMOS%3F'),jdecode(''), jdecode('%2F16785%2F783.html'), 'true',[],'',''],
		['PAGE','26601',jdecode('HORARIOS'),jdecode(''), jdecode('%2F16785%2F26601.html'), 'true',[],'','']
	],'',''],
	['PAGE','220693',jdecode('PROXIMOS+EVENTOS'),jdecode(''), jdecode('%2F220693.html'), 'true',[],'',''],
	['PAGE','552',jdecode('SALA+DE+BAILE'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','219493',jdecode('PROGRAMACION'),jdecode(''), jdecode('%2F552%2F219493.html'), 'true',[],'','']
	],'',''],
	['PAGE','573',jdecode('DISCOTECA'),jdecode(''), jdecode('%2F573%2Findex.html'), 'true',[ 
		['PAGE','93566',jdecode('PROGRAMACION'),jdecode(''), jdecode('%2F573%2F93566.html'), 'true',[],'','']
	],'',''],
	['PAGE','93545',jdecode('PROMOCIONES'),jdecode(''), jdecode('%2F93545.html'), 'true',[],'',''],
	['PAGE','132056',jdecode('LA+MILONGUITA+DE+TERRASSA'),jdecode(''), jdecode('%2F132056%2Findex.html'), 'true',[ 
		['PAGE','156267',jdecode('FOTOS+LA+MILONGUITA'),jdecode(''), jdecode('%2F132056%2F156267.html'), 'true',[],'',''],
		['PAGE','178811',jdecode('LOS+OCAMPO'),jdecode(''), jdecode('%2F132056%2F178811.html'), 'true',[],'','']
	],'',''],
	['PAGE','5501',jdecode('ESCOLA+DE+BALL+%22TOT+BALL%22'),jdecode(''), jdecode('%2F5501%2Findex.html'), 'true',[ 
		['PAGE','26622',jdecode('HORARIOS+Y+CURSOS'),jdecode(''), jdecode('%2F5501%2F26622.html'), 'true',[],'',''],
		['PAGE','102445',jdecode('FOTOS+ESCOLA+DE+BALL'),jdecode(''), jdecode('%2F5501%2F102445.html'), 'true',[],'','']
	],'',''],
	['PAGE','762',jdecode('ORGANIZA+TU+EVENTO'),jdecode(''), jdecode('%2F762%2Findex.html'), 'true',[ 
		['PAGE','106345',jdecode('FOTOS+EVENTOS'),jdecode(''), jdecode('%2F762%2F106345.html'), 'true',[],'','']
	],'',''],
	['PAGE','95045',jdecode('FOTOS'),jdecode(''), jdecode('%2F95045%2Findex.html'), 'true',[ 
		['PAGE','108045',jdecode('ACTUACIONES+EN+DIRECTO'),jdecode(''), jdecode('%2F95045%2F108045.html'), 'true',[],'','']
	],'',''],
	['PAGE','150277',jdecode('VIDEOS'),jdecode(''), jdecode('%2F150277%2Findex.html'), 'true',[ 
		['PAGE','224893',jdecode('BALL+MODERNISTA'),jdecode(''), jdecode('%2F150277%2F224893.html'), 'true',[],'',''],
		['PAGE','150856',jdecode('KING+AFRICA+1'),jdecode(''), jdecode('%2F150277%2F150856.html'), 'true',[],'',''],
		['PAGE','150877',jdecode('KING+AFRICA+2'),jdecode(''), jdecode('%2F150277%2F150877.html'), 'true',[],'',''],
		['PAGE','150898',jdecode('KING+AFRICA+3'),jdecode(''), jdecode('%2F150277%2F150898.html'), 'true',[],'','']
	],'',''],
	['PAGE','9022',jdecode('COLABORADORES'),jdecode(''), jdecode('%2F9022.html'), 'true',[],'',''],
	['PAGE','5106',jdecode('LIBRO+DE+VISITAS'),jdecode(''), jdecode('%2F5106.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('LOCALIZACION+Y+PARKING'),jdecode(''), jdecode('%2F5201%2Findex.html'), 'true',[ 
		['PAGE','5301',jdecode('COMO+ENCONTRARNOS'),jdecode(''), jdecode('%2F5201%2F5301.html'), 'true',[],'','']
	],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='660000';
theSitetree.keyvisualId='951';
theSitetree.keyvisualName='mixgetraenke.jpg';
theSitetree.fontsetId='166';
theSitetree.graphicsetId='197';
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: 			'NewYork',
				paletteFamily: 	'660000',
				keyvisualId: 	'951',
				keyvisualName: 	'mixgetraenke.jpg',
				fontsetId: 		'166',
				graphicsetId: 	'197',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'660000',
				c_color: 		'000000',
				d_color: 		'990000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '16785',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-ab36190393522a537ef31f6fdc506978']={
webappId:    '7060',
documentId:  '102445',
internalId:  'ab36190393522a537ef31f6fdc506978',
customField: 'language:es;country:ES;'
};
webappMappings['1002']=webappMappings['1002-5106aars20in3ske']={
webappId:    '1002',
documentId:  '5106',
internalId:  '5106aars20in3ske',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '220693',
internalId:  '',
customField: '20120128-224117'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '5201',
internalId:  'location',
customField: 'language:es;country:ES;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '5301',
internalId:  'routing',
customField: 'es_ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20090311-175850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20111122-131324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '783',
internalId:  '',
customField: '20110427-130528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102445',
internalId:  '',
customField: '20110625-015957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100204-113256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20101121-045113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20111202-205109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93545',
internalId:  '',
customField: '20111122-131944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9022',
internalId:  '',
customField: '20111030-184847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20101022-171245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5106',
internalId:  '',
customField: '20080409-123107'
};
webappMappings['1501']=webappMappings['1501-3817271']={
webappId:    '1501',
documentId:  '16785',
internalId:  '3817271',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20111030-033242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26622',
internalId:  '',
customField: '20111202-205218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106345',
internalId:  '',
customField: '20101028-225702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150277',
internalId:  '',
customField: '20100617-231812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224893',
internalId:  '',
customField: '20110518-165450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16785',
internalId:  '',
customField: '20111202-155540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95045',
internalId:  '',
customField: '20111214-111417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108045',
internalId:  '',
customField: '20110508-031917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93566',
internalId:  '',
customField: '20111202-204626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '219493',
internalId:  '',
customField: '20111202-204343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132056',
internalId:  '',
customField: '20110427-121110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150856',
internalId:  '',
customField: '20100617-231856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150877',
internalId:  '',
customField: '20100617-231936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150898',
internalId:  '',
customField: '20100617-232040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156267',
internalId:  '',
customField: '20100902-140550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178811',
internalId:  '',
customField: '20101109-170220'
};
var webAppHostname = 'wsc.webaporter.com:80';
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20IN3SKE';
var companyName   = 'SALA+DE+FESTES+FRED+ASTAIRE';
var htmlTitle	  = '';
var metaKeywords  = 'discoteca+fred+astaire';
var metaContents  = 'sala+de+fiestas+terrasa++fiestas+terrasa+academia+de+baile+terrasa';
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();
};

