/* [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','1101',jdecode('Home'),jdecode(''), jdecode('%2F1101.html'), 'true',[],'',''],
	['PAGE','116601',jdecode('Arrival+%26+Departure'),jdecode(''), jdecode('%2F116601.html'), 'true',[],'',''],
	['PAGE','48601',jdecode('Sitting+Room'),jdecode(''), jdecode('%2F48601.html'), 'true',[],'',''],
	['PAGE','47701',jdecode('Family+Room'),jdecode(''), jdecode('%2F47701.html'), 'true',[],'',''],
	['PAGE','48201',jdecode('The+Double+Bedroom'),jdecode(''), jdecode('%2F48201.html'), 'true',[],'',''],
	['PAGE','49101',jdecode('Twin+Bedroom'),jdecode(''), jdecode('%2F49101.html'), 'true',[],'',''],
	['PAGE','18701',jdecode('Views+%26+Garden'),jdecode(''), jdecode('%2F18701.html'), 'true',[],'',''],
	['ITEM','118412',jdecode('Available+Dates'),jdecode(''), jdecode('http%3A%2F%2Fwww.embracescotland.co.uk%2Fproperty_details.asp%3Fproperty_id%3D470'), 'true',[],'','_blank'],
	['PAGE','7043',jdecode('Availability+Enquiry'),jdecode(''), jdecode('%2F7043.html'), 'true',[],'',''],
	['PAGE','94901',jdecode('Booking+Form'),jdecode(''), jdecode('%2F94901.html'), 'false',[],'',''],
	['PAGE','20001',jdecode('Activities'),jdecode(''), jdecode('%2F20001.html'), 'true',[],'',''],
	['PAGE','73701',jdecode('Moray+Firth+Dolphins'),jdecode(''), jdecode('%2F73701.html'), 'true',[],'',''],
	['PAGE','119112',jdecode('links'),jdecode(''), jdecode('%2F119112.html'), 'true',[],'',''],
	['PAGE','119912',jdecode('Family+History+Research'),jdecode(''), jdecode('%2F119912.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='2A7871';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='473';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2A7871';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'2A7871',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'473',
				contentColor: 	'FFFFFF',
				contentBGColor: '2A7871',
				a_color: 		'2A7871',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-523787']={
webappId:    '1501',
documentId:  '1101',
internalId:  '523787',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-892']={
webappId:    '7008',
documentId:  '7043',
internalId:  '892',
customField: 'language:en;country:GB;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '119912',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20110703-121217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119112',
internalId:  '',
customField: '20110122-125927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48601',
internalId:  '',
customField: '20070204-185132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47701',
internalId:  '',
customField: '20070204-183549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48201',
internalId:  '',
customField: '20070128-155305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20070128-155401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20070204-184950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20110901-204317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20110122-174637'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '116601',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73701',
internalId:  '',
customField: '20070306-213439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119912',
internalId:  '',
customField: '20110122-143208'
};
webappMappings['7008']=webappMappings['7008-893']={
webappId:    '7008',
documentId:  '7043',
internalId:  '893',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-1735']={
webappId:    '7008',
documentId:  '94901',
internalId:  '1735',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94901',
internalId:  '',
customField: '20080607-210222'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1101',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '48601',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '47701',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '48201',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '49101',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '18701',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7043',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '94901',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '20001',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116601',
internalId:  '',
customField: '20101113-161807'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '73701',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '119112',
internalId:  '',
customField: 'language:en;country:GB;'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXECJ';
var companyName   = 'Fuchsia+Cottage-Fortrose+Harbour.';
var htmlTitle	  = 'Black+Isle%2CHoliday+Cottage%2C+Black+Isle+Cottage%2C+Fuchsia+Cottage%2CFortrose+Harbour%2CScotland';
var metaKeywords  = 'Black+Isle+Cottages%2CHoliday+Cottages%2C+Log+Fire%2CSelf+Catering%2CBlack+Isle%2C+Cottages+Black+Isle%2CFuchsia+Cottage%2CFortrose+Accommodation%2C+accommodation+Fortrose%2C+Accommodation+Black+Isle%2CMoray+Firth%2CFortrose%2C+Golf%2C+Golf+Scottish+Open%2C2011+Barclays+Scottish+Open%2CCastle+Stuart%2CInverness%2CNear+Inverness%2C+Highlands+of+Scotland%2CBlack+Isle+Cottages%2CCoastal+Cottages%2CCottages+by+the+sea%2CChanonry%2CFuchsia+Cottage.starhols%2CFuchsia+Cottage.co.uk%2CFushia%2CBlack+Isle%2C+Visit+Scotland%2C+Fortrose+Harbour%2C+Harbour+side%2C+Harbor+cottage%2C+Black+Isle+Holiday+cottages%2C+Culloden+Moor%2C+Rosemarkie%2C+Fortrose%2C+chalets%2C+battlefield%2C+self+catering+in+Scotland%2C+Self+Catering+Holidays%2C+Inverness%2C+self-catering%2C+cottages%2C+fishing+accommodation%2C+golf%2C+loch+ness%2C+monster%2C+rentals%2C+vacations+in+the+highlands%2C+vacation+rental%2C+Inverness+Airport%2C+train+station%2C+bus+Station%2C+Visit+Scotland%2C+Scottish+Tourist+Board%2C+grading+3+star+self+catering%2CDolphins%2C+Moray+Firth+Dolphins%2C+bottle+nose+dolphins%2C+Cromarty%2C+castles%2C+Hugh+Miller%2C+Geological+fossil+fields%2C+Black+Isle+agriculture+show%2C+beach%2C+accommodation%2C+hiking%2C+hill+walking%2C+Fortrose%2C+Chanonry+Point%2C+sailing%2Ccanoeing%2Chighland-games%2CRosemarkie+holiday+cottages%2C+Scotland%2C+Chanonary%2CFuchsia+Cottage%2C+Starhols%2C+Family+History%2C+Jack%2C+Fraser%2C+McKenzie%2C+Fortrose+Cathedral%2C+Black+Isle+Information%2C+Fortrose+Information%2CAvoch%2CWhinstone%2CFlowerburn%2CHillockhead%2CBay+View%2CWest+End%2CKreel+Cottage%2C+Cottages%2CRosehaugh%2CCottages+in+Scotland%2CCottages+Highlands+of+Scotland%2CVisitScotland%2CHoliday+Cottage+Highlands+of+Scotland%2CFortrose+Golf+Club%2C+Chanonry+Sailing+Club%2CLHH';
var metaContents  = 'Fuchsia+Cottage-+Fortrose+Harbour%2C+Moray+Firth%2C+Black+Isle%2C+Self+Catering+Holiday+Cottage%2C+Highlands+of+Scotland%2C+Self+Catering+Cottage%2CVacation+Rental%2CHoliday+cottages+in+Scotland%2CHoliday+cottages+self+catering%2Cself+catering%2Choliday+cottages%2Cself+catering+cottages%2Cself+catering+cottage%2CCottages+on+the+Black+Isle%2CSelf+catering+scotland%2Cself+catering+in+scotland%2Cscotland+self+catering.holidaycottages+in+scotland%2Choliday+cottages+scotland%2CHoliday+cottages+self+catering+scotland%2Choliday+cottage';
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();
};

