/* [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','2001',jdecode('Home'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','2104',jdecode('biography'),jdecode(''), jdecode('%2F2104.html'), 'true',[],'',''],
	['PAGE','2078',jdecode('pictures'),jdecode(''), jdecode('%2F2078.html'), 'true',[],'',''],
	['PAGE','2301',jdecode('%22Double+or+Nothing%22'),jdecode(''), jdecode('%2F2301.html'), 'true',[],'',''],
	['PAGE','2327',jdecode('reviews'),jdecode(''), jdecode('%2F2327.html'), 'true',[],'',''],
	['PAGE','2052',jdecode('interviews'),jdecode(''), jdecode('%2F2052.html'), 'true',[],'',''],
	['PAGE','2130',jdecode('contact'),jdecode(''), jdecode('%2F2130.html'), 'true',[],'',''],
	['PAGE','6201',jdecode('2008+Cruise'),jdecode(''), jdecode('%2F6201.html'), 'true',[],'',''],
	['PAGE','22301',jdecode('2009'),jdecode(''), jdecode('%2F22301.html'), 'true',[],'',''],
	['PAGE','50712',jdecode('2010'),jdecode(''), jdecode('%2F50712.html'), 'true',[],'',''],
	['PAGE','60912',jdecode('2011'),jdecode(''), jdecode('%2F60912.html'), 'true',[],'',''],
	['PAGE','27812',jdecode('Thelma%26%23x27%3Bs+Appendix'),jdecode(''), jdecode('%2F27812%2Findex.html'), 'true',[ 
		['PAGE','22327',jdecode('Stories+I'),jdecode(''), jdecode('%2F27812%2F22327.html'), 'true',[],'',''],
		['PAGE','28612',jdecode('Stories+II'),jdecode(''), jdecode('%2F27812%2F28612.html'), 'true',[],'',''],
		['PAGE','28638',jdecode('Stories+III'),jdecode(''), jdecode('%2F27812%2F28638.html'), 'true',[],'',''],
		['PAGE','28664',jdecode('Stories+IV'),jdecode(''), jdecode('%2F27812%2F28664.html'), 'true',[],'',''],
		['PAGE','28690',jdecode('Stories+V'),jdecode(''), jdecode('%2F27812%2F28690.html'), 'true',[],'',''],
		['PAGE','29512',jdecode('Stories+VI'),jdecode(''), jdecode('%2F27812%2F29512.html'), 'true',[],'',''],
		['PAGE','38412',jdecode('Stories+VII'),jdecode(''), jdecode('%2F27812%2F38412.html'), 'true',[],'',''],
		['PAGE','42712',jdecode('Stories+VIII'),jdecode(''), jdecode('%2F27812%2F42712.html'), 'true',[],'',''],
		['PAGE','42812',jdecode('Stories+IX'),jdecode(''), jdecode('%2F27812%2F42812.html'), 'true',[],'',''],
		['PAGE','48512',jdecode('Stories+X'),jdecode(''), jdecode('%2F27812%2F48512.html'), 'true',[],'','']
	],'',''],
	['PAGE','38912',jdecode('Your+comments+please%21'),jdecode(''), jdecode('%2F38912.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Flowers';
theSitetree.paletteFamily='33369D';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10485';
theSitetree.graphicsetId='11027';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='ACACDE';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Flowers',
				paletteFamily: 	'33369D',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10485',
				graphicsetId: 	'11027',
				contentColor: 	'000000',
				contentBGColor: 'ACACDE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5D5DAA',
				e_color: 		'5D5DAA',
				f_color: 		'5D5DAA',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20111101-145604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2104',
internalId:  '',
customField: '20110309-192152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20080503-123638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20090714-232628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2327',
internalId:  '',
customField: '20091229-192449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20080506-115408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2130',
internalId:  '',
customField: '20111213-124259'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '6201',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20080524-184248'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20111102-133922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22327',
internalId:  '',
customField: '20100103-194227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27812',
internalId:  '',
customField: '20100103-205120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28612',
internalId:  '',
customField: '20090826-172126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28638',
internalId:  '',
customField: '20090828-181322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28664',
internalId:  '',
customField: '20090830-112449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28690',
internalId:  '',
customField: '20090919-185956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29512',
internalId:  '',
customField: '20090919-190106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50712',
internalId:  '',
customField: '20101130-125620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60912',
internalId:  '',
customField: '20111213-143253'
};
webappMappings['1002']=webappMappings['1002-38912anbt20in2t57']={
webappId:    '1002',
documentId:  '38912',
internalId:  '38912anbt20in2t57',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38912',
internalId:  '',
customField: '20090915-195827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38412',
internalId:  '',
customField: '20090920-000554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42712',
internalId:  '',
customField: '20100108-184800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20100109-234740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48512',
internalId:  '',
customField: '20100103-204550'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20IN2T57';
var companyName   = 'Thelma+Ruby';
var htmlTitle	  = '';
var metaKeywords  = 'Thelma+Ruby%2C+actress';
var metaContents  = 'Thelma+Ruby++website';
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();
};

