/* [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 theSitetree=[ 
	['PAGE','2601',jdecode('OCAMEDI'),jdecode(''),'/2601.html','true',[],''],
	['PAGE','10522',jdecode('Obesidad...%C2%BFQu%C3%A9+debes+saber%3F'),jdecode(''),'/10522.html','true',[],''],
	['PAGE','21701',jdecode('Una+nota+personal'),jdecode(''),'/21701.html','true',[],''],
	['PAGE','10543',jdecode('Un+poco+de+humor'),jdecode(''),'/10543.html','true',[],''],
	['PAGE','22601',jdecode('%C2%BFQu%C3%A9+es+el+S%C3%ADndrome+Metab%C3%B3lico%3F'),jdecode(''),'/22601.html','true',[],''],
	['PAGE','20601',jdecode('%C2%BFQu%C3%A9+hacer+para+rebajar+de+peso%3F'),jdecode(''),'/20601.html','true',[],''],
	['PAGE','20643',jdecode('DIABETES'),jdecode(''),'/20643.html','true',[],''],
	['PAGE','20622',jdecode('Anorexia+y+Bulimia+%28VIDEO%29'),jdecode(''),'/20622.html','true',[],''],
	['PAGE','21722',jdecode('Libro+de+Visitas'),jdecode(''),'/21722.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='88A6B5';
theSitetree.keyvisualId='11283';
theSitetree.keyvisualName='kv_11283.jpg';
theSitetree.fontsetId='32116';
theSitetree.graphicsetId='13936';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				name: 			'Vita02',
				paletteFamily: 	'88A6B5',
				keyvisualId: 	'11283',
				keyvisualName: 	'kv_11283.jpg',
				fontsetId: 		'32116',
				graphicsetId: 	'13936',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20090827-004753'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14434533']={
webappId:    '1501',
documentId:  '2601',
internalId:  '14434533',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20090827-005459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10522',
internalId:  '',
customField: '20090827-000713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10543',
internalId:  '',
customField: '20090827-004519'
};
webappMappings['1002']=webappMappings['1002-21722avfl30inhsdx']={
webappId:    '1002',
documentId:  '21722',
internalId:  '21722avfl30inhsdx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20090831-191834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21722',
internalId:  '',
customField: '20090901-022811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20643',
internalId:  '',
customField: '20090827-005459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20622',
internalId:  '',
customField: '20090827-005459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20090903-200730'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INHSDX';
var companyName   = 'OCAMEDI';
var htmlTitle	  = 'ocamedi';
var metaKeywords  = 'sobre+peso%2C+obesidad%2C+dietas%2C+sindromes%2C+sindromes+metabolicos%2C+Dr.+Alessandro+Oca%2C+Alessandro+Oca%2C+diabetes%2C+menopausia%2C+sindrome+de+down%2C+autismo%2C+sexualidad%2C+sexo%2C+genetica%2C+genetista%2C+ejercicio%2C+adelgazar%2C+delgado%2C+fitness%2C+vida%2C+alegria%2C+salud%2C+formas+de+adelgazar%2C+cambio+de+vida%2C+spotweb.com%2C+venezuela%2C+saludable%2C+bajar+la+barriga%2C+abdomen%2C';
var metaContents  = 'sobre+peso%2C+obesidad%2C+dietas%2C+sindromes%2C+sindromes+metabolicos%2C+Dr.+Alessandro+Oca%2C+Alessandro+Oca%2C+diabetes%2C+menopausia%2C+sindrome+de+down%2C+autismo%2C+sexualidad%2C+sexo%2C+genetica%2C+genetista%2C+ejercicio%2C+adelgazar%2C+delgado%2C+fitness%2C+vida%2C+alegria%2C+salud%2C+formas+de+adelgazar%2C+cambio+de+vida%2C+spotweb.com%2C+venezuela%2C+saludable%2C+bajar+la+barriga%2C+abdomen%2C';
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();
};
