/* [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','301',jdecode('INICIO'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','352',jdecode('UBICACION'),jdecode(''),'/352.html','true',[],'',''],
	['PAGE','373',jdecode('ACTIVIDADES'),jdecode(''),'/373.html','true',[],'',''],
	['PAGE','394',jdecode('CABA%C3%91AS'),jdecode(''),'/394/index.html','true',[ 
		['PAGE','3801',jdecode('2+personas'),jdecode(''),'/394/3801.html','true',[],'',''],
		['PAGE','3822',jdecode('4+personas'),jdecode(''),'/394/3822.html','true',[],'',''],
		['PAGE','3843',jdecode('6+personas'),jdecode(''),'/394/3843.html','true',[],'','']
	],'',''],
	['PAGE','415',jdecode('GALERIA+'),jdecode(''),'/415.html','true',[],'',''],
	['PAGE','20701',jdecode('SPA'),jdecode(''),'/20701.html','true',[],'',''],
	['PAGE','43601',jdecode('PROMOCIONES'),jdecode(''),'/43601.html','true',[],'',''],
	['PAGE','436',jdecode('CONTACTO'),jdecode(''),'/436.html','true',[],'',''],
	['PAGE','15401',jdecode('%C3%81lbum+de+fotos'),jdecode(''),'/15401.html','true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Weekend';
theSitetree.paletteFamily='61702D';
theSitetree.keyvisualId='4173';
theSitetree.keyvisualName='kv_4173.jpg';
theSitetree.fontsetId='10528';
theSitetree.graphicsetId='11150';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='87974E';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Weekend',
				paletteFamily: 	'61702D',
				keyvisualId: 	'4173',
				keyvisualName: 	'kv_4173.jpg',
				fontsetId: 		'10528',
				graphicsetId: 	'11150',
				contentColor: 	'FFFFFF',
				contentBGColor: '87974E',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-240']={
webappId:    '7008',
documentId:  '436',
internalId:  '240',
customField: 'language:es;country:ES;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20091217-160821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20070625-085456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373',
internalId:  '',
customField: '20090831-182940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '394',
internalId:  '',
customField: '20091126-153701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20080820-105202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3822',
internalId:  '',
customField: '20080820-105743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3843',
internalId:  '',
customField: '20081127-160831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '415',
internalId:  '',
customField: '20081128-160014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20090525-160601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436',
internalId:  '',
customField: '20091103-114817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20070712-125008'
};
webappMappings['1501']=webappMappings['1501-14037787']={
webappId:    '1501',
documentId:  '301',
internalId:  '14037787',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-14037792']={
webappId:    '1501',
documentId:  '301',
internalId:  '14037792',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20091217-160914'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INVSF8';
var companyName   = 'Villas+Mazamitla';
var htmlTitle	  = 'VILLAS+MAZAMITLA+%3A%3A+Hotel++Monta%C3%B1a+de+Altura';
var metaKeywords  = 'Caba%C3%B1as%2C+Mazamitla%2C+villas%2C+pueblo+magico%2C+vacaciones%2C+monta%C3%B1a%2C+lago+privado%2C+jacuzzi%2C+villas+mazamitla%2C+spa%2C+maz-spa%2C+masajes%2C+bicicletas+de+monta%C3%B1a%2C+alberca+techada+climatizada';
var metaContents  = 'Villas+Mazamitla%2C+descripci%C3%B3n+de+caba%C3%B1as+para+vacacionar+en+uno+de+los+m%C3%A1s+populares+pueblos+m%C3%A1gicos+de+M%C3%A9xico';
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();
};
