/* [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','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],'',''],
	['PAGE','106323',jdecode('Online+Booking'),jdecode(''),'/106323.html','true',[],'',''],
	['PAGE','113223',jdecode('Golf+and+Dine'),jdecode(''),'/113223.html','true',[],'',''],
	['PAGE','28201',jdecode('Tournament+Information'),jdecode(''),'/28201.html','true',[],'',''],
	['PAGE','28701',jdecode('Membership+Information'),jdecode(''),'/28701.html','true',[],'',''],
	['PAGE','29301',jdecode('Wedding+Inquiry'),jdecode(''),'/29301.html','true',[],'',''],
	['PAGE','7201',jdecode('Green+Fee+Rates'),jdecode(''),'/7201.html','true',[],'',''],
	['PAGE','77601',jdecode('Restaurant+Menu'),jdecode(''),'/77601.html','true',[],'',''],
	['PAGE','58501',jdecode('Golf+Academy'),jdecode(''),'/58501/index.html','true',[ 
		['PAGE','58801',jdecode('Junior+Golf+Camp'),jdecode(''),'/58501/58801.html','true',[],'',''],
		['PAGE','58822',jdecode('Elite+Junior+Program*+New'),jdecode(''),'/58501/58822.html','true',[],'',''],
		['PAGE','60001',jdecode('Golf+Schools'),jdecode(''),'/58501/60001.html','true',[],'',''],
		['PAGE','60022',jdecode('Clinics+%26+Custom+Programs'),jdecode(''),'/58501/60022.html','true',[],'',''],
		['PAGE','60043',jdecode('Lessons'),jdecode(''),'/58501/60043.html','true',[],'',''],
		['PAGE','60064',jdecode('Executive+Golf+Packages'),jdecode(''),'/58501/60064.html','true',[],'',''],
		['PAGE','60085',jdecode('Golf+School+in+Florida'),jdecode(''),'/58501/60085.html','true',[],'','']
	],'',''],
	['PAGE','36801',jdecode('Job+Opportunities'),jdecode(''),'/36801.html','true',[],'',''],
	['PAGE','22901',jdecode('Photo+Gallery'),jdecode(''),'/22901.html','true',[],'',''],
	['PAGE','48201',jdecode('Scorecard'),jdecode(''),'/48201.html','true',[],'',''],
	['PAGE','35801',jdecode('Driving+Directions'),jdecode(''),'/35801.html','true',[],'',''],
	['PAGE','5664',jdecode('e-Club'),jdecode(''),'/5664.html','true',[],'',''],
	['PAGE','5601',jdecode('About+Us'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','48943',jdecode('Links'),jdecode(''),'/48943.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Outdoor';
theSitetree.paletteFamily='3A4E32';
theSitetree.keyvisualId='3922';
theSitetree.keyvisualName='kv_3922.jpg';
theSitetree.fontsetId='10504';
theSitetree.graphicsetId='11080';
theSitetree.contentColor='3A4E32';
theSitetree.contentBGColor='C7D1C7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Outdoor',
				paletteFamily: 	'3A4E32',
				keyvisualId: 	'3922',
				keyvisualName: 	'kv_3922.jpg',
				fontsetId: 		'10504',
				graphicsetId: 	'11080',
				contentColor: 	'3A4E32',
				contentBGColor: 'C7D1C7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4A6E41',
				e_color: 		'4A6E41',
				f_color: 		'4A6E41',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77601',
internalId:  '',
customField: '20100407-100346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20100526-073351'
};
webappMappings['7060']=webappMappings['7060-9035769e75f8a6612cf0ae424a9dff25']={
webappId:    '7060',
documentId:  '22901',
internalId:  '9035769e75f8a6612cf0ae424a9dff25',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-4476768']={
webappId:    '1501',
documentId:  '1101',
internalId:  '4476768',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20100106-070006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28201',
internalId:  '',
customField: '20100422-052022'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20100126-105913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100526-073422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58501',
internalId:  '',
customField: '20100420-073707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20100324-102205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58822',
internalId:  '',
customField: '20090422-095359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60001',
internalId:  '',
customField: '20100420-074051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60022',
internalId:  '',
customField: '20100420-073915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60043',
internalId:  '',
customField: '20090424-074349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60064',
internalId:  '',
customField: '20090424-074556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60085',
internalId:  '',
customField: '20090424-074806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36801',
internalId:  '',
customField: '20100330-072552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20060623-213843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48201',
internalId:  '',
customField: '20100106-065421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35801',
internalId:  '',
customField: '20080227-124208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5664',
internalId:  '',
customField: '20100518-101807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113223',
internalId:  '',
customField: '20100526-073315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20080225-091710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48943',
internalId:  '',
customField: '20100106-065929'
};
webappMappings['7008']=webappMappings['7008-644']={
webappId:    '7008',
documentId:  '5664',
internalId:  '644',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106323',
internalId:  '',
customField: '20100324-081458'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN020INEQ3B';
var companyName   = 'Royal+Woodbine+Golf+Club';
var htmlTitle	  = 'Royal+Woodbine+Golf+Club';
var metaKeywords  = '';
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();
};
