/* [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','301',jdecode('Home+'),jdecode(''),'/301.html','true',[],''],
	['PAGE','1801',jdecode('Services+and+Events'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','352',jdecode('Contact+Us'),jdecode(''),'/352.html','true',[],'']];
var siteelementCount=3;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10510';
theSitetree.graphicsetId='10916';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Stars',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10510',
				graphicsetId: 	'10916',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090807-151627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20090206-130353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '352',
internalId:  '',
customField: '20090206-130525'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INLLD6';
var companyName   = 'The+Venus+Moon';
var htmlTitle	  = 'The+Venus+Moon+-+Metaphysical+Shop+in+Renton+WA';
var metaKeywords  = 'metaphysical%2C+renton%2C+Egyptian%2C+tarot%2C+psychic%2C+fairs%2C+gems%2C+jewelery%2C+meditations%2C+drummings%2C+interders%2C+Tarot+Card+Shop%2C+wiccan+shop%2C+pagan+shop%2C+religious+shop%2C+crystal+shop%2C+rune+shop%2C+psychic+shop%2C+stone+shop%2C+crystal+shop%2C+Tarot+Card+Shop%2C+wiccan+shop%2C+pagan+shop%2C+religious+shop%2C+crystal+shop%2C+rune+shop%2C+psychic+shop%2C+stone+shop%2C+crystal+shop%2C+incense%2C+pagan%2C+wiccan%2C+wicca%2C+magic%2C+magik%2C+magick%2C+druid%2C+celtic%2C+keltic%2C+religious%2C+books%2C+religious+books%2C+crystal+balls%2C+crystals%2C+stones%2C+energy+work%2C+energy%2C+oils%2C+massage+oils%2C+oil+diffusors%2C+body+sprays%2C+psychic+readers%2C+aura%2C+aura+readers%2C+Shamans%2C+shaman%2C+healer%2C+healers%2C+energy+healer%2C+crysal+healing%2C+king+county%2C+king%2C+Issaquah%2C+kent%2C+skyway%2C+downtown+renton%2C+maple+valley%2C+renton+wa%2C+renton+Washington%2C+kent+wa%2C+kent+Washington%2C+issaquah+wa%2C+issaquah+Washington%2C+maple+valley+wa%2C+maple+valley+Washington%2C+candles%2C+pentacle%2C+necklace%2C+pendulums%2C+pendulums%2C+dowsing%2C+fairies%2C+faeries%2C+fairie%2C+faerie%2C+folk%2C+lore%2C+dragons%2C+dragon%2C+elf%2C+elfs%2C+atlantis%2C+runes%2C+tarot%2C+tarot+cards%2C+rituals%2C+pagan+rituals%2C+wiccan+rituals%2C+Christian%2C+Taoism%2C+Taoist%2C+Buddhist%2C+Buddhism%2C+wands%2C+wand%2C+charka%2C+charkas%2C+groups%2C+meetup%2C+meetings%2C+meet%2C+newage%2C+new+age%2C+transendance%2C+ascention%2C+ascend%2C+witchcraft%2C+craft%2C+kingcounty%2C+seattle%2C+metaphysics%2C+venus%2C+moon%2C+mystic%2C+mystical%2C+god%2C+goddess';
var metaContents  = 'Welcome+to+The+Venus+Moon+-+Dynamic%2C+changing+and+eclectic+Metaphysical+shop+in+Renton+Washington%21++Come+explore+all+that+we+have+to+offer%21++Tarot%2C+psychics%2C+energy%2C+crystals+--+all+things+mystic+and+wonderful%21++Come+explore%21++Events+for+All+paths+--+come+enjoy%21++Well+be+delighted+to+have+you+join+us%21';
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();
};
