/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','23301',jdecode('Getting+Here'),jdecode(''), jdecode('%2F23301.html'), 'true',[],'',''],
	['PAGE','58578',jdecode('Contact+Us'),jdecode(''), jdecode('%2F58578.html'), 'true',[],'',''],
	['PAGE','75600',jdecode('ON-LINE+SPECIALS'),jdecode(''), jdecode('%2F75600.html'), 'true',[],'',''],
	['PAGE','2252',jdecode('About+Us'),jdecode(''), jdecode('%2F2252.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('Hickory+Golf+at+OBGL+and+Beyond'),jdecode(''), jdecode('%2F30301.html'), 'true',[],'',''],
	['PAGE','42812',jdecode('%22Waggle+and+Feel%22++Playing+with+Hickory+Clubs'),jdecode(''), jdecode('%2F42812.html'), 'true',[],'',''],
	['PAGE','2273',jdecode('History'),jdecode(''), jdecode('%2F2273.html'), 'true',[],'',''],
	['PAGE','2315',jdecode('RATES'),jdecode(''), jdecode('%2F2315.html'), 'true',[],'',''],
	['PAGE','24101',jdecode('Scorecard'),jdecode(''), jdecode('%2F24101.html'), 'true',[],'',''],
	['PAGE','34712',jdecode('News+and+Reviews+OBGL+%26+Hickory+Golf'),jdecode(''), jdecode('%2F34712.html'), 'true',[],'',''],
	['PAGE','56478',jdecode('Golf+Shop+%26+Clubhouse'),jdecode(''), jdecode('%2F56478.html'), 'true',[],'',''],
	['PAGE','31101',jdecode('Merchandise'),jdecode(''), jdecode('%2F31101.html'), 'true',[],'',''],
	['PAGE','59878',jdecode('About+Bandon%2C+Oregon'),jdecode(''), jdecode('%2F59878.html'), 'true',[],'',''],
	['PAGE','2357',jdecode('Lodging+%26+Other+Services'),jdecode(''), jdecode('%2F2357.html'), 'true',[],'',''],
	['PAGE','29401',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F29401.html'), 'true',[],'',''],
	['PAGE','54778',jdecode('Bandit+-+OBGL+Sheep+Dog'),jdecode(''), jdecode('%2F54778.html'), 'true',[],'',''],
	['PAGE','63189',jdecode('EVENTS'),jdecode(''), jdecode('%2F63189.html'), 'true',[],'',''],
	['PAGE','58378',jdecode('GUESTBOOK'),jdecode(''), jdecode('%2F58378.html'), 'true',[],'',''],
	['PAGE','69089',jdecode('Time+to+Move+On'),jdecode(''), jdecode('%2F69089.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Delta';
theSitetree.paletteFamily='080245';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10440';
theSitetree.graphicsetId='10811';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='080245';
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: 			'Delta',
				paletteFamily: 	'080245',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10440',
				graphicsetId: 	'10811',
				contentColor: 	'FFFFFF',
				contentBGColor: '080245',
				a_color: 		'221785',
				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:  '2201',
internalId:  '',
customField: '20120129-171726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20120129-171830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2273',
internalId:  '',
customField: '20100327-191435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59878',
internalId:  '',
customField: '20100526-182950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20120110-181149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20120110-181247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20100603-111233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20110601-155357'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20110828-194458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100708-202319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31101',
internalId:  '',
customField: '20110723-204522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34712',
internalId:  '',
customField: '20110909-185622'
};
webappMappings['1501']=webappMappings['1501-5888279']={
webappId:    '1501',
documentId:  '2201',
internalId:  '5888279',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20100708-202626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54778',
internalId:  '',
customField: '20100708-201429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56478',
internalId:  '',
customField: '20110418-133450'
};
webappMappings['1002']=webappMappings['1002-58378ahw050invp63']={
webappId:    '1002',
documentId:  '58378',
internalId:  '58378ahw050invp63',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58378',
internalId:  '',
customField: '20100514-140045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58578',
internalId:  '',
customField: '20100514-140415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63189',
internalId:  '',
customField: '20111108-201904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69089',
internalId:  '',
customField: '20111022-155759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75600',
internalId:  '',
customField: '20120125-160813'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INVP63';
var companyName   = 'Old+Bandon+Golf+Links';
var htmlTitle	  = 'Old+Bandon+Golf+Links';
var metaKeywords  = 'Old%2CBandon%2CGolf%2CLinks%2COregon%2Cdunes%2Ccoast%2Cface+rock%2Chickory%2Cplay+hickory%2CBandon+Dunes%2CBandon+Crossings%2CFace+Rock+Golf+Course%2Cplayhickory.com%2COld+MacDonald%2Cantique%2Cgutta%2Cpercha%2CSouthern+Oregon+Coast%2Cpistol%2Criver%2Cgolf%2Clinks%2CBest+Western+Inn+at+Face+Rock%2CTroy+Russell';
var metaContents  = 'Old+Bandon+Golf+Links+-+9-Hole+Public+Golf+Course+-++Challenging+course+built+in+1927%3B+Great+rates+and+family-friendly.++The+only+public+course+in+the+US+to+offer+hickory+club+rentals+from+the+1890s+and+1920s.++Round+out+your+vacation+with+a+short+game+to+stretch+your+legs+on+your+arrival+or+departure+date.++Standard+rental+clubs%2C+push+and+power+carts+available.+Call+for+tee+times+or+to+reserve+a+cart%3A++541-329-1927';
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();
};

