/* [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','33',jdecode('Home'),jdecode(''),'/33.html','true',[],'',''],
	['PAGE','1818',jdecode('Annies+Cottage'),jdecode(''),'/1818/index.html','true',[ 
		['PAGE','2978',jdecode('Annie%26%23x27%3Bs+photographs'),jdecode(''),'/1818/2978.html','true',[],'','']
	],'',''],
	['PAGE','2405',jdecode('Well+Cottage'),jdecode(''),'/2405/index.html','true',[ 
		['PAGE','3062',jdecode('Well+Photographs'),jdecode(''),'/2405/3062.html','true',[],'','']
	],'',''],
	['PAGE','6001',jdecode('The+Chapel'),jdecode(''),'/6001/index.html','true',[ 
		['PAGE','13901',jdecode('The+Chapel+pictures'),jdecode(''),'/6001/13901.html','true',[],'',''],
		['PAGE','19801',jdecode('The+Chapel+prices'),jdecode(''),'/6001/19801.html','true',[],'','']
	],'',''],
	['PAGE','2414',jdecode('A+brief+History'),jdecode(''),'/2414.html','true',[],'',''],
	['PAGE','1827',jdecode('Prices'),jdecode(''),'/1827.html','true',[],'',''],
	['PAGE','1680',jdecode('Contact+and+Booking'),jdecode(''),'/1680.html','true',[],'',''],
	['PAGE','1698',jdecode('How+to+find+us'),jdecode(''),'/1698.html','true',[],'',''],
	['PAGE','1716',jdecode('Terms+and+Conditions'),jdecode(''),'/1716.html','true',[],'',''],
	['PAGE','2075',jdecode('Local+Attractions+%26+Links'),jdecode(''),'/2075.html','true',[],'',''],
	['PAGE','3200',jdecode('Guestbook'),jdecode(''),'/3200/index.html','true',[ 
		['PAGE','3199',jdecode('Read+Guestbook'),jdecode(''),'/3200/3199.html','false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='B650B7';
theSitetree.keyvisualId='5821';
theSitetree.keyvisualName='kv_5821.jpg';
theSitetree.fontsetId='11096';
theSitetree.graphicsetId='11870';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easylife',
				paletteFamily: 	'B650B7',
				keyvisualId: 	'5821',
				keyvisualName: 	'kv_5821.jpg',
				fontsetId: 		'11096',
				graphicsetId: 	'11870',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '33',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-3200AHW050IN3R9W']={
webappId:    '1002',
documentId:  '3200',
internalId:  '3200AHW050IN3R9W',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-61b5fa012fb4fecd64903704702c05ca']={
webappId:    '7060',
documentId:  '2764',
internalId:  '61b5fa012fb4fecd64903704702c05ca',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-657ce0a2a4de427fd200bf773a14dc16']={
webappId:    '7060',
documentId:  '2978',
internalId:  '657ce0a2a4de427fd200bf773a14dc16',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-646a225f2687cbc4f9c146a7db501afa']={
webappId:    '7060',
documentId:  '3062',
internalId:  '646a225f2687cbc4f9c146a7db501afa',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33',
internalId:  '',
customField: '20100415-040705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1818',
internalId:  '',
customField: '20100225-123908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2978',
internalId:  '',
customField: '20100202-111639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2405',
internalId:  '',
customField: '20100313-062738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3062',
internalId:  '',
customField: '20080122-223826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2414',
internalId:  '',
customField: '20100225-094218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1827',
internalId:  '',
customField: '20100318-063414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1680',
internalId:  '',
customField: '20100208-035352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1698',
internalId:  '',
customField: '20100225-094320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1716',
internalId:  '',
customField: '20100208-113210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2075',
internalId:  '',
customField: '20100303-051504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3200',
internalId:  '',
customField: '20080123-111003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3199',
internalId:  '',
customField: '20080123-111003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100302-111643'
};
webappMappings['7060']=webappMappings['7060-803c415721c3e02a9105ae405bbfd6f2']={
webappId:    '7060',
documentId:  '13901',
internalId:  '803c415721c3e02a9105ae405bbfd6f2',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20100225-062227'
};
webappMappings['1501']=webappMappings['1501-6930657']={
webappId:    '1501',
documentId:  '33',
internalId:  '6930657',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20100225-100500'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '33',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3R9W';
var companyName   = 'Annie%27s+and+Well+Cottages';
var htmlTitle	  = 'Annies+and+Well+Cottage';
var metaKeywords  = 'self+catering+accomodation%2CManston%2C+Broadstairs%2C+Ramsgate%2C+Margate%2C+Sandwich+open%2C+Sandwich+golf%2C+Thanet%2C+Cottages%2C+cottages4you%2C+english+country+cottages%2C+holiday+properties+in+Kent%2C+Fishing+%2Csailing%2C+Golf%2C+holiday+cottages';
var metaContents  = 'self+catering+cottages+between+Broadstairs%2C+Margate%2C+Ramsgate+and+Sandwich+on+the+Isle+of+Thanet%2C+two+1+bedroom+cottages+and+a+luxury+6-10+bed+character+property.+Within+easy+reach+of+the+local+sandy+beaches+and+local+amenities.';
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();
};
