/* [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','92',jdecode('Home'),jdecode(''),'/92.html','true',[],''],
	['PAGE','122',jdecode('About+Wicca'),jdecode(''),'/122/index.html','true',[ 
		['PAGE','149',jdecode('Sabbats'),jdecode(''),'/122/149.html','true',[],''],
		['PAGE','158',jdecode('The+Elements'),jdecode(''),'/122/158.html','true',[],'']
	],''],
	['PAGE','113',jdecode('About+ElderMoon'),jdecode(''),'/113/index.html','true',[ 
		['PAGE','167',jdecode('Contact+us'),jdecode(''),'/113/167.html','true',[],''],
		['PAGE','494',jdecode('Recommended+Reading'),jdecode(''),'/113/494.html','true',[],''],
		['PAGE','79412',jdecode('Our+structure'),jdecode(''),'/113/79412.html','true',[],'']
	],''],
	['PAGE','1360',jdecode('Inside+EMC..'),jdecode(''),'/1360.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11077';
theSitetree.keyvisualName='kv_11077.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='D8D8D5';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11077',
				keyvisualName: 	'kv_11077.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'D8D8D5',
				contentBGColor: '2E2E2E',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '149',
internalId:  '',
customField: '20070111-201255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158',
internalId:  '',
customField: '20060206-143607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92',
internalId:  '',
customField: '20070419-020228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122',
internalId:  '',
customField: '20080913-110722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113',
internalId:  '',
customField: '20080116-225416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167',
internalId:  '',
customField: '20071212-190406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20080815-104703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79412',
internalId:  '',
customField: '20080815-105321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1360',
internalId:  '',
customField: '20080117-005717'
};
webappMappings['7008']=webappMappings['7008-143']={
webappId:    '7008',
documentId:  '167',
internalId:  '143',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-144']={
webappId:    '7008',
documentId:  '1360',
internalId:  '144',
customField: 'language:en;country:US;'
};
var canonHostname = 'cm4all.west-datacenter.net';
var accountId     = 'AWH010INXZZU';
var companyName   = 'ElderMoon+Circle';
var htmlTitle	  = 'ElderMoon+Circle+--+Honoring+the+divine+within.';
var metaKeywords  = 'herbs%2C+wicca%2C+magick%2C+magic%2C+pagan%2C+pentacle%2C+good%2C+Wicca%2C+wicce%2C+books%2C+circle%2C+coven%2C+teaching%2C+Massachusetts%2C+MA%2C+candle%2C+candles%2C+sabbat%2C+esbat%2C+Reiki%2C+attunements%2C+Stoughton%2C+open%2C+energy+work%2C+ceremonial%2C+CM%2C+astrology%2C+tarot%2C+tree+of+life%2C+qabalah%2C+crystal%2C+crystals%2C+stone%2C+earth%2C+air%2C+fire%2C+water%2C+elements%2C+elementals%2C+healing%2C+meditation%2C+class%2C+classes%2C+petitioner%2C+group%2C+chakras%2C+correspondances%2Cmeta+name%3Dverify-v1+content%3DN27qG5VwWANbwz%2FM6QK9OTaDAeLzUKtRMCQpcoL5g8Q%3D+%2F';
var metaContents  = 'Wiccan+circle+and+magickal+teaching';
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();
};
