/* [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','1446',jdecode('Home'),jdecode(''),'/1446.html','true',[],'',''],
	['PAGE','1467',jdecode('About+the+Play'),jdecode(''),'/1467.html','true',[],'',''],
	['PAGE','4201',jdecode('Tony+Hancock'),jdecode(''),'/4201.html','true',[],'',''],
	['PAGE','1488',jdecode('Photos'),jdecode(''),'/1488.html','true',[],'',''],
	['PAGE','1509',jdecode('Production+Blog'),jdecode(''),'/1509.html','true',[],'',''],
	['PAGE','1520',jdecode('Guestbook'),jdecode(''),'/1520.html','true',[],'',''],
	['PAGE','1541',jdecode('Invest'),jdecode(''),'/1541.html','true',[],'',''],
	['PAGE','7201',jdecode('Links'),jdecode(''),'/7201.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='479949';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10895';
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: 			'Alpha',
				paletteFamily: 	'479949',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10895',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'479949',
				e_color: 		'479949',
				f_color: 		'479949',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-4b41464eaa7e824a931839dc43696155']={
webappId:    '7060',
documentId:  '1488',
internalId:  '4b41464eaa7e824a931839dc43696155',
customField: 'language:en;country:GB;'
};
webappMappings['7050']=webappMappings['7050-1479']={
webappId:    '7050',
documentId:  '1509',
internalId:  '1479',
customField: 'language:en;country:GB;'
};
webappMappings['7002']=webappMappings['7002-1301']={
webappId:    '7002',
documentId:  '1520',
internalId:  '1301',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-3221']={
webappId:    '7008',
documentId:  '1541',
internalId:  '3221',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1446',
internalId:  '',
customField: '20100721-183329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1467',
internalId:  '',
customField: '20100420-010009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1488',
internalId:  '',
customField: '20100331-210815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1509',
internalId:  '',
customField: '20081127-023424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1520',
internalId:  '',
customField: '20091207-021305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1541',
internalId:  '',
customField: '20100331-210941'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1446',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8282534']={
webappId:    '1501',
documentId:  '1446',
internalId:  '8282534',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100721-184317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20100523-145329'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEN3Z';
var companyName   = '%27Hancock%27s+Finest+Hour%27+by+Colin+Bennett';
var htmlTitle	  = 'Nick+Hennegan+presents+Hancocks+Finest+Hour';
var metaKeywords  = 'Tony+Hancock%2C+Theatre%2C+Theatre+Tours%2C+Touring%2C+Maverick+Theatre%2C+Nick+Hennegan%2C+Paul+Henry%2C+Crossroads%2C+Benny%2C+BBC+Television%2C+ATV+television%2C+producers%2C+theatre+producers%2C+theatre+angels%2C+investors%2C+angels%2C+Birmingham%2C+Bury+St+Edmunds%2C+Richmond%2C+Yorkshire%2C+Alexandra.';
var metaContents  = 'Website+of+new+theatre+tour+of+Hancocks+Finest+Hour%2C+by+Colin+Bennett%2C+directed+by+Chris+Hayes%2C+produced+by+Nicholas+Hennegan+Ltd.';
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();
};
