/* [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','79012',jdecode('WELCOME'),jdecode(''), jdecode('%2F79012.html'), 'true',[],'',''],
	['PAGE','1412',jdecode('About+Us'),jdecode(''), jdecode('%2F1412.html'), 'true',[],'',''],
	['PAGE','112512',jdecode('Club+Charter'),jdecode(''), jdecode('%2F112512.html'), 'true',[],'',''],
	['PAGE','155212',jdecode('Honorary+Members'),jdecode(''), jdecode('%2F155212.html'), 'true',[],'',''],
	['PAGE','6601',jdecode('Supreme+Beings'),jdecode(''), jdecode('%2F6601.html'), 'true',[],'',''],
	['PAGE','92312',jdecode('Young+Travellers'),jdecode(''), jdecode('%2F92312.html'), 'true',[],'',''],
	['PAGE','27312',jdecode('Up+To+The+Minute+News'),jdecode(''), jdecode('%2F27312.html'), 'true',[],'',''],
	['PAGE','7912',jdecode('Future+Events'),jdecode(''), jdecode('%2F7912.html'), 'true',[],'',''],
	['PAGE','7512',jdecode('Contact+%26+membership'),jdecode(''), jdecode('%2F7512.html'), 'true',[],'',''],
	['PAGE','59312',jdecode('Club+Night'),jdecode(''), jdecode('%2F59312.html'), 'true',[],'',''],
	['PAGE','76012',jdecode('Feedback'),jdecode(''), jdecode('%2F76012.html'), 'true',[],'',''],
	['PAGE','236023',jdecode('Past+Events+2012'),jdecode(''), jdecode('%2F236023.html'), 'true',[],'',''],
	['PAGE','138612',jdecode('Past+Events+2011'),jdecode(''), jdecode('%2F138612.html'), 'true',[],'',''],
	['PAGE','39512',jdecode('Past+Events+2010'),jdecode(''), jdecode('%2F39512.html'), 'true',[],'',''],
	['PAGE','77412',jdecode('Past+Events+2009'),jdecode(''), jdecode('%2F77412.html'), 'true',[],'',''],
	['PAGE','127512',jdecode('Photos+2011'),jdecode(''), jdecode('%2F127512.html'), 'true',[],'',''],
	['PAGE','6627',jdecode('Photos+2009-2010'),jdecode(''), jdecode('%2F6627.html'), 'true',[],'',''],
	['PAGE','8012',jdecode('Links'),jdecode(''), jdecode('%2F8012.html'), 'true',[],'',''],
	['PAGE','204412',jdecode('SCI-FI+EVENT+PHOTOS+2011'),jdecode(''), jdecode('%2F204412.html'), 'true',[],'',''],
	['PAGE','29012',jdecode('2009+SCI-FI+Photos'),jdecode(''), jdecode('%2F29012.html'), 'true',[],'',''],
	['PAGE','116312',jdecode('2010+Sci-Fi+Photos'),jdecode(''), jdecode('%2F116312.html'), 'true',[],'','']];
var siteelementCount=21;
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 prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKQS'
};
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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7912',
internalId:  '',
customField: '20120208-152216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8012',
internalId:  '',
customField: '20120207-140820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112512',
internalId:  '',
customField: '20111207-171110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27312',
internalId:  '',
customField: '20120207-140113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1412',
internalId:  '',
customField: '20110519-135433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7512',
internalId:  '',
customField: '20111126-180041'
};
webappMappings['7060']=webappMappings['7060-0ffbad6c4553c691f4f9f9c5cc02e410']={
webappId:    '7060',
documentId:  '6627',
internalId:  '0ffbad6c4553c691f4f9f9c5cc02e410',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155212',
internalId:  '',
customField: '20110421-131509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20111207-171339'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '79012',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6627',
internalId:  '',
customField: '20110421-142919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92312',
internalId:  '',
customField: '20111011-154209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76012',
internalId:  '',
customField: '20120207-143343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77412',
internalId:  '',
customField: '20100727-161757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29012',
internalId:  '',
customField: '20100305-095045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39512',
internalId:  '',
customField: '20110402-220040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59312',
internalId:  '',
customField: '20120207-140638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79012',
internalId:  '',
customField: '20120208-151416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116312',
internalId:  '',
customField: '20120122-114105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127512',
internalId:  '',
customField: '20120122-140644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '236023',
internalId:  '',
customField: '20120207-141937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138612',
internalId:  '',
customField: '20111207-184645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204412',
internalId:  '',
customField: '20120122-114235'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3W9B';
var companyName   = 'NORWICH+TIME+TRAVELLERS+%28DR+WHO+AND+SCI-FI%29+FAN+CLUB+++++++++';
var htmlTitle	  = 'Online+Home+Of+NORWICH+TIME+TRAVELLERS%21';
var metaKeywords  = '';
var metaContents  = '';
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();
};

