/* [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','3901',jdecode('Home'),jdecode(''),'/3901.html','true',[],'',''],
	['PAGE','13012',jdecode('Mythical+Shop'),jdecode(''),'/13012/index.html','true',[ 
		['PAGE','62482',jdecode('Fairy+Dust'),jdecode(''),'/13012/62482.html','true',[],'',''],
		['PAGE','63982',jdecode('Princess+Dust'),jdecode(''),'/13012/63982.html','true',[],'',''],
		['PAGE','90110',jdecode('Dragon%26%23x27%3Bs+Hoard'),jdecode(''),'/13012/90110.html','true',[],'',''],
		['PAGE','87410',jdecode('Wizards+Amulet'),jdecode(''),'/13012/87410.html','false',[],'',''],
		['PAGE','88410',jdecode('Wizards+Wands'),jdecode(''),'/13012/88410.html','false',[],'',''],
		['PAGE','4701',jdecode('Magic+Gardens'),jdecode(''),'/13012/4701.html','true',[],'',''],
		['PAGE','34882',jdecode('Games+%26+More'),jdecode(''),'/13012/34882.html','true',[],'',''],
		['PAGE','28054',jdecode('Fairy+Parties'),jdecode(''),'/13012/28054.html','false',[],'','']
	],'',''],
	['PAGE','86510',jdecode('Gem+Shop'),jdecode(''),'/86510/index.html','true',[ 
		['PAGE','85010',jdecode('Apache+Tears'),jdecode(''),'/86510/85010.html','true',[],'',''],
		['PAGE','87631',jdecode('Rose+Quartz'),jdecode(''),'/86510/87631.html','false',[],'',''],
		['PAGE','87810',jdecode('Turquoise'),jdecode(''),'/86510/87810.html','false',[],'',''],
		['PAGE','87610',jdecode('Hematite'),jdecode(''),'/86510/87610.html','false',[],'',''],
		['PAGE','87831',jdecode('Cats+Eye'),jdecode(''),'/86510/87831.html','false',[],'','']
	],'',''],
	['PAGE','4722',jdecode('Kids+Stuff'),jdecode(''),'/4722/index.html','true',[ 
		['PAGE','52882',jdecode('Kids++Crafts+1'),jdecode(''),'/4722/52882.html','true',[],'',''],
		['PAGE','62503',jdecode('Kids+Crafts+2'),jdecode(''),'/4722/62503.html','true',[],'',''],
		['PAGE','62524',jdecode('Kids+Crafts+3'),jdecode(''),'/4722/62524.html','false',[],'',''],
		['PAGE','62545',jdecode('Kids+Crafts+4'),jdecode(''),'/4722/62545.html','false',[],'',''],
		['PAGE','62566',jdecode('Kids+Crafts+5'),jdecode(''),'/4722/62566.html','false',[],'',''],
		['PAGE','52782',jdecode('Games+Page'),jdecode(''),'/4722/52782.html','false',[],'','']
	],'',''],
	['PAGE','17512',jdecode('Fairy+Interesting'),jdecode(''),'/17512.html','true',[],'',''],
	['PAGE','4785',jdecode('Sightings'),jdecode(''),'/4785.html','true',[],'',''],
	['PAGE','78810',jdecode('Waiting+for+Fairies%21'),jdecode(''),'/78810.html','true',[],'',''],
	['PAGE','72710',jdecode('Ordering+Info.'),jdecode(''),'/72710.html','true',[],'',''],
	['PAGE','22654',jdecode('Links'),jdecode(''),'/22654/index.html','true',[ 
		['PAGE','97810',jdecode('More+Links'),jdecode(''),'/22654/97810.html','true',[],'','']
	],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Fantasy';
theSitetree.paletteFamily='906145';
theSitetree.keyvisualId='9902';
theSitetree.keyvisualName='kv2.swf';
theSitetree.fontsetId='17703';
theSitetree.graphicsetId='13064';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Fantasy',
				paletteFamily: 	'906145',
				keyvisualId: 	'9902',
				keyvisualName: 	'kv2.swf',
				fontsetId: 		'17703',
				graphicsetId: 	'13064',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				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:  '3901',
internalId:  '',
customField: '20100920-005659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100920-010318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28054',
internalId:  '',
customField: '20090831-001117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20100920-011027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20080727-004318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17512',
internalId:  '',
customField: '20080713-203849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13012',
internalId:  '',
customField: '20100920-013337'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22654',
internalId:  '',
customField: '20100920-013318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34882',
internalId:  '',
customField: '20090901-012625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52782',
internalId:  '',
customField: '20080717-091120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52882',
internalId:  '',
customField: '20080723-000608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85010',
internalId:  '',
customField: '20090901-025634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78810',
internalId:  '',
customField: '20100920-011129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62482',
internalId:  '',
customField: '20100920-013558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63982',
internalId:  '',
customField: '20100920-013759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62503',
internalId:  '',
customField: '20080722-235253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62524',
internalId:  '',
customField: '20080718-152101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62545',
internalId:  '',
customField: '20080718-152101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62566',
internalId:  '',
customField: '20080718-152101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72710',
internalId:  '',
customField: '20100920-005618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86510',
internalId:  '',
customField: '20090901-012728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87631',
internalId:  '',
customField: '20090901-012802'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87810',
internalId:  '',
customField: '20090831-225448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87610',
internalId:  '',
customField: '20090831-225529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87831',
internalId:  '',
customField: '20090831-225632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90110',
internalId:  '',
customField: '20100920-013444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87410',
internalId:  '',
customField: '20090701-214656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88410',
internalId:  '',
customField: '20090702-002408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97810',
internalId:  '',
customField: '20100920-015906'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2OJN';
var companyName   = 'The+Magic+Fairy+Garden';
var htmlTitle	  = 'Fairies++Faery++Pixie++Dragon++Gifts++Unique++Child+Birthday++Party++Fairy+Dust+Necklace';
var metaKeywords  = 'Fairies++Fairy++Pixie++Dragon+Wizards+Gem+Stones+Rose+Quartz+Apache+Tears++Gifts++Unique++Child+Birthday++Party';
var metaContents  = 'A+Loving+Place+for+Fairies%2C+Pixies%2C+Wizards++all+Mythical+Creatures.';
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();
};

