/* [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','401',jdecode('Quienes+somos'),jdecode(''),'/401/index.html','true',[ 
		['PAGE','36822',jdecode('Metodolog%C3%ADa'),jdecode(''),'/401/36822.html','true',[],'','']
	],'',''],
	['PAGE','174901',jdecode('Esplugues+news'),jdecode(''),'/174901.html','true',[],'',''],
	['PAGE','36843',jdecode('Profesores'),jdecode(''),'/36843/index.html','true',[ 
		['PAGE','173701',jdecode('Consulta+a+tu+tutor'),jdecode(''),'/36843/173701.html','true',[],'','']
	],'',''],
	['PAGE','36864',jdecode('Matr%C3%ADculas+'),jdecode(''),'/36864/index.html','true',[ 
		['PAGE','74101',jdecode('Pre-matr%C3%ADcula'),jdecode(''),'/36864/74101/index.html','true',[ 
			['PAGE','74701',jdecode('Pre-matr%C3%ADcula+%28follow+up+page%29'),jdecode(''),'/36864/74101/74701.html','false',[],'','']
		],'','']
	],'',''],
	['PAGE','37601',jdecode('Localizaci%C3%B3n'),jdecode(''),'/37601.html','true',[],'',''],
	['PAGE','36885',jdecode('Niveles+'),jdecode(''),'/36885/index.html','true',[ 
		['PAGE','158601',jdecode('Elementary'),jdecode(''),'/36885/158601.html','true',[],'',''],
		['PAGE','158622',jdecode('Pre-Intermediate'),jdecode(''),'/36885/158622.html','true',[],'',''],
		['PAGE','158643',jdecode('Intermediate'),jdecode(''),'/36885/158643.html','true',[],'',''],
		['PAGE','158664',jdecode('Upper-Intermediate'),jdecode(''),'/36885/158664.html','true',[],'',''],
		['PAGE','158685',jdecode('Nivel+Advanced+'),jdecode(''),'/36885/158685.html','true',[],'','']
	],'',''],
	['PAGE','36906',jdecode('Empresas'),jdecode(''),'/36906.html','true',[],'',''],
	['PAGE','158706',jdecode('Otros+Servicios'),jdecode(''),'/158706/index.html','true',[ 
		['PAGE','158727',jdecode('Cursos+Generalitat'),jdecode(''),'/158706/158727.html','true',[],'',''],
		['PAGE','158748',jdecode('Refuerzo+'),jdecode(''),'/158706/158748.html','true',[],'',''],
		['PAGE','158769',jdecode('Clases+gratuitas'),jdecode(''),'/158706/158769.html','true',[],'',''],
		['PAGE','158790',jdecode('Viajes+extranjero'),jdecode(''),'/158706/158790.html','true',[],'','']
	],'',''],
	['PAGE','158811',jdecode('Intensivos+verano'),jdecode(''),'/158811.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Bigcity_NYC';
theSitetree.paletteFamily='303050';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17892';
theSitetree.graphicsetId='13161';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='303050';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_NYC',
				paletteFamily: 	'303050',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17892',
				graphicsetId: 	'13161',
				contentColor: 	'FFFFFF',
				contentBGColor: '303050',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091119-162720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74101',
internalId:  '',
customField: '20091211-181421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36885',
internalId:  '',
customField: '20091215-152131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36906',
internalId:  '',
customField: '20091122-174400'
};
webappMappings['1501']=webappMappings['1501-9436624']={
webappId:    '1501',
documentId:  '401',
internalId:  '9436624',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20091203-164018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36864',
internalId:  '',
customField: '20091211-180302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36843',
internalId:  '',
customField: '20091215-160513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36822',
internalId:  '',
customField: '20091203-145640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74701',
internalId:  '',
customField: '20091006-120228'
};
webappMappings['7008']=webappMappings['7008-9737']={
webappId:    '7008',
documentId:  '173701',
internalId:  '9737',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174901',
internalId:  '',
customField: '20100617-181925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158601',
internalId:  '',
customField: '20091215-160609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158622',
internalId:  '',
customField: '20091215-160617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158643',
internalId:  '',
customField: '20091215-160628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158664',
internalId:  '',
customField: '20091215-160638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158685',
internalId:  '',
customField: '20091215-160649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158706',
internalId:  '',
customField: '20091215-155354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158727',
internalId:  '',
customField: '20091125-173435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158748',
internalId:  '',
customField: '20091125-164556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158769',
internalId:  '',
customField: '20091125-164455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158790',
internalId:  '',
customField: '20091125-164323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158811',
internalId:  '',
customField: '20091125-170627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173701',
internalId:  '',
customField: '20100616-120736'
};
webappMappings['7008']=webappMappings['7008-7241']={
webappId:    '7008',
documentId:  '74101',
internalId:  '7241',
customField: 'language:es;country:ES;'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'AARS20INLODK';
var companyName   = 'The+English+House';
var htmlTitle	  = 'The+English+House';
var metaKeywords  = 'Cursos%2C++ingles%2C++esplugues%2C+academia%2C+English%2C+idiomas%2C+repaso%2C+escuela%2C+empresas%2C+cursos+parados%2C+cursos+generalitat%2C++Forcem%2C+niveles+de+ingles';
var metaContents  = 'Cursos%2C++ingles%2C++esplugues%2C+academia%2C+English%2C+idiomas%2C+repaso%2C+escuela%2C+empresas%2C+cursos+parados%2C+cursos+generalitat%2C++Forcem%2C+niveles+de+ingles';
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();
};
