/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('%C2%BFQui%C3%A9nes+somos%3F'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Estudios'),jdecode(''),'/573/index.html','true',[ 
		['PAGE','594',jdecode('Tomograf%C3%ADa'),jdecode(''),'/573/594.html','true',[],'',''],
		['PAGE','615',jdecode('Mastograf%C3%ADa'),jdecode(''),'/573/615.html','true',[],'',''],
		['PAGE','636',jdecode('Ultrasonido'),jdecode(''),'/573/636.html','true',[],'',''],
		['PAGE','11101',jdecode('Ultrasonido+4D'),jdecode(''),'/573/11101.html','true',[],'',''],
		['PAGE','657',jdecode('Electrocardiograf%C3%ADa'),jdecode(''),'/573/657.html','true',[],'',''],
		['PAGE','678',jdecode('Rx'),jdecode(''),'/573/678.html','true',[],'',''],
		['PAGE','699',jdecode('An%C3%A1lisis+Cl%C3%ADnicos'),jdecode(''),'/573/699.html','true',[],'',''],
		['PAGE','14401',jdecode('Holter'),jdecode(''),'/573/14401.html','true',[],'',''],
		['PAGE','17001',jdecode('Densitometr%C3%ADa+%C3%93sea'),jdecode(''),'/573/17001.html','true',[],'',''],
		['PAGE','17022',jdecode('Ecocardiograf%C3%ADa'),jdecode(''),'/573/17022.html','true',[],'',''],
		['PAGE','17043',jdecode('Endoscop%C3%ADa'),jdecode(''),'/573/17043.html','true',[],'',''],
		['PAGE','14422',jdecode('Colposcopia'),jdecode(''),'/573/14422.html','true',[],'','']
	],'',''],
	['PAGE','720',jdecode('Directorio+M%C3%A9dico'),jdecode(''),'/720.html','true',[],'',''],
	['PAGE','741',jdecode('Descuentos'),jdecode(''),'/741.html','true',[],'',''],
	['PAGE','762',jdecode('Ubicaci%C3%B3n'),jdecode(''),'/762.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2439';
theSitetree.keyvisualName='apotheke.jpg';
theSitetree.fontsetId='406';
theSitetree.graphicsetId='461';
theSitetree.contentColor='2F325F';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2439',
				keyvisualName: 	'apotheke.jpg',
				fontsetId: 		'406',
				graphicsetId: 	'461',
				contentColor: 	'2F325F',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2541']={
webappId:    '7008',
documentId:  '762',
internalId:  '2541',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20080409-130123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '741',
internalId:  '',
customField: '20100222-114822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090325-113705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20080714-100137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20080714-100209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20080714-100237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20080714-100312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20080428-163934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20080714-100358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20080714-100428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20080714-100509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20080714-100615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20080714-102410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17022',
internalId:  '',
customField: '20080714-100747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17043',
internalId:  '',
customField: '20080714-100828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14422',
internalId:  '',
customField: '20080714-100909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20080714-100942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20080428-162632'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLHSJ';
var companyName   = 'Imagen+Cl%C3%ADnica';
var htmlTitle	  = '%3A%3A+Imagen+Cl%C3%ADnica+%3A%3A';
var metaKeywords  = 'analisis+clinicos%2C+colposcopia%2C+Papanicolau%2C+Mastografia%2C+Estudio+de+Orina%2C+Cardiologia%2C+Medicina+Nuclear%2C+Holter%2C+Enferemdades+Cardiacas%2C+Ultrasonido%2C+Ultraconido+3d%2C+Ultrasonido+4d%2C+Ginecologia%2C+Prostata%2C+Mamas';
var metaContents  = 'Laboratorio+de+analisis+clinicos%2C+especialidades+medicas%2C+estudios+de+laboratorio';
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();
};
