/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','9243',jdecode('About+Resident+Artists'),jdecode(''),'/9243/index.html','true',[ 
		['PAGE','190193',jdecode('Linda+Burrell'),jdecode(''),'/9243/190193.html','true',[],'',''],
		['PAGE','191393',jdecode('Cyndy+Wolf'),jdecode(''),'/9243/191393.html','true',[],'',''],
		['PAGE','191435',jdecode('Suzanne+Thomas'),jdecode(''),'/9243/191435.html','true',[],'',''],
		['PAGE','191456',jdecode('Gayle+Blackerby'),jdecode(''),'/9243/191456.html','true',[],'',''],
		['PAGE','191414',jdecode('Mary+Benejam'),jdecode(''),'/9243/191414.html','true',[],'',''],
		['PAGE','191477',jdecode('Lynda+Ayers'),jdecode(''),'/9243/191477.html','true',[],'','']
	],'',''],
	['PAGE','9222',jdecode('Children%26%23x27%3Bs+Art+Lessons'),jdecode(''),'/9222.html','true',[],'',''],
	['PAGE','10201',jdecode('Class+Registration+Forms'),jdecode(''),'/10201.html','true',[],'',''],
	['PAGE','9201',jdecode('Paint+Party+Classes'),jdecode(''),'/9201/index.html','true',[ 
		['PAGE','195393',jdecode('Paint+Party+Registration'),jdecode(''),'/9201/195393.html','true',[],'','']
	],'',''],
	['PAGE','5501',jdecode('Monthly+Guest+Gallery+'),jdecode(''),'/5501.html','true',[],'',''],
	['PAGE','10801',jdecode('Fine+Art+Gallery'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','196693',jdecode('+Jewelry+Gallery'),jdecode(''),'/196693.html','true',[],'',''],
	['PAGE','8101',jdecode('Contact+Us'),jdecode(''),'/8101.html','true',[],'',''],
	['PAGE','192393',jdecode('Directions+'),jdecode(''),'/192393.html','true',[],'',''],
	['PAGE','9264',jdecode('Guestbook'),jdecode(''),'/9264.html','true',[],'',''],
	['PAGE','198593',jdecode('Children%26%23x27%3Bs+Art+Lessons'),jdecode(''),'/198593.html','false',[],'',''],
	['PAGE','198493',jdecode('Gift+Gallery'),jdecode(''),'/198493.html','false',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='3D4B78';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='424';
theSitetree.graphicsetId='467';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D4B78';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'3D4B78',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'424',
				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: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100727-111347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100727-113038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20100616-035337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191393',
internalId:  '',
customField: '20100519-061603'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20100727-111639'
};
webappMappings['7008']=webappMappings['7008-154']={
webappId:    '7008',
documentId:  '8101',
internalId:  '154',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10201',
internalId:  '',
customField: '20100614-080458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20100622-122648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100524-105036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20100519-060746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20100519-062527'
};
webappMappings['1002']=webappMappings['1002-9264anfi10inx2k8']={
webappId:    '1002',
documentId:  '9264',
internalId:  '9264anfi10inx2k8',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '190193',
internalId:  '',
customField: '20100519-063542'
};
webappMappings['7060']=webappMappings['7060-00edad35795697c16a67f946dff6f012']={
webappId:    '7060',
documentId:  '10801',
internalId:  '00edad35795697c16a67f946dff6f012',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191456',
internalId:  '',
customField: '20100519-063829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191414',
internalId:  '',
customField: '20100519-062233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191435',
internalId:  '',
customField: '20100622-122220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191477',
internalId:  '',
customField: '20100610-153337'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '192393',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192393',
internalId:  '',
customField: '20100524-033322'
};
webappMappings['7060']=webappMappings['7060-c39b138e10eace4bc3716e85f1cd817e']={
webappId:    '7060',
documentId:  '5501',
internalId:  'c39b138e10eace4bc3716e85f1cd817e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195393',
internalId:  '',
customField: '20100610-151744'
};
webappMappings['7060']=webappMappings['7060-08caf46757bbe50f83a3933548ea8ef4']={
webappId:    '7060',
documentId:  '196693',
internalId:  '08caf46757bbe50f83a3933548ea8ef4',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '196693',
internalId:  '',
customField: '20100524-045838'
};
webappMappings['7060']=webappMappings['7060-04e652cca16123ee117bc557c36ecf32']={
webappId:    '7060',
documentId:  '198493',
internalId:  '04e652cca16123ee117bc557c36ecf32',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-e10e6834d68a9946a3668d0e50791428']={
webappId:    '7060',
documentId:  '198593',
internalId:  'e10e6834d68a9946a3668d0e50791428',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '198593',
internalId:  '',
customField: '20100524-104553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '198493',
internalId:  '',
customField: '20100524-104353'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI10INX2K8';
var companyName   = 'Sunflower+Studio+%26+Gallery';
var htmlTitle	  = 'Sunflower+Studio++-+Wake+Forest%2C+NC';
var metaKeywords  = 'artwork%2C+paintings%2C+jewelry%2C+pastels%2C+acrylic+paintings%2C+watercolor%2C+art+lessons%2C+childrens+art+lessons%2C+hand+forged+jewelry%2C+beaded+handmade+jewelry%2C+prints%2C+cards%2C+oil+paintings%2C+commissions%2C+lessons%2C+adult+art+lessons%2C+wake+forest%2C+nc%2C+custom+jewelry';
var metaContents  = 'Original+works+of+art+in+watercolors%2C+acrylics%2C+pastels+and+oils%2C+as+well+as+local+landmark+paintings+and+hand+forged+and+crafted+precious+metal+and+beaded+jewelry.+The+gallery+offers+a+unique+opportunity+to+meet+and+visit+with+each+artist+as+she+works.+Art+lessons+for+adults+and+children+offered+in+historic+downtown+Wake+Forest%2C+NC.+Call+919-570-0765+with+any+questions.';
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();
};
