/* [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','1401',jdecode('Home'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','1473',jdecode('Contact'),jdecode(''),'/1473/index.html','true',[ 
		['PAGE','11901',jdecode('Feedback+Form'),jdecode(''),'/1473/11901/index.html','true',[ 
			['PAGE','12301',jdecode('Feedback+Form+%28follow+up+page%29'),jdecode(''),'/1473/11901/12301.html','false',[],'','']
		],'','']
	],'',''],
	['PAGE','1557',jdecode('Calendar'),jdecode(''),'/1557.html','true',[],'',''],
	['PAGE','1683',jdecode('Fixtures+and+Events'),jdecode(''),'/1683/index.html','true',[ 
		['PAGE','17201',jdecode('Club+Singles'),jdecode(''),'/1683/17201.html','true',[],'',''],
		['PAGE','9901',jdecode('Jean+John'),jdecode(''),'/1683/9901.html','true',[],'',''],
		['PAGE','9985',jdecode('Qld+Snr+Champs'),jdecode(''),'/1683/9985.html','true',[],'',''],
		['PAGE','9922',jdecode('Super+Singles'),jdecode(''),'/1683/9922.html','true',[],'',''],
		['PAGE','9943',jdecode('Zone+1'),jdecode(''),'/1683/9943.html','true',[],'','']
	],'',''],
	['PAGE','12401',jdecode('News'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','1641',jdecode('Links'),jdecode(''),'/1641.html','true',[],'',''],
	['PAGE','39501',jdecode('Profiles'),jdecode(''),'/39501/index.html','true',[ 
		['PAGE','39522',jdecode('Carole+Sheppard'),jdecode(''),'/39501/39522.html','true',[],'',''],
		['PAGE','39543',jdecode('Tony+Cavanagh'),jdecode(''),'/39501/39543.html','true',[],'',''],
		['PAGE','39564',jdecode('Maureen+Piggott'),jdecode(''),'/39501/39564.html','true',[],'',''],
		['PAGE','39585',jdecode('Tony+Webster'),jdecode(''),'/39501/39585.html','true',[],'',''],
		['PAGE','39606',jdecode('Nina+Taylor'),jdecode(''),'/39501/39606.html','true',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Retro';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='205';
theSitetree.graphicsetId='246';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Retro',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'205',
				graphicsetId: 	'246',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'FF9900',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'EAEAEA',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39606',
internalId:  '',
customField: '20090602-060323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39501',
internalId:  '',
customField: '20090602-055139'
};
webappMappings['1501']=webappMappings['1501-15138486']={
webappId:    '1501',
documentId:  '1401',
internalId:  '15138486',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20090805-180404'
};
webappMappings['7008']=webappMappings['7008-754']={
webappId:    '7008',
documentId:  '11901',
internalId:  '754',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9943',
internalId:  '',
customField: '20090407-223708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1557',
internalId:  '',
customField: '20100620-140849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1683',
internalId:  '',
customField: '20090528-233144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1473',
internalId:  '',
customField: '20090407-223012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20080911-201005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20080911-201145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20080930-211411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20081001-233943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9922',
internalId:  '',
customField: '20080911-211032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9985',
internalId:  '',
customField: '20090407-224636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100620-140655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1641',
internalId:  '',
customField: '20080914-221340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39585',
internalId:  '',
customField: '20090602-060255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39522',
internalId:  '',
customField: '20090602-060853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39543',
internalId:  '',
customField: '20090602-061833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39564',
internalId:  '',
customField: '20090602-063220'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN010INLLP2';
var companyName   = 'Inner+City+Darts+Association';
var htmlTitle	  = 'Inner+City+Darts+Association';
var metaKeywords  = 'brisbane+city%2C+innercity+darts%2C+queensland%2C+vulture+street%2C+stephen+road%2C+south+brisbane%2C+competition+darts%2C+recreational+darts%2C+social+darts%2C+junior+darts%2C+sporting+darts%2C+zone+one%2C+zone+1%2C+blind+hall';
var metaContents  = 'Recreational%2C+sporting%2C+and+competition+darts+in+Brisbane+CBD+inner+city+and+metropolitan+region';
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();
};
