/* [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','7301',jdecode('Jan+White+Artist'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','12101',jdecode('Exhibitions'),jdecode(''),'/12101.html','true',[],''],
	['PAGE','41301',jdecode('Comments+'),jdecode(''),'/41301.html','true',[],''],
	['PAGE','12164',jdecode('Press'),jdecode(''),'/12164.html','true',[],''],
	['PAGE','12185',jdecode('Links'),jdecode(''),'/12185.html','true',[],''],
	['PAGE','12206',jdecode('Contact'),jdecode(''),'/12206.html','true',[],''],
	['PAGE','13001',jdecode('Collections'),jdecode(''),'/13001.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'DDDDDD',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100609-015801'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7301',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-17227171']={
webappId:    '1501',
documentId:  '7301',
internalId:  '17227171',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20090819-073056'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '41301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12164',
internalId:  '',
customField: '20100130-021451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12185',
internalId:  '',
customField: '20100209-052602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12206',
internalId:  '',
customField: '20100104-035925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20091007-022545'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '13001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12206',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12185',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12164',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41301',
internalId:  '',
customField: '20100208-234721'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '12101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '7301',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-41301aendu0in37rf']={
webappId:    '1002',
documentId:  '41301',
internalId:  '41301aendu0in37rf',
customField: 'icq=false'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN37RF';
var companyName   = 'Jan+White+Art+';
var htmlTitle	  = 'Dr+Jan+Maureen+White+Artist%2FWriter%28Scultpture%2C+Painting%2C+Prints%2C+Photography%29+';
var metaKeywords  = 'art+for+sale%2Csculpture%2Cart%2Cplacement%2Cdesign%2Ctips%2Celertgadget%2Cinterior%2Cpainter%2Clandscape%2Cprints%2Ce-ooks%2Cexhibitions%2Cgallery%2Cwater%2Cfeatures%2Cwriter%2Carticles%2Cdesigns%2Ccollections%2Ccollectors%2Cartworks%2Cbronze%2Cmacquette%2Csaatchi%2Carchitecture%2Cdevelopments%2Cprojects%2Ccommissions%2Cphotographs%2Cdecorating%2Cgarden%2Cfoyer%2Coffice%2Ccorporate%2Carchitectural%2Celert%2Crss%2C';
var metaContents  = 'Art+for+sale+sculpture+water+features+paintings+prints+ebooks+casting+and+art+placement+and+design+tips+by+Jan+White+artist+';
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();
};
