/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','852',jdecode('About+Jenny+Meehan'),jdecode(''),'/852.html','true',[],'',''],
	['PAGE','978',jdecode('Contact'),jdecode(''),'/978/index.html','true',[ 
		['PAGE','101201',jdecode('Links'),jdecode(''),'/978/101201.html','true',[],'','']
	],'',''],
	['PAGE','999',jdecode('Projects+Page'),jdecode(''),'/999.html','true',[],'',''],
	['PAGE','957',jdecode('Exhibitions%2FStatement'),jdecode(''),'/957.html','true',[],'',''],
	['PAGE','894',jdecode('Painting+2009'),jdecode(''),'/894.html','true',[],'',''],
	['PAGE','145112',jdecode('Painting+2010'),jdecode(''),'/145112.html','true',[],'',''],
	['PAGE','17901',jdecode('Drawing+2009'),jdecode(''),'/17901.html','true',[],'',''],
	['PAGE','31601',jdecode('Drawing+2010'),jdecode(''),'/31601.html','true',[],'',''],
	['PAGE','873',jdecode('Photography'),jdecode(''),'/873/index.html','true',[ 
		['PAGE','7301',jdecode('Photography+Gallery+1'),jdecode(''),'/873/7301.html','true',[],'',''],
		['PAGE','14501',jdecode('Photography+Gallery+2'),jdecode(''),'/873/14501.html','true',[],'',''],
		['PAGE','7622',jdecode('John+Lewis+Foundations'),jdecode(''),'/873/7622.html','true',[],'','']
	],'',''],
	['PAGE','7811',jdecode('Poetry'),jdecode(''),'/7811.html','true',[],'',''],
	['PAGE','915',jdecode('Sculpture'),jdecode(''),'/915/index.html','true',[ 
		['PAGE','39601',jdecode('Articulation+Sculpture'),jdecode(''),'/915/39601.html','true',[],'','']
	],'',''],
	['PAGE','18901',jdecode('Journal'),jdecode(''),'/18901/index.html','true',[ 
		['PAGE','107512',jdecode('Press+Coverage'),jdecode(''),'/18901/107512.html','true',[],'','']
	],'',''],
	['PAGE','79701',jdecode('New+Directions+2008'),jdecode(''),'/79701.html','true',[],'',''],
	['PAGE','129312',jdecode('Solo+Exhibitions'),jdecode(''),'/129312.html','true',[],'',''],
	['PAGE','145612',jdecode('Videos'),jdecode(''),'/145612.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='423';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'423',
				graphicsetId: 	'467',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D4B78',
				a_color: 		'3D4B78',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100602-065701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20100420-174522'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '999',
internalId:  '',
customField: '20100316-151813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20100602-065923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20100201-172904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20100706-191641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20100727-094807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20100625-112251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20100618-174158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7811',
internalId:  '',
customField: '20100419-160026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7622',
internalId:  '',
customField: '20091201-081649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145112',
internalId:  '',
customField: '20100727-095949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79701',
internalId:  '',
customField: '20100621-212618'
};
webappMappings['7050']=webappMappings['7050-214']={
webappId:    '7050',
documentId:  '18901',
internalId:  '214',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107512',
internalId:  '',
customField: '20100203-172557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20100727-180352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17901',
internalId:  '',
customField: '20100706-191504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100401-094044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145612',
internalId:  '',
customField: '20100706-191656'
};
webappMappings['7008']=webappMappings['7008-349']={
webappId:    '7008',
documentId:  '978',
internalId:  '349',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101201',
internalId:  '',
customField: '20100419-111308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129312',
internalId:  '',
customField: '20100621-125303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100129-213117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39601',
internalId:  '',
customField: '20100104-170324'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2QLU';
var companyName   = 'jennymeehan.co.uk';
var htmlTitle	  = 'jenny+meehan+fine+artist';
var metaKeywords  = 'jenny+meehan+art++fine+art+photography+digital+art+painting+oil+acrylic+poetry+south+west+london+surrey+united+kingdom+chessington+jennifer+j.meehan+artist+painter+photographer++kingston+upon+thames+contemporary+open+exhibition+christian+faith+liturgical+alternative+worship+sacramental+gallery+prints+originals+gallery+online+gallery+prints+to+buy+purchase+original+art+buy+original+painting+devotional+prayer+contemplative+worship+church+abstract+figurative+poster+prints+writer+poet+inspirational+wall+art+for+sale+purchase+blog+journal+wordpress++photobox++photographic+art+imagery+';
var metaContents  = 'Jenny+Meehan%2C+contemporary+fine+artist+based+in+Surrey%2C+South+West+London%2C+United+Kingdom.+Painting+and+digital+photography.+Figurative+and+abstract.+Original+paintings+for+sale.+Photography+for+sale.+';
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();
};
