/* [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','1701',jdecode('Home'),jdecode(''),'/1701.html','true',[],''],
	['PAGE','1920',jdecode('Condo+Rental+Rates'),jdecode(''),'/1920.html','true',[],''],
	['PAGE','48201',jdecode('Get+a+Rate+Quote'),jdecode(''),'/48201.html','true',[],''],
	['PAGE','32901',jdecode('CALENDAR'),jdecode(''),'/32901.html','true',[],''],
	['PAGE','1983',jdecode('RESERVE+NOW%21'),jdecode(''),'/1983.html','true',[],''],
	['PAGE','1773',jdecode('Unit+316+%282+BR%29'),jdecode(''),'/1773.html','true',[],''],
	['PAGE','27201',jdecode('Unit+324+%281+BR%29'),jdecode(''),'/27201.html','true',[],''],
	['PAGE','27222',jdecode('Unit+326+%281+BR%29'),jdecode(''),'/27222.html','true',[],''],
	['PAGE','45001',jdecode('Last+Minute+Deals'),jdecode(''),'/45001.html','true',[],''],
	['PAGE','33601',jdecode('Parking+Info'),jdecode(''),'/33601.html','true',[],''],
	['PAGE','1752',jdecode('Arrival'),jdecode(''),'/1752.html','true',[],''],
	['PAGE','1794',jdecode('Your+Visit'),jdecode(''),'/1794.html','true',[],''],
	['PAGE','1815',jdecode('Mountain+Lodge+Fun'),jdecode(''),'/1815.html','true',[],''],
	['PAGE','10001',jdecode('Photo+Album'),jdecode(''),'/10001.html','true',[],''],
	['PAGE','1878',jdecode('Village+at+Snowshoe'),jdecode(''),'/1878.html','true',[],''],
	['PAGE','1836',jdecode('Split+Rock+Pool%2FSpa'),jdecode(''),'/1836.html','true',[],''],
	['PAGE','1857',jdecode('Dining+%26+Nightlife'),jdecode(''),'/1857.html','true',[],''],
	['PAGE','1962',jdecode('Online+Queries'),jdecode(''),'/1962.html','true',[],''],
	['PAGE','1941',jdecode('Snowshoe+Events'),jdecode(''),'/1941.html','true',[],''],
	['PAGE','1899',jdecode('Planning+Your+Trip'),jdecode(''),'/1899.html','true',[],''],
	['PAGE','15901',jdecode('Map'),jdecode(''),'/15901.html','true',[],''],
	['PAGE','8306',jdecode('Guestbook'),jdecode(''),'/8306/index.html','true',[ 
		['PAGE','8301',jdecode('Read+Guestbook'),jdecode(''),'/8306/8301.html','false',[],'']
	],''],
	['PAGE','34101',jdecode('Cancellation+Policy'),jdecode(''),'/34101.html','true',[],''],
	['PAGE','2004',jdecode('Contact+Us'),jdecode(''),'/2004.html','true',[],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2253';
theSitetree.keyvisualName='reise3.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='415';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='93A6CC';
var theTemplate={
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2253',
				keyvisualName: 	'reise3.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'415',
				contentColor: 	'FFFFFF',
				contentBGColor: '93A6CC',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				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:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2767080']={
webappId:    '1501',
documentId:  '1701',
internalId:  '2767080',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-8306ahw050invtlx']={
webappId:    '1002',
documentId:  '8306',
internalId:  '8306ahw050invtlx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20091009-210042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20091113-185118'
};
webappMappings['7005']=webappMappings['7005-399']={
webappId:    '7005',
documentId:  '1701',
internalId:  '399',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '15901',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20091113-185329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20091113-190620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1815',
internalId:  '',
customField: '20081024-212611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1920',
internalId:  '',
customField: '20091029-003402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1983',
internalId:  '',
customField: '20091028-231727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20081022-223958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20081022-224027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1836',
internalId:  '',
customField: '20091009-203100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1857',
internalId:  '',
customField: '20081022-224334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1962',
internalId:  '',
customField: '20091029-002809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1941',
internalId:  '',
customField: '20091104-213403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1899',
internalId:  '',
customField: '20091104-213926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20091104-214142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8306',
internalId:  '',
customField: '20081019-113527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20081019-113527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2004',
internalId:  '',
customField: '20091028-234735'
};
webappMappings['7060']=webappMappings['7060-3a4ead5256b722245c6198713b86b068']={
webappId:    '7060',
documentId:  '10001',
internalId:  '3a4ead5256b722245c6198713b86b068',
customField: 'language:en;country:US;'
};
webappMappings['7005']=webappMappings['7005-400']={
webappId:    '7005',
documentId:  '1701',
internalId:  '400',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27201',
internalId:  '',
customField: '20091113-185523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27222',
internalId:  '',
customField: '20091113-185742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20091028-231525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33601',
internalId:  '',
customField: '20091008-170212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20091009-202507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45001',
internalId:  '',
customField: '20091029-003150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48201',
internalId:  '',
customField: '20091103-224853'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INVTLX';
var companyName   = 'Mountain+Lodge+Condos+at+Snowshoe%2C+WV';
var htmlTitle	  = 'Mountain+Lodge+Condos+%7E%7E+Snowshoe%2C+WV';
var metaKeywords  = 'Snowshoe+West+Virginia+Mountain+Lodge+Ski';
var metaContents  = '';
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();
};
