/* [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','6501',jdecode('Studio+Home+Page'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','16601',jdecode('Shows+%26+Exhibits'),jdecode(''),'/16601/index.html','true',[ 
		['PAGE','29401',jdecode('Canadian+%26+Fair+Trade'),jdecode(''),'/16601/29401.html','false',[],'']
	],''],
	['PAGE','16622',jdecode('Art+Gifts+%26+Merchandise'),jdecode(''),'/16622.html','true',[],''],
	['PAGE','22601',jdecode('Pet+Portraits'),jdecode(''),'/22601.html','true',[],''],
	['PAGE','30701',jdecode('ARTicals'),jdecode(''),'/30701.html','false',[],''],
	['PAGE','16685',jdecode('Contact+Me'),jdecode(''),'/16685.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Boston';
theSitetree.paletteFamily='832A2A';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11066';
theSitetree.graphicsetId='11840';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='A34242';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Boston',
				paletteFamily: 	'832A2A',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11066',
				graphicsetId: 	'11840',
				contentColor: 	'FFFFFF',
				contentBGColor: 'A34242',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20091110-131923'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16622',
internalId:  '',
customField: '20091028-103255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20091110-133319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20091110-133950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20090523-203330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30701',
internalId:  '',
customField: '20091028-014029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16685',
internalId:  '',
customField: '20090523-204104'
};
webappMappings['7008']=webappMappings['7008-987']={
webappId:    '7008',
documentId:  '16685',
internalId:  '987',
customField: 'language:en;country:US;'
};
var canonHostname = 'cm4all.netfirms.com';
var accountId     = 'ANFI10INXL9X';
var companyName   = 'www.LisaCharltonGallery.com';
var htmlTitle	  = 'Lisa+Charlton+Gallery%2C+Unique+Art+Gift+%26+Decor';
var metaKeywords  = 'Lisa+Charlton%2CGallery%2CLisa+Charlton+Gallery%2CAnimals%2CBirds%2CNature%2CFriendship%2C+Gift%2CFine+Art%2CPets%2CDogs%2CCats%2CHorses%2C+Birds%2CFarm%2CWildlife%2COriginals%2COrnaments%2C+Prints%2CFUNctional%2CWall+Art%2CPet+Pegs%2CStationery%2C+Greeting+Cards%2CCollectables%2CT-Shirts%2CDog+Show+Trophy%2CPet+Portraits%2CCommissions%2CCustom%2CFor+pets+sake%2Ctrophy%2Cdog+show%2CArt%2Cpaintings%2Cornaments%2Ct-shirts%2CGeorgina+Studio+Tour%2CCanadian%2CCanada%2CCanine+Art%2Cwall+peg%2Cwood%2Cnewfoundland%2Cpointer%2CSt.%2Csaint+bernard%2Cwolfhound%2Cparrot%2Crooster%2Cwolves%2Cwolf%2Cpet+portrait%2Cgreeting+cards%2C+gcu%2Cmugs%2Ccafepress%2Cebay%2Cgreeting+card+universe%2Cart+and+gift+gallery%2Ccustom%2Cdesign%2Ccrows%2Cravens%2Cleopard%2Cgerman+shepherd%2Cpugs%2CLabrador%2CRetriever%2CRottweiler%2CBearded+Collie%2CBrittany%2CSpaniel%2CBorder%2CCollie%2CBoston%2CTerrier%2CDachshund%2CBernese+Mountain+Dog%2CSiberian%2CHusky%2CDoberman%2CScottish%2CShetland%2CSheepdog%2CSheltie%2CMiniature%2C+Pinscher%2CLighthouse%2CWholesale%2CFox%2CPolar+Bear%2C+Puffin.Portuguese+Water+Dog%2CLoon%2CWall+art%2Ccardinal%2Ccougar%2Cafrican%2Cdeer%2Celk%2Cowl%2Ctiger%2Ceagle%2Clovebirds%2Cgiraffe%2Cgorilla%2Czebra%2Cmacaw%2Cpuppy%2Cearth+day%2Cstretched+canvas%2Cprints%2Climited+edition%2Cnumbered%2Canimal+lover%2C+dog+lover%2Ccat+lover%2Czoo%2Cexotic%2Ccrafted%2Chand+made%2Cartisan%2Chand+crafted%2Cunique%2Cwall+peg+painting%2CDog+Breed';
var metaContents  = 'Animals%2C+Birds%2C+Nature%2C+Friendship+by+Artist+Lisa+Charlton.+Gift%2C+Fine+Art++Unique+Decor+featuring+paintings+of+Pets%2C+Dogs%2C+Cats%2C+Horses%2C+Birds%2C+Farm%2C+Wildlife++more.+Originals%2C+Ornaments%2C+Prints%2C+FUNctional+Wall+Art%2C+Pet+Pegs%2C+Stationery%2C+Greeting+Cards%2C+Collectables%2C+T-Shirts%2C+Dog+Show+Trophy.++Pet+Portraits%2C+Commissions%2C+Custom+Art+Design+and+Painting+Models+Welcomed.+';
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();
};
