/* [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','4555',jdecode('Home'),jdecode(''),'/4555/index.html','true',[ 
		['PAGE','13002',jdecode('Breve+Rese%C3%B1a'),jdecode(''),'/4555/13002.html','true',[],'','']
	],'',''],
	['PAGE','5910',jdecode('MASHACH+ESCUELA'),jdecode(''),'/5910/index.html','true',[ 
		['PAGE','4612',jdecode('%C2%BFQuienes+somos%3F'),jdecode(''),'/5910/4612.html','true',[],'',''],
		['PAGE','5937',jdecode('Especialidades'),jdecode(''),'/5910/5937.html','true',[],'','']
	],'',''],
	['PAGE','5802',jdecode('kODESH'),jdecode(''),'/5802/index.html','true',[ 
		['PAGE','5829',jdecode('Quienes+Somos'),jdecode(''),'/5802/5829.html','true',[],'',''],
		['PAGE','5856',jdecode('Servicios'),jdecode(''),'/5802/5856.html','true',[],'',''],
		['PAGE','5883',jdecode('Masajes'),jdecode(''),'/5802/5883.html','true',[],'','']
	],'',''],
	['PAGE','15702',jdecode('Viajes'),jdecode(''),'/15702.html','true',[],'',''],
	['PAGE','5002',jdecode('Cont%C3%A1ctenos'),jdecode(''),'/5002/index.html','true',[ 
		['PAGE','7102',jdecode('Cont%C3%A1ctenos+%28follow+up+page%29'),jdecode(''),'/5002/7102.html','false',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Filofax';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='526';
theSitetree.keyvisualName='massage.jpg';
theSitetree.fontsetId='61';
theSitetree.graphicsetId='62';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Filofax',
				paletteFamily: 	'003366',
				keyvisualId: 	'526',
				keyvisualName: 	'massage.jpg',
				fontsetId: 		'61',
				graphicsetId: 	'62',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003366',
				b_color: 		'66CCFF',
				c_color: 		'000000',
				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:  '4555',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5802',
internalId:  '',
customField: '20061110-111618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4555',
internalId:  '',
customField: '20071010-093223'
};
webappMappings['1501']=webappMappings['1501-158127']={
webappId:    '1501',
documentId:  '4555',
internalId:  '158127',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-14007']={
webappId:    '7008',
documentId:  '5002',
internalId:  '14007',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5856',
internalId:  '',
customField: '20061110-111914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5829',
internalId:  '',
customField: '20061110-111823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5910',
internalId:  '',
customField: '20080115-181856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4612',
internalId:  '',
customField: '20061110-113156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5937',
internalId:  '',
customField: '20080115-152751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15702',
internalId:  '',
customField: '20070709-101440'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INX3DW';
var companyName   = 'Kodesh+%2F+Mashach';
var htmlTitle	  = 'www.kodeshmashach.com.mx';
var metaKeywords  = 'mesoterapia%2C+masajes%2C+clinica%2C+belleza%2C+tratamientos+corporales%2C+faciales%2C+terapias+alternas%2C+carreras%2C+especialidades+%2C+cursos%2C+naturismo%2C+medicina+tradicional%2C+peeling%2C+flores+de+bash%2C+masajes+reductivos%2C+feng+shui';
var metaContents  = 'amplia+informaci%C3%B3n+sobre+capacitaci%C3%B3n+en+carreras+de+cosmetolog%C3%ADa%2Ccosmiatr%C3%ADa%2C+masajes%2C+clinicas+de+belleza%2C+y+todo+lo+relacionado+a+la+bellezatanto+interna+como+externa+del+cuerpo+humano%2C+salud';
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();
};

