/* [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','247401',jdecode('Home'),jdecode(''),'/247401/index.html','true',[ 
		['PAGE','252801',jdecode('Match+Reports'),jdecode(''),'/247401/252801.html','true',[],''],
		['PAGE','501',jdecode('Club+News+07-08+%26+08-09'),jdecode(''),'/247401/501.html','true',[],''],
		['PAGE','134101',jdecode('Football+Articles'),jdecode(''),'/247401/134101.html','true',[],''],
		['PAGE','263801',jdecode('Book+The+Pitch'),jdecode(''),'/247401/263801.html','true',[],'']
	],''],
	['PAGE','74385',jdecode('Club+Info'),jdecode(''),'/74385/index.html','true',[ 
		['PAGE','74406',jdecode('Commitee'),jdecode(''),'/74385/74406.html','true',[],''],
		['PAGE','74322',jdecode('Teams'),jdecode(''),'/74385/74322.html','true',[],''],
		['PAGE','204801',jdecode('Club+Honours+'),jdecode(''),'/74385/204801.html','true',[],'']
	],''],
	['PAGE','125001',jdecode('Ground'),jdecode(''),'/125001.html','true',[],''],
	['PAGE','84101',jdecode('Results+'),jdecode(''),'/84101.html','true',[],''],
	['PAGE','131001',jdecode('MSL+Info'),jdecode(''),'/131001/index.html','true',[ 
		['PAGE','165201',jdecode('Midlands+Club+Locator'),jdecode(''),'/131001/165201.html','true',[],''],
		['PAGE','171601',jdecode('ABBEYLEIX+ATHLETIC+'),jdecode(''),'/131001/171601.html','true',[],''],
		['PAGE','174101',jdecode('BALLINASLOE+TOWN'),jdecode(''),'/131001/174101.html','true',[],''],
		['PAGE','170701',jdecode('BANAGHER+UTD'),jdecode(''),'/131001/170701.html','true',[],''],
		['PAGE','174122',jdecode('EDENDERRY+TOWN'),jdecode(''),'/131001/174122.html','true',[],''],
		['PAGE','156801',jdecode('GALLEN+UNITED'),jdecode(''),'/131001/156801.html','true',[],''],
		['PAGE','181801',jdecode('KILLAVILLA+UTD'),jdecode(''),'/131001/181801.html','true',[],''],
		['PAGE','190301',jdecode('KILLEIGH'),jdecode(''),'/131001/190301.html','true',[],''],
		['PAGE','167901',jdecode('KILTORMER+AFC'),jdecode(''),'/131001/167901.html','true',[],''],
		['PAGE','174143',jdecode('MULLINGAR+ATHLETIC'),jdecode(''),'/131001/174143.html','true',[],''],
		['PAGE','167922',jdecode('PORTLAOISE+CELTIC'),jdecode(''),'/131001/167922.html','true',[],''],
		['PAGE','181001',jdecode('SAINT+AENGUS'),jdecode(''),'/131001/181001.html','true',[],''],
		['PAGE','171622',jdecode('TULLAMORE+AFC'),jdecode(''),'/131001/171622.html','true',[],'']
	],'']];
var siteelementCount=25;
theSitetree.topTemplateName='Tournament';
theSitetree.paletteFamily='43419A';
theSitetree.keyvisualId='4442';
theSitetree.keyvisualName='kv_4442.jpg';
theSitetree.fontsetId='10810';
theSitetree.graphicsetId='11250';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5351AE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Tournament',
				paletteFamily: 	'43419A',
				keyvisualId: 	'4442',
				keyvisualName: 	'kv_4442.jpg',
				fontsetId: 		'10810',
				graphicsetId: 	'11250',
				contentColor: 	'FFFFFF',
				contentBGColor: '5351AE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FBF43D',
				e_color: 		'FBF43D',
				f_color: 		'FBF43D',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090922-184652'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '247401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '247401',
internalId:  '',
customField: '20100520-171759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125001',
internalId:  '',
customField: '20090922-190236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84101',
internalId:  '',
customField: '20090922-190726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204801',
internalId:  '',
customField: '20090922-190452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74385',
internalId:  '',
customField: '20100430-070129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74406',
internalId:  '',
customField: '20100430-070440'
};
webappMappings['1501']=webappMappings['1501-4439120']={
webappId:    '1501',
documentId:  '247401',
internalId:  '4439120',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '263801',
internalId:  '',
customField: '20100513-174051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74322',
internalId:  '',
customField: '20091007-192145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131001',
internalId:  '',
customField: '20090922-191048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165201',
internalId:  '',
customField: '20090922-191207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171601',
internalId:  '',
customField: '20080326-211616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174101',
internalId:  '',
customField: '20080314-200129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '170701',
internalId:  '',
customField: '20080326-204105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174122',
internalId:  '',
customField: '20080329-181446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156801',
internalId:  '',
customField: '20080309-185646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181801',
internalId:  '',
customField: '20080326-210137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '190301',
internalId:  '',
customField: '20080329-182516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167901',
internalId:  '',
customField: '20080310-155741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174143',
internalId:  '',
customField: '20080323-170749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167922',
internalId:  '',
customField: '20080309-185347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181001',
internalId:  '',
customField: '20080326-205711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171622',
internalId:  '',
customField: '20080326-202828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252801',
internalId:  '',
customField: '20100405-170745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134101',
internalId:  '',
customField: '20091004-180126'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INE7S3';
var companyName   = 'PORTUMNA+TOWN+FOOTBALL+CLUB+est.2006';
var htmlTitle	  = 'portumna+town+football+club';
var metaKeywords  = 'portumna+town+football+club+www.portumnatown.com+soccer+portumna+town+fc+midlands+schoolboys+girls+football+league+sponsors+are+portumna+retirement+village+neil+evason+sports++web+sponsors+monthly+club+and+player+awards+';
var metaContents  = 'portumna+town+football+club+the+soccer+club+caters+for+under+8+to+under+14+age+groups+we+play+in+the+midlands+schoolboys+girls+football+league+we+are+provided+by+evowearsports+web+design';
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();
};
