/* [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 theSitetree=[ 
	['PAGE','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],''],
	['PAGE','1152',jdecode('About+Christy'),jdecode(''),'/1152/index.html','true',[ 
		['PAGE','10501',jdecode('c.v.'),jdecode(''),'/1152/10501.html','true',[],'']
	],''],
	['PAGE','1194',jdecode('Gallery'),jdecode(''),'/1194.html','true',[],''],
	['PAGE','55001',jdecode('Gallery+i'),jdecode(''),'/55001.html','true',[],''],
	['PAGE','55401',jdecode('Gallery+ii'),jdecode(''),'/55401.html','true',[],''],
	['PAGE','62201',jdecode('Architecture'),jdecode(''),'/62201.html','true',[],''],
	['PAGE','1278',jdecode('Contact'),jdecode(''),'/1278.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Nature';
theSitetree.paletteFamily='1503FF';
theSitetree.keyvisualId='3640';
theSitetree.keyvisualName='kv_3640.jpg';
theSitetree.fontsetId='10459';
theSitetree.graphicsetId='10879';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Nature',
				paletteFamily: 	'1503FF',
				keyvisualId: 	'3640',
				keyvisualName: 	'kv_3640.jpg',
				fontsetId: 		'10459',
				graphicsetId: 	'10879',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'1503FF',
				e_color: 		'1503FF',
				f_color: 		'1503FF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20090825-072743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20090923-075357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20090923-075517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1194',
internalId:  '',
customField: '20070925-093131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55001',
internalId:  '',
customField: '20090910-094218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55401',
internalId:  '',
customField: '20080330-065058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62201',
internalId:  '',
customField: '20080913-062943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1278',
internalId:  '',
customField: '20070925-094923'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INXLT6';
var companyName   = 'Christy+Avraam+Artist';
var htmlTitle	  = 'CHRISTY+AVRAAM+BRITISH+ARTIST';
var metaKeywords  = 'artist+in+school%2C+art%2C+painting%2C+drawing%2C+buy+art%2C+british+artist%2C+london%2C+famous%2C+successful%2C+exhibition%2C+private+view%2C+living%2C+buy%2C+artist%2C+st+martins%2C+goldsmiths%2C+rca%2C+london+insititute%2C+saatchi%2C+painter%2C+canvas%2C+contemporary%2C+gallery%2C+YBA%2C+fine+art%2C+paintings%2C+oil+painting%2C+drawing%2C+buy+art%2C+painter%2C+fine+artist%2C+st+martins%2C+conceptual+art%2C+art%2C+buy+art%2C+drawings%2C+living%2C+conceptual%2C+successful%2C+exhibition%2C+private+view%2C+goldsmiths%2C+royal+college%2C+rca%2C+london+institute%2C+saatchi%2C+canvas%2C+contemporary%2C+gallery+Art%2C+Buy+Art%2C+oil+paintings%2C+British+Artists%2C+original+paintings%2C+landscape+painting%2C+abstract%2C+consultants%2C+consultancy%2C+landscape%2C+fine%2C+contemporary+drawing%2C+artworks%2C+sculpture+for+sale%2C+art+for+sale%2C+portrait+artists%2C+family+portraits%2C+purchase%2C+lease%2C+rent%2C+office%2C+vouchers%2C+London%2C+galleries%2C+gallery%2C+artist+in+residence%2C+artists+in+schools';
var metaContents  = 'British+Art+Online+from+award+winning+British+conceptual+figurative+artist+christy+avraam+from+christyavraam.com+including+oil%2C+landscape+paintings%2C+drawings%2C+prints+or+contemporary+artworks%2C+artist+in+residence';
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();
};
