/* [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','10101',jdecode('Home'),jdecode(''),'/10101.html','true',[],'',''],
	['PAGE','29712',jdecode('Management+Services'),jdecode(''),'/29712.html','true',[],'',''],
	['PAGE','10152',jdecode('Great+Gas+Petroleum'),jdecode(''),'/10152.html','true',[],'',''],
	['PAGE','30912',jdecode('Marble+%26+Granite'),jdecode(''),'/30912.html','true',[],'',''],
	['PAGE','10282',jdecode('Ballyhoura+Apple+Farm'),jdecode(''),'/10282.html','true',[],'',''],
	['PAGE','40912',jdecode('Bruhenny+Holdings'),jdecode(''),'/40912.html','true',[],'',''],
	['PAGE','10230',jdecode('Retailing+-+Costcutter'),jdecode(''),'/10230.html','true',[],'',''],
	['PAGE','54356',jdecode('Strategic+Equity+Partners'),jdecode(''),'/54356.html','true',[],'',''],
	['PAGE','78578',jdecode('Noah%26%23x27%3Bs+Ark+Press'),jdecode(''),'/78578.html','true',[],'',''],
	['PAGE','93678',jdecode('Castle+Pook'),jdecode(''),'/93678.html','true',[],'',''],
	['PAGE','57456',jdecode('Booney+House'),jdecode(''),'/57456.html','true',[],'',''],
	['PAGE','43312',jdecode('Village+Renewal+Trust'),jdecode(''),'/43312.html','true',[],'',''],
	['PAGE','46712',jdecode('Community+Care'),jdecode(''),'/46712.html','true',[],'',''],
	['PAGE','10386',jdecode('Churchtown'),jdecode(''),'/10386.html','true',[],'',''],
	['PAGE','10412',jdecode('People+-+Management'),jdecode(''),'/10412.html','true',[],'',''],
	['PAGE','39012',jdecode('People+-+Gerry+Murphy'),jdecode(''),'/39012/index.html','true',[ 
		['PAGE','55056',jdecode('Memories+1954+-+1972'),jdecode(''),'/39012/55056.html','true',[],'',''],
		['PAGE','54856',jdecode('Doneraile+Address++2002'),jdecode(''),'/39012/54856.html','true',[],'','']
	],'',''],
	['PAGE','16901',jdecode('Bruhenny+Etymology'),jdecode(''),'/16901.html','true',[],'',''],
	['PAGE','11001',jdecode('Market+House+History'),jdecode(''),'/11001.html','true',[],'',''],
	['PAGE','57856',jdecode('Bruhenny+TV'),jdecode(''),'/57856.html','false',[],'',''],
	['PAGE','44112',jdecode('Recession+Statement'),jdecode(''),'/44112.html','false',[],'',''],
	['PAGE','10464',jdecode('Location+%2F+Map'),jdecode(''),'/10464.html','true',[],'',''],
	['PAGE','10490',jdecode('Email+%2F+Contact+Us'),jdecode(''),'/10490.html','true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6872';
theSitetree.keyvisualName='kv_6872.jpg';
theSitetree.fontsetId='11211';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6872',
				keyvisualName: 	'kv_6872.jpg',
				fontsetId: 		'11211',
				graphicsetId: 	'12030',
				contentColor: 	'FFFFFF',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				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['7008']=webappMappings['7008-5399']={
webappId:    '7008',
documentId:  '10490',
internalId:  '5399',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100809-221127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10152',
internalId:  '',
customField: '20100622-173800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43312',
internalId:  '',
customField: '20100412-172227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57456',
internalId:  '',
customField: '20100811-172732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10230',
internalId:  '',
customField: '20100221-212132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10282',
internalId:  '',
customField: '20100622-182104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44112',
internalId:  '',
customField: '20100625-230734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54356',
internalId:  '',
customField: '20100523-185650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78578',
internalId:  '',
customField: '20100830-230539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10386',
internalId:  '',
customField: '20090816-221531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10412',
internalId:  '',
customField: '20100601-000243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54856',
internalId:  '',
customField: '20100525-161637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10464',
internalId:  '',
customField: '20100810-223903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10490',
internalId:  '',
customField: '20100811-222934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11001',
internalId:  '',
customField: '20100611-094309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57856',
internalId:  '',
customField: '20100525-161603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100221-152958'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29712',
internalId:  '',
customField: '20100811-222416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30912',
internalId:  '',
customField: '20100811-151548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55056',
internalId:  '',
customField: '20100524-113617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39012',
internalId:  '',
customField: '20100705-173649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40912',
internalId:  '',
customField: '20100809-153721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46712',
internalId:  '',
customField: '20100718-234844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93678',
internalId:  '',
customField: '20100809-145022'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3M9B';
var companyName   = 'MARKET+HOUSE+GROUP+%7C+CHURCHTOWN';
var htmlTitle	  = 'Market+House+Group+%7C+Churchtown+%7C+Cork+%7C+Ireland';
var metaKeywords  = 'Churchtown+North+Cork+Churchtown+GreatGas+Great%2BGas+Maurice+Gilbert+Gerry+Murphy+Maurice%2BGilbert+Gerry%2BMurphy+Clashganniv+Mark%2BJakeman+Charleville+Buttevant+Ballyhea+Liscarroll+';
var metaContents  = 'Market+House+Group+is+the+collective+identity+used+to+describe+a+number+of+commercial+and+community+based+businesses+located+in+the+Market+House+in+Churchtown+in+north+County+Cork+in+Ireland.+Tel+%2B353+%280%2922+23+989.';
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();
};
