/* [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','12101',jdecode('Home'),jdecode(''),'/12101.html','true',[],'',''],
	['PAGE','1901',jdecode('Cottage+Details'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','9001',jdecode('Master+Bedroom'),jdecode(''),'/9001.html','true',[],'',''],
	['PAGE','9027',jdecode('Twin+Bedroom'),jdecode(''),'/9027.html','true',[],'',''],
	['PAGE','6601',jdecode('Tariff+2009'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','18801',jdecode('Tariff+2010'),jdecode(''),'/18801.html','true',[],'',''],
	['PAGE','6727',jdecode('Whats+Near+By'),jdecode(''),'/6727.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='F0F1D8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10350';
theSitetree.graphicsetId='10473';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'cutout',
				paletteFamily: 	'F0F1D8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10350',
				graphicsetId: 	'10473',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20090404-143048'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9001',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100130-183120'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12101',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6727',
internalId:  '',
customField: '20090705-153411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20090418-161231'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1901',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20080816-165929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9027',
internalId:  '',
customField: '20080816-170127'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '9027',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6601',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '6727',
internalId:  '',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20100216-083436'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEW8R';
var companyName   = 'Sea+Whispers+Cottage';
var htmlTitle	  = 'Sea+Whispers+Cottage+-+Reighton%2C+Near+Filey%2C+North+Yorkshire.++Suitable+for+up+to+four+guests+';
var metaKeywords  = 'Sea+Whispers+Cottage%2C+Reighton%2C+near+Filey%2C+North+Yorkshire+Coastline%2C+small+well+behaved+dog+welcome%2C+luxory+accommodation%2C+non+smoking%2C+two+double+bedrooms+both+ensuite%2C+king+sized+bed%2C+near+to+Reighton+Sands%2C+near+to+Cayton+Bay%2C+near+to+Bridlington%2C+near+to+Scarborough%2C+near+to+Filey%2C+www.seawhisperscottage.com%2C+holiday+cottages+in+filey%2C+holiday+cottages+filey%2C+filey+cottages%2C+filey+accommodation%2C+filey+self+catering+apartments%2Cself+catering+near+filey%2C+holiday+homes+near+filey%2C+filey+holiday+properties%2C+filey+self+catering%2C+self+catering+in+north+yorkshire%2C+holiday+cottages+in+north+yorkshire%2C+holiday+cottage+north+yorkshire+uk%2C+property+to+let+north+yorkshire%2C+north+yorkshire+coastline%2C+luxury+cottages+north+yorkshire%2C+cottages+rent+north+yorkshire%2C+weekend+break+north+yorkshire%2C+accommodation+knaresborough%2C+bridlington+accommodation%2C+bridlington+holiday+cottages%2C+self+catering+bridlington%2C+romantic+break+bridlington%2C+self+catering+in+scarborough%2C+scarborough+cottages%2C+reighton+village%2C+www.seawhisperscottage.com';
var metaContents  = 'Sea+Whispers+Cottage+Reighton+North+Yorkshire+4+Star+rating+with+Yorkshire+Tourist+Board+two+bedroomed+both+ensuite+-+sleeping+four+guests+wood+burning+stove+fitted+kitchen+mircowave+DVD+player+small+library+of+books+and+DVDs+games+washing+machine+and+patio+area+with+gas+b-b-q+small+well+behaved+dog+welcome+non+smoking+seawhisperscottage';
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();
};
