/* [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','4456',jdecode('INICIO'),jdecode(''),'/4456.html','true',[],'',''],
	['PAGE','70306',jdecode('ACTIVIDADES'),jdecode(''),'/70306/index.html','true',[ 
		['PAGE','26906',jdecode('Escuela+de+Padres+09-10'),jdecode(''),'/70306/26906.html','true',[],'',''],
		['PAGE','69106',jdecode('Postales+Navidad+2009'),jdecode(''),'/70306/69106.html','true',[],'',''],
		['PAGE','67406',jdecode('Cabalgata+REYES+2010'),jdecode(''),'/70306/67406.html','true',[],'',''],
		['PAGE','68506',jdecode('Fiestas+Inmaculada+2009'),jdecode(''),'/70306/68506.html','true',[],'',''],
		['PAGE','78306',jdecode('Resumen+curso+08-09'),jdecode(''),'/70306/78306.html','true',[],'',''],
		['PAGE','48406',jdecode('Resumen+curso+07-08'),jdecode(''),'/70306/48406.html','true',[],'','']
	],'',''],
	['PAGE','9915',jdecode('DEPORTE'),jdecode(''),'/9915/index.html','true',[ 
		['PAGE','50406',jdecode('Ajedrez'),jdecode(''),'/9915/50406.html','true',[],'',''],
		['PAGE','87206',jdecode('Nataci%C3%B3n'),jdecode(''),'/9915/87206.html','true',[],'',''],
		['PAGE','50427',jdecode('K%C3%A1rate'),jdecode(''),'/9915/50427.html','true',[],'',''],
		['PAGE','73106',jdecode('Tenis'),jdecode(''),'/9915/73106.html','true',[],'','']
	],'',''],
	['PAGE','62806',jdecode('CHARLAS+Y+SEMINARIOS'),jdecode(''),'/62806/index.html','true',[ 
		['PAGE','49306',jdecode('Educar+en+Familia'),jdecode(''),'/62806/49306.html','true',[],'',''],
		['PAGE','63106',jdecode('Programa+Moneo'),jdecode(''),'/62806/63106.html','true',[],'','']
	],'',''],
	['PAGE','83306',jdecode('A.M.P.A.+INFO'),jdecode(''),'/83306/index.html','true',[ 
		['PAGE','21416',jdecode('Actas+Reuniones'),jdecode(''),'/83306/21416.html','true',[],'',''],
		['PAGE','9591',jdecode('Curso+08-09'),jdecode(''),'/83306/9591.html','true',[],'','']
	],'',''],
	['PAGE','9726',jdecode('HACERSE+MIEMBRO'),jdecode(''),'/9726.html','true',[],'',''],
	['PAGE','9888',jdecode('ENLACES'),jdecode(''),'/9888.html','true',[],'',''],
	['PAGE','10527',jdecode('%C3%81LBUM+DE+FOTOS'),jdecode(''),'/10527.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Care';
theSitetree.paletteFamily='666699';
theSitetree.keyvisualId='16';
theSitetree.keyvisualName='verlegener_junge.jpg';
theSitetree.fontsetId='22';
theSitetree.graphicsetId='20';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Care',
				paletteFamily: 	'666699',
				keyvisualId: 	'16',
				keyvisualName: 	'verlegener_junge.jpg',
				fontsetId: 		'22',
				graphicsetId: 	'20',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'666699',
				b_color: 		'E8E7F1',
				c_color: 		'000000',
				d_color: 		'6A8493',
				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:  '4456',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-920666']={
webappId:    '1501',
documentId:  '4456',
internalId:  '920666',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78306',
internalId:  '',
customField: '20091008-100734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9591',
internalId:  '',
customField: '20091008-094155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83306',
internalId:  '',
customField: '20100603-163658'
};
webappMappings['7060']=webappMappings['7060-4497b70c1ec7c4e232646d34ba985b84']={
webappId:    '7060',
documentId:  '10527',
internalId:  '4497b70c1ec7c4e232646d34ba985b84',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4456',
internalId:  '',
customField: '20091024-083836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21416',
internalId:  '',
customField: '20100619-085223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9726',
internalId:  '',
customField: '20100219-101108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63106',
internalId:  '',
customField: '20100217-101303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49306',
internalId:  '',
customField: '20081009-102219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48406',
internalId:  '',
customField: '20081109-104509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9888',
internalId:  '',
customField: '20071005-182201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9915',
internalId:  '',
customField: '20091116-102406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62806',
internalId:  '',
customField: '20100514-185745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87206',
internalId:  '',
customField: '20100526-164335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10527',
internalId:  '',
customField: '20081109-105155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26906',
internalId:  '',
customField: '20100514-185336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50406',
internalId:  '',
customField: '20091014-080609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70306',
internalId:  '',
customField: '20100619-085034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73106',
internalId:  '',
customField: '20091014-071419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67406',
internalId:  '',
customField: '20100217-095712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50427',
internalId:  '',
customField: '20091014-080501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68506',
internalId:  '',
customField: '20091218-171335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69106',
internalId:  '',
customField: '20091226-160853'
};
var canonHostname = 'llwc535.servidoresdns.net';
var accountId     = 'Aas010IN2YBR';
var companyName   = 'A.M.P.A.+SSCC+Miranda';
var htmlTitle	  = 'www.ampassccmiranda.com';
var metaKeywords  = 'colegio+sagrados+corazones+asociaci%EF%BF%BDn+padres+madres+miranda+de+ebro';
var metaContents  = 'Asociaci%EF%BF%BDn+de+padres+y+madres+del+colegio+Sagrados+Corazones+de+Miranda+de+Ebro';
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();
};
