/* [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','39901',jdecode('HOME+PAGE'),jdecode(''), jdecode('%2F39901.html'), 'true',[],'',''],
	['PAGE','8279',jdecode('JASPER%26%23x27%3BS+WEBSITE'),jdecode(''), jdecode('%2F8279.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Knowing+Jasper+Series'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','10001',jdecode('ABOUT+LILLIE'),jdecode(''), jdecode('%2F10001.html'), 'true',[],'',''],
	['PAGE','27801',jdecode('Her+Autobiography'),jdecode(''), jdecode('%2F27801.html'), 'true',[],'',''],
	['PAGE','44701',jdecode('Amazon+BUY+NOW'),jdecode(''), jdecode('%2F44701.html'), 'true',[],'',''],
	['PAGE','3101',jdecode('ISBN+Numbers'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','41901',jdecode('Lillie+on+Twitter'),jdecode(''), jdecode('%2F41901.html'), 'true',[],'',''],
	['PAGE','41927',jdecode('Jasper+On+Twitter'),jdecode(''), jdecode('%2F41927.html'), 'true',[],'',''],
	['PAGE','41953',jdecode('Ommaehha+Companies'),jdecode(''), jdecode('%2F41953.html'), 'true',[],'',''],
	['PAGE','8305',jdecode('Contact+Us'),jdecode(''), jdecode('%2F8305.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Noble';
theSitetree.paletteFamily='7B7A7A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17225';
theSitetree.graphicsetId='12670';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='7B7A7A';
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: 			'Noble',
				paletteFamily: 	'7B7A7A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17225',
				graphicsetId: 	'12670',
				contentColor: 	'FFFFFF',
				contentBGColor: '7B7A7A',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20120120-122945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20120120-122458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8305',
internalId:  '',
customField: '20120120-122959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10001',
internalId:  '',
customField: '20120119-121126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8279',
internalId:  '',
customField: '20120119-120937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41901',
internalId:  '',
customField: '20120120-122934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20120120-122621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39901',
internalId:  '',
customField: '20120120-122836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41927',
internalId:  '',
customField: '20120119-121912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41953',
internalId:  '',
customField: '20120119-122023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44701',
internalId:  '',
customField: '20120120-122805'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN3TFO';
var companyName   = 'The+Website+of+Lillie+Whittle+Publishing';
var htmlTitle	  = 'LILLIE+WHITTLE+PUBLISHING+';
var metaKeywords  = 'who+stole+my+memories%2C+lillie+whittle%2C+lily+wittle%2C+lilly+wittle%2C+lily+wittel%2C+lily+witell%2C+lilly+whittle%2C+lilly+wittel%2C+autobiography+lillie+whittle%2C+knowing+Jasper%2C+who+stole+my+memories%2C+lillie+whittle+publishing+ltd.%2C';
var metaContents  = 'The+Official+Website.+Lillie+publishes+the+Knowing+Jasper+Series+of+books+and+other+works+including+her+autobiography+Who+Stole+My+Memories.';
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();
};

