/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','66201',jdecode('Gifts'),jdecode(''),'/66201.html','true',[],'',''],
	['PAGE','66305',jdecode('Homeware'),jdecode(''),'/66305.html','true',[],'',''],
	['PAGE','75401',jdecode('Alex+Clark'),jdecode(''),'/75401.html','true',[],'',''],
	['PAGE','66487',jdecode('Annie+Tempest'),jdecode(''),'/66487.html','true',[],'',''],
	['PAGE','66409',jdecode('Cath+Kidston'),jdecode(''),'/66409.html','true',[],'',''],
	['PAGE','66435',jdecode('Emma+Ball'),jdecode(''),'/66435.html','true',[],'',''],
	['PAGE','66461',jdecode('Emma+Bridgewater'),jdecode(''),'/66461.html','true',[],'',''],
	['PAGE','66227',jdecode('Girly+Gifts'),jdecode(''),'/66227.html','true',[],'',''],
	['PAGE','66279',jdecode('Kids'),jdecode(''),'/66279.html','true',[],'',''],
	['PAGE','66357',jdecode('Toiletries'),jdecode(''),'/66357.html','true',[],'',''],
	['PAGE','66383',jdecode('Greetings+Cards+%26+Stationery'),jdecode(''),'/66383.html','true',[],'',''],
	['PAGE','75427',jdecode('Waterproof+Clothing'),jdecode(''),'/75427.html','true',[],'',''],
	['PAGE','66539',jdecode('Local+Attractions'),jdecode(''),'/66539.html','true',[],'',''],
	['PAGE','66565',jdecode('Picture+Gallery'),jdecode(''),'/66565.html','true',[],'',''],
	['PAGE','66591',jdecode('Contact+Details'),jdecode(''),'/66591.html','true',[],'',''],
	['PAGE','2306',jdecode('Guestbook'),jdecode(''),'/2306/index.html','true',[ 
		['PAGE','2301',jdecode('Read+Guestbook'),jdecode(''),'/2306/2301.html','false',[],'','']
	],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Hobby1';
theSitetree.paletteFamily='FFFFF1';
theSitetree.keyvisualId='10071';
theSitetree.keyvisualName='kv_10071.jpg';
theSitetree.fontsetId='21085';
theSitetree.graphicsetId='13177';
theSitetree.contentColor='14559E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Hobby1',
				paletteFamily: 	'FFFFF1',
				keyvisualId: 	'10071',
				keyvisualName: 	'kv_10071.jpg',
				fontsetId: 		'21085',
				graphicsetId: 	'13177',
				contentColor: 	'14559E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20101218-073725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66201',
internalId:  '',
customField: '20101217-075243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66305',
internalId:  '',
customField: '20101217-075319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66409',
internalId:  '',
customField: '20101217-102413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66461',
internalId:  '',
customField: '20101217-075441'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66435',
internalId:  '',
customField: '20101214-133743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66487',
internalId:  '',
customField: '20101217-075349'
};
webappMappings['1002']=webappMappings['1002-2306anbt10in2mn3']={
webappId:    '1002',
documentId:  '2306',
internalId:  '2306anbt10in2mn3',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2301',
internalId:  '',
customField: '20070720-170022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66279',
internalId:  '',
customField: '20101217-075641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75401',
internalId:  '',
customField: '20101217-102335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2306',
internalId:  '',
customField: '20101217-102942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66539',
internalId:  '',
customField: '20101214-154054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66591',
internalId:  '',
customField: '20101214-154201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75427',
internalId:  '',
customField: '20101214-153007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66357',
internalId:  '',
customField: '20101217-075718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66565',
internalId:  '',
customField: '20101217-102247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66383',
internalId:  '',
customField: '20101217-102006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66227',
internalId:  '',
customField: '20101217-075502'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2MN3';
var companyName   = '';
var htmlTitle	  = 'chooseagift%2C+specialgifts%2C+the+anchor+shop%2C+blakeney%2C+Norfolk';
var metaKeywords  = 'Gifts+and+product+chooseagift+.+the+anchor+shop+.+unique+gifts+.+choose+a+gift+.+specialgifts+.+novelties+.+gifts+.+toys+.+pottery+.+greetings+cards+.+candles+.+games+.+bags+.+tableware+.+collections+.+paintings+.+frames+.+chinaware+.+silk+flowers+.+paper+articules+.+fashion+decorations+.+materials+.+throws+.+cushions+.+signs+.+posters+.+plaques+.+babyware+.+childrens+collections+.+jewelery+.+beads+.+necklaces+.+shawls+.+scarves+.+ties+.+mugs+.+clocks+.+mens+novelty+.+ladies+novelty+.+clothing+.+furnishings+.+outdoor+.+kitchen+ware+and+novelties+.+earthenware+.+speciality+items+.+classic+curios+.+animal+pottery+.+curiosity+.+funny+.+trinkets+.+bathroom+ornaments+.+bedroom+collectables+.+statuettes+.+xmas+decorations+and+gifts+.+aniversary+presents+.+birthday+gifts+.+speciality+items+.+seaside+novelties+.+marine+trinkets+.+boating+and+fishing+novelties+.+electronics+.+anchor+.+store+.+merchandise+.+Blakeney+Norfolk+.+travelaway+.+ipopcentre';
var metaContents  = 'Gifts+and+product+chooseagift+.+the+anchor+shop+.+unique+gifts+.+special+gifts+.+Blakeney+Nofolk+.+novelties+.+gifts+.+choose+a+gift+.+toys+.+pottery+.+greetings+cards+.+candles+.+games+.+bags+.+tableware+.+collections+.+paintings+.+frames+.+xmas+gifts+.+chinaware+.+silk+flowers+.+paper+articules+.+fashion+decorations+.+materials+.+throws+.+cushions+.+signs+.+posters+.+plaques+.+babyware+.+childrens+collections+.+jewelery+.+beads+.+necklaces+.+shawls+.+scarves+.+ties+.+mugs+.+clocks+.+mens+novelty+.+ladies+novelty+.+clothing+.+furnishings+.+outdoor+.+kitchen+ware+and+novelties+.+earthenware+.+speciality+items+.+classic+curios+.+animal+pottery+.+curiosity+.+funny+.+trinkets+.+bathroom+ornaments+.+bedroom+collectables+.+statuettes+.+xmas+decorations+and+gifts+.+anniversary+presents+.+birthday+gifts+.+speciality+items+.+seaside+novelties+.+marine+trinkets+.+boating+and+fishing+novelties+.+electronics+.+anchor+.+store+.+merchandise+.++Blakeney+Norfolk%2C+ipopcentre%2C+travelaway';
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();
};

