/* [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(''), jdecode('%2F2101.html'), 'true',[],'',''],
	['PAGE','8101',jdecode('Upcoming+Tournaments'),jdecode(''), jdecode('%2F8101.html'), 'true',[],'',''],
	['PAGE','2152',jdecode('Prices'),jdecode(''), jdecode('%2F2152.html'), 'true',[],'',''],
	['PAGE','2215',jdecode('About+us'),jdecode(''), jdecode('%2F2215%2Findex.html'), 'true',[ 
		['PAGE','2236',jdecode('Our+team'),jdecode(''), jdecode('%2F2215%2F2236.html'), 'true',[],'',''],
		['PAGE','2257',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F2215%2F2257.html'), 'true',[],'',''],
		['PAGE','2278',jdecode('Opening+hours'),jdecode(''), jdecode('%2F2215%2F2278.html'), 'true',[],'','']
	],'',''],
	['PAGE','2173',jdecode('Contact'),jdecode(''), jdecode('%2F2173.html'), 'true',[],'',''],
	['PAGE','5122',jdecode('Join'),jdecode(''), jdecode('%2F5122.html'), 'true',[],'',''],
	['PAGE','6901',jdecode('Guest+Book'),jdecode(''), jdecode('%2F6901.html'), 'true',[],'',''],
	['PAGE','6922',jdecode('Coupons%2FDiscounts'),jdecode(''), jdecode('%2F6922.html'), 'true',[],'',''],
	['PAGE','5101',jdecode('Club+Newsletter'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','5143',jdecode('Interesting+links'),jdecode(''), jdecode('%2F5143.html'), 'true',[],'',''],
	['PAGE','5822',jdecode('course+pictures'),jdecode(''), jdecode('%2F5822.html'), 'true',[],'',''],
	['PAGE','5843',jdecode('Tuesday+lunch+specials'),jdecode(''), jdecode('%2F5843.html'), 'true',[],'',''],
	['PAGE','15501',jdecode('Nescatunga+2010+pics'),jdecode(''), jdecode('%2F15501.html'), 'true',[],'','']];
var siteelementCount=16;
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 prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
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:  '2101',
internalId:  '',
customField: '20100504-234115'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14732865']={
webappId:    '1501',
documentId:  '2101',
internalId:  '14732865',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20110527-232700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20110317-220151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20111022-115854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20100504-225638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20111022-120042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2257',
internalId:  '',
customField: '20111022-120233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2278',
internalId:  '',
customField: '20100307-190122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20091209-211402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5143',
internalId:  '',
customField: '20111022-120550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5122',
internalId:  '',
customField: '20111022-120401'
};
webappMappings['7060']=webappMappings['7060-b4d6fc375856265b7ce5d3ad70d639a3']={
webappId:    '7060',
documentId:  '15501',
internalId:  'b4d6fc375856265b7ce5d3ad70d639a3',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-83857236a8782ca09356021e85f55f3c']={
webappId:    '7060',
documentId:  '5822',
internalId:  '83857236a8782ca09356021e85f55f3c',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-13585']={
webappId:    '7008',
documentId:  '2173',
internalId:  '13585',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5822',
internalId:  '',
customField: '20100601-204454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5843',
internalId:  '',
customField: '20111022-115318'
};
webappMappings['1002']=webappMappings['1002-6901avf340i7c98d']={
webappId:    '1002',
documentId:  '6901',
internalId:  '6901avf340i7c98d',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20111022-115432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20100104-233621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20100810-164450'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7C98D';
var companyName   = 'Alva+Golf+and+Country+Club';
var htmlTitle	  = 'Alva+golf+and+country+club';
var metaKeywords  = 'golf';
var metaContents  = 'Golf';
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();
};

