/* [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','7001',jdecode('HOME'),jdecode(''), jdecode('../www.abcboats.co.uk_/7001.html'), 'true',[],'',''],
	['PAGE','9901',jdecode('NARROW+BOATS'),jdecode(''), jdecode('../www.abcboats.co.uk_/9901.html'), 'true',[],'',''],
	['PAGE','28401',jdecode('65FTX12FT'),jdecode(''), jdecode('../www.abcboats.co.uk_/28401.html'), 'true',[],'',''],
	['PAGE','30401',jdecode('28FT+MINIMAX'),jdecode(''), jdecode('../www.abcboats.co.uk_/30401.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('WIDE+BEAM'),jdecode(''), jdecode('../www.abcboats.co.uk_/10401.html'), 'true',[],'',''],
	['PAGE','12701',jdecode('SEMI-TRAD'),jdecode(''), jdecode('../www.abcboats.co.uk_/12701.html'), 'true',[],'',''],
	['PAGE','10801',jdecode('NEW+CLASSIC+RANGE'),jdecode(''), jdecode('../www.abcboats.co.uk_/10801.html'), 'true',[],'',''],
	['PAGE','13101',jdecode('TRADITIONAL'),jdecode(''), jdecode('../www.abcboats.co.uk_/13101.html'), 'true',[],'',''],
	['PAGE','14201',jdecode('GALLERY+1'),jdecode(''), jdecode('../www.abcboats.co.uk_/14201.html'), 'true',[],'',''],
	['PAGE','15501',jdecode('PICS%2C+REVIEWS+%26+T%26C%26%23x27%3BS'),jdecode(''), jdecode('../www.abcboats.co.uk_/15501.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Georgia';
theSitetree.paletteFamily='6080D3';
theSitetree.keyvisualId='5994';
theSitetree.keyvisualName='kv_5994.html';
theSitetree.fontsetId='11118';
theSitetree.graphicsetId='11911';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='6080D3';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Georgia',
				paletteFamily: 	'6080D3',
				keyvisualId: 	'5994',
				keyvisualName: 	'kv_5994.jpg',
				fontsetId: 		'11118',
				graphicsetId: 	'11911',
				contentColor: 	'FFFFFF',
				contentBGColor: '6080D3',
				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:  '7001',
internalId:  '',
customField: '20120103-223003'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20110601-163803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20110601-165149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20110606-200307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090222-184414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20090222-184626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20110301-183757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20110606-200836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20110301-191521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20110308-085800'
};
webappMappings['1501']=webappMappings['1501-12327787']={
webappId:    '1501',
documentId:  '7001',
internalId:  '12327787',
customField: '1501'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7001',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9901',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '28401',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '30401',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10401',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12701',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '10801',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13101',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '14201',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '15501',
internalId:  '',
customField: 'language:en;country:GB;'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEGA8';
var companyName   = 'ABC+BOATS';
var htmlTitle	  = 'ABC+BOATS';
var metaKeywords  = 'crick+boat+show+2011%2Cthe+nottingham+narrowboat+company%2Csmall+narrowboats%2C20ft+to+62ft+narrowboat%2Cnarrowboat+refits%2Cnew+narrowboats%2Cused+narrowboats%2Cnarrowboat+sales%2Cnarrowboat+refurbishment%2Cnarrowboat+repairs%2Cnarrowboat+painters%2Ccustom+narrowboat+builders%2Cnarrowboat+builders%2Cnarrowboat+construction%2Cnarrowboat+shells%2Cnottingham+narrowboat%2Cnarrowboat+manufacturers%2Cnarrowboats+for+sale%2Cnarrowboat+lineouts%2Cnarrowboat+line+outs%2Cnarrowboat+sailaway+shells%2Cdeluxe+narrowboat+sailaway+shells%2Cnarrowboat+discussion+forum%2Cnarrowboats+in+nottingham%2Cwide+beam+boat+refits%2Cnew+wide+beam+boats%2Cused+wide+beam+boats%2Cwide+beam+boat+sales%2Cwide+beam+boat+refurbishment%2Cwide+beam+boat+repairs%2Cwide+beam+boat+painters%2Ccustom+wide+beam+boat+builders%2Cwide+beam+boat+builders%2Cwide+beam+boat+construction%2Cwide+beam+boat+shells%2Cnottingham+wide+beam+boat%2Cwide+beam+boat+manufacturers%2Cwide+beam+boats+for+sale%2Cwide+beam+boat+linouts%2Cwide+beam+boat+line+outs%2Cwide+beam+boat+sailaway+shells%2Cdeluxe+wide+beam+boat+sailaway+shells%2Cwide+beam+boat+discussion+forum%2Cwide+beam+boats+in+nottingham%2Cnarrowboat+prices%2Cwidebeam+prices%2Cstainless+steel+water+tank%2Cstainless+steel+waste+tank%2Cstainless+steel+black+water+tank%2Cstainless+steel+grey+water+tank%2Csteel+waste+tank%2Csteel+water+tank%2Csteel+black+water+tank%2Csteel+grey+water+tank%2Crope+fenders%2Cfully+fitted+narrowboat%2Cfully+fitted+widebeam';
var metaContents  = 'ABC+BOATS+-+THE+AFFORDABLE+BOAT+COMPANY';
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__%20%2b%20page%2c%20true%2c%20true.html)).toString();
};

