/* [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','2501',jdecode('Home'),jdecode(''), jdecode('%2F2501.html'), 'true',[],'',''],
	['PAGE','2552',jdecode('About+me'),jdecode(''), jdecode('%2F2552%2Findex.html'), 'true',[ 
		['PAGE','6153',jdecode('Biography'),jdecode(''), jdecode('%2F2552%2F6153.html'), 'true',[],'',''],
		['PAGE','17601',jdecode('News'),jdecode(''), jdecode('%2F2552%2F17601.html'), 'true',[],'',''],
		['PAGE','6127',jdecode('Camera+Clubs'),jdecode(''), jdecode('%2F2552%2F6127.html'), 'true',[],'',''],
		['PAGE','6101',jdecode('Home+Portraits'),jdecode(''), jdecode('%2F2552%2F6101.html'), 'true',[],'',''],
		['PAGE','11301',jdecode('Advertising'),jdecode(''), jdecode('%2F2552%2F11301.html'), 'true',[],'','']
	],'',''],
	['PAGE','40101',jdecode('Books'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','20801',jdecode('Photo+Galleries'),jdecode(''), jdecode('%2F20801%2Findex.html'), 'true',[ 
		['PAGE','2578',jdecode('Slide+Show'),jdecode(''), jdecode('%2F20801%2F2578.html'), 'true',[],'',''],
		['PAGE','20827',jdecode('Dubrovnik'),jdecode(''), jdecode('%2F20801%2F20827.html'), 'true',[],'',''],
		['PAGE','20853',jdecode('Little+Poland'),jdecode(''), jdecode('%2F20801%2F20853.html'), 'true',[],'',''],
		['PAGE','20879',jdecode('Venice'),jdecode(''), jdecode('%2F20801%2F20879.html'), 'true',[],'',''],
		['PAGE','20905',jdecode('By+The+Way'),jdecode(''), jdecode('%2F20801%2F20905.html'), 'true',[],'',''],
		['PAGE','21701',jdecode('Around+Teignmouth'),jdecode(''), jdecode('%2F20801%2F21701.html'), 'true',[],'',''],
		['PAGE','37201',jdecode('France'),jdecode(''), jdecode('%2F20801%2F37201.html'), 'true',[],'',''],
		['PAGE','38201',jdecode('Seale+Hayne'),jdecode(''), jdecode('%2F20801%2F38201.html'), 'true',[],'',''],
		['PAGE','39201',jdecode('Pembrokeshire'),jdecode(''), jdecode('%2F20801%2F39201.html'), 'true',[],'',''],
		['PAGE','41101',jdecode('Community+Centre'),jdecode(''), jdecode('%2F20801%2F41101.html'), 'true',[],'',''],
		['PAGE','41901',jdecode('Kitchen+Beauty'),jdecode(''), jdecode('%2F20801%2F41901.html'), 'true',[],'',''],
		['PAGE','43201',jdecode('Gran+Canaria'),jdecode(''), jdecode('%2F20801%2F43201.html'), 'true',[],'',''],
		['PAGE','46301',jdecode('Cambodia'),jdecode(''), jdecode('%2F20801%2F46301.html'), 'true',[],'',''],
		['PAGE','46327',jdecode('Australia'),jdecode(''), jdecode('%2F20801%2F46327.html'), 'true',[],'',''],
		['PAGE','46353',jdecode('Thailand'),jdecode(''), jdecode('%2F20801%2F46353.html'), 'true',[],'',''],
		['PAGE','46379',jdecode('New+Zealand'),jdecode(''), jdecode('%2F20801%2F46379.html'), 'true',[],'','']
	],'',''],
	['PAGE','19501',jdecode('Links'),jdecode(''), jdecode('%2F19501.html'), 'true',[],'',''],
	['PAGE','2604',jdecode('Contact+Me'),jdecode(''), jdecode('%2F2604.html'), 'true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Plant';
theSitetree.paletteFamily='777777';
theSitetree.keyvisualId='9452';
theSitetree.keyvisualName='kv_9452.jpg';
theSitetree.fontsetId='17400';
theSitetree.graphicsetId='12820';
theSitetree.contentColor='464545';
theSitetree.contentBGColor='DEDBDB';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKQS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Plant',
				paletteFamily: 	'777777',
				keyvisualId: 	'9452',
				keyvisualName: 	'kv_9452.jpg',
				fontsetId: 		'17400',
				graphicsetId: 	'12820',
				contentColor: 	'464545',
				contentBGColor: 'DEDBDB',
				a_color: 		'B3B1B1',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-ef4c20dc64adb8a8c9d52969728e314e']={
webappId:    '7060',
documentId:  '2578',
internalId:  'ef4c20dc64adb8a8c9d52969728e314e',
customField: 'language:en;country:GB;'
};
webappMappings['7008']=webappMappings['7008-6829']={
webappId:    '7008',
documentId:  '2604',
internalId:  '6829',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20110907-093551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2578',
internalId:  '',
customField: '20100315-160958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20100319-141717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2604',
internalId:  '',
customField: '20100627-083652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20100316-083831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6153',
internalId:  '',
customField: '20100316-164402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6127',
internalId:  '',
customField: '20100324-091509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11301',
internalId:  '',
customField: '20100324-091254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20110528-102229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20100618-122840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20100319-143238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20827',
internalId:  '',
customField: '20100804-112141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20853',
internalId:  '',
customField: '20100315-160626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20879',
internalId:  '',
customField: '20100315-160654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20905',
internalId:  '',
customField: '20100311-091520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21701',
internalId:  '',
customField: '20100315-160802'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37201',
internalId:  '',
customField: '20100518-094558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20100618-122616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39201',
internalId:  '',
customField: '20100702-100522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20120124-191705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41101',
internalId:  '',
customField: '20101215-091803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41901',
internalId:  '',
customField: '20101221-143923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43201',
internalId:  '',
customField: '20110117-121733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46353',
internalId:  '',
customField: '20120201-110622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46379',
internalId:  '',
customField: '20120201-110622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46301',
internalId:  '',
customField: '20120201-110622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46327',
internalId:  '',
customField: '20120201-110622'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN37YQ';
var companyName   = 'Ken+Holland+Photography';
var htmlTitle	  = 'Ken+Holland+Photography';
var metaKeywords  = 'Ken+Holland+Teignmouth+South+Devon+Photographer';
var metaContents  = 'Ken+Holland+Teignmouth+Photographer';
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();
};

