/* [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','2301',jdecode('Howdy'),jdecode(''),'/2301.html','true',[],''],
	['PAGE','3101',jdecode('Cowboy+Dinner+Show'),jdecode(''),'/3101.html','true',[],''],
	['PAGE','2722',jdecode('Bit-O-Wyo++Posse'),jdecode(''),'/2722.html','true',[],''],
	['PAGE','2743',jdecode('Happy+Trail+Rides'),jdecode(''),'/2743.html','true',[],''],
	['PAGE','3601',jdecode('Private+Shindigs'),jdecode(''),'/3601.html','true',[],''],
	['PAGE','50001',jdecode('What+they%26%23x27%3Bre+sayin%26%23x27%3B'),jdecode(''),'/50001.html','true',[],''],
	['PAGE','2785',jdecode('How+to+git+here'),jdecode(''),'/2785.html','true',[],''],
	['PAGE','3801',jdecode('Mercantile'),jdecode(''),'/3801.html','true',[],''],
	['PAGE','3622',jdecode('Reservations+Required'),jdecode(''),'/3622.html','true',[],''],
	['PAGE','6201',jdecode('Windriders+Camp'),jdecode(''),'/6201.html','true',[],''],
	['PAGE','14601',jdecode('Our+Family'),jdecode(''),'/14601.html','true',[],''],
	['PAGE','2764',jdecode('Our+Wranglers'),jdecode(''),'/2764.html','true',[],''],
	['PAGE','2806',jdecode('Our+4+legged+Friends'),jdecode(''),'/2806.html','true',[],''],
	['PAGE','3822',jdecode('Photo+Gallery'),jdecode(''),'/3822.html','true',[],''],
	['PAGE','3843',jdecode('Give+us+a+holler'),jdecode(''),'/3843.html','true',[],''],
	['PAGE','3864',jdecode('Our+Pardners'),jdecode(''),'/3864.html','true',[],''],
	['PAGE','3885',jdecode('Want+a+job'),jdecode(''),'/3885.html','true',[],''],
	['PAGE','14622',jdecode('Things+to+know'),jdecode(''),'/14622.html','true',[],''],
	['PAGE','26001',jdecode('Bean+Recipe'),jdecode(''),'/26001.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Common';
theSitetree.paletteFamily='4455BE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26635';
theSitetree.graphicsetId='13448';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Common',
				paletteFamily: 	'4455BE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26635',
				graphicsetId: 	'13448',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20100114-150826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2722',
internalId:  '',
customField: '20100220-200058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100114-150853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2743',
internalId:  '',
customField: '20091113-145630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20081226-114843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2785',
internalId:  '',
customField: '20090612-162518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20081226-114929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3622',
internalId:  '',
customField: '20081226-115003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2764',
internalId:  '',
customField: '20081126-104450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2806',
internalId:  '',
customField: '20081226-115118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3822',
internalId:  '',
customField: '20081226-115144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3843',
internalId:  '',
customField: '20081125-150703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3864',
internalId:  '',
customField: '20081226-115213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3885',
internalId:  '',
customField: '20080514-170244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20080502-105827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20081226-115038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14622',
internalId:  '',
customField: '20090727-161835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20081226-115541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50001',
internalId:  '',
customField: '20090916-150346'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2GR0';
var companyName   = 'Come+a+ridin%27%2C+singin%27+and+lovin%27+Wyoming';
var htmlTitle	  = '';
var metaKeywords  = 'Thing+to+do+in+Cheyenne%2C+Wyoming%2C++Attractions+Cheyenne+Wyoming%2C+Attractions+Wyoming.++Entertainment+Cheyenne%2C+Wyoming%2C++Dinner+Cheyenne%2C+Wyoming%2C+Resturants+Cheyenne%2CWyoming%2C++Shows+Cheyenne%2C+Wyoming+Trial+Rides+Cheyenne%2C+Wyoming%2C+Horseback+Riding+Cheyenne%2C+Wyoming%2C+BIT-O-WYO%2C+Blue+Water+Cowboy+Band%2C+Cowboy+Club+Band%2C+Live+Entertainment+Cheyenne%2C+Wyoming%2C++Trail+Rides+Cheyenne%2C+HOrseback+Riding+Cheyenne';
var metaContents  = 'Come+to+the+BIT-O-WYO+ranch+to+experince+true+western+hospitality+and+entertainment++in+Cheyenne%2C+WY.++Our+Horse+Barn+Dinner+Show+and+Trail+Rides+offer+a+great+cowboy+expereince.If+you+dont+love+Wyoming+now+you+will+after+visiting+the+BIT-O-WYO.+We+will+treat+you+like+family.';
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();
};
