/* [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','901',jdecode('Home'),jdecode(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','952',jdecode('Maile+%28my-lee%29+Treehouse'),jdecode(''), jdecode('%2F952.html'), 'true',[],'',''],
	['PAGE','973',jdecode('The+Garden+Suite'),jdecode(''), jdecode('%2F973.html'), 'true',[],'',''],
	['PAGE','12901',jdecode('More+Pictures++++'),jdecode(''), jdecode('%2F12901.html'), 'true',[],'',''],
	['PAGE','23701',jdecode('Guest+Comments++++++++++++++++'),jdecode(''), jdecode('%2F23701.html'), 'true',[],'',''],
	['PAGE','40401',jdecode('Availability+Calendar'),jdecode(''), jdecode('%2F40401.html'), 'true',[],'',''],
	['PAGE','7401',jdecode('Rates'),jdecode(''), jdecode('%2F7401.html'), 'true',[],'',''],
	['PAGE','43201',jdecode('Contact+Us'),jdecode(''), jdecode('%2F43201%2Findex.html'), 'true',[ 
		['PAGE','48301',jdecode('CONTACT+US+%28follow+up+page%29'),jdecode(''), jdecode('%2F43201%2F48301.html'), 'false',[],'','']
	],'',''],
	['PAGE','40422',jdecode('Make+a+Reservation'),jdecode(''), jdecode('%2F40422.html'), 'true',[],'',''],
	['PAGE','59204',jdecode('Massage+%21%21'),jdecode(''), jdecode('%2F59204.html'), 'true',[],'',''],
	['PAGE','53001',jdecode('Area+Information+'),jdecode(''), jdecode('%2F53001.html'), 'true',[],'',''],
	['PAGE','59825',jdecode(''),jdecode(''), jdecode('%2F59825.html'), 'true',[],'',''],
	['PAGE','59644',jdecode('Menehune+Mansions%21'),jdecode(''), jdecode('%2F59644.html'), 'true',[],'',''],
	['PAGE','60012',jdecode('Hune+Mansion'),jdecode(''), jdecode('%2F60012.html'), 'true',[],'',''],
	['PAGE','60075',jdecode('Mahana+Mansion'),jdecode(''), jdecode('%2F60075.html'), 'true',[],'',''],
	['PAGE','60355',jdecode('More+Pictures'),jdecode(''), jdecode('%2F60355.html'), 'true',[],'',''],
	['PAGE','59956',jdecode('Reservation+Agreement'),jdecode(''), jdecode('%2F59956.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Canvas';
theSitetree.paletteFamily='3D8D43';
theSitetree.keyvisualId='3697';
theSitetree.keyvisualName='kv_3697.jpg';
theSitetree.fontsetId='10471';
theSitetree.graphicsetId='10938';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='EFFFE7';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Canvas',
				paletteFamily: 	'3D8D43',
				keyvisualId: 	'3697',
				keyvisualName: 	'kv_3697.jpg',
				fontsetId: 		'10471',
				graphicsetId: 	'10938',
				contentColor: 	'000000',
				contentBGColor: 'EFFFE7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'3D8D43',
				e_color: 		'3D8D43',
				f_color: 		'3D8D43',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59644',
internalId:  '',
customField: '20120204-050356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59204',
internalId:  '',
customField: '20110706-155132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20120125-061004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20091008-010934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20120131-035256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20120131-035216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20091008-011218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40401',
internalId:  '',
customField: '20110817-152158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20101020-234138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20080226-234151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20080127-062646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40422',
internalId:  '',
customField: '20111218-222344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53001',
internalId:  '',
customField: '20111218-215431'
};
webappMappings['7008']=webappMappings['7008-9875']={
webappId:    '7008',
documentId:  '43201',
internalId:  '9875',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59825',
internalId:  '',
customField: '20111231-001437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59956',
internalId:  '',
customField: '20120131-041035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60012',
internalId:  '',
customField: '20120204-051853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60075',
internalId:  '',
customField: '20120204-051603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60355',
internalId:  '',
customField: '20120207-052117'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXCF';
var companyName   = 'THE+MAILE+TREE+HOUSE';
var htmlTitle	  = 'dream+vacation+rental';
var metaKeywords  = 'dream+come+true%2C+forest%2C+vacation+rental%2C+bed+and+breakfast%2C+ameneties%2C+luxury%2C+comfort%2C+accomadations%2C+getaway%2C+rainforest%2C+Volcano%2C++love+nests%2C+enchanting%2C+Volcano+Village%2C+Volcano+National+Park%2C+Big+Island%2C+jacuzzi%2C+Hawaii%2C+comfy%2C+fireplace%2C+Select+Comfort%2C+birdwatching%2C+scenery%2C+cozy%2C+hiking%2C+cottage%2C+cabin%2C+';
var metaContents  = 'Up+scale+Vacation+Rental+in+Volcano+Village+on+the+Big+Island+of+Hawaii+offering+Bed+and+Breakfast+services+in+luxurious+and+full+comfort+accomadations.++Beautiful+rainforest+and+gardened+surroundings.+A+real+treat+retreat.';
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();
};

