/* [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','9201',jdecode('%7BHome%7D'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','68301',jdecode('%7BThe+Artist%7D'),jdecode(''),'/68301.html','true',[],''],
	['PAGE','68322',jdecode('%7BPortfolio%7D'),jdecode(''),'/68322.html','true',[],''],
	['PAGE','68343',jdecode('%7BShop%7D'),jdecode(''),'/68343.html','true',[],''],
	['PAGE','19901',jdecode('%7BClasses%7D'),jdecode(''),'/19901/index.html','true',[ 
		['PAGE','19922',jdecode('Register+for+Classes'),jdecode(''),'/19901/19922.html','true',[],''],
		['PAGE','72601',jdecode('Testimonials'),jdecode(''),'/19901/72601.html','true',[],''],
		['PAGE','70401',jdecode('Directions'),jdecode(''),'/19901/70401.html','false',[],'']
	],''],
	['PAGE','68364',jdecode('%7BPublicity%7D'),jdecode(''),'/68364.html','true',[],''],
	['PAGE','68385',jdecode('%7BAvailable+At%7D'),jdecode(''),'/68385.html','true',[],''],
	['PAGE','68406',jdecode('%7BAbout+Metal+Clay%7D'),jdecode(''),'/68406.html','true',[],''],
	['PAGE','68427',jdecode('%7BContact+Info%7D'),jdecode(''),'/68427.html','true',[],''],
	['PAGE','68448',jdecode('%7BLinks%7D'),jdecode(''),'/68448.html','true',[],'']];
var siteelementCount=13;
theSitetree.topTemplateName='Inspiration';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='103';
theSitetree.graphicsetId='123';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Inspiration',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'103',
				graphicsetId: 	'123',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'669999',
				c_color: 		'000000',
				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:  '9201',
internalId:  '',
customField: '20100118-160005'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9201',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1610']={
webappId:    '7008',
documentId:  '19922',
internalId:  '1610',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20100118-165819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19922',
internalId:  '',
customField: '20100118-160518'
};
webappMappings['7060']=webappMappings['7060-9758a1e4de90fef9e1e608f546abaef7']={
webappId:    '7060',
documentId:  '68322',
internalId:  '9758a1e4de90fef9e1e608f546abaef7',
customField: 'language:en;country:US;'
};
webappMappings['4001']=webappMappings['4001-7142647']={
webappId:    '4001',
documentId:  '68343',
internalId:  '7142647',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-64c3c49c0677807ab3c8aa28294f6164']={
webappId:    '7060',
documentId:  '68364',
internalId:  '64c3c49c0677807ab3c8aa28294f6164',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-68427anfi20inxhe0']={
webappId:    '1002',
documentId:  '68427',
internalId:  '68427anfi20inxhe0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68385',
internalId:  '',
customField: '20091024-163817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68301',
internalId:  '',
customField: '20091024-143044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68322',
internalId:  '',
customField: '20091024-143209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68343',
internalId:  '',
customField: '20091107-161443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68364',
internalId:  '',
customField: '20091024-144024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68427',
internalId:  '',
customField: '20091024-155325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68448',
internalId:  '',
customField: '20091024-155112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68406',
internalId:  '',
customField: '20091024-144212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70401',
internalId:  '',
customField: '20091024-143836'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '70401',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['1501']=webappMappings['1501-7196904']={
webappId:    '1501',
documentId:  '9201',
internalId:  '7196904',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72601',
internalId:  '',
customField: '20091024-162655'
};
var canonHostname = 'cm4all.netfirms.com';
var accountId     = 'ANFI20INXHE0';
var companyName   = '%7BRARE%7Dadornment';
var htmlTitle	  = 'Rare+Adornment%2C+Unique+Art+Jewelry+%26+PMC+Classes+in+Kansas+City+%26+Seattle';
var metaKeywords  = '';
var metaContents  = '';
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();
};

