/* [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','1246',jdecode('Home'),jdecode(''),'/1246.html','true',[],'',''],
	['PAGE','17301',jdecode('News'),jdecode(''),'/17301.html','true',[],'',''],
	['PAGE','17101',jdecode('Blogroll'),jdecode(''),'/17101.html','true',[],'',''],
	['PAGE','22301',jdecode('Recent+Prizes'),jdecode(''),'/22301.html','true',[],'',''],
	['PAGE','51501',jdecode('Fisherman%26%23x27%3Bs+Blues+**'),jdecode(''),'/51501.html','true',[],'',''],
	['PAGE','1369',jdecode('Great+Search+For+Truth'),jdecode(''),'/1369.html','true',[],'',''],
	['PAGE','41501',jdecode('*November+Novel+*1'),jdecode(''),'/41501.html','false',[],'',''],
	['PAGE','43401',jdecode('*+November+Novel+*'),jdecode(''),'/43401.html','false',[],'',''],
	['PAGE','41527',jdecode('Biography'),jdecode(''),'/41527.html','false',[],'',''],
	['PAGE','30101',jdecode('Subscribe'),jdecode(''),'/30101.html','true',[],'',''],
	['PAGE','1380',jdecode('GuestBook'),jdecode(''),'/1380.html','true',[],'',''],
	['PAGE','27901',jdecode('Poetry'),jdecode(''),'/27901.html','false',[],'',''],
	['PAGE','17001',jdecode('Home'),jdecode(''),'/17001.html','false',[],'',''],
	['PAGE','18001',jdecode('Links'),jdecode(''),'/18001.html','true',[],'',''],
	['PAGE','1401',jdecode('Contact+Mich%C3%A9al'),jdecode(''),'/1401.html','true',[],'',''],
	['PAGE','1343',jdecode('Photos'),jdecode(''),'/1343.html','false',[],'',''],
	['PAGE','23301',jdecode('Roadtrip+-+Australia.'),jdecode(''),'/23301.html','true',[],'',''],
	['PAGE','23001',jdecode('Roadtrip+-+New+Zealand'),jdecode(''),'/23001.html','true',[],'',''],
	['PAGE','17201',jdecode('Vote'),jdecode(''),'/17201.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='33405B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12686';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='363B49';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'33405B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12686',
				contentColor: 	'FFFFFF',
				contentBGColor: '363B49',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-9f5e8b753cf87a8cb70e9d098f4230c4']={
webappId:    '7060',
documentId:  '1343',
internalId:  '9f5e8b753cf87a8cb70e9d098f4230c4',
customField: 'language:en;country:GB;'
};
webappMappings['7050']=webappMappings['7050-1185']={
webappId:    '7050',
documentId:  '1369',
internalId:  '1185',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20091104-032807'
};
webappMappings['7008']=webappMappings['7008-1304']={
webappId:    '7008',
documentId:  '1401',
internalId:  '1304',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20100215-052546'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1246',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1343',
internalId:  '',
customField: '20080828-153137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1369',
internalId:  '',
customField: '20080707-110947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1380',
internalId:  '',
customField: '20090210-185621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20090210-180039'
};
webappMappings['7008']=webappMappings['7008-2498']={
webappId:    '7008',
documentId:  '1246',
internalId:  '2498',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-1683']={
webappId:    '7008',
documentId:  '17001',
internalId:  '1683',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20090115-170354'
};
webappMappings['7005']=webappMappings['7005-9']={
webappId:    '7005',
documentId:  '17201',
internalId:  '9',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20090303-123259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20080923-160116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20090428-143608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20090428-143704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20090104-222019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20081120-110518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23301',
internalId:  '',
customField: '20090521-193827'
};
webappMappings['7008']=webappMappings['7008-2274']={
webappId:    '7008',
documentId:  '30101',
internalId:  '2274',
customField: 'language:en;country:GB;'
};
webappMappings['7002']=webappMappings['7002-1620']={
webappId:    '7002',
documentId:  '1380',
internalId:  '1620',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20090210-180258'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '1246',
internalId:  '1501',
customField: '1501'
};
webappMappings['1501']=webappMappings['1501-585351']={
webappId:    '1501',
documentId:  '1246',
internalId:  '585351',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41501',
internalId:  '',
customField: '20091106-031535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41527',
internalId:  '',
customField: '20090927-011806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43401',
internalId:  '',
customField: '20091201-062926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51501',
internalId:  '',
customField: '20100302-070422'
};
var canonHostname = 'wc1.hosting.digiweb.ie';
var accountId     = 'AGW010INXLIV';
var companyName   = 'The+Great+Search+For+Truth';
var htmlTitle	  = 'The+Great+Search+for+Truth.';
var metaKeywords  = 'Great+Search+for+Truth.+Ballinrobe+Bull.+Donnellan+Michael+Donnellan%2C+mickdonnellan+Blog+Mich%C3%A9al+Donnellan+The+Great+Search+for+Truth.+.+.+.Layla';
var metaContents  = '...Donnellan.+Great+Search+for+Truth.+Ballinrobe....';
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();
};
