/* [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','5201',jdecode('Home'),jdecode(''),'/5201.html','true',[],''],
	['PAGE','9243',jdecode('About+Resident+Artists'),jdecode(''),'/9243.html','true',[],''],
	['PAGE','5501',jdecode('Monthly+Guest+Gallery+'),jdecode(''),'/5501.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.html','true',[],''],
	['PAGE','10801',jdecode('Our+Gallery'),jdecode(''),'/10801.html','true',[],''],
	['PAGE','8101',jdecode('Contact+Us+%26+Directions'),jdecode(''),'/8101.html','true',[],''],
	['PAGE','9264',jdecode('Guestbook'),jdecode(''),'/9264.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Macao';
theSitetree.paletteFamily='607FB8';
theSitetree.keyvisualId='6421';
theSitetree.keyvisualName='kv_6421.jpg';
theSitetree.fontsetId='11167';
theSitetree.graphicsetId='11976';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='A3BAE5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Macao',
				paletteFamily: 	'607FB8',
				keyvisualId: 	'6421',
				keyvisualName: 	'kv_6421.jpg',
				fontsetId: 		'11167',
				graphicsetId: 	'11976',
				contentColor: 	'000000',
				contentBGColor: 'A3BAE5',
				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:  '5201',
internalId:  '',
customField: '20100309-053241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100306-114427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20100222-110318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20100303-044612'
};
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: '20090916-144616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20100210-151628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20090122-133032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8101',
internalId:  '',
customField: '20100309-054226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20090122-142112'
};
webappMappings['1002']=webappMappings['1002-9264anfi10inx2k8']={
webappId:    '1002',
documentId:  '9264',
internalId:  '9264anfi10inx2k8',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-00edad35795697c16a67f946dff6f012']={
webappId:    '7060',
documentId:  '10801',
internalId:  '00edad35795697c16a67f946dff6f012',
customField: 'language:en;country:US;'
};
var canonHostname = 'cm4all.netfirms.com';
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();
};
