/* [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('Home'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','452',jdecode('Mensaje+-+cuerpo+directivo'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','473',jdecode('Nuestros+Objetivos'),jdecode(''), jdecode('%2F473.html'), 'true',[],'',''],
	['PAGE','494',jdecode('Actividades'),jdecode(''), jdecode('%2F494.html'), 'true',[],'',''],
	['PAGE','515',jdecode('Nuestro+logo'),jdecode(''), jdecode('%2F515.html'), 'true',[],'',''],
	['PAGE','536',jdecode('D%C3%B3nde+estamos'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','557',jdecode('%C2%BFQuieres+ser+socio%3F'),jdecode(''), jdecode('%2F557.html'), 'true',[],'',''],
	['PAGE','578',jdecode('Contactos'),jdecode(''), jdecode('%2F578.html'), 'true',[],'',''],
	['PAGE','18001',jdecode('FORO+AMURM+'),jdecode(''), jdecode('%2F18001.html'), 'true',[],'',''],
	['PAGE','599',jdecode('Links+de+inter%C3%A9s'),jdecode(''), jdecode('%2F599.html'), 'true',[],'',''],
	['PAGE','620',jdecode('Directorio'),jdecode(''), jdecode('%2F620.html'), 'true',[],'',''],
	['PAGE','9701',jdecode('Noticias'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'',''],
	['PAGE','10301',jdecode('T%C3%A9rminos+indispensables'),jdecode(''), jdecode('%2F10301.html'), 'true',[],'',''],
	['PAGE','11106',jdecode('Libro+de+visitas'),jdecode(''), jdecode('%2F11106%2Findex.html'), 'true',[ 
		['PAGE','11101',jdecode('Leer+el+libro+de+Visitas'),jdecode(''), jdecode('%2F11106%2F11101.html'), 'false',[],'','']
	],'',''],
	['PAGE','38301',jdecode('Medicamentos+en+Influenza'),jdecode(''), jdecode('%2F38301.html'), 'true',[],'',''],
	['PAGE','49912',jdecode('P%C3%A1gina+nueva'),jdecode(''), jdecode('%2F49912.html'), 'false',[],'',''],
	['PAGE','51012',jdecode('Declaraci%C3%B3n+MTY'),jdecode(''), jdecode('%2F51012.html'), 'false',[],'',''],
	['PAGE','80112',jdecode('Congreso+URM'),jdecode(''), jdecode('%2F80112.html'), 'false',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'es',
  country: 'ES'
};
var prodDef={
  wl_name: 'grp13-hostin',
  product: 'WSCSYSSSSLY0XJEZ'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-2826']={
webappId:    '7008',
documentId:  '578',
internalId:  '2826',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-11106avec10inlirr']={
webappId:    '1002',
documentId:  '11106',
internalId:  '11106avec10inlirr',
customField: 'icq=false'
};
webappMappings['1003']=webappMappings['1003-avec10inlirr114e339b79e']={
webappId:    '1003',
documentId:  '18001',
internalId:  'avec10inlirr114e339b79e',
customField: 'es:ES:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110910-065553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20110318-123813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20110318-131146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20101006-150048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20070904-100938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20070907-214222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20070903-194242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20070905-122458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20070913-140616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20090314-165857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20080402-191321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20110111-113621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20071120-180145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11106',
internalId:  '',
customField: '20070903-195459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20070903-195459'
};
webappMappings['1003']=webappMappings['1003-avec10inlirr12ac01de105']={
webappId:    '1003',
documentId:  '49912',
internalId:  'avec10inlirr12ac01de105',
customField: 'es:ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20090902-193059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49912',
internalId:  '',
customField: '20100917-223645'
};
webappMappings['1003']=webappMappings['1003-avec10inlirr12ae2ef5325']={
webappId:    '1003',
documentId:  '51012',
internalId:  'avec10inlirr12ae2ef5325',
customField: 'es:ES'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51012',
internalId:  '',
customField: '20100905-154201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80112',
internalId:  '',
customField: '20110721-180227'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLIRR';
var companyName   = 'BIENVENIDO+A+AMURM';
var htmlTitle	  = 'Asociaci%C3%B3n+Mexicana+para+el+Uso+Racional+de+Medicamentos%2C+A.C.';
var metaKeywords  = 'Informaci%C3%B3n+cient%C3%ADfica%2C+divulgaci%C3%B3n%2C+docencia%2C+asesor%C3%ADas%2C+uso+racional+de+medicamentos%2C+f%C3%A1rmacos%2C';
var metaContents  = 'Informaci%C3%B3n+cient%C3%ADfica%2C+divulgaci%C3%B3n%2C+docencia%2C+asesor%C3%ADas';
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();
};

