/* [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','8701',jdecode('Home'),jdecode(''),'/8701.html','true',[],'',''],
	['PAGE','8752',jdecode('How+to+find+us'),jdecode(''),'/8752.html','true',[],'',''],
	['PAGE','8778',jdecode('Acers+-+Conifers'),jdecode(''),'/8778.html','true',[],'',''],
	['PAGE','8804',jdecode('Exotics+-+Grasses'),jdecode(''),'/8804.html','true',[],'',''],
	['PAGE','8830',jdecode('Heathers+-+Hostas'),jdecode(''),'/8830.html','true',[],'',''],
	['PAGE','10301',jdecode('Roses+-+Trees+'),jdecode(''),'/10301.html','true',[],'',''],
	['PAGE','8856',jdecode('Seasonal+plants+etc.'),jdecode(''),'/8856.html','true',[],'',''],
	['PAGE','8934',jdecode('Hanging+baskets+and+tubs'),jdecode(''),'/8934.html','true',[],'',''],
	['PAGE','8882',jdecode('Sundries+and+Extra+Items+'),jdecode(''),'/8882.html','true',[],'',''],
	['PAGE','8908',jdecode('Contact+us'),jdecode(''),'/8908.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Flowers';
theSitetree.paletteFamily='FCFAA4';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10485';
theSitetree.graphicsetId='11028';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FBFAD0';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Flowers',
				paletteFamily: 	'FCFAA4',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10485',
				graphicsetId: 	'11028',
				contentColor: 	'000000',
				contentBGColor: 'FBFAD0',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'807015',
				e_color: 		'807015',
				f_color: 		'807015',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20110918-171732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8752',
internalId:  '',
customField: '20101001-190401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8778',
internalId:  '',
customField: '20101001-190535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8804',
internalId:  '',
customField: '20110918-171647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8830',
internalId:  '',
customField: '20100926-171745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8856',
internalId:  '',
customField: '20110918-171424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8882',
internalId:  '',
customField: '20110918-171134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8908',
internalId:  '',
customField: '20080825-104230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8934',
internalId:  '',
customField: '20110918-171212'
};
webappMappings['7008']=webappMappings['7008-2258']={
webappId:    '7008',
documentId:  '8908',
internalId:  '2258',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20110918-171602'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '8701',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEW4Y';
var companyName   = 'WINDMILL+VIEW+PLANT+CENTRE';
var htmlTitle	  = 'Windmill+View+Plant+Centre+-+for+a+huge+selection+of+quality+plants++';
var metaKeywords  = 'windmill+view+plant+centre%2C+plants+near+retford%2C+plants+near+south+leverton%2C+plants+in+dn22%2C+dwarf+conifers%2C+japanese+acers%2C+alpine+troughs%2C+elmdene+alpine+troughs%2C+alpine+plants%2C+conifers+for+sale%2C+wall+climbers%2C+jasmine+climber%2C+clematis+plants%2C+wisteria+plants%2C+pampas+grass%2C+cordyline+plants%2C+shuttlecock+fern%2C+redcurrant+bushes%2C+blackcurrant+bushes%2C+gooseberry+bushes%2C+laurel+plants%2C+yew+plants%2C+leylandii+plants%2C+privet+plants%2C+hosta+plants%2C+winter+flowering+heather+plants%2C+summer+flowering+heather+plants%2C+herb+plants%2C+herbaceous+perennial+plants%2C+cottage+garden+plants%2C+perennial+plants%2C+summer+hanging+baskets+retford%2C+winter+hanging+baskets+retford%2C+wall+baskets+retford%2C+terracotta+pots+retford%2C+multipurpose+composts+nottinghamshire%2C+vegetable+seeds%2C+flower+seeds%2C+fruit+trees+uk%2C+hybrid+tea+rosea%2C+flower+carpet+roses%2C+floribunda+roses%2C+vegetable+plants+for+sale%2C+unusual+shrubs%2C+garden+shrubs%2C+strawberry+trees+for+sale%2C+apple+trees%2C+plum+trees%2C+minarette+fruit+trees%2C+apricot+trees%2C+indian+bean+trees%2C+bay+trees%2C+garden+centre+nottinghamshire%2C+hardy+plants+nottinghamshire%2C+outdoor+plants+uk%2C+plant+centre+nottinghamshire%2C+climbing+plants%2C+ornamental+trees%2C+alpines%2C+heathers%2C+garden+gift+vouchers%2C+geranium+plants%2C+fuchsia+plants%2C+surfinia+plants%2C+begonia+plants%2C+winter+flowering+pansy+plants%2C+';
var metaContents  = 'One+of+the+largest+selection+of+hardy+outdoor+plants+to+be+found+in+Nottinghamshire.+We+have++many+rare+and+unusual+varieties%2C+including+a+substantial+selection+of+Japanese+acers%2C+fruit+trees+and+ornamental+trees.+In+summer+we+stock+lots+of+hanging+basket+plants+%2C+including+Geranium+and+Fuchsia%2C+and+a+wide+selection+of+hanging+and+wall+baskets.+We+also+offer+a+refilling+service+for+customers+own+baskets.';
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();
};

