/* [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','5122',jdecode('Tours%2FRecorridos+turisticos'),jdecode(''),'/5122/index.html','true',[ 
		['PAGE','5143',jdecode('Ruta+del+Tequila'),jdecode(''),'/5122/5143.html','true',[],'',''],
		['PAGE','6701',jdecode('Arqueolog%C3%ADa'),jdecode(''),'/5122/6701.html','true',[],'',''],
		['PAGE','5164',jdecode('Haciendas'),jdecode(''),'/5122/5164.html','true',[],'','']
	],'',''],
	['PAGE','17001',jdecode('Eco+Adventours'),jdecode(''),'/17001.html','true',[],'',''],
	['PAGE','5185',jdecode('Otros+Servicios'),jdecode(''),'/5185.html','true',[],'',''],
	['PAGE','8701',jdecode('Reservas+on-line'),jdecode(''),'/8701.html','true',[],'',''],
	['PAGE','501',jdecode('%C2%BFQuienes+Somos%3F'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','38801',jdecode('Paquetes+de+viajes'),jdecode(''),'/38801.html','false',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'es',
  country: 'ES'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-2857']={
webappId:    '7008',
documentId:  '8701',
internalId:  '2857',
customField: 'language:es;country:ES;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20100101-160726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20091231-151821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5164',
internalId:  '',
customField: '20090709-194643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20091029-183239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20090709-195241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5185',
internalId:  '',
customField: '20091023-182817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20100208-122421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090212-135611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20090212-143023'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN201O';
var companyName   = 'Expertos+en+la+Ruta+del+Tequila';
var htmlTitle	  = '';
var metaKeywords  = 'Tequila+Tours%2C+Tour+del+Tequila%2C+Tequila+tour%2C+tour+de+tequila%2C+tours+tequila%2C+tequila+recorridos+turisticos%2C+tours+en+tequila%2C+tours+ruta+del+tequila%2C+tour+of+tequila%2C+Viaje+a+Tequila%2C+Quiero+Tequila%2C+Conocer+Tequila%2C+Tours%2C+Recorridos+a+Tequila%2C+Tour+a+Tequila%2C+Tours+a+Tequila%2C+Guadalajara+Tequila%2C+Recorridos%2C+Ruta+del+Tequila%2C+Tequila%2C+Vive+Mexico%2C+M%C3%A9xico%2C+Museo+Tequila%2C+tequila+pueblo+magico%2C+pueblo+magico%2C+Tequila+Pueblo+Magico%2C+Sauza%2C+Cuervo%2C+Herradura%2C+jimador%2C+cofradia%2C+rapel%2C+escalada%2C+senderismo%2C+tracking%2C+ecoturismo%2C+ecotours%2C+mundo+cuervo%2C+Paisaje+Agavero%2C+Agaves%2C+Jimador%2C+Tour+Tequila%2C+Jalisco';
var metaContents  = 'Somos+operadores+especializados+en+la+Ruta+del+Tequila%2C+la+cual+comprende+varios+municipios+en+el+estado+de+Jalisco%3B+y+que+como+principal+atractivo+tiene+%E2%80%9CEl+Paisaje+Agavero%E2%80%9D+considerado+Patrimonio+de+la+Humanidad+por+la+UNESCO%2C+el+Tequila%2C+las+antiguas+destiler%C3%ADas+%28haciendas%29%2C+el+sitio+arqueol%C3%B3gico+%E2%80%9CGuachimontones%E2%80%9D%2C+etc.+As%C3%AD+como%2C+atractivos+naturales+que+van+desde+el+Volc%C3%A1n+de+Tequila+que+se+eleva+a+3%2C000msm%2C+la+laguna+de+Teuchitlan%2C+el+R%C3%ADo+Santiago+uno+de+los+m%C3%A1s+importantes+del+pa%C3%ADs%2C+etc.';
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();
};
