/* [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','2801',jdecode('Home'),jdecode(''),'/2801.html','true',[],'',''],
	['PAGE','2852',jdecode('About+me'),jdecode(''),'/2852.html','true',[],'',''],
	['PAGE','3027',jdecode('My+Music'),jdecode(''),'/3027/index.html','true',[ 
		['PAGE','10501',jdecode('Bad+News+Blues'),jdecode(''),'/3027/10501.html','false',[],'',''],
		['PAGE','10601',jdecode('Banker+Blues'),jdecode(''),'/3027/10601.html','false',[],'',''],
		['PAGE','11301',jdecode('Blue%2C+blue%2C+blues'),jdecode(''),'/3027/11301.html','false',[],'',''],
		['PAGE','11401',jdecode('Blues+hanging+around+my+neck'),jdecode(''),'/3027/11401.html','false',[],'',''],
		['PAGE','11427',jdecode('Come+back+home+to+me'),jdecode(''),'/3027/11427.html','false',[],'',''],
		['PAGE','11453',jdecode('Coming+home'),jdecode(''),'/3027/11453.html','false',[],'',''],
		['PAGE','11479',jdecode('Deep+blue'),jdecode(''),'/3027/11479.html','false',[],'',''],
		['PAGE','11505',jdecode('I+want+to+see+you+again'),jdecode(''),'/3027/11505.html','false',[],'',''],
		['PAGE','11531',jdecode('Irish+summertime+blues'),jdecode(''),'/3027/11531.html','false',[],'',''],
		['PAGE','12701',jdecode('Long+time+waiting+blues'),jdecode(''),'/3027/12701.html','false',[],'',''],
		['PAGE','12801',jdecode('Madelaine'),jdecode(''),'/3027/12801.html','false',[],'',''],
		['PAGE','12827',jdecode('Mr+Debt+collector'),jdecode(''),'/3027/12827.html','false',[],'',''],
		['PAGE','12853',jdecode('No+more+easy+man'),jdecode(''),'/3027/12853.html','false',[],'',''],
		['PAGE','12879',jdecode('Nonsense+song'),jdecode(''),'/3027/12879.html','false',[],'',''],
		['PAGE','12905',jdecode('Richman+blues'),jdecode(''),'/3027/12905.html','false',[],'','']
	],'',''],
	['PAGE','3001',jdecode('Musical+Partnerships'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','3401',jdecode('My+New+CD'),jdecode(''),'/3401.html','true',[],'',''],
	['PAGE','3053',jdecode('Contact+Me'),jdecode(''),'/3053.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Groove';
theSitetree.paletteFamily='B7B0F5';
theSitetree.keyvisualId='6029';
theSitetree.keyvisualName='kv_6029.jpg';
theSitetree.fontsetId='11125';
theSitetree.graphicsetId='11917';
theSitetree.contentColor='5F5F60';
theSitetree.contentBGColor='E4E4E6';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Groove',
				paletteFamily: 	'B7B0F5',
				keyvisualId: 	'6029',
				keyvisualName: 	'kv_6029.jpg',
				fontsetId: 		'11125',
				graphicsetId: 	'11917',
				contentColor: 	'5F5F60',
				contentBGColor: 'E4E4E6',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-4234']={
webappId:    '7008',
documentId:  '3053',
internalId:  '4234',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20090814-164615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2852',
internalId:  '',
customField: '20090731-161330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20090731-170956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3027',
internalId:  '',
customField: '20090828-163907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3053',
internalId:  '',
customField: '20090723-145710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20090814-174637'
};
webappMappings['1501']=webappMappings['1501-2532503']={
webappId:    '1501',
documentId:  '2801',
internalId:  '2532503',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090814-173308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20090814-173344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20090814-173856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20090814-173936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11427',
internalId:  '',
customField: '20090814-174017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11453',
internalId:  '',
customField: '20090814-174102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11479',
internalId:  '',
customField: '20090814-174139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11505',
internalId:  '',
customField: '20090814-174222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11531',
internalId:  '',
customField: '20090814-174314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090828-161834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20090828-161917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12827',
internalId:  '',
customField: '20090828-162644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12853',
internalId:  '',
customField: '20090828-163445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12879',
internalId:  '',
customField: '20090828-163525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12905',
internalId:  '',
customField: '20090828-163612'
};
var canonHostname = 'wc1.hosting.digiweb.ie';
var accountId     = 'AGW010IN2WNH';
var companyName   = 'Barney%27s+Blues';
var htmlTitle	  = 'Blues+music+from+Bernard+Costello%2C+original+lyrics+written+by+Bernard+Costello';
var metaKeywords  = 'Blues+music+from+Bernard+Costello%2C+original+lyrics+written+by+Bernard+Costello';
var metaContents  = 'Blues+music+from+Bernard+Costello%2C+original+lyrics+written+by+Bernard+Costello';
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();
};
