/* [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','10101',jdecode('Home'),jdecode(''),'/10101.html','true',[],'',''],
	['PAGE','73201',jdecode('Seasonal+Offers'),jdecode(''),'/73201.html','false',[],'',''],
	['PAGE','70401',jdecode('Email+Club'),jdecode(''),'/70401.html','true',[],'',''],
	['PAGE','30301',jdecode('Eating'),jdecode(''),'/30301.html','true',[],'',''],
	['PAGE','29301',jdecode('Drinking'),jdecode(''),'/29301.html','true',[],'',''],
	['PAGE','29327',jdecode('Function+Room'),jdecode(''),'/29327.html','true',[],'',''],
	['PAGE','29353',jdecode('Business+Events'),jdecode(''),'/29353.html','true',[],'',''],
	['PAGE','29379',jdecode('Accommodation'),jdecode(''),'/29379.html','true',[],'',''],
	['PAGE','30901',jdecode('Out+%26+About'),jdecode(''),'/30901.html','true',[],'',''],
	['PAGE','15901',jdecode('Gallery'),jdecode(''),'/15901.html','true',[],'',''],
	['PAGE','10308',jdecode('Opening+Hours'),jdecode(''),'/10308.html','true',[],'',''],
	['PAGE','10334',jdecode('How+to+find+us'),jdecode(''),'/10334.html','true',[],'',''],
	['PAGE','10360',jdecode('Contact+Us'),jdecode(''),'/10360.html','true',[],'',''],
	['PAGE','15579',jdecode('Your+Comments'),jdecode(''),'/15579.html','true',[],'',''],
	['PAGE','15501',jdecode('Xmas+%26+New+Year'),jdecode(''),'/15501.html','false',[],'',''],
	['PAGE','76801',jdecode('Join+the+team'),jdecode(''),'/76801.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Food';
theSitetree.paletteFamily='7C7C7C';
theSitetree.keyvisualId='7617';
theSitetree.keyvisualName='kv_7617.jpg';
theSitetree.fontsetId='16717';
theSitetree.graphicsetId='12243';
theSitetree.contentColor='7A7A7A';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Food',
				paletteFamily: 	'7C7C7C',
				keyvisualId: 	'7617',
				keyvisualName: 	'kv_7617.jpg',
				fontsetId: 		'16717',
				graphicsetId: 	'12243',
				contentColor: 	'7A7A7A',
				contentBGColor: 'FFFFFF',
				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['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '10334',
internalId:  'routing',
customField: 'en_GB'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100128-192024'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29353',
internalId:  '',
customField: '20091027-173030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29379',
internalId:  '',
customField: '20100130-172952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20091106-182333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100312-230946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10308',
internalId:  '',
customField: '20091031-200228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10334',
internalId:  '',
customField: '20091017-130406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10360',
internalId:  '',
customField: '20091106-182456'
};
webappMappings['7060']=webappMappings['7060-fcbfbb7b776839a977a0e01db1807214']={
webappId:    '7060',
documentId:  '15901',
internalId:  'fcbfbb7b776839a977a0e01db1807214',
customField: 'language:en;country:GB;'
};
webappMappings['1002']=webappMappings['1002-15579anbt10in35tf']={
webappId:    '1002',
documentId:  '15579',
internalId:  '15579anbt10in35tf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20091124-185306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20100120-162859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20100312-231100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29327',
internalId:  '',
customField: '20100128-191753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15579',
internalId:  '',
customField: '20091107-172101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70401',
internalId:  '',
customField: '20100304-182954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73201',
internalId:  '',
customField: '20100302-173255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76801',
internalId:  '',
customField: '20100202-172801'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN35TF';
var companyName   = 'Prudent+Inns';
var htmlTitle	  = 'The+White+Swan+Hotel';
var metaKeywords  = '';
var metaContents  = 'The+White+Swan+Hotel+is+an+18th+century+inn+set+in+the+picturesque+hamlet+of+Drakeholes+in+Doncaster.+The+function+room+is+the+ideal+setting+for+a+wedding+venue%2C+birthday+celebration+or+as+a+corporate+meeting+venue.+The+wood+panelled+restaurant+is+available+for+use+as+a+private+dining+room+for+up+to+25+people.+En+suite+accomadation+with+views+over+the+Chesterfield+canal.';
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();
};
