/* [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','4901',jdecode('The+Badger+Sett'),jdecode(''),'/4901.html','true',[],'',''],
	['PAGE','33712',jdecode('About+us'),jdecode(''),'/33712.html','true',[],'',''],
	['PAGE','4952',jdecode('News'),jdecode(''),'/4952.html','true',[],'',''],
	['PAGE','5108',jdecode('Current+Bands'),jdecode(''),'/5108/index.html','true',[ 
		['PAGE','25112',jdecode('Kodiak+Jack'),jdecode(''),'/5108/25112.html','true',[],'',''],
		['PAGE','42312',jdecode('Moody+Tuesday'),jdecode(''),'/5108/42312.html','true',[],'',''],
		['PAGE','48512',jdecode('Timshel'),jdecode(''),'/5108/48512.html','true',[],'',''],
		['PAGE','60112',jdecode('The+Rising'),jdecode(''),'/5108/60112.html','true',[],'',''],
		['PAGE','62612',jdecode('In+Darklight'),jdecode(''),'/5108/62612.html','true',[],'',''],
		['PAGE','65812',jdecode('Lost+Morals'),jdecode(''),'/5108/65812.html','true',[],'',''],
		['PAGE','70512',jdecode('Mark+Rooney+And+Band'),jdecode(''),'/5108/70512.html','true',[],'',''],
		['PAGE','70538',jdecode('themightyroadflower'),jdecode(''),'/5108/70538.html','true',[],'','']
	],'',''],
	['PAGE','68412',jdecode('Past+Projects'),jdecode(''),'/68412/index.html','true',[ 
		['PAGE','21201',jdecode('Recreation'),jdecode(''),'/68412/21201.html','true',[],'',''],
		['PAGE','36112',jdecode('The+Visitors'),jdecode(''),'/68412/36112.html','true',[],'','']
	],'',''],
	['PAGE','4978',jdecode('Gigs'),jdecode(''),'/4978.html','true',[],'',''],
	['PAGE','5004',jdecode('Bits+To+Buy'),jdecode(''),'/5004/index.html','true',[ 
		['PAGE','40512',jdecode('Discography'),jdecode(''),'/5004/40512.html','true',[],'','']
	],'',''],
	['PAGE','56212',jdecode('Demos+reviewed%3F'),jdecode(''),'/56212.html','true',[],'',''],
	['PAGE','5082',jdecode('Talk+To+The+Badger'),jdecode(''),'/5082.html','true',[],'',''],
	['PAGE','29512',jdecode('The+Hot+Topic'),jdecode(''),'/29512.html','true',[],'',''],
	['PAGE','51312',jdecode('Press+%26+Reviews'),jdecode(''),'/51312.html','true',[],'',''],
	['PAGE','15101',jdecode('Links'),jdecode(''),'/15101.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Concise';
theSitetree.paletteFamily='E11923';
theSitetree.keyvisualId='7267';
theSitetree.keyvisualName='kv_7267.jpg';
theSitetree.fontsetId='16437';
theSitetree.graphicsetId='12140';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Concise',
				paletteFamily: 	'E11923',
				keyvisualId: 	'7267',
				keyvisualName: 	'kv_7267.jpg',
				fontsetId: 		'16437',
				graphicsetId: 	'12140',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70538',
internalId:  '',
customField: '20100824-145749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091208-110210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4952',
internalId:  '',
customField: '20100814-142055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5108',
internalId:  '',
customField: '20100814-140617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5004',
internalId:  '',
customField: '20100326-170815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5082',
internalId:  '',
customField: '20090217-164442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70512',
internalId:  '',
customField: '20100824-145749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20100813-174624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20090217-164237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4978',
internalId:  '',
customField: '20100813-184250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48512',
internalId:  '',
customField: '20100107-115723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25112',
internalId:  '',
customField: '20100107-120624'
};
webappMappings['1501']=webappMappings['1501-8923315']={
webappId:    '1501',
documentId:  '4901',
internalId:  '8923315',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4901',
internalId:  '1006',
customField: '1006'
};
webappMappings['7005']=webappMappings['7005-122']={
webappId:    '7005',
documentId:  '29512',
internalId:  '122',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-3935']={
webappId:    '7008',
documentId:  '5082',
internalId:  '3935',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68412',
internalId:  '',
customField: '20100814-140727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62612',
internalId:  '',
customField: '20100709-143049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60112',
internalId:  '',
customField: '20100411-140540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29512',
internalId:  '',
customField: '20100619-162918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33712',
internalId:  '',
customField: '20090315-170544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56212',
internalId:  '',
customField: '20100813-175547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36112',
internalId:  '',
customField: '20100314-175204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65812',
internalId:  '',
customField: '20100714-205634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40512',
internalId:  '',
customField: '20100714-190507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42312',
internalId:  '',
customField: '20100619-161138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51312',
internalId:  '',
customField: '20100131-164202'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEOXN';
var companyName   = 'Angry+Badger+Records';
var htmlTitle	  = '+Angry+Badger+Records%3A+An+Independent+Record+Label+for+the+unsigned+artist';
var metaKeywords  = 'Record+Label%2C+Indie%2C+Independent+Record+Label%2C+Southampton+Local+Bands%2C+unsigned+artists%2C+unsigned+bands%2C+';
var metaContents  = 'Angry+Badger+Records+is+a+Southampton+based%2C+Independent+Record+Label.++Set+up+to+help+unsigned+acts+get+their+music+out+there......++Contact+for+details+on+how+to+join+the+Badger+Sett+list.';
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();
};
