/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','2401',jdecode('ADVENTURE+CAMP'),jdecode(''),'/2401/index.html','true',[ 
		['PAGE','2422',jdecode('Summer+Adventure+Camp'),jdecode(''),'/2401/2422.html','true',[],'',''],
		['PAGE','2443',jdecode('Winter+Adventure+Camp'),jdecode(''),'/2401/2443.html','true',[],'',''],
		['PAGE','4301',jdecode('Acting+Out'),jdecode(''),'/2401/4301.html','true',[],'','']
	],'',''],
	['PAGE','2464',jdecode('Hunting'),jdecode(''),'/2464/index.html','true',[ 
		['PAGE','2485',jdecode('Deer'),jdecode(''),'/2464/2485.html','true',[],'',''],
		['PAGE','2506',jdecode('Bear'),jdecode(''),'/2464/2506.html','true',[],'',''],
		['PAGE','2527',jdecode('Moose'),jdecode(''),'/2464/2527.html','true',[],'',''],
		['PAGE','2548',jdecode('birds+and+small+game'),jdecode(''),'/2464/2548.html','true',[],'','']
	],'',''],
	['PAGE','2569',jdecode('Fishing'),jdecode(''),'/2569/index.html','true',[ 
		['PAGE','2590',jdecode('Ice+Fishing'),jdecode(''),'/2569/2590.html','true',[],'','']
	],'',''],
	['PAGE','2611',jdecode('Our+Staff'),jdecode(''),'/2611.html','true',[],'',''],
	['PAGE','2632',jdecode('Recreation'),jdecode(''),'/2632/index.html','true',[ 
		['PAGE','2653',jdecode('Summer+Recreation'),jdecode(''),'/2632/2653.html','true',[],'',''],
		['PAGE','2674',jdecode('Winter+Recreation'),jdecode(''),'/2632/2674.html','true',[],'','']
	],'',''],
	['PAGE','2695',jdecode('Cabins+-+Accomodations'),jdecode(''),'/2695.html','true',[],'',''],
	['PAGE','2716',jdecode('Mushing+101'),jdecode(''),'/2716.html','true',[],'',''],
	['PAGE','2737',jdecode('Haunted+Forest'),jdecode(''),'/2737.html','true',[],'',''],
	['PAGE','2758',jdecode('Contact+Us'),jdecode(''),'/2758.html','true',[],'',''],
	['PAGE','2779',jdecode('Price+Guide'),jdecode(''),'/2779.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='589955';
theSitetree.keyvisualId='7084';
theSitetree.keyvisualName='kv_7084.jpg';
theSitetree.fontsetId='16390';
theSitetree.graphicsetId='12123';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='589955';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Billy',
				paletteFamily: 	'589955',
				keyvisualId: 	'7084',
				keyvisualName: 	'kv_7084.jpg',
				fontsetId: 		'16390',
				graphicsetId: 	'12123',
				contentColor: 	'FFFFFF',
				contentBGColor: '589955',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20100325-194547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100325-190712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2422',
internalId:  '',
customField: '20100325-201523'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-6990734']={
webappId:    '1501',
documentId:  '2101',
internalId:  '6990734',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2443',
internalId:  '',
customField: '20100325-201950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4301',
internalId:  '',
customField: '20100325-202823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2632',
internalId:  '',
customField: '20100203-203208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2653',
internalId:  '',
customField: '20100203-203339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2674',
internalId:  '',
customField: '20100203-203501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2695',
internalId:  '',
customField: '20100203-205518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2716',
internalId:  '',
customField: '20100203-203826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2737',
internalId:  '',
customField: '20100203-204258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2464',
internalId:  '',
customField: '20100622-043654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2569',
internalId:  '',
customField: '20100203-212111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2611',
internalId:  '',
customField: '20100317-151422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2758',
internalId:  '',
customField: '20100203-205820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2779',
internalId:  '',
customField: '20100622-052726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2485',
internalId:  '',
customField: '20100203-211225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2506',
internalId:  '',
customField: '20100203-211212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2527',
internalId:  '',
customField: '20100622-050009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2548',
internalId:  '',
customField: '20100203-211905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2590',
internalId:  '',
customField: '20100203-212224'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INZWLB';
var companyName   = 'LUGDON++LODGE';
var htmlTitle	  = 'Lugdon+Lodge';
var metaKeywords  = 'hunting%2C+bear%2C+moose%2C+deer%2C+hunt%2C+overnight+camps%2C+adventure%2C+children%2C+dogsled%2C+husky%2C+acting+out%2C+recreation%2C+snow+shoeing%2C+skiing%2C+mountain+climbing%2C+kayaking%2C+Eagle+Lake%2C+Maine%2C+Northern+Maine%2C+canoeing%2C+swimming%2C+fishing%2C+ice+fishing%2C+soccer%2C+basketball%2C+cabin+rentals%2C+lodging%2C+Lugdon+Lodge%2C+Sly+Brook+Road';
var metaContents  = 'Lugdon+LodgeExperience+the+Maine+Adventure%21We+offer+Cabin+Rentals%2C+Hunting%2C+Childrens+Adventure+Camps%2C+Dogsledding+and+many+other+Outdoor+Recreational+Activities.Located+in+Northern+Maine%2C+on+Eagle+Lake.';
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();
};
