/* [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','4601',jdecode('Home'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','4652',jdecode('Artist'),jdecode(''), jdecode('%2F4652%2Findex.html'), 'true',[ 
		['PAGE','16201',jdecode('Danny+Abrahams'),jdecode(''), jdecode('%2F4652%2F16201.html'), 'true',[],'',''],
		['PAGE','13501',jdecode('Kay+Boyce'),jdecode(''), jdecode('%2F4652%2F13501.html'), 'true',[],'',''],
		['PAGE','26201',jdecode('Peter+Brook'),jdecode(''), jdecode('%2F4652%2F26201.html'), 'true',[],'',''],
		['PAGE','13901',jdecode('Sir+William+Russell+Flint'),jdecode(''), jdecode('%2F4652%2F13901.html'), 'true',[],'',''],
		['PAGE','13927',jdecode('Gary+Hodges'),jdecode(''), jdecode('%2F4652%2F13927.html'), 'true',[],'',''],
		['PAGE','13801',jdecode('Doug+Hyde'),jdecode(''), jdecode('%2F4652%2F13801.html'), 'true',[],'',''],
		['PAGE','13953',jdecode('L+S+Lowry'),jdecode(''), jdecode('%2F4652%2F13953.html'), 'true',[],'',''],
		['PAGE','48301',jdecode('Miro'),jdecode(''), jdecode('%2F4652%2F48301.html'), 'true',[],'',''],
		['PAGE','47901',jdecode('Picasso'),jdecode(''), jdecode('%2F4652%2F47901.html'), 'true',[],'',''],
		['PAGE','13979',jdecode('David+Shepherd'),jdecode(''), jdecode('%2F4652%2F13979.html'), 'true',[],'',''],
		['PAGE','14005',jdecode('Sarah+Jane+Szikora'),jdecode(''), jdecode('%2F4652%2F14005.html'), 'true',[],'',''],
		['PAGE','14031',jdecode('Mackenzie+Thorpe'),jdecode(''), jdecode('%2F4652%2F14031.html'), 'true',[],'',''],
		['PAGE','14057',jdecode('Originals'),jdecode(''), jdecode('%2F4652%2F14057.html'), 'true',[],'','']
	],'',''],
	['PAGE','4704',jdecode('Contact'),jdecode(''), jdecode('%2F4704.html'), 'true',[],'',''],
	['PAGE','4756',jdecode('Exhibitions'),jdecode(''), jdecode('%2F4756%2Findex.html'), 'true',[ 
		['PAGE','4782',jdecode('Background+information'),jdecode(''), jdecode('%2F4756%2F4782.html'), 'true',[],'',''],
		['PAGE','4808',jdecode('Artist'),jdecode(''), jdecode('%2F4756%2F4808.html'), 'true',[],'','']
	],'',''],
	['PAGE','4834',jdecode('Giftware'),jdecode(''), jdecode('%2F4834.html'), 'true',[],'',''],
	['PAGE','4860',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F4860.html'), 'true',[],'',''],
	['PAGE','9801',jdecode('Sculptures'),jdecode(''), jdecode('%2F9801.html'), 'true',[],'',''],
	['PAGE','9827',jdecode('Jewellery'),jdecode(''), jdecode('%2F9827.html'), 'true',[],'',''],
	['PAGE','4730',jdecode('About+us'),jdecode(''), jdecode('%2F4730.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Education';
theSitetree.paletteFamily='004D3D';
theSitetree.keyvisualId='7321';
theSitetree.keyvisualName='kv_7321.jpg';
theSitetree.fontsetId='16462';
theSitetree.graphicsetId='12156';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='60786B';
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: 			'Education',
				paletteFamily: 	'004D3D',
				keyvisualId: 	'7321',
				keyvisualName: 	'kv_7321.jpg',
				fontsetId: 		'16462',
				graphicsetId: 	'12156',
				contentColor: 	'FFFFFF',
				contentBGColor: '60786B',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20110324-155132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4652',
internalId:  '',
customField: '20100917-131015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4756',
internalId:  '',
customField: '20101005-125400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13927',
internalId:  '',
customField: '20110906-135655'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4704',
internalId:  '',
customField: '20101015-154242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4730',
internalId:  '',
customField: '20101013-130445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4782',
internalId:  '',
customField: '20100914-141509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4808',
internalId:  '',
customField: '20100914-141509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4834',
internalId:  '',
customField: '20110921-153958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4860',
internalId:  '',
customField: '20100914-141509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20110921-154106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9827',
internalId:  '',
customField: '20110819-162009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20110519-183522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20110329-151828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20110509-183019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13953',
internalId:  '',
customField: '20120111-130421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13979',
internalId:  '',
customField: '20110726-154331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14005',
internalId:  '',
customField: '20110201-143003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14031',
internalId:  '',
customField: '20110225-184337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14057',
internalId:  '',
customField: '20111026-135514'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4860',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20110706-114217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26201',
internalId:  '',
customField: '20111029-153437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47901',
internalId:  '',
customField: '20110805-161135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48301',
internalId:  '',
customField: '20110805-162030'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN3UUB';
var companyName   = 'PICTURESALES+OF+OTLEY+';
var htmlTitle	  = 'Picturesales';
var metaKeywords  = '';
var metaContents  = '';
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();
};

