/* [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','5101',jdecode('Home'),jdecode(''),'/5101.html','true',[],'',''],
	['PAGE','7250',jdecode('The+Lodge'),jdecode(''),'/7250/index.html','true',[ 
		['PAGE','7271',jdecode('Living+%26+Dining'),jdecode(''),'/7250/7271.html','true',[],'',''],
		['PAGE','16021',jdecode('Kitchen+%26+Dining'),jdecode(''),'/7250/16021.html','true',[],'',''],
		['PAGE','16042',jdecode('Bedrooms'),jdecode(''),'/7250/16042.html','true',[],'',''],
		['PAGE','21947',jdecode('Bathrooms'),jdecode(''),'/7250/21947.html','true',[],'','']
	],'',''],
	['PAGE','7313',jdecode('Make+Reservations'),jdecode(''),'/7313.html','true',[],'',''],
	['PAGE','18477',jdecode('Meal+Package'),jdecode(''),'/18477.html','true',[],'',''],
	['PAGE','44934',jdecode('Group+Activities'),jdecode(''),'/44934/index.html','true',[ 
		['PAGE','55334',jdecode('Celebrations'),jdecode(''),'/44934/55334.html','true',[],'',''],
		['PAGE','55355',jdecode('Seminars'),jdecode(''),'/44934/55355.html','true',[],'',''],
		['PAGE','55376',jdecode('Meetings'),jdecode(''),'/44934/55376.html','true',[],'','']
	],'',''],
	['PAGE','44955',jdecode('Eco-Tourism'),jdecode(''),'/44955/index.html','true',[ 
		['PAGE','46418',jdecode('The+Land'),jdecode(''),'/44955/46418.html','true',[],'',''],
		['PAGE','46397',jdecode('Birding'),jdecode(''),'/44955/46397.html','true',[],'',''],
		['PAGE','46460',jdecode('Native+Wildlife'),jdecode(''),'/44955/46460.html','true',[],'','']
	],'',''],
	['PAGE','37934',jdecode('Guest+Book'),jdecode(''),'/37934/index.html','true',[ 
		['PAGE','46481',jdecode('Testimonials'),jdecode(''),'/37934/46481.html','true',[],'',''],
		['PAGE','70145',jdecode('Rehab+Junction'),jdecode(''),'/37934/70145.html','true',[],'','']
	],'',''],
	['PAGE','7460',jdecode('Location'),jdecode(''),'/7460.html','true',[],'',''],
	['PAGE','8250',jdecode('FAQs'),jdecode(''),'/8250.html','true',[],'',''],
	['PAGE','7481',jdecode('Contact+Us'),jdecode(''),'/7481.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='BB9C60';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='364';
theSitetree.graphicsetId='417';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BB9C60';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'BB9C60',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'364',
				graphicsetId: 	'417',
				contentColor: 	'000000',
				contentBGColor: 'BB9C60',
				a_color: 		'BB9C60',
				b_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20110517-093747'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5101',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-20241']={
webappId:    '7008',
documentId:  '7313',
internalId:  '20241',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55355',
internalId:  '',
customField: '20100812-154555'
};
webappMappings['7008']=webappMappings['7008-20243']={
webappId:    '7008',
documentId:  '7481',
internalId:  '20243',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7460',
internalId:  '',
customField: '20101104-110911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8250',
internalId:  '',
customField: '20100819-155411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7250',
internalId:  '',
customField: '20100811-164114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7271',
internalId:  '',
customField: '20100610-144034'
};
webappMappings['1002']=webappMappings['1002-41834aendu0in3lrc']={
webappId:    '1002',
documentId:  '41834',
internalId:  '41834aendu0in3lrc',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7313',
internalId:  '',
customField: '20110402-090317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46460',
internalId:  '',
customField: '20100819-165633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7481',
internalId:  '',
customField: '20110401-171028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55376',
internalId:  '',
customField: '20100812-154059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16021',
internalId:  '',
customField: '20100610-144210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16042',
internalId:  '',
customField: '20090908-111557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18477',
internalId:  '',
customField: '20100819-155502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21947',
internalId:  '',
customField: '20090928-093440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70145',
internalId:  '',
customField: '20110527-095631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46418',
internalId:  '',
customField: '20100811-170229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46481',
internalId:  '',
customField: '20100610-152140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44934',
internalId:  '',
customField: '20110402-090520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44955',
internalId:  '',
customField: '20100819-164729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55334',
internalId:  '',
customField: '20100812-154220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37934',
internalId:  '',
customField: '20110527-094829'
};
webappMappings['1002']=webappMappings['1002-37934aendu0in3lrc']={
webappId:    '1002',
documentId:  '37934',
internalId:  '37934aendu0in3lrc',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46397',
internalId:  '',
customField: '20100615-153708'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3LRC';
var companyName   = 'Bucks+%26+Ducks+Hunting+Lodge';
var htmlTitle	  = 'Ronnie+and+Gloria+Ogle%27s+Bucks+%26+Ducks+Hunting+Lodge+near+Bellevue%2C+Texas';
var metaKeywords  = 'Bucks+and+Ducks%2C+Folded+Wings+Adventures%2C+Texas+hunting%2C+hunting+lodge%2C+Dallas-Fort+Worth+hunting%2C+Texas+deer+hunting%2C+Texas+bird+hunting%2C+Texas+lodge';
var metaContents  = 'Bucks+and+Ducks+Hunting+Lodge+located+an+hour+northwest+of+the+Dallas-Fort+Worth+Metroplex+in+Texas%2C+has+over+14%2C000+private+acres+of+some+of+the+best+hunting+land+in+Texas%2C+with+hunts+managed+by+Folded+Wings+Adventures.++Come+for+the+day+-+or+stay+for+the+week.++You%27re+gonna+love+this+place%21';
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();
};

