/* [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','1734',jdecode('%E2%80%A2+About+us+%E2%80%A2+'),jdecode(''),'/1734.html','true',[],''],
	['PAGE','83',jdecode('%E2%80%A2+ChileQuest+presents...'),jdecode(''),'/83.html','true',[],''],
	['PAGE','1662',jdecode('%E2%80%A2+Chile%2C+a+unique+experience'),jdecode(''),'/1662.html','true',[],''],
	['PAGE','3074',jdecode('%E2%80%A2+Chile%26%23x27%3Bs+Regions'),jdecode(''),'/3074/index.html','true',[ 
		['PAGE','1671',jdecode('Norte+Grande'),jdecode(''),'/3074/1671.html','true',[],''],
		['PAGE','1680',jdecode('Norte+Chico'),jdecode(''),'/3074/1680.html','true',[],''],
		['PAGE','1689',jdecode('Santiago+%26+Central+Chile'),jdecode(''),'/3074/1689.html','true',[],''],
		['PAGE','1698',jdecode('Easter+Island'),jdecode(''),'/3074/1698.html','true',[],''],
		['PAGE','1707',jdecode('South+%26+Lakes+Region'),jdecode(''),'/3074/1707.html','true',[],''],
		['PAGE','1716',jdecode('Patagonia'),jdecode(''),'/3074/1716.html','true',[],'']
	],''],
	['PAGE','4039',jdecode('%E2%80%A2+Main+Cities'),jdecode(''),'/4039.html','true',[],''],
	['PAGE','1770',jdecode('%E2%80%A2+Programs'),jdecode(''),'/1770.html','true',[],''],
	['PAGE','9300',jdecode('%E2%80%A2+Activities'),jdecode(''),'/9300.html','true',[],''],
	['PAGE','9291',jdecode('%E2%80%A2+Hotels'),jdecode(''),'/9291.html','true',[],''],
	['PAGE','7800',jdecode('%E2%80%A2+Ski+Resorts'),jdecode(''),'/7800.html','true',[],''],
	['PAGE','7581',jdecode('%E2%80%A2+National+Parks'),jdecode(''),'/7581.html','true',[],''],
	['PAGE','6844',jdecode('%E2%80%A2+Contact+us+%E2%80%A2+Requests'),jdecode(''),'/6844/index.html','true',[ 
		['PAGE','17145',jdecode('%E2%80%A2+Contact+us+%E2%80%A2+Requests+%28follow+up+page%29'),jdecode(''),'/6844/17145.html','false',[],''],
		['PAGE','17041',jdecode('%E2%80%A2+Contact+us+%E2%80%A2+Requests+%28follow+up+page%29'),jdecode(''),'/6844/17041.html','false',[],''],
		['PAGE','17030',jdecode('%E2%80%A2+Contact+us+%E2%80%A2+Requests+%28follow+up+page%29'),jdecode(''),'/6844/17030.html','false',[],''],
		['PAGE','8803',jdecode('Contact+us+%28follow+up+page%29'),jdecode(''),'/6844/8803.html','false',[],'']
	],''],
	['PAGE','11533',jdecode('%E2%80%A2+Links+%E2%80%A2+Info+%E2%80%A2+News'),jdecode(''),'/11533.html','true',[],''],
	['PAGE','17164',jdecode('%E2%80%A2+Guestbook'),jdecode(''),'/17164/index.html','true',[ 
		['PAGE','17163',jdecode('Read+Guestbook'),jdecode(''),'/17164/17163.html','false',[],'']
	],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Aroundtheworld';
theSitetree.paletteFamily='7FACDC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10790';
theSitetree.graphicsetId='11215';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='7FACDC';
var theTemplate={
				name: 			'Aroundtheworld',
				paletteFamily: 	'7FACDC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10790',
				graphicsetId: 	'11215',
				contentColor: 	'000000',
				contentBGColor: '7FACDC',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '83',
internalId:  '1006',
customField: '1006'
};
webappMappings['1001']=webappMappings['1001-ahw050in3rd6b41e591255fd64bc']={
webappId:    '1001',
documentId:  '17041',
internalId:  'ahw050in3rd6b41e591255fd64bc',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83',
internalId:  '',
customField: '20090509-164506'
};
webappMappings['1001']=webappMappings['1001-ahw050in3rd62489db48dbb0018b']={
webappId:    '1001',
documentId:  '6844',
internalId:  'ahw050in3rd62489db48dbb0018b',
customField: ''
};
webappMappings['1001']=webappMappings['1001-ahw050in3rd6c48004c1637edab8']={
webappId:    '1001',
documentId:  '8803',
internalId:  'ahw050in3rd6c48004c1637edab8',
customField: 'followUp'
};
webappMappings['1002']=webappMappings['1002-17164AHW050IN3RD6']={
webappId:    '1002',
documentId:  '17164',
internalId:  '17164AHW050IN3RD6',
customField: 'icq=false'
};
webappMappings['1001']=webappMappings['1001-ahw050in3rd6c48004c1637edab8']={
webappId:    '1001',
documentId:  '17030',
internalId:  'ahw050in3rd6c48004c1637edab8',
customField: 'followUp'
};
webappMappings['1001']=webappMappings['1001-ahw050in3rd62489db48dbb0018b']={
webappId:    '1001',
documentId:  '17145',
internalId:  'ahw050in3rd62489db48dbb0018b',
customField: 'followUp'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1734',
internalId:  '',
customField: '20070208-135232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1662',
internalId:  '',
customField: '20061225-153246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3074',
internalId:  '',
customField: '20070307-131404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1671',
internalId:  '',
customField: '20061225-153627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1680',
internalId:  '',
customField: '20061225-153734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1689',
internalId:  '',
customField: '20061227-185725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1698',
internalId:  '',
customField: '20070307-131534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1707',
internalId:  '',
customField: '20061227-185845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1716',
internalId:  '',
customField: '20061227-190011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4039',
internalId:  '',
customField: '20061227-190049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1770',
internalId:  '',
customField: '20070831-124547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9300',
internalId:  '',
customField: '20061227-190159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9291',
internalId:  '',
customField: '20091117-172522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7800',
internalId:  '',
customField: '20061227-190318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7581',
internalId:  '',
customField: '20061227-190359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6844',
internalId:  '',
customField: '20090513-080923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17145',
internalId:  '',
customField: '20070227-162906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17041',
internalId:  '',
customField: '20070226-222846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17030',
internalId:  '',
customField: '20070226-222332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8803',
internalId:  '',
customField: '20060427-025419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11533',
internalId:  '',
customField: '20080214-161942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17164',
internalId:  '',
customField: '20070307-131609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17163',
internalId:  '',
customField: '20070227-181829'
};
webappMappings['1501']=webappMappings['1501-1792485']={
webappId:    '1501',
documentId:  '83',
internalId:  '1792485',
customField: '1501'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3RD6';
var companyName   = 'ChileQuest+International';
var htmlTitle	  = 'ChileQuest+International';
var metaKeywords  = 'Chile%2C+Atacama%2C+Chile+Tours%2C+Atacama%2C+Patagonia%2C+Torres+del+Paine%2C+Chile+travel%2C+Easter+Island+ChileQuest%2C+Travel+Chile%2C+Chile+Wine%2C+Santiago%2C+Chile+travel%2C+tour+Chile%2C+Patagonia%2C+Chiles+tours%2C+Chile++Chile+Travel+Tours%2C+Chile+travel%2C+About+Chile%2C+Quest+to+Chile%2CTravel+to+Chile+Tour%2C+Chile+information%2C+Info+Chile%2C+Chile+Vacation%2C+Chile+Tourism%2C+Patagonia+Chile%2C+CHILE+hotels%2C+Santiago+de+Chile%2C+Wines+of+Chile%2C+GO+Chile%2C+About+Chile+Welcome+Chile%2C+Chile+travel';
var metaContents  = 'ChileQuest+provides+guided+tours+and+travel+activities+throughout+Chile+and+its+regions.+Chile+Travel+and+Tours.+Travel+Chile%2C+Chile+travel%2C+tour+Chile%2C+Chile+Wine+Tours%2C+Chile++Chile+Travel%2C+Chile+tours%2C+Quest+to+Chile%2C+ChileTravel%2C+Vacations+to+Chile%2C+Chile+Tours%2C+Tourism+Chile%2C+Santiago+de+Chile%2C+Santiago+Chile%2C+Wines+Chile%2C+Travel+Chile%2C+Chile+Information+Chile%2C+GO+Chile%2C+About+ChileTravel';
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();
};
