/* [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 theSitetree=[ 
	['PAGE','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','1622',jdecode('Anchor+Shop'),jdecode(''),'/1622.html','true',[],''],
	['PAGE','2201',jdecode('Go+Shopping+Here'),jdecode(''),'/2201.html','true',[],''],
	['PAGE','18801',jdecode('Other+Shop+Items'),jdecode(''),'/18801.html','true',[],''],
	['PAGE','19401',jdecode('New+Product+'),jdecode(''),'/19401.html','true',[],''],
	['PAGE','45901',jdecode('Travelaway+Fights+Hotels'),jdecode(''),'/45901.html','true',[],''],
	['PAGE','1727',jdecode('Links+to+other+sites'),jdecode(''),'/1727.html','true',[],''],
	['PAGE','1601',jdecode('Message+Forum'),jdecode(''),'/1601.html','true',[],''],
	['PAGE','2306',jdecode('Guestbook'),jdecode(''),'/2306/index.html','true',[ 
		['PAGE','2301',jdecode('Read+Guestbook'),jdecode(''),'/2306/2301.html','false',[],'']
	],''],
	['PAGE','15401',jdecode('Journal'),jdecode(''),'/15401.html','true',[],''],
	['PAGE','1748',jdecode('contact+us'),jdecode(''),'/1748.html','true',[],''],
	['PAGE','28301',jdecode('Games+to+play+now'),jdecode(''),'/28301.html','true',[],''],
	['PAGE','1643',jdecode('Business+in+Blakeney'),jdecode(''),'/1643.html','true',[],''],
	['PAGE','1706',jdecode('Business+Photo%26%23x27%3Bs'),jdecode(''),'/1706.html','true',[],''],
	['PAGE','1664',jdecode('Blakeney+Gallery'),jdecode(''),'/1664.html','true',[],''],
	['PAGE','35401',jdecode('Sell+your+own+items+here'),jdecode(''),'/35401.html','true',[],''],
	['PAGE','51101',jdecode('Ipod-Centre+Shop+Link'),jdecode(''),'/51101.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Qben';
theSitetree.paletteFamily='3871AA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17183';
theSitetree.graphicsetId='12657';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Qben',
				paletteFamily: 	'3871AA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17183',
				graphicsetId: 	'12657',
				contentColor: 	'2E2E2E',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'DC9E3C',
				e_color: 		'C976A5',
				f_color: 		'DC9E3C',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090708-091913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20070722-235416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1622',
internalId:  '',
customField: '20070725-075439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20070722-124405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1643',
internalId:  '',
customField: '20070902-183000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1664',
internalId:  '',
customField: '20070722-193919'
};
webappMappings['1003']=webappMappings['1003-anbt10in2mn3113ea6e2f1b']={
webappId:    '1003',
documentId:  '1601',
internalId:  'anbt10in2mn3113ea6e2f1b',
customField: 'en:GB:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1706',
internalId:  '',
customField: '20070724-164325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1748',
internalId:  '',
customField: '20070723-070026'
};
webappMappings['4001']=webappMappings['4001-2663634']={
webappId:    '4001',
documentId:  '2201',
internalId:  '2663634',
customField: 'language:en;country:GB;'
};
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:  '1727',
internalId:  '',
customField: '20070823-080429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45901',
internalId:  '',
customField: '20070826-100426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20070910-130547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2306',
internalId:  '',
customField: '20070720-170022'
};
webappMappings['7060']=webappMappings['7060-28965bc85722ef893d23d68995c40ce4']={
webappId:    '7060',
documentId:  '19401',
internalId:  '28965bc85722ef893d23d68995c40ce4',
customField: 'language:en;country:GB;'
};
webappMappings['1501']=webappMappings['1501-2665819']={
webappId:    '1501',
documentId:  '501',
internalId:  '2665819',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-253']={
webappId:    '7050',
documentId:  '15401',
internalId:  '253',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20080401-075541'
};
webappMappings['7060']=webappMappings['7060-534eeaac15540e076584e68956975534']={
webappId:    '7060',
documentId:  '18801',
internalId:  '534eeaac15540e076584e68956975534',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20070722-124228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28301',
internalId:  '',
customField: '20070723-065454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20071013-154124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51101',
internalId:  '',
customField: '20070902-181408'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2MN3';
var companyName   = 'The+Anchor+Shop+.+Chooseagift.net+';
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();
};
