/* [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','6301',jdecode('Home'),jdecode(''),'/6301.html','true',[],'',''],
	['PAGE','6352',jdecode('Jewelry'),jdecode(''),'/6352/index.html','true',[ 
		['PAGE','6373',jdecode('Necklaces'),jdecode(''),'/6352/6373.html','true',[],'','']
	],'',''],
	['PAGE','10801',jdecode('Divination'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','6415',jdecode('Incense+%26+Oils'),jdecode(''),'/6415.html','true',[],'',''],
	['PAGE','6436',jdecode('Gemstones'),jdecode(''),'/6436.html','true',[],'',''],
	['PAGE','12301',jdecode('Chime+Candles'),jdecode(''),'/12301.html','true',[],'',''],
	['PAGE','6457',jdecode('Ogin%26%23x27%3Bs+Ritual+Bath'),jdecode(''),'/6457.html','true',[],'',''],
	['PAGE','17301',jdecode('Other+Cool+Stuff...'),jdecode(''),'/17301.html','true',[],'',''],
	['PAGE','12001',jdecode('2009+Season'),jdecode(''),'/12001.html','true',[],'',''],
	['PAGE','16101',jdecode('2010+Season'),jdecode(''),'/16101.html','true',[],'',''],
	['PAGE','6478',jdecode('2010+Schedule'),jdecode(''),'/6478.html','true',[],'',''],
	['PAGE','16701',jdecode('Friends+of+Chandra'),jdecode(''),'/16701.html','true',[],'',''],
	['PAGE','6499',jdecode('Sign+our+Guestbook%21'),jdecode(''),'/6499.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='6699CC';
theSitetree.keyvisualId='862';
theSitetree.keyvisualName='astern.jpg';
theSitetree.fontsetId='160';
theSitetree.graphicsetId='186';
theSitetree.contentColor='6699CC';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'6699CC',
				keyvisualId: 	'862',
				keyvisualName: 	'astern.jpg',
				fontsetId: 		'160',
				graphicsetId: 	'186',
				contentColor: 	'6699CC',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-6499aen330infy4t']={
webappId:    '1002',
documentId:  '6499',
internalId:  '6499aen330infy4t',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20100529-051501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6352',
internalId:  '',
customField: '20100518-172754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6373',
internalId:  '',
customField: '20100505-041208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16101',
internalId:  '',
customField: '20100518-170759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6415',
internalId:  '',
customField: '20100505-041824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6436',
internalId:  '',
customField: '20100529-050809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6457',
internalId:  '',
customField: '20100505-042252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6478',
internalId:  '',
customField: '20100529-050736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6499',
internalId:  '',
customField: '20100521-214902'
};
webappMappings['7060']=webappMappings['7060-e756cd64fb44a0d454dd3f2118f22b9d']={
webappId:    '7060',
documentId:  '6373',
internalId:  'e756cd64fb44a0d454dd3f2118f22b9d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20100518-172944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100505-041422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20100415-100156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20100518-165001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20100518-172202'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INFY4T';
var companyName   = 'Chandra%27s+Charms';
var htmlTitle	  = 'Chandras+Charms+++Magick+Within...';
var metaKeywords  = 'Wiccan%2C+Pagan%2C+macrame%2C+wire+wrapped+charms%2C+herbal+incense%2C+ritual+oils%2C+gemstones%2C+incense+warmers%2C+incense+burners%2C+raw+quartz%2C+amethyst%2C+emerald%2C+flourite%2C+amber%2C+Jet%2C+Witch%27s+Armour%2C+pendulums%2C+chime+candles%2C+goat%27s+milk+soap%2C+divination%2C+MoJo+bags';
var metaContents  = 'Chandra%27s+Charms+is+a+home+based+Pagan+Ritual+shop+offering+handmade+unique+jewelry%2C+homemade+herbal+incense%2C+original+oil+blends%2C+goat%27s+milk+based+soap+infused+with+original+oil+blends%2C+tumbled+gemstones%2C+tools+for+divination%2C+incense+warmers%2C+chime+candles+and+holders%2C+pre-made+MoJo+bags+with+specific+intent+and+always+happy+to+accept+requests+for+custom+orders.';
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();
};
